Jump to content
Flirc Forums

HID Consumer Table codes


Recommended Posts



I've been doing some hacking with Flirc and EventGhost to get the best possible setup. I wanted all the keys to be intercepted by EventGhost so I could do some more advanced control schemes. My problem was that I don't like mapping remote keys to some arbitrary shortcuts. The problem here is that in Windows I cannot stop key presses just from a specific keyboard (Flirc in this case) so I loose those shortcuts if I use them in Flirc and EG.


Now here comes a little trick. Media buttons are not treated as Keyboard events (they are not intercepted by HID keyboard filter driver) but are available to Generic HID plugin in EventGhost. Why is that? Because media keys are not from default keyboard HID usage table but from the "consumer" one. Media keys in EventGhost's Generic HID are received as decimal value of HID code for those buttons. Unfortunatelly Flirc GUI (and CLI too) doesn't have much media keys available to be used. Fortunatelly saved config file has very simple structure :). I've assigned every button on remote to Play button for a reference and then replaced play button code to ranges that are not officially used in Consumer HID Table, from 0x04 to 0x1F, then from 0x23 to 0x2F - this was enough for my remote but there are other unused ranges. Those can be found here http://www.freebsddiary.org/APC/usb_hid_usages.php, table 12 - Consumer. After loading the config back into Flirc I'm getting correct HID codes in EventGhost when I'm pressing buttons.


Here are my two suggestions:

1. I don't know if this can be somehow done in the firmware, but when I hold the button pressed on the remote I'm getting a stream of button press events in HID instead of just one (this also happens for not modified config with standard media buttons). When I release the button then HID gets release event correctly. For now I've modified Generic HID plugin to remember last event and not issue it again if enduring events are enabled (required for long press detection and action repeat configuration). Maybe I'm wrong (I don't know HID specifics) but I think Flirc should only send one key press event (on press and hold) and then one release event. If not then forget this suggestion.


2. It would be nice to be able to set arbitrary codes from Consumer table (possibly using hex notation or detected by 0x before the code) using at least the CLI. Maybe new command in CLI like record_hid or something. I know that Flirc can only store 2 bytes per key (modifier + HID code for keyboard table and HID code + 0x66 as a marker for consumer table) so we cannot access codes above 0xFF but I think this is enough for most cases. This would be great feature for advanced users.

Edited by yawor
Link to comment
Share on other sites

  • 8 months later...

I'd like to second the proposals given above.  Setting up custom HID codes via the CLI is fine (), but it would be really useful to:


1) See a list of the currently programmed codes (even using the 'keys' switch and the CLI you get gibberish for custom HIDs, which doesn't help debugging)

2) See a full list of available HID codes that you can code into a flirc (noting the 2 byte limit), preferably in decimal as well as hex

3) Be able to code HID codes directly from the GUI.


Avoiding the repeat presses would also be good, although as @yawor notes, we can get around this using his custom Generic HID for EventGhost.


Being able to use these consumer HID codes is such a great advantage when trying to avoid other key combinations and when interacting with EventGhost - it would be really useful if this was properly supported by the GUI.



Link to comment
Share on other sites



I've already talked with Jason about properly showing custom HID codes in CLI and he said he'll fix this. I'll send a message to remind him about this issue.


Key repeating in "HID mode" is not a Flirc issue. This is an issue with original EG HID plugin. EG has two types of events: normal (single shot) and enduring. Original HID plugin trigger only normal events so every new HID event received will trigger new EG event. My change adds ability to trigger enduring event. Enduring event ends only when different key is pressed or previous key is released. Thanks to that you can use long press triggers in EG.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...