The file format is toml. Since a remote control can use multiple protocols, the top level is an array of protocols. The vast majority of remotes only use one protocol.
There are some pre-defined BPF protocol decoders, which are listed below. See R https://lwn.net/Articles/759188/ E for how to write your own.
The following variants are currently defined:
Protocol rc-5 has variants rc-5, rc-5x-20, rc-5-sz.
Protocol nec has variants nec, nec-x, nec-32.
Protocol sony has variants sony-12, sony-15, sony-20.
Protocol rc-6 has variants rc-6-0, rc-6-6a-20, rc-6-6a-24, rc-6-6a-32, rc-6-mce.
Protocol rc-mm has variants rc-mm-12, rc-mm-24, and rc-mm-32.
If the scancode start with 0x, it is interpreted as a hexadecimal number. If it starts with a 0, it is interpreted as an octal number.
Valid keycodes are listed in the input-event-codes.h header file. Examples are KEY_ENTER, KEY_ESC or BTN_LEFT for the left mouse button. Note that if the keymap is only used for sending IR, then the key does not have to be a valid linux keycode. It can be any string without whitespace.
The raw field is an string, which lists pulse and space values, separated by whitespace. The first is a pulse value microseconds, and the second a space, third pulse, etc. The space values can be preceded by a - sign and the pulse value can be preceded by a +sign. There should be an odd number of value so that the last entry is a pulse.
Some of the BPF protocol decoders are generic and will need parameters to work. Other are for specific remotes and should work without any parameters. The timing parameters are all in microseconds (µs).
margin Define how much tolerance there is for message length. Default 200.
header_pulse Length of first pulse, default 900.
header_space Length of following space, default 2900.
leader_pulse Length of second pulse, default 1300.
margin Define how much tolerance there is for message length. Default 200.
margin Define how much tolerance there is for message length. Default 200.
header_pulse Define how long a leading pulse is. This is not always present. Default 0.
header_space Define how long the space is after the leading pulse. Must be set if header\_pulse is set.
zero\_pulse, zero\_space, one\_pulse, one\_space Signally lengths for bits. See R https://clearwater.com.au/code/rc5 E for these are defined.
bits Number of bits. Default 14.
scancode\_mask Bits to mask out of resulting scancode.
toggle\_bit Bit that specifies the toggle. If this value is greater than the number of bits, no toggle is defined.
margin Define how much tolerance there is for message length. Default 200.
header_pulse Length of the first leading pulse. Default 2125.
header_space Length of the space after the leading pulse. Default 1875.
repeat_pulse Length of the leading pulse for key repeat. Default 0.
repeat_space Length of the space after the leading pulse for key repeat. Default 0.
bit_pulse Length of the pulse for each bit. Default 625.
bit_0_space Length of the space for a zero bit. Default 375.
bit_1_space Length of the space for a one bit. Default 1625.
trailer_pulse Length of the pulse after the last bit. Needed to bookend the last bit. Default 625.
bits Number of bits. Default 4.
reverse Should the bits be read in least significant bit first. Set to non-zero to enable. Default 0.
header_optional Some remotes do not send the header pulse and space for key repeats, so set this to non-zero to make the header optional. Default 0. An alternative implementation might only allow missing headers for repeat messages, but this would fail to decode key presses if the first message with the header did not decode correctly to due interference.
margin Define how much tolerance there is for message length. Default 200.
header_pulse Length of the first leading pulse. Default 2125.
header_space Length of the space after the leading pulse. Default 1875.
repeat_pulse Length of the leading pulse for key repeat. Default 0.
repeat_space Length of the space after the leading pulse for key repeat. Default 0.
bit_space Length of the space for each bit. Default 625.
bit_0_pulse Length of the pulse for a zero bit. Default 375.
bit_1_pulse Length of the pulse for a one bit. Default 1625.
trailer_pulse Length of the pulse after the last bit. Optional. Default 0.
bits Number of bits. Default 4.
reverse Should the bits be read in least significant bit first. Set to non-zero to enable. Default 0.
header_optional Some remotes do not send the header pulse and space for key repeats, so set this to non-zero to make the header optional. Default 0. An alternative implementation might only allow missing headers for repeat messages, but this would fail to decode key presses if only the first message did not decode correctly to due interference.
License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
https://lwn.net/Articles/759188/
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/input-event-codes.h#n64