Generic MCE Remote: Worked with Raspbmc, not with OSMC

Yes, it’s me again. This time the topic is The Good Pi, which I recently upgraded from Raspbmc to OSMC RC2.

I have one of those cheap Chinese keyboard/mouse remotes.

It worked fine with Raspbmc. I had mapped all the keys to do what I wanted. I hoped that I could just use the same keyboard.xml file with OSMC.

Not!

Some keys work, but some don’t. For example, I had set the yellow key to bring up the contextual menu, but now it does nothing.

I suspect that I have chosen the wrong remote configuration file.

Which one should I choose for this sort of remote?

I use keyboard.xml in keymaps folder to do the customising.
I haven’t noticed any changes when going raspbmc to osmc - but there was something changed at the last changes of kodi version with raspbmc.
Perhaps you should post the mappings, so we can have a look at what you use.
Derek

I got the expected keyboard codes from this article:

Unbranded MCE Remote

It states the following:

<one mod="ctrl,alt">YourAction1</one> <!-- Green -->
<two mod="ctrl,alt">YourAction2</two> <!-- Orange -->
<three mod="ctrl,alt">YourAction3</three> <!-- Blue -->
<four mod="ctrl,alt">YourAction4</four> <!-- Yellow -->

I built my keyboard.xml file based on that and it worked fine in Raspbmc. Here’s what I have for the Blue key:

  <three mod="ctrl,alt">ContextMenu</three> <!-- Blue —>

So, pressing the Blue key should always bring up the Context Menu. That worked fine in Raspbmc.

But, with OSMC, here’w what happens when I press the Blue key:

17:32:16 T:3023548416   DEBUG: Keyboard: scancode: 0x03, sym: 0x0040, unicode: 0x0040, modifier: 0x140
17:32:16 T:3023548416   DEBUG: OnKey: ctrl-alt-at (0x5f040) pressed, action is
17:32:16 T:3023548416   DEBUG: Keyboard: scancode: 0x1d, sym: 0x0132, unicode: 0x0000, modifier: 0x40
17:32:16 T:3023548416   DEBUG: OnKey: ctrl-leftctrl (0x1f0d0) pressed, action is
17:32:16 T:3023548416   DEBUG: Keyboard: scancode: 0x38, sym: 0x0134, unicode: 0x0000, modifier: 0x140
17:32:16 T:3023548416   DEBUG: OnKey: ctrl-alt-leftalt (0x5f0d4) pressed, action is
17:32:16 T:3023548416   DEBUG: Keyboard: scancode: 0x3c, sym: 0x011b, unicode: 0x0000, modifier: 0x140
17:32:16 T:3023548416   DEBUG: OnKey: ctrl-alt-f2 (0x5f091) pressed, action is

I’m expecting ctrl-alt-three, but it’s not there and no action is mapped.

Oddly, I do get ctrl-alt-three when I press the Yellow key, but that should be ctrl-alt-four.

I’ve noticed over the time I’ve had raspbmc and now osmc that I need to redo the keymaps for the coloured buttons on this remote from time to time. It seems that occasionally updates cause the keypresses received to change.

Adjust the keymap to reflect what is being received and you should be good to go again.

This is very odd, but I will give it a try. The remote itself hasn’t changed, why would the developers suddenly change the interpretation of the keypresses?

One other thing. When running OSMC, the remote is very unresponsive. Some keypresses are not received at all.

I just rebooted the Pi into Raspbmc and the remote is, once again, 100% responsive. Every keypress is received and logged.

There is something about OSMC that messes with this remote.

I’m wonder if I need to select a different remote in MyOSMC->Remotes?

Which one is correct for this remote?

=====

Here’s what the Kodi log shows for the colored buttons on the remote when run under Raspbmc. All the correct codes are there:

