Xorg and PS/2 keyboard

Hi there. Hope I'm not too late with my answer :)

Preamble

I have the same problem with Menu key on Thinkpad X220 with FreeBSD 14.1. I've tried to use Menu key to switch between languages like this: setxkbmap -model "thinkpad" -layout us,ru -option grp:menu_toggle but failed — the language not switch. When I press the Menu key on Emacs it prints "<XF86Menu> is undefined".

The command xev -event keyboard prints the same output that was already posted in this thread.

I didn't want to use xkbcomp(1) solution because it requires to add one more dotfile in my $HOME. So I came to the next solution:

Solution

It is possible to remap just one key with xmodmap(1). To bring back Menu key the next command can be used:

Code:
xmodmap -e "keycode 147  = Menu NoSymbol Menu"

In my case, I want to use XF86Menu key as a language switcher, so I came to the next command:

Code:
xmodmap -e "keycode 147  = ISO_Next_Group Menu ISO_Next_Group Menu"

Keycode #147 was taken from the aforementioned xev(1) output.
 
Back
Top