xremap / xremap

Key remapper for X11 and Wayland
MIT License
1.45k stars 84 forks source link

Mouse remapping doesn't work #529

Open Ascyt opened 1 day ago

Ascyt commented 1 day ago

When I have something like:

keymap:
  - remap:
    BTN_RIGHT: Ctrl-v

where BTN_RIGHT is taken from https://github.com/emberian/evdev/blob/1d020f11b283b0648427a2844b6b980f1a268221/src/scancodes.rs#L26-L572 (as mentioned in the readme) and assumed to mean the right click mouse button.

It doesn't alter the behaviour of the right click button. This is the same for any other mouse buttons, including scroll wheel behaviour.

When I run it it does appear to detect the correct mouse:

Selecting devices from the following list:
------------------------------------------------------------------------------
/dev/input/event0 : Power Button
/dev/input/event1 : Lid Switch
/dev/input/event10: HD-Audio Generic Mic
/dev/input/event11: HD-Audio Generic Headphone
/dev/input/event12: Logitech G502 HERO Gaming Mouse
/dev/input/event13: Logitech G502 HERO Gaming Mouse Keyboard
/dev/input/event14: input-remapper keyboard
/dev/input/event2 : Video Bus
/dev/input/event3 : AT Translated Set 2 keyboard
/dev/input/event4 : Wireless hotkeys
/dev/input/event5 : PC Speaker
/dev/input/event6 : HP WMI hotkeys
/dev/input/event7 : ELAN071A:00 04F3:30FD Mouse
/dev/input/event8 : ELAN071A:00 04F3:30FD Touchpad
/dev/input/event9 : HD-Audio Generic HDMI/DP,pcm=3
------------------------------------------------------------------------------
Selected keyboards automatically since --device options weren't specified:
------------------------------------------------------------------------------
/dev/input/event13: Logitech G502 HERO Gaming Mouse Keyboard
/dev/input/event14: input-remapper keyboard
/dev/input/event3 : AT Translated Set 2 keyboard
------------------------------------------------------------------------------

where "Logitech G502 HERO Gaming Mouse" is indeed the mouse I have.

I don't get any error messages or similar when I start xremap or press right click. It just doesn't alter the behaviour of right click. Normal keyboard keys work fine. I am running xremap with sudo.

wistoft commented 14 hours ago

Have you tried to start xremap with the argument --mouse. If that works, then I think the issue is the missing warning. Because xremap could warn, that you have mouse hotkey, but doesn't listen to mouse events.

vuongtuha commented 12 hours ago

@wistoft for this case, could we make 1 main config runs for both mouse/keyboard? I mean normal I would start xremap on boot like this xremap $HOME/.config/xremap/config.xml --watch=device or I should point out --device={abc} for better usage?