How can I map my keyboard's macro keys?

0

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.

user1067707

Posted 2019-07-26T07:34:06.880

Reputation: 1

Answers

1

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:

  1. the keycode (in the below example, the keycode for 'A' on my keyboard is 38:
  2. 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"```

user138278

Posted 2019-07-26T07:34:06.880

Reputation: 265

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. – user1067707 – 2019-07-26T10:15:23.680

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: https://superuser.com/questions/348070/equivalent-for-xev-on-windows

– user138278 – 2019-07-26T16:28:28.200

I mentioned AHK in my question, the macro keys aren't detected. – user1067707 – 2019-07-27T08:11:27.203