How to remap keys only for a particular keyboard in Linux?
7
votes
2
answers
5293
views
I have a numpad connected via USB and my goal is to be able to remap keys on that numpad so they can run custom commands or be mapped to other key combinations.
I have this in my
.xbindkeysrc
file:
~ $ cat .xbindkeysrc
"xte 'keydown Super_L' 'key Left' 'keyup Super_L'"
m:0x10 + c:79 + Release
Mod2 + KP_Home
This remaps the NUM 7 key (which normally prints 7) to Super_L + Left Arrow
. That's great and it works, BUT FOR ALL KEYBOARDS, while my goal is to make it work only for the numpad.
Been searching how to do it, but the closest I got was to use xinput set-button-map
. Unfortunately, this seems to only work for devices like mouses. I like tried fetching what the button map is for the numpad with xinput get-button-map [device id]
but it just prints numbers from 1 to 7 and I definitely have more buttons on my keypad, so it doesn't necessarily make sense.
Any advice?
Asked by orion3
(211 rep)
Aug 16, 2019, 08:17 AM
Last activity: Jul 25, 2021, 06:19 PM
Last activity: Jul 25, 2021, 06:19 PM