Search the Community
Showing results for tags 'modifier keys'.
Found 1 result
tl;dr USB HID codes from here http://www.freebsddiary.org/APC/usb_hid_usages.php should be given to flirc_util record_api as decimal Hi all Just had to deal with flirc_util record_api on account of the GUI not recognizing the Flirc board as connected (http://forum.flirc.tv/index.php?/topic/2208-linux-x64-flirc_util-works-without-root-but-flirc-gui-always-say-disconnected/#comment-12182 ), and I thought I'd save the information I found in a topic with a descriptive title for future reference: This is also a good resource: http://forum.flirc.tv/index.php?/topic/128-modifier-keys-in-command-line-recording/ flirc_util record_api x y where x is the modifier key and y is the HID key. # Modifier keys According to the documentation presented when running "flirc_util record_api" the modifier keys are specified by logically OR'ing these values together as binary (the de facto standard for specifying flags as a single parameter): OR'ing binary numbers is done by going through the two numbers bit by bit and comparing corresponding bits. If one of the two bits is 1 set the corresponding result bit to 1, otherwise set it to 0, e.g. 0101 OR 0010 = 0111. For these specific binary numbers (1,2,4...128 as decimal) OR'ing is the same as ADDing, and since "flirc_util record_api" expects a decimal input we might as add them in decimal: LEFT CTRL + LEFT SHFIT = 1 + 2 = 3 LEFT CTRL + LEFT ALT + LEFT SHIFT = 1 + 2 + 4 = 7 # HID keys The HID key codes can be found here: http://www.freebsddiary.org/APC/usb_hid_usages.php "flirc_util record_api" expects the code as decimal, but the freebsddiary.org page gives them in HEX, so get your hex-to-dec converter out. For example, 'g and G' is specified as 0x0A which is 10 in decimal. So if you want to program the g/G keyboard key with "flirc_util record_api x y" you have to specify y as 10, not 0x0A or similar. Another example is DownArrow which is specified as 0x52 in hex which needs to be specified as 82 in decimal. # Putting it together If you want to program LEFT CTRL + LEFT SHIFT + UP ARROW you need 1+2=3 as modifier key and 0x52=82 as HID key: flirc_util record_api 3 82 Another example is LEFT CTRL + LEFT SHIFT + LEFT ALT + S which would be 1+2+4=7 as modifier key and 0x16=22 as HID key: flirc_util record_api 7 22 # Documentation from flirc_util