Remapping key HID remote - disabling the original behavior

If you have a question or need help, this is the place to be.
Post Reply
cshaun
Posts: 5
Joined: Tue Aug 30, 2016 12:45 pm

Remapping key HID remote - disabling the original behavior

Post by cshaun » Tue Aug 30, 2016 1:04 pm

I've just bought a "Rii i25A" remote for use with Kodi.
I've managed to detect the key presses for various buttons (most seem to be HID even the previous and next track). I can map them to a action e.g. emulating a keyboard stroke.

The problem I'm having is the original behavior still persists. Think there is something simple I'm missing? How do I hide / disable / cancel the original action / press from Windows?

I'm trying to remap Prev Track and Next Track to keyboard shortcuts. There's also a search button which triggers Windows 10 search, "browser home" button which opens a browser and a sleep button. Got the sleep button working by setting "sleep button does nothing" in windows control panel.

Have read all the online documentation and spent hours searching for a solution. Help much appreciated!

Running EventGhost 0.4.1.r1722, Windows 10 Anniversary.

(It's a nice remote - just super annoying the default action is 'mouse on', and it goes to sleep after a couple min. Need to press a button to wake it up before it registers any key presses. Dumb... No back button on the front of the mouse, you'd think the mouse right click is supposed to switch to back when the mouse is off, but it doesn't. Mele 10 doesn't have these particular issues, but many other disadvantages.)

jachin99
Experienced User
Posts: 646
Joined: Sat Feb 13, 2016 8:39 pm

Re: Remapping key HID remote - disabling the original behavi

Post by jachin99 » Wed Aug 31, 2016 12:44 pm

See if you can modify keyboard.xml in Kodi. For a quick test to see if this works, find the file, and try making a backup copy of it, and placing it on your desktop. From there, open keyboard.xml in its original location, and delete most of the information inside. I say leave the original file because I'm not sure if Kodi is self healing, and will just look for a backup copy of keyboard.xml somewhere if it cannot see the original file.

cshaun
Posts: 5
Joined: Tue Aug 30, 2016 12:45 pm

Re: Remapping key HID remote - disabling the original behavi

Post by cshaun » Thu Sep 01, 2016 4:50 am

Thanks. I've already created my own 'keyboard.xml' file. Named it after the remote. My understanding is can be named anything, the defaults are loaded and then the users profiles in alphabetical order. So my file is overriding Kodi defaults. It's working fine, as I've used it to disable the mouse, and remap the left and right clicks (essentially behaves like the mouse doesn't exist in Kodi).

However I can't remap the keys I want because they're HID and not standard keyboard keys or media keys. If I turn Kodi's debug on I don't get any scan codes for those keys even though it sees and reacts to them. So as far as I can tell I can't map them in the keyboard.xml file. Hence trying EventGhost which does see them and I can map - just can't stop the original behavior of the key.

Had found this, which looks like it'd work with Kodi but it's for Linux.

Have since found:
https://autohotkey.com/board/topic/5592 ... Bkeyboards
Which mentions :Quick Macros, GlovePIE, and HID macros.
These seem like they're able to properly remap they keys and disable the original behavior.

I'd prefer to use EventGhost - still wondering if there's something I'm just not doing right?

jachin99
Experienced User
Posts: 646
Joined: Sat Feb 13, 2016 8:39 pm

Re: Remapping key HID remote - disabling the original behavi

Post by jachin99 » Thu Sep 01, 2016 12:26 pm

I had the exact same problem with my remote. My solution at the time was to go to JRiver because my remote worked out of the box with them. Why not use the kodi plugins already available for EG? Maybe you could remap some of your HID remote keys to emulate keystrokes, or perform some other action. I'm thinking the keyboard plugin for EG intercepts and captures keystrokes so they never make it to whatever software your using.

cshaun
Posts: 5
Joined: Tue Aug 30, 2016 12:45 pm

Re: Remapping key HID remote - disabling the original behavi

Post by cshaun » Thu Sep 01, 2016 1:44 pm

I could try the Kodi plugin. You seem to think that will be different for some reason?

So atm I'm just trying to use EG go simply remap a key (for example the search button) to a key press (say "s" which Kodi by default uses to open the power off dialog). So it works and I get the power off dialog, but I also have Windows (start) search menu pop up. So it's sending the key press but Windows is also seeing the original key press. i.e. if not running EG I get the Windows (start) search menu pop up.

Is there some command / action or way of telling EG to intercept it and not let anything else see the original key press (everything else just sees the new emulated press)?

jachin99
Experienced User
Posts: 646
Joined: Sat Feb 13, 2016 8:39 pm

Re: Remapping key HID remote - disabling the original behavi

Post by jachin99 » Thu Sep 01, 2016 2:23 pm

I don't exactly understand what you are trying to do. I get that your problem is that windows sees your keypresses, and performs windows actions over what you are trying to do with EG, and Kodi. The description of the keyboard plugin says it intercepts keystrokes so they won't perform their original actions. What keys are you trying to map to which actions, and what happens on your PC when you press those buttons. Maybe you could assign different hotkeys. I use the generic HID plugin for my remote. EG intercepts keystrokes on my machine so I don't have this problem. I'm just trying to understand your problem a little more. Are you trying to control anything other than Kodi, and could you have another macro that is interfering. Maybe you could try deleting some of your macros and rebuilding them. I have found that at times, I need to restart my machine, then build my macros in order to get them to function correctly, I.E. if I build a macro on a machine that has been running for a while, then it won't work.

cshaun
Posts: 5
Joined: Tue Aug 30, 2016 12:45 pm

Re: Remapping key HID remote - disabling the original behavi

Post by cshaun » Fri Sep 02, 2016 3:35 pm

See my screenshot below.

I'm trying to remap a few different buttons. I'm having the same issue with all of them. Most are via HID plugin. But having the same issue with Keyboard.Apps key. It's remapped to "c" but when I test it does type the "c" but also pops up a context menu. Volume up and down (HID.Button.234) sends a CEC command to my receiver to change volume, which works, but it's still adjusting windows volume at the same time.
Surely 95% of use cases you want to replace what a button does, not just add additional commands along side it?

You mention yours is working? Can you copy/past code for me?
And yes I did read in the keyboard plugin that it supposedly does disable the keypress if a macro is run (what I'm after). No mention of it in the HID plugin.
EG-Screen-grab.PNG

jachin99
Experienced User
Posts: 646
Joined: Sat Feb 13, 2016 8:39 pm

Re: Remapping key HID remote - disabling the original behavi

Post by jachin99 » Fri Sep 02, 2016 4:22 pm

I took your keyboard.Apps example, and tried linking it to an action in my tree just for testing. My computer performed the EG action but brought up the apps menu at the same time. I then altered the button press from keyboard.Apps to Alt+keyboard.Apps, and this did not bring up the context menu. A simple way for you to solve your problem would be to include two keys in every macro where windows is performing additional actions. I do this for my function keys so that the keyboard plugin doesn't steal my function keys but I can still use them to launch batch scripts, and activate keyboard profiles. The volume is a little strange and here is what I found for that: My HID buttons for volume up, and down are the same for yours but I have JRiver instead of Kodi, and there is an option within JRIver to change how the machine handles volume changes so I get the choice of adjusting the application's sound, the PC's sounds or a few others. Without JRiver running, I get the volume slider as well. The keyboard plugin will not help here I believe because it doesn't intercept HID traffic. Maybe there is a way you can disable windows handling volume changes within the OS itself. You should ask around the Kodi forums about that, and try looking in Kodi's settings to see if there is a way that it can handle volume traffic. If it is just you, and you don't mind using a keyboard, then you could use the alt+whichever key method to adjust volume also.

cshaun
Posts: 5
Joined: Tue Aug 30, 2016 12:45 pm

Re: Remapping key HID remote - disabling the original behavi

Post by cshaun » Sat Sep 03, 2016 2:33 am

Assume you mean change all my keys to include the ALT modifier? ALT+Vol up, ALT+Home etc. It's a remote not a keyboard (see picture below).

Is this not something EG can do?

The search button does a "find" in notepad, but when in Kodi it does a windows search (Kodi loses focus). So obviously Notepad is able to intercept and stop they key doing anything else. So does seem possible?

As you say seems perhaps need to focus more energy on the Kodi side. Kodi responds to many of the HID buttons like Prev/Next Track - but I can't seem to remap them with keyboards.xml (reportedly doesn't see the specific key, however does respond to it).

I tried HID Macros - that didn't work. Strangely couldn't see most of the button presses. It could easily remap a "a" on a particular keyboard to "b".
Wish they had a TAB key instead of CAPS. Caps could be Fn+Shift - mute on keyboard side is far less useful. Right alt should have rather been a context menu key. If for example you CTRL+ALT+DEL you can't get the context menu to kill an app in the task manager.
Possibly on the hunt for a different remote then. Maybe I don't need one with the IR buttons as might be able to make due with CEC controlling those devices.
Rii_i25A.jpg

jachin99
Experienced User
Posts: 646
Joined: Sat Feb 13, 2016 8:39 pm

Re: Remapping key HID remote - disabling the original behavi

Post by jachin99 » Sat Sep 03, 2016 3:13 am

I'm not exactly sure how to help you, and I'm traveling for the weekend. One idea, if Kodi has an exclusive mode for video or sound, then enable it. This will suppress things like noises or graphics (Mouse Pointer at least) from popping up over a video that is playing. I know Kodi DS player has this but it might be something built into Mad VR. I was thinking you had a standard keyboard for some reason. Many of my remote buttons did not work out of the box either, and I had to add seven HID devices to my autostart. Try this also because as well. Instead of mapping your HID buttons to keystroke emulations, use the actual kodi plugin. I realize this might not suppress system commands but you can post in that plugin's thread to see what others have done. My remote is like yours in that it uses a combination of HID codes, keyboard inputs, and keystroke emulation, and it works most of the time. You can try assigning different keys for search on your remote so that interference isn't possible. If you want a new remote, and have some money, get look at the gyration remotes. I looked at something similar to what you have but I went for gyration instead. You could also just stick with a mouse with a few extra buttons. I'll try to show you my tree but it is extremely long.

loopey
Posts: 1
Joined: Mon Jun 24, 2019 8:16 pm

Re: Remapping key HID remote - disabling the original behavior

Post by loopey » Mon Jun 24, 2019 8:32 pm

I know this is a very old thread, but I've been searching high & low for a fix to this problem, and I found a solution. Since this was a thread that kept coming up in my Google searches, I wanted to post the fix here for others that are facing the same problem.

You need to get a program called X-Mouse Button Control, which is free and can be found at http://www.highrez.co.uk/downloads/XMou ... ontrol.htm . It will allow you to remap mouse buttons for specific applications.

One note, when configuring for Emby, you will need to use the "Specific Window" feature when adding the profile (using just the executable will not work)

Hope that helps someone!

PS- considering how this converts the Rii i25 from a pretty paperweight to a usable remote, consider donating to the author..... at least buy him a beer!

Post Reply