Solved mapping mouse butons to keystrokes

Solved issue

new_vintage

New Member
Joined
May 2, 2024
Messages
11
Reaction score
6
Credits
98
I am using openSUSE Leap 15.5 . I'd like to remap two mouse buttons to the Home and End keys. I am aware of xmodmap; it returns the expected ten buttons mapped to 1-10. The question is how to map two of those buttons, 8 and 9 in my case, to Home and End. It seems like
Code:
xmodmap -e "pointer = 1 2 3 4 5 6 7 Home End 10"
is what I want to accomplish, but writing the key name is improper syntax. Likewise, substituting the keycodes for Home and End 110 and 115 in decimal or 0x6e and 0x73 in hex doesn't work. The values stick and
Code:
xmodmap -pp
returns 1 2 3 4 5 6 7 110 115 10, but that is meaningless since 110 and 115 are simply numbers, not keycodes.

Is what I am trying even possible with xmodmap, or will this be more complicated?
 


I figured out one way to do this. It uses a script run by xbindkeys calling xdotool at login time. The script is:
Code:
"xdotool key 'Home'"
    b:8
    
"xdotool key 'End'"
    b:9
This is saved as .xbindkeysrc and run by xbindkeys at login time.
 

Members online


Latest posts

Top