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


Possibly Related Threads…
Thread Author Replies Views Last Post
  DietPi OS for Pinebook MichaIng 3 5,146 03-11-2024, 05:02 PM
Last Post: oxoocoffee
  Slarm64 on Pinebook [Slackware Arm - 64 bit] KRT 46 59,569 09-26-2023, 03:18 PM
Last Post: mara
  Broke pinebook GUI, what to do, fix or install new? acruhl 2 775 07-13-2023, 05:43 PM
Last Post: acruhl
  Orignal PineBook jwp1000 1 606 07-10-2023, 07:44 AM
Last Post: tophneal
  Pinebook no longer boots rjtanner 12 3,242 04-13-2023, 01:09 PM
Last Post: tophneal
  Stock Debian on original Pinebook moonwalkers 1 3,115 01-29-2022, 10:37 PM
Last Post: cel
  Write image to eMMC - Pinebook 11.6" irongarment 4 3,666 01-04-2022, 09:22 PM
Last Post: irongarment
  E: The repository 'http://pinebook.kde.org.uk bionic Release' no longer has a Release pixelpaperyarn 3 5,084 05-07-2021, 10:20 AM
Last Post: tophneal
  pinebook.kde.org.uk no longer has release file?? supermassive 1 3,714 01-20-2021, 11:18 AM
Last Post: tophneal
Question Ran apt update on my Pinebook.. ford442 0 2,735 12-25-2020, 04:40 PM
Last Post: ford442

Forum Jump:


Users browsing this thread: 1 Guest(s)