Kodi Community Forum
[LINUX] Generic HID Remote Driver for XBMC (Drivers for XBMC on Linux and XBMC Live) - Printable Version

+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Kodi General Help and Support (/forumdisplay.php?fid=111)
+---- Forum: Linux and Live support (/forumdisplay.php?fid=52)
+---- Thread: [LINUX] Generic HID Remote Driver for XBMC (Drivers for XBMC on Linux and XBMC Live) (/showthread.php?tid=88560)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12


- ximon - 2011-02-24 23:06

Sure, thanks:

Code:
#TV
00040200:KEY_F1

#PC
04003d0000000000:KEY_END

0003b40000:KEY_R
0003b00000:KEY_P
0003b30000:KEY_F
0003b70000:KEY_X
0003b60000:KEY_COMMA
0003b10000:KEY_SPACE
0003b50000:KEY_DOT
# 0003b20000:KEY_RECORD

# Back
00002a0000000000:KEY_BACKSPACE

#More
0003090200:KEY_C

0000500000000000:KEY_LEFT
0000510000000000:KEY_DOWN
0000520000000000:KEY_UP
00004f0000000000:KEY_RIGHT
0000280000000000:KEY_ENTER

#Aspect
03001d0000000000:KEY_TAB

# MSN
0100110000000000:KEY_M

#Videos/Red
00041000:KEY_RED

#Music/Green
00040400:KEY_GREEN

#Pictures/Yellow
00040800:KEY_YELLOW

#MyTV/Blue
00042000:KEY_BLUE

#Start
00040100:KEY_ESC

0003e20000:KEY_MUTE
0003e90000:KEY_VOLUMEUP
0003ea0000:KEY_VOLUMEDOWN
00004b0000000000:KEY_PAGEUP
00004e0000000000:KEY_PAGEDOWN
00001e0000000000:KEY_1
00001f0000000000:KEY_2
0000200000000000:KEY_3
0000210000000000:KEY_4
0000220000000000:KEY_5
0000230000000000:KEY_6
0000240000000000:KEY_7
0000250000000000:KEY_8
0000260000000000:KEY_9
0000270000000000:KEY_0
0000550000000000:KEY_KPASTERISK

#Guide
00038d0000:KEY_O

#RTV
00044000:KEY_Z

#Help
00003a0000000000:KEY_T

#Window
0400280000000000:KEY_W

0100040000000000:KEY_F2
0300100000000000:KEY_F3
0300040000000000:KEY_A
0100180000000000:KEY_GREEN
0100180000000000:KEY_RED

Edit: I have been double-checking, it's not all the short codes that aren't working - it's some short ones and some long ones.

Confirmed not working:
Title/Red 0100180000000000:KEY_I
Start 00040100:KEY_ESC
TV 0040200:KEY_F1
PC 04003d0000000000:KEY_END


- ximon - 2011-02-24 23:51

coldsource,

Don't worry about my remote, I can work around the four buttons that don't work, and I still have way more buttons working now than before thanks to your driver.

Great work, you have greatly enhanced my xbmc experience!

Thanks again!
Big Grin


- coldsource - 2011-02-24 23:56

Hi ximon,

I've just tested everything and all seems to work. I have simulated the key events and I get the correct keys. I don't see what could cause your problems.

Maybe the mapped keys are interfering with something else, you could try with simple keys like letters and test in a term to see if this works (outside of xbmc).

Hope you'll find a solution !
Glad to have helped you !


- Mindzai - 2011-02-25 00:05

Not that it helps much but I can confirm that I also have a remote which sends long and short codes and it all works fine.


- UsagiYojimbo - 2011-02-25 11:30

ximon Wrote:
Code:
...
0100180000000000:KEY_GREEN
0100180000000000:KEY_RED
Edit: I have been double-checking, it's not all the short codes that aren't working - it's some short ones and some long ones.

Confirmed not working:
Title/Red 0100180000000000:KEY_I
Start 00040100:KEY_ESC
TV 0040200:KEY_F1
PC 04003d0000000000:KEY_END
I am not sure to have any significance, but the code for Title/Red is doubled in the map: one for KEY_GREEN and another for KEY_RED. Could this be the cause of the problems? Nerd However, the other codes seem to be not doubled.

Edit:
I forgot to upload my mapping file, so here it is:
Code:
# Buttons on the remote:

43415400FF40:KEY_I            # Info
43415400FF70:KEY_O            # App
43415400FF58:KEY_M            # Task
43415400FF78:KEY_POWER        # App Exit

43415400FF00:KEY_S            # Power
43415400FF68:KEY_BACKSPACE    # Select
43415400FF50:KEY_ESC          # ESC
43415400FF7A:KEY_ENTER        # Enter

43415400FFDA:KEY_LEFT         # Left
43415400FFFA:KEY_RIGHT        # Right
43415400FF8A:KEY_UP           # Up
43415400FFCA:KEY_DOWN         # Down

43415400FF92:KEY_VIDEO        # Movie
43415400FFB2:KEY_AUDIO        # Music
#43415400FFF0:KEY_PHOTO        # Photo

43415400FF9A:KEY_TV           # eTV
43415400FFAA:KEY_RADIO        # eRadio

43415400FF42:KEY_MENU         # Menu

43415400FFA8:KEY_PAGEUP       # CH +
43415400FFA0:KEY_PAGEDOWN     # CH -

43415400FF48:KEY_MUTE         # Mute
43415400FF88:KEY_VOLUMEUP     # Vol +
43415400FF90:KEY_VOLUMEDOWN   # Vol -

#43415400FF4A:                 # Input
#43415400FF5A:                 # Timer
#43415400FF98:                 # Tab

43415400FFD0:KEY_1            # Numbers
43415400FFE8:KEY_2
43415400FFD8:KEY_3
43415400FFE0:KEY_4
43415400FF0A:KEY_5
43415400FF2A:KEY_6
43415400FF12:KEY_7
43415400FF32:KEY_8
43415400FF1A:KEY_9
43415400FFC0:KEY_0

43415400FFC8:KEY_L            # Char
#43415400FFF8:                 # Resolution

43415400FFC2:KEY_PREVIOUSSONG # Prev
43415400FFE2:KEY_PLAY         # Play / Pause
43415400FFF2:KEY_NEXTSONG     # Next
43415400FFB0:KEY_STOP         # Stop
43415400FF80:KEY_PRINT        # Rec

43415400FFEA:KEY_TAB          # FullScreen
43415400FF72:KEY_EJECTCD      # Eject

43415400FF77:CORE::LAST_KEY    # Button repetition


# Buttons on the MediaBay's panel:

4341544BA101:KEY_MENU         # Menu
4341544BA102:KEY_UP           # Up / CPU
4341544BA103:KEY_DOWN         # Down / HDD
4341544BA104:KEY_ENTER        # Enter / RAM
4341544BA105:KEY_ESC          # ESC / OS
The remote itself is like this, but with slightly different button labels:
[Image: pilot.jpg]


- WittFan - 2011-02-27 01:24

Grez Wrote:This is brilliant, thank you so much Coldsource, this driver/app has solved all my Remote niggles with my Jetway Mini-TOP.

Grez, I've got a Jetway Mini-Top too,but I'm not having any luck getting hid_mapper to see my remote.

According to dmesg hid_mapper should find the remote on hidraw4 and hidraw5:
Code:
user@minitop:~$ dmesg | grep aureal
[    2.599575] aureal 0003:0755:2626.0005: fixing Aureal Cy se W-01RN USB_V3.1 report descriptor. Keyboard Logical Maximum = 101
[    2.600793] aureal 0003:0755:2626.0005: input,hidraw4: USB HID v1.10 Keyboard [Cy se̪www.ir www.irfmedia.com UIR] on usb-0000:00:1d.3-2/input0
[    2.625167] aureal 0003:0755:2626.0006: input,hidraw5: USB HID v1.10 Mouse [Cy se̪www.ir www.irfmedia.com UIR] on usb-0000:00:1d.3-2/input1

But hid_mapper isn't finding anything. Sad
Code:
user@minitop:~$ sudo ./hid_mapper_beta/hid_mapper --list-devices --lookup-id

Found HID device at /dev/hidraw0
  Manufacturer : 0d8c
  Product name : 013c

Found HID device at /dev/hidraw1
  Manufacturer : Unknown
  Product name : Unknown

Found HID device at /dev/hidraw2
  Manufacturer : Unknown
  Product name : Unknown

Found HID device at /dev/hidraw3
  Manufacturer : Unknown
  Product name : Unknown

Found HID device at /dev/hidraw4
  Manufacturer : Unknown
  Product name : Unknown

Found HID device at /dev/hidraw5
  Manufacturer : Unknown
  Product name : Unknown


Did you have to do anything special to get hid_mapper to see your remote?


- akr884 - 2011-02-28 18:23

coldsource Wrote:I've updated beta version : hid_mapper_beta.tar.gz

The BTN_RIGHT and BTN_LEFT mouse clicks work perfectly.

The only thing missing for me, as far as the remote control configuration is simultaneous button clicks. I think you mentioned it earlier talking about how to do drag-and-drop with the mouse, or for me, selecting text, or dragging a scroll bar.

But it seems like it could also be useful, given that I've mapped a lot of my keys to function keys, to be able to have maybe a KEY_ALT to be able to use key shortcuts inside or outside of XBMC.

I was also thinking about writing a tutorial with my button mappings for my remote, although I'll probably wait until you declare a final version of the mapper. Do you think it would make sense to have an auto-configure tool for specific remotes like in LIRC?

Anyways, thanks again for your great work and I hope you decide to keep improving the button mapper.


- Mindzai - 2011-02-28 18:27

akr884 Wrote:Do you think it would make sense to have an auto-configure tool for specific remotes like in LIRC?

I was thinking about writing a tool to generate map files. At first probably just a simple CLI script but eventually as an XBMC plugin.


- UsagiYojimbo - 2011-03-02 12:11

I had to remove (# out) key repetition code as it sometimes gets repeated ad infinitum...


- Psycho_Dad - 2011-03-03 18:28

coldsource Wrote:Hi Psycho_Dad,
Sorry I had completely forgotten your previous post.
[...]
Let me know if it works

Hi! Sorry for the late reply!

Everything works perfectly now. I've tried hid_mapper under Debian Squeeze amd64 and Ubuntu Maverick amd64 also; it works fine under both distros.

One thing though: I don't know if it's a feature or not but I couldn't map key combinations, like CTRL+F1 or something.

I wanted to map mplayer's default shortcuts in my mapping file, but I failed to map 'O' for example as that would require KEY_LEFTSHIFT+KEY_O or something. Not a huge problem for me as I remapped the keys in mplayer's conf for lowercase letters but this feature couldn't hurt. Smile


- UsagiYojimbo - 2011-03-04 08:36

Psycho_Dad Wrote:One thing though: I don't know if it's a feature or not but I couldn't map key combinations, like CTRL+F1 or something.

I wanted to map mplayer's default shortcuts in my mapping file, but I failed to map 'O' for example as that would require KEY_LEFTSHIFT+KEY_O or something. Not a huge problem for me as I remapped the keys in mplayer's conf for lowercase letters but this feature couldn't hurt. Smile

My thoughts exactly. Well, without mplayer..


- coldsource - 2011-03-04 13:31

Hi everyone,

WittFan Wrote:Grez, I've got a Jetway Mini-Top too,but I'm not having any luck getting hid_mapper to see my remote.
Could you tell me which distribution you are using ? It seems that the /sys filesystem doesn't contain some required files for hid_mapper.

UsagiYojimbo Wrote:I had to remove (# out) key repetition code as it sometimes gets repeated ad infinitum...
In which situation does it happen ? If you can isolate a sample case I'll try to debug this.

akr884 Wrote:The only thing missing for me, as far as the remote control configuration is simultaneous button clicks. I think you mentioned it earlier talking about how to do drag-and-drop with the mouse, or for me, selecting text, or dragging a scroll bar.

Psycho_Dad Wrote:One thing though: I don't know if it's a feature or not but I couldn't map key combinations, like CTRL+F1 or something.
You're right I'll implement keys combination in the next beta release. Maybe key modifiers (like SHIFT, ALT..) would be enough, or do you need multiple key presses like A+B ? I think modifiers should be enough at least for the first release but tell me.

Mindzai Wrote:I was thinking about writing a tool to generate map files. At first probably just a simple CLI script but eventually as an XBMC plugin.
I think it would be a very good idea. It would simplify a lot the generation of map files. Integrating it into an XBMC plugin would be even better since some people are not very friendly with command line tools. Tell me if you need help for this.

Thansk everyone


- Psycho_Dad - 2011-03-05 08:50

coldsource Wrote:You're right I'll implement keys combination in the next beta release. Maybe key modifiers (like SHIFT, ALT..) would be enough, or do you need multiple key presses like A+B ? I think modifiers should be enough at least for the first release but tell me.

I need no more as mplayer works just fine with my remapped keys and I only use a handful of buttons, but if you ask me there will surely be other hid_mapper users who jsut couldn't *live* without exotic key combinations like Ctrl+Super+Alt+Shift+A+F12. So you probably better off doing the most complicated stuff you could imagine. : )


- UsagiYojimbo - 2011-03-05 17:04

coldsource Wrote:In which situation does it happen ? If you can isolate a sample case I'll try to debug this.

I found out:
The receiver always sends 6 bytes. If no button pressed for a given time, it sends zeros to fill up...

Edit:
The problem occurs, when something get between the key-down and the key-up events.
It also only affects XBMC, or at least it had not occurred in consoles...


- UsagiYojimbo - 2011-03-05 20:46

coldsource Wrote:You're right I'll implement keys combination in the next beta release. Maybe key modifiers (like SHIFT, ALT..) would be enough, or do you need multiple key presses like A+B ? I think modifiers should be enough at least for the first release but tell me.

I do not think one could need to generate a "key combination" where more than one non-modifier keys are pressed at the same time.
Also, Unices use "key combinations" where non-modifier keys (with modifiers, optionally) are pressed in sequence.
So "A+B" (that is A and B are pressed at the same time) is not likely needed, but "A B" (that is: A is pressed, after which B is pressed) is a possibility...Nerd