čtvrtek 13. října 2016

Mismapped Enter on external keyboard on X96

I recently bought X96 TV Box with Android 6.0. It's rather small black box with remote control, with quadcore ARM Amlogic, 2GB of RAM and 16 GB of flash. It makes easily available content of connected NAS through Kodi etc.
Problem was with strange keyboard map - pressing Enter on external keyboard did nothing in most of cases. After some digging and comparing I found that it emmits DPAD_Center instead of Enter.
It can be fixed by editing /system/usr/keylayouts/Generic.kl and replacing
key 28    DPAD_CENTER
to
key 28    ENTER
In a script (run as root):
mount -o remount,rw /system && \
busybox sed -i 's@key 28[[:blank:]].*@key 28   ENTER@' /system/usr/keylayouts/Generic.kl && \
mount -o remount,ro /system