Pinebook Remapping Keyboard with Xmodmap

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

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

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 !


   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    Cool

please join us for a chat @   or ssl

( I regret that I am not able to respond to personal messages;  let's meet on irc! )

I carried the xmodmap keyboard remapping to the next level by remapping some of the rest of the numeric keypad for useful  i3  work ;  then I added bindsym entries in  ~/.config/i3/config  to be able to map and unmap the keyboard with a single keystroke !

KP_Insert --> Super_L

KP_Delete --> Super_R

KP_Enter --> Return

KP_begin --> Control_R

bindsym entries in ~/.config/i3/config

bindsym  $mod+Shift+KP_Add  exec  xmodmap  ~/xmodmap_changes

bindsym  $mod+Shift+KP_Subtract  exec  xmodmap  ~/xmodmap_original

marcushh777    Cool

please join us for a chat @   or ssl

( I regret that I am not able to respond to personal messages;  let's meet on irc! )

Possibly Related Threads...
Thread Author Replies Views Last Post
Information Manjaro ARM for Pinebook erchache2000 65 4,399 09-05-2019, 03:07 AM
Last Post: fitter
  Pinebook 1080p / KDE Neon freezes every 5-10 min pyrrhumain 9 280 09-01-2019, 03:11 PM
Last Post: xircledev
  Archlinux (mainline) for Pinebook anarsoul 51 13,728 08-28-2019, 05:23 PM
Last Post: conlaoch
  will openMP work on a pinebook? rustythorn 2 86 07-23-2019, 01:42 PM
Last Post: tophneal
  Armbian - Xenial Desktop (Pinebook) pineadmin 83 17,352 07-17-2019, 01:22 PM
Last Post: catsmile
  pinebook 1080p crash and fix nano2 2 173 06-24-2019, 07:41 PM
Last Post: pyrrhumain
  NIxOS installation guide for Pinebook Surehand53 0 148 06-23-2019, 03:46 AM
Last Post: Surehand53
  Improve the life of your Pinebook battery by setting charger's voltage limits wlad 0 158 06-11-2019, 02:27 PM
Last Post: wlad
  How can I reliably get battery status on pinebook tillea 5 1,281 06-11-2019, 10:10 AM
Last Post: wlad
  pinebook black screen when booting with "different power mode than last used" penzoiders 9 482 06-06-2019, 02:02 PM
Last Post: Surehand53

Forum Jump:

Users browsing this thread: 1 Guest(s)