Pinebook Remapping Keyboard with Xmodmap
#1
Lightbulb 
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
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 !


Shy
marcushh777    Cool

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! )
  Reply
#2


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


Shy
marcushh777    Cool

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! )
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  E: The repository 'http://pinebook.kde.org.uk bionic Release' no longer has a Release pixelpaperyarn 3 460 05-07-2021, 10:20 AM
Last Post: tophneal
  Slarm64 on Pinebook [Slackware Arm - 64 bit] KRT 29 11,411 05-04-2021, 11:34 PM
Last Post: mara
  DietPi OS for Pinebook MichaIng 1 641 03-10-2021, 02:45 PM
Last Post: MichaIng
  pinebook.kde.org.uk no longer has release file?? supermassive 1 596 01-20-2021, 11:18 AM
Last Post: tophneal
Question Ran apt update on my Pinebook.. ford442 0 545 12-25-2020, 04:40 PM
Last Post: ford442
Information Manjaro ARM for Pinebook erchache2000 88 36,669 11-29-2020, 04:36 PM
Last Post: Mr.Fermer
  Pinebook is going the way of Betamax? trigger 10 5,176 11-01-2020, 02:02 PM
Last Post: leperotero
  Pinebook Pro (i3 WM): Confirm Shutdown on Power Button etothepii 3 2,096 08-14-2020, 06:03 AM
Last Post: loblik
  Manjaro sway profile for pinebook e-minguez 3 1,838 07-21-2020, 03:25 PM
Last Post: jezek
  Reset User or Factory Reset PineBook Linux 11.6" pittman64 1 1,961 07-07-2020, 11:26 PM
Last Post: tllim

Forum Jump:


Users browsing this thread: 1 Guest(s)