Kodi OpenElec Keyboard Issue

Kodi / XBMC / OpenElec may have trouble with Apple Bluetooth Keyboards when numlock is stuck on. Only volume keys and a few others like backspace seem to work. When this is the case you can use a crude hack to force numlock/capslock to be off by create a file in /storage/.config/autostart.sh with the follow. Don’t forget to chmod +x it.

python -c 'from ctypes import *; X11 = cdll.LoadLibrary("libX11.so.6"); display = X11.XOpenDisplay(None); X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(18), c_uint(2)); X11.XCloseDisplay(display)'