09-04-2017, 12:55 PM
(This post was last modified: 09-06-2017, 09:59 AM by MarkHaysHarris777.)
Greetings,
This is a follow-up to the "dead Alt keys issue" on my Pinebook; the corner pin(12) of the 8051 is bent, which resulted in dead Alt keys (both of them); neither one send scancodes from my keyboard.
What I did to get full functionality (including AltGr key) is to connect a usb numeric keypad to the Pinebook, and then use xmodmap (part of the x11-xserver-utils package) to remap the keysym(s) kp_left and kp_right and kp_begin to Alt_L and Alt_R and Control_R!
I did not have xmodmap installed on my xenial-i3 image, so I had to install it with :
sudo apt install x11-xserver-utils
1) the first step is to build an xmodmap file of the current mapping :
xmodmap -pke >xmodmap_original
The file is human readable... study it.
2) second step is to copy the original file, and then edit the copy :
cp xmodmap_original xmodmap_changes
original
changed
3) save the changes file and then activate your new xmodmap with :
xmodmap ~/xmodmap_changes
Congratulations ! The keypad left and right are now Alt_L and Alt_R !
Notes:
You can check the new keysym(s) with the tool xev. xev can be used to check your entire keyboard, and mouse; it will report the scancode (keycode) and keysym for all keys including the numeric keypad.
This only works in x11. What we're doing here is to set a different keysym in x11 for a given scancode. So, in x11, in the above example, scancode(s) 64 and 108 now do nothing in x11; and the scancode(s) 83 and 85 now take on new meaning(s) ... new keysyms !
The kp_begin (keypad 5) has been remapped as Control_R ; interesting because the Pinebook doesn't even have a Control_R !
The changes are lost with reboot; unless, the xmodmap is executed at startup in rc.local, or as a systemd service one-shot !
This is a follow-up to the "dead Alt keys issue" on my Pinebook; the corner pin(12) of the 8051 is bent, which resulted in dead Alt keys (both of them); neither one send scancodes from my keyboard.
What I did to get full functionality (including AltGr key) is to connect a usb numeric keypad to the Pinebook, and then use xmodmap (part of the x11-xserver-utils package) to remap the keysym(s) kp_left and kp_right and kp_begin to Alt_L and Alt_R and Control_R!
I did not have xmodmap installed on my xenial-i3 image, so I had to install it with :
sudo apt install x11-xserver-utils
1) the first step is to build an xmodmap file of the current mapping :
xmodmap -pke >xmodmap_original
The file is human readable... study it.
2) second step is to copy the original file, and then edit the copy :
cp xmodmap_original xmodmap_changes
original
Code:
keycode 83 = KP_Left KP_4 KP_Left KP_4
keycode 84 = KP_Begin KP_5 KP_Begin KP_5
keycode 85 = KP_Right KP_6 KP_Right KP_6
changed
Code:
keycode 83 = Alt_L Meta_L Alt_L Meta_L
keycode 84 = Control_R NoSymbol Control_R
keycode 85 = Alt_R Meta_R Alt_R Meta_R
3) save the changes file and then activate your new xmodmap with :
xmodmap ~/xmodmap_changes
Congratulations ! The keypad left and right are now Alt_L and Alt_R !
Notes:
You can check the new keysym(s) with the tool xev. xev can be used to check your entire keyboard, and mouse; it will report the scancode (keycode) and keysym for all keys including the numeric keypad.
This only works in x11. What we're doing here is to set a different keysym in x11 for a given scancode. So, in x11, in the above example, scancode(s) 64 and 108 now do nothing in x11; and the scancode(s) 83 and 85 now take on new meaning(s) ... new keysyms !
The kp_begin (keypad 5) has been remapped as Control_R ; interesting because the Pinebook doesn't even have a Control_R !
The changes are lost with reboot; unless, the xmodmap is executed at startup in rc.local, or as a systemd service one-shot !
marcushh777
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697
( I regret that I am not able to respond to personal messages; let's meet on irc! )
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697
( I regret that I am not able to respond to personal messages; let's meet on irc! )