Skip to main content
Topic: [SOLVED] Xorg: bind key for mouse event (Read 1365 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Xorg: bind key for mouse event

Hi all!

I want to use Menu key (keycode 135) as RightButton click (button 1). I tried to do it via xmodmap but it didn't succeed:
Code: [Select]
xmodmap -e "keycode 135 = button 3"
xmodmap:  commandline:1:  bad keysym name 'button' in keysym list
xmodmap:  1 error encountered, aborting.

Is there any way to do it and is it possible to make such a bind both for DM and for user session?
ARMtix

Re: Xorg: bind key for mouse event

Reply #1
Try
Code: [Select]
% xmodmap -e "keycode 135 = Pointer_Button1"  (or Button2 etc, whichever is your right button)
Make sure you don't have 'Disable touchpad while typing' if you're on a laptop. Put that line in ~/.Xmodmap to make it permanent.

Re: Xorg: bind key for mouse event

Reply #2
Try
Code: [Select]
% xmodmap -e "keycode 135 = Pointer_Button1"  (or Button2 etc, whichever is your right button)
Make sure you don't have 'Disable touchpad while typing' if you're on a laptop. Put that line in ~/.Xmodmap to make it permanent.
Thanks, but it didn't help for some reason. Xev shows Pointer_Button1 event if i press menu key but no other application reacts to it
ARMtix

Re: Xorg: bind key for mouse event

Reply #3
Desktop or laptop? If on laptop, make sure your touchpad isn't 'disabled while typing' by your DE; I had the same problem until I deactivated it.

Re: Xorg: bind key for mouse event

Reply #4
Desktop or laptop? If on laptop, make sure your touchpad isn't 'disabled while typing' by your DE; I had the same problem until I deactivated it.
I tried both with same result. On a laptop touchpad was not disabled because X recognized it as mouse (this is the reason why i want to make this bind: without evdev module any press on my touchpad is recognized as left button click. However, libinput --debug-events recognizes right button click correctly)
ARMtix

Re: Xorg: bind key for mouse event

Reply #5
Weird though, this should be input-module independent. I use evdev though and it works...

Re: Xorg: bind key for mouse event

Reply #6
The missing step is found: "xkbset m" should be run before xmodmap
ARMtix