1

I want to map, remap or create a shortcut that:

F1 : Right click

F2 : Left click

F3 : Scroll Down

F4 : Scroll Up

1

I used xmodmap and xdotool, and I made the best use of them. xmodmap is better for left and right click. Shortcut using xdotool is better for scroll down and up.

I will show all steps to let the user decide which keys and buttons they want to remap.

0 - Discover keys names

With xev you discover:

F1 : keycode 67

F2 : keycode 68

F3 : keycode 69

F4 : keycode 70

Left click: Pointer_Button1

Right click: Pointer_Button3

Scroll Down: Pointer_Button5

Scroll Up: Pointer_Button6

1 - Use F1 and F2 to left and right click

Use xmodmap to really remap keys (better than shortcuts, because it allows drag and drop)

xmodmap -e "keycode 67 = Pointer_Button3"
xmodmap -e "keycode 68 = Pointer_Button1 Pointer_Button1"

This solution derived partially from here.

2 - Create shortcuts for scroll down and up

keyboard > shortcuts > "+" > ...

Scroll down and shortcut F3

xdotool click 5

Scroll up and shortcut F4

xdotool click 4

Restore default configuration of xmodmap:

setxkbmap -option
  • This is great, really, but now I have my keypad off. How to map F1/F2 keys as clicks and be able to use numeric keypad please ? – Mévatlavé Kraspek Jan 29 at 15:14
  • @MévatlavéKraspek unfortunatelly I still dont have the answer... I simply stopped using keypad... If you find the solution please share. – Vitor Abella Jan 30 at 0:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.