Bleach:~ mnewman$ ssh pi@192.168.0.151
Warning: Permanently added '192.168.0.151' (RSA) to the list of known hosts.
pi@192.168.0.151's password: 

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
pi@raspbmc:~$ tail -F /home/pi/.kodi/temp/kodi.log | grep OnKey 
10:45:52 T:3037933568   DEBUG: OnKey: ctrl-leftctrl (0x1f0d0) pressed, action is
10:45:52 T:3037933568   DEBUG: OnKey: ctrl-alt-leftalt (0x5f0d4) pressed, action is
10:45:52 T:3037933568   DEBUG: OnKey: ctrl-alt-164 (0x5f0a4) pressed, action is
10:45:52 T:3037933568   DEBUG: OnKey: ctrl-alt-one (0x5f031) pressed, action is Info
10:45:53 T:3037933568   DEBUG: OnKey: ctrl-alt-f1 (0x5f090) pressed, action is
10:45:53 T:3037933568   DEBUG: OnKey: ctrl-leftctrl (0x1f0d0) pressed, action is
10:45:53 T:3037933568   DEBUG: OnKey: ctrl-alt-leftalt (0x5f0d4) pressed, action is
10:45:53 T:3037933568   DEBUG: OnKey: ctrl-alt-b (0x5f042) pressed, action is
10:45:53 T:3037933568   DEBUG: OnKey: ctrl-alt-two (0x5f032) pressed, action is OSD
10:45:53 T:3037933568   DEBUG: OnKey: ctrl-leftctrl (0x1f0d0) pressed, action is
10:45:53 T:3037933568   DEBUG: OnKey: ctrl-alt-leftalt (0x5f0d4) pressed, action is
10:45:53 T:3037933568   DEBUG: OnKey: ctrl-alt-f2 (0x5f091) pressed, action is
10:45:54 T:3037933568   DEBUG: OnKey: ctrl-leftctrl (0x1f0d0) pressed, action is
10:45:54 T:3037933568   DEBUG: OnKey: ctrl-alt-leftalt (0x5f0d4) pressed, action is
10:45:54 T:3037933568   DEBUG: OnKey: ctrl-alt-c (0x5f043) pressed, action is
10:45:54 T:3037933568   DEBUG: OnKey: ctrl-alt-three (0x5f033) pressed, action is ContextMenu
10:45:54 T:3037933568   DEBUG: OnKey: ctrl-leftctrl (0x1f0d0) pressed, action is
10:45:54 T:3037933568   DEBUG: OnKey: ctrl-alt-leftalt (0x5f0d4) pressed, action is
10:45:54 T:3037933568   DEBUG: OnKey: ctrl-alt-f3 (0x5f092) pressed, action is
10:45:55 T:3037933568   DEBUG: OnKey: ctrl-leftctrl (0x1f0d0) pressed, action is
10:45:55 T:3037933568   DEBUG: OnKey: ctrl-alt-leftalt (0x5f0d4) pressed, action is
10:45:55 T:3037933568   DEBUG: OnKey: ctrl-alt-164 (0x5f0a4) pressed, action is
10:45:55 T:3037933568   DEBUG: OnKey: ctrl-alt-four (0x5f034) pressed, action is Delete
10:45:55 T:3037933568   DEBUG: OnKey: ctrl-alt-f4 (0x5f093) pressed, action is

Boy, this is frustrating. I changed the keyboard.xml as suggested:

  <one mod="ctrl,alt">Info</one> <!-- Green -->
  <b mod="ctrl,alt">OSD</two> <!-- Orange -->
  <three mod="ctrl,alt">ContextMenu</three> <!-- Blue -->
  <d mod="ctrl,alt">Delete</four> <!-- Yellow —>

But now, even the ones that used to work, don’t anymore:

13:06:53 T:3024470016   DEBUG: OnKey: ctrl-alt-one (0x5f031) pressed, action is

So, the green key, which used to map to ‘info’, now doesn’t map to anything at all.

What have I done?

I found that a couple of my key mappings had to be changed when updates happened, but the correspondence and sequence were preserved.
I originally had 1 2 3 4 (with ctrl alt modifiers) for top row
and now have 1 f2 3 f4 with modifiers.
I think there was at least one other button changed, or wasn’t apparent, but cannot quickly ascertain which.
One other comment, just in case - at one point all my keys seemed to be ineffective or doing wrong things. I eventually traced this to having somehow pushed the ‘numlock’ key (which changes the perceived key actions.
HTH
Derek

Thanks for taking the time to reply.

Your scheme worked for me.

I had tried it, but had failed to balance the tags properly, which caused it to fail.

You’re a gem for sticking with me.

Mike

I realize that this is a long shot, but can anyone explain why changes like this are made?

1 Like

I’ve just done a recheck on the possibilities for that row of coloured keys (I won’t use colours, since people quote them as different colours, and I have a form of colour blindness which caan make other peoples descriptions confusing) which are labelled A B C D and one can, with RC2 on Pi1B+ use mappings:
ctrl-alt-a ctrl-alt-b ctrl-alt-c ctrl-alt-d
or ctrl-alt-F1 ctrl-alt-F2 ctrl-alt-F3 ctrl-alt-F4

and I use the key above NUMLOCK for ContextMenu (mapped ctrl-o)

HTH
Derek

Interesting. I’ve just done a search of my kodi.log and verified that your findings are the same as mine.

Thanks for showing me the way.

Hi!
Same remote arrived today at my home.
I connected IR receiver to my rpi 2, started rpi 2 to boot into osmc, but remote is not working at all.
Gone to osmc setting, tried to select add remote but nothing hapened.
What I do wrong? Is there some customisation I have to do before using this remote?

The basic functions of the remote (play/pause, stop, arrow keys, etc.) should work out of the box.

Did you put in a battery? Mine didn’t come with one.

You only need to customize if you want to assign specific functions to the buttons. In this thread we are talking about assigning functions to the four color keys.

I apologize for interupting, but I got answer from my ebay seller that is well known problem with fast rpi devices (rpi 2) because they boot to fast before ir driver manage to load. I can’t find similar topic so I write here. Moderator maybe can move my posts to separate thread…

I find myself doubtful about that ebay reply -
I’ve not had any problems with that PCRemote depicted and RPi2B.
Only time I got no output at all I determined (by swapping RPi installations and remote and USB detector) that the problem was that the USB bit had stopped working.
Derek

1 Like

Same thing here. It works fine with RPI B+ but not with RPI 2 even after loading a custom key map.

??? I don’t understand - I just said it was OK with Pi2

Btw, today I first started rpi 2, wait to boot up into osmc and after that I pluged in IR receiver into usb port. And remote started to work just fine. I dont know what was the problem first time. Maybe realy rpi2 booted to fast… :slight_smile:

I have found that using the emote in post 1, that it does not work on the initial cold boot, but works just fine on subsequent warm boots. Weird.

Sometimes just unplugging the receiver and plugging it in again restores the remote….

See this thread: USB Remote Not Working on Boot