Favi keyboard's arrow keys are not recognized by omxplayer
|Status:||Closed||Start date:||12 Aug 2014|
|Target version:||PiBox - 0.9.0|
|Severity:||01 - Critical|
#1 Updated by Hammel about 5 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.
#2 Updated by Hammel about 5 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.
#4 Updated by Hammel about 5 years ago
- % Done changed from 50 to 60
- do xmodmap manually; xmodmap -pke > /root/.xmodmaprc (might now work anymore)
- do xmodmap manually; xmodmap -pke > /root/.Xmodmap (possible replacement for previous alternative)
- do xmodmap manually; echo "xmodmap /root/.xmodmaprc" > /root/.xsessionrc
- 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.
#6 Updated by Hammel about 5 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.