I am building a project using RASPBIAN Jessie, it needs a remote but isn’t a multimedia project so I won’t be using OSMC software.
Where can I find documentation that describes the OSMC Remote Control device sold in stores. I like the look of it and want to re-purpose it for my other project, written in Python.
I had scouted around but can’t find it, if it exists, it’s obscured by search results about the OSMC software system. I want to take a look before buying one, here is the unit OSMC Remote Control | The Pi Hut
Thanks in advance for any advice or information.
Regards
David
It depends on the OS you’re using. One good thing about our remote over others (ahem Hama), is that we only send one key code per button, so it’s easily remappable.
On Windows I suspect you can use something like EventGhost to map the keys to actions.
I also wanted to use the official OSMC remote for other projects. I bought the current version - the one with the vol up / vol down buttons - and mapped the keys using the python script below.
Two things I discovered:
The following button codes have changed:
info: KEY_I (23)
context: KEY_C (46)
vol down: KEY_MINUS (12)
vol up: KEY_EQUAL (13)
The receiver appears as 2 USB devices on my RPi 2B (Jessie):
/dev/input/event0 (most KEYs)
/dev/input/event1 (KEY_BACK, KEY_PLAYPAUSE, KEY_STOP)
Python code:
from evdev import InputDevice, categorize, ecodes
from select import select
devices = map(InputDevice, ('/dev/input/event0', '/dev/input/event1'))
devices = {dev.fd: dev for dev in devices}
#for dev in devices.values(): print(dev)
while True:
r, w, x = select(devices, [], [])
for fd in r:
for event in devices[fd].read():
if event.type == ecodes.EV_KEY and event.value == 1:
data = categorize(event)
print data