I have 17 macro keys in my keyboard which I can't use because the manufacturer's software isn't compatible with modern operating systems, and only ever supported Windows to begin with. The keys of course aren't part of the keyboard map (verified with programs such as SharpKeys and Autohotkey) and I don't have the slightest idea how I can put them into use.
1 Answer
If you are using linux, you can use xev
to learn about the keys on your keyboard and xmodmap
to remap them.
Here's output of me running xev and pressing the letter "A". You'll want to take note of two things:
- the keycode (in the below example, the keycode for 'A' on my keyboard is 38:
- the name of the key (in the below example that would be what shows up as the last value inside the the parenthesis containing the keysym hex value and name (keysym hexadecimal_value, keyname) like (keysym 0x41, A)
$ xev
KeyRelease event, serial 32, synthetic NO, window 0x2600001,
root 0x192, subw 0x0, time 140212192, (223,614), root:(1184,615),
state 0x2, keycode 38 (keysym 0x41, A), same_screen YES,
XLookupString gives 1 bytes: (41) "A"
XFilterEvent returns: False
If you want to remap a key, you'd use xmodmap
. Below is how you would map a theorectical keycode of 1 to the A key shown above:
xmodmap -e "keycode 1 = A"```
-
Do xev and xmodmap detect the keys which aren't part of the keyboard map? In your example a basic remapping task is performed. I'll also appreciate if you add a method for Windows to your answer. Jul 26, 2019 at 10:15
-
If the key is dead, you wont have anything show up in the response on the terminal prompt. Regarding windows, I found this info on autohotkey which seems pretty good: superuser.com/questions/348070/equivalent-for-xev-on-windows Jul 26, 2019 at 16:28
-