Bug #375


Favi keyboard's arrow keys are not recognized by omxplayer

Added by Hammel over 9 years ago. Updated over 9 years ago.

Target version:
Start date:
12 Aug 2014
Due date:
% Done:


Estimated time:
01 - Critical


I need a keyboard config that allows the Favi keyboard's arrow keys to work with omxplayer. Currently there is no way to jump forward or back in omxplayer from the Favi keyboard.

See the ArchLinux descriptions for xmodmap and xkb extension.

Actions #1

Updated by Hammel over 9 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 20

After testing last night it appears the Favi's arrow keys are the same as a 101-key keyboard's arrow keys (keycodes 111,113,114,116), but the omxplayer wants the keys for the keypad (keycodes 80,83,85,88). I think this can be fixed with xmodmap though I haven't tried it yet.

See RM #361 for a way to identify the Favi in order to determine if the keyboard mappings should be changed.

Actions #2

Updated by Hammel over 9 years ago

  • % Done changed from 20 to 50

Turns out the FAVI on the Pi has different keycodes. So the following actually works to get the arrow keys to work with omxplayer:

xmodmap -e 'keycode 198=KP_Up'
xmodmap -e 'keycode 200=KP_Left'
xmodmap -e 'keycode 201=KP_Right'
xmodmap -e 'keycode 204=KP_Down'

So I just need to put this into a shell script and call it from xinitrc. This needs to go in the PiBoxMediaServer UI repo.

Actions #3

Updated by Hammel over 9 years ago

  • Priority changed from Urgent to Immediate
  • Target version changed from 0.10.0 to 0.9.0
Actions #4

Updated by Hammel over 9 years ago

  • % Done changed from 50 to 60
Calling xmodmap from /etc/X11/xinitrc 4 times seems to slow the boot process - X takes longer to get to matchbox. It might be better to generate the full xmodmap (xmodmap -pke > file) and then load it from /etc/X11/xinitrc, though that may still slow down the starting of X. Other alternatives:
  1. do xmodmap manually; xmodmap -pke > /root/.xmodmaprc (might now work anymore)
  2. do xmodmap manually; xmodmap -pke > /root/.Xmodmap (possible replacement for previous alternative)
  3. do xmodmap manually; echo "xmodmap /root/.xmodmaprc" > /root/.xsessionrc
  4. do xmodmap manually; echo "xmodmap /root/.xmodmaprc" > /root/.xinitrc

Another problem may be having xinitrc call lsusb to find the favi keyboard. I might want to have S10usbdev save the output from lsusb so other scripts can use it, or possibly use the -d option (which actually seems much slower that piping lsusb output to grep). A quick set of timed tests shows that grep'ing for the FAVI vendor/product ids from a file generated from the output of lsusb is MUCH faster than running lsusb and grep'ing its output directly. So S10usbdev should write that output to a file for other init scripts to use.

This file should be named usb.list and placed under /tmp/init which is created by rcS. rcS can then clean up that directory after it runs all the init scripts. This will allow future init updates to have a place to do similar things.

Actions #5

Updated by Hammel over 9 years ago

  • Severity changed from 03 - Medium to 01 - Critical
Actions #6

Updated by Hammel over 9 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 60 to 100

Updated S10usbdev in core repo to write out lsusb output to /etc/init.d/data/usb. Then updated xinitrc in UI repo to test for FAVI keyboard from that data and runs xmodmap to fix arrow key mappings.

Issue can be closed.


Also available in: Atom PDF