yawor Posted June 25, 2014 Report Share Posted June 25, 2014 (edited) Hi, 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 June 25, 2014 by yawor Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.