Remote control
Single-page view · as markdown
file: uapi/v4l/keytable.c
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
/* keytable.c - This program allows checking/replacing keys at IR
Copyright (C) 2006-2009 Mauro Carvalho Chehab <mchehab@kernel.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
void
int
int
Introduction
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Introduction #
LIRC stands for Linux Infrared Remote Control. The LIRC device interface is a bi-directional interface for transporting raw IR and decoded scancodes data between userspace and kernelspace. Fundamentally, it is just a chardev (/dev/lircX, for X = 0, 1, 2, ...), with a number of standard struct file_operations defined on it. With respect to transporting raw IR and decoded scancodes to and fro, the essential fops are read, write and ioctl.
It is also possible to attach a BPF program to a LIRC device for decoding raw IR into scancodes.
Example dmesg output upon a driver registering w/LIRC:
$ dmesg |grep lirc_dev
rc rc0: lirc_dev: driver mceusb registered at minor = 0, raw IR receiver, raw IR transmitter
What you should see for a chardev:
$ ls -l /dev/lirc*
crw-rw---- 1 root root 248, 0 Jul 2 22:20 /dev/lirc0
Note that the package v4l-utils contains tools for working with LIRC devices:
ir-ctl: can receive raw IR and transmit IR, as well as query LIRC device features.
ir-keytable: can load keymaps; allows you to set IR kernel protocols; load BPF IR decoders and test IR decoding. Some BPF IR decoders are also provided.
LIRC modes #
LIRC supports some modes of receiving and sending IR codes, as shown on the following table.
LIRC_MODE_SCANCODE
This mode is for both sending and receiving IR.
For transmitting (aka sending), create a struct lirc_scancode with the desired scancode set in the
scancodemember,rc_protoset to the IR protocol, and all other members set to 0. Write this struct to the lirc device.For receiving, you read struct lirc_scancode from the LIRC device. The
scancodefield is set to the received scancode and the IR protocol is set inrc_proto. If the scancode maps to a valid key code, this is set in thekeycodefield, else it is set toKEY_RESERVED.The
flagscan haveLIRC_SCANCODE_FLAG_TOGGLEset if the toggle bit is set in protocols that support it (e.g. rc-5 and rc-6), orLIRC_SCANCODE_FLAG_REPEATfor when a repeat is received for protocols that support it (e.g. nec).In the Sanyo and NEC protocol, if you hold a button on remote, rather than repeating the entire scancode, the remote sends a shorter message with no scancode, which just means button is held, a "repeat". When this is received, the
LIRC_SCANCODE_FLAG_REPEATis set and the scancode and keycode is repeated.With nec, there is no way to distinguish "button hold" from "repeatedly pressing the same button". The rc-5 and rc-6 protocols have a toggle bit. When a button is released and pressed again, the toggle bit is inverted. If the toggle bit is set, the
LIRC_SCANCODE_FLAG_TOGGLEis set.The
timestampfield is filled with the time nanoseconds (inCLOCK_MONOTONIC) when the scancode was decoded.
LIRC_MODE_MODE2
The driver returns a sequence of pulse and space codes to userspace, as a series of u32 values.
This mode is used only for IR receive.
The upper 8 bits determine the packet type, and the lower 24 bits the payload. Use
LIRC_VALUE()macro to get the payload, and the macroLIRC_MODE2()will give you the type, which is one of:
LIRC_MODE2_PULSESignifies the presence of IR in microseconds, also known as flash.
LIRC_MODE2_SPACESignifies absence of IR in microseconds, also known as gap.
LIRC_MODE2_FREQUENCYIf measurement of the carrier frequency was enabled with ioctl LIRC_SET_MEASURE_CARRIER_MODE then this packet gives you the carrier frequency in Hertz.
LIRC_MODE2_TIMEOUTWhen the timeout set with ioctl LIRC_GET_REC_TIMEOUT and LIRC_SET_REC_TIMEOUT expires due to no IR being detected, this packet will be sent, with the number of microseconds with no IR.
LIRC_MODE2_OVERFLOWSignifies that the IR receiver encounter an overflow, and some IR is missing. The IR data after this should be correct again. The actual value is not important, but this is set to 0xffffff by the kernel for compatibility with lircd.
LIRC_MODE_PULSE
In pulse mode, a sequence of pulse/space integer values are written to the lirc device using LIRC write().
The values are alternating pulse and space lengths, in microseconds. The first and last entry must be a pulse, so there must be an odd number of entries.
This mode is used only for IR send.
Data types used by LIRC_MODE_SCANCODE #
struct lirc_scancode #
decoded scancode with protocol for use with LIRC_MODE_SCANCODE
Definition
;
Members
timestamp: Timestamp in nanoseconds using CLOCK_MONOTONIC when IR was decoded.flags: should be 0 for transmit. When receiving scancodes, LIRC_SCANCODE_FLAG_TOGGLE or LIRC_SCANCODE_FLAG_REPEAT can be set depending on the protocolrc_proto: see enum rc_protokeycode: the translated keycode. Set to 0 for transmit.scancode: the scancode received or to be sent
enum rc_proto #
the Remote Controller protocol
Constants
RC_PROTO_UNKNOWN: Protocol not knownRC_PROTO_OTHER: Protocol known but proprietaryRC_PROTO_RC5: Philips RC5 protocolRC_PROTO_RC5X_20: Philips RC5x 20 bit protocolRC_PROTO_RC5_SZ: StreamZap variant of RC5RC_PROTO_JVC: JVC protocolRC_PROTO_SONY12: Sony 12 bit protocolRC_PROTO_SONY15: Sony 15 bit protocolRC_PROTO_SONY20: Sony 20 bit protocolRC_PROTO_NEC: NEC protocolRC_PROTO_NECX: Extended NEC protocolRC_PROTO_NEC32: NEC 32 bit protocolRC_PROTO_SANYO: Sanyo protocolRC_PROTO_MCIR2_KBD: RC6-ish MCE keyboardRC_PROTO_MCIR2_MSE: RC6-ish MCE mouseRC_PROTO_RC6_0: Philips RC6-0-16 protocolRC_PROTO_RC6_6A_20: Philips RC6-6A-20 protocolRC_PROTO_RC6_6A_24: Philips RC6-6A-24 protocolRC_PROTO_RC6_6A_32: Philips RC6-6A-32 protocolRC_PROTO_RC6_MCE: MCE (Philips RC6-6A-32 subtype) protocolRC_PROTO_SHARP: Sharp protocolRC_PROTO_XMP: XMP protocolRC_PROTO_CEC: CEC protocolRC_PROTO_IMON: iMon Pad protocolRC_PROTO_RCMM12: RC-MM protocol 12 bitsRC_PROTO_RCMM24: RC-MM protocol 24 bitsRC_PROTO_RCMM32: RC-MM protocol 32 bitsRC_PROTO_XBOX_DVD: Xbox DVD Movie Playback Kit protocolRC_PROTO_MAX: Maximum value of enum rc_proto
BPF based IR decoder #
The kernel has support for decoding the most common IR protocols, but there are many protocols which are not supported. To support these, it is possible to load an BPF program which does the decoding. This can only be done on LIRC devices which support reading raw IR.
First, using the bpf(2) syscall with the BPF_LOAD_PROG argument, program must be loaded of type BPF_PROG_TYPE_LIRC_MODE2. Once attached to the LIRC device, this program will be called for each pulse, space or timeout event on the LIRC device. The context for the BPF program is a pointer to a unsigned int, which is a LIRC_MODE_MODE2 value. When the program has decoded the scancode, it can be submitted using the BPF functions bpf_rc_keydown() or bpf_rc_repeat(). Mouse or pointer movements can be reported using bpf_rc_pointer_rel().
Once you have the file descriptor for the BPF_PROG_TYPE_LIRC_MODE2 BPF program, it can be attached to the LIRC device using the bpf(2) syscall. The target must be the file descriptor for the LIRC device, and the attach type must be BPF_LIRC_MODE2. No more than 64 BPF programs can be attached to a single LIRC device at a time.
LIRC Device Interface
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
LIRC Function Reference
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
- LIRC read()
- LIRC write()
- ioctl LIRC_GET_FEATURES
- ioctls LIRC_GET_SEND_MODE and LIRC_SET_SEND_MODE
- ioctls LIRC_GET_REC_MODE and LIRC_SET_REC_MODE
- ioctl LIRC_GET_REC_RESOLUTION
- ioctl LIRC_SET_SEND_DUTY_CYCLE
- ioctls LIRC_GET_MIN_TIMEOUT and LIRC_GET_MAX_TIMEOUT
- ioctl LIRC_GET_REC_TIMEOUT and LIRC_SET_REC_TIMEOUT
- ioctl LIRC_SET_REC_CARRIER
- ioctl LIRC_SET_REC_CARRIER_RANGE
- ioctl LIRC_SET_SEND_CARRIER
- ioctl LIRC_SET_TRANSMITTER_MASK
- ioctl LIRC_SET_MEASURE_CARRIER_MODE
- ioctl LIRC_SET_WIDEBAND_RECEIVER
ioctl LIRC_GET_FEATURES
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_GET_FEATURES - Get the underlying hardware device's features
Synopsis #
int ioctl(int fd, LIRC_GET_FEATURES, __u32 *features)
Arguments #
-
fdFile descriptor returned by open().
-
featuresBitmask with the LIRC features.
Description #
Get the underlying hardware device's features. If a driver does not announce support of certain features, calling of the corresponding ioctls is undefined.
LIRC features #
LIRC_CAN_REC_RAW
Unused. Kept just to avoid breaking uAPI.
LIRC_CAN_REC_PULSE
Unused. Kept just to avoid breaking uAPI. LIRC_MODE_PULSE can only be used for transmitting.
LIRC_CAN_REC_MODE2
This is raw IR driver for receiving. This means that LIRC_MODE_MODE2 is used. This also implies that LIRC_MODE_SCANCODE is also supported, as long as the kernel is recent enough. Use the ioctls LIRC_GET_REC_MODE and LIRC_SET_REC_MODE to switch modes.
LIRC_CAN_REC_LIRCCODE
Unused. Kept just to avoid breaking uAPI.
LIRC_CAN_REC_SCANCODE
This is a scancode driver for receiving. This means that LIRC_MODE_SCANCODE is used.
LIRC_CAN_SET_SEND_CARRIER
The driver supports changing the modulation frequency via ioctl LIRC_SET_SEND_CARRIER.
LIRC_CAN_SET_SEND_DUTY_CYCLE
The driver supports changing the duty cycle using ioctl LIRC_SET_SEND_DUTY_CYCLE.
LIRC_CAN_SET_TRANSMITTER_MASK
The driver supports changing the active transmitter(s) using ioctl LIRC_SET_TRANSMITTER_MASK.
LIRC_CAN_SET_REC_CARRIER
The driver supports setting the receive carrier frequency using ioctl LIRC_SET_REC_CARRIER.
LIRC_CAN_SET_REC_CARRIER_RANGE
The driver supports ioctl LIRC_SET_REC_CARRIER_RANGE.
LIRC_CAN_GET_REC_RESOLUTION
The driver supports ioctl LIRC_GET_REC_RESOLUTION.
LIRC_CAN_SET_REC_TIMEOUT
The driver supports ioctl LIRC_SET_REC_TIMEOUT.
LIRC_CAN_MEASURE_CARRIER
The driver supports measuring of the modulation frequency using ioctl LIRC_SET_MEASURE_CARRIER_MODE.
LIRC_CAN_USE_WIDEBAND_RECEIVER
The driver supports learning mode using ioctl LIRC_SET_WIDEBAND_RECEIVER.
LIRC_CAN_SEND_RAW
Unused. Kept just to avoid breaking uAPI.
LIRC_CAN_SEND_PULSE
The driver supports sending (also called as IR blasting or IR TX) using LIRC_MODE_PULSE. This implies that LIRC_MODE_SCANCODE is also supported for transmit, as long as the kernel is recent enough. Use the ioctls LIRC_GET_SEND_MODE and LIRC_SET_SEND_MODE to switch modes.
LIRC_CAN_SEND_MODE2
Unused. Kept just to avoid breaking uAPI. LIRC_MODE_MODE2 can only be used for receiving.
LIRC_CAN_SEND_LIRCCODE
Unused. Kept just to avoid breaking uAPI.
Return Value #
On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
ioctls LIRC_GET_REC_MODE and LIRC_SET_REC_MODE
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_GET_REC_MODE/LIRC_SET_REC_MODE - Get/set current receive mode.
Synopsis #
int ioctl(int fd, LIRC_GET_REC_MODE, __u32 *mode)
int ioctl(int fd, LIRC_SET_REC_MODE, __u32 *mode)
Arguments #
-
fdFile descriptor returned by open().
-
modeMode used for receive.
Description #
Get and set the current receive mode. Only LIRC_MODE_MODE2 and LIRC_MODE_SCANCODE are supported. Use ioctl LIRC_GET_FEATURES to find out which modes the driver supports.
Return Value #
|
|
Device not available. |
|
|
Device does not support receiving. |
|
|
Invalid mode or invalid mode for this device. |
ioctl LIRC_GET_REC_RESOLUTION
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_GET_REC_RESOLUTION - Obtain the value of receive resolution, in microseconds.
Synopsis #
int ioctl(int fd, LIRC_GET_REC_RESOLUTION, __u32 *microseconds)
Arguments #
-
fdFile descriptor returned by open().
-
microsecondsResolution, in microseconds.
Description #
Some receivers have maximum resolution which is defined by internal sample rate or data format limitations. E.g. it's common that signals can only be reported in 50 microsecond steps.
This ioctl returns the integer value with such resolution, with can be used by userspace applications like lircd to automatically adjust the tolerance value.
Return Value #
On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
ioctls LIRC_GET_SEND_MODE and LIRC_SET_SEND_MODE
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_GET_SEND_MODE/LIRC_SET_SEND_MODE - Get/set current transmit mode.
Synopsis #
int ioctl(int fd, LIRC_GET_SEND_MODE, __u32 *mode)
int ioctl(int fd, LIRC_SET_SEND_MODE, __u32 *mode)
Arguments #
-
fdFile descriptor returned by open().
-
modeThe mode used for transmitting.
Description #
Get/set current transmit mode.
Only LIRC_MODE_PULSE and LIRC_MODE_SCANCODE are supported by for IR send, depending on the driver. Use ioctl LIRC_GET_FEATURES to find out which modes the driver supports.
Return Value #
|
|
Device not available. |
|
|
Device does not support transmitting. |
|
|
Invalid mode or invalid mode for this device. |
ioctls LIRC_GET_MIN_TIMEOUT and LIRC_GET_MAX_TIMEOUT
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_GET_MIN_TIMEOUT / LIRC_GET_MAX_TIMEOUT - Obtain the possible timeout range for IR receive.
Synopsis #
int ioctl(int fd, LIRC_GET_MIN_TIMEOUT, __u32 *timeout)
int ioctl(int fd, LIRC_GET_MAX_TIMEOUT, __u32 *timeout)
Arguments #
-
fdFile descriptor returned by open().
-
timeoutTimeout, in microseconds.
Description #
Some devices have internal timers that can be used to detect when there's no IR activity for a long time. This can help lircd in detecting that a IR signal is finished and can speed up the decoding process. Returns an integer value with the minimum/maximum timeout that can be set.
Return Value #
On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
LIRC uAPI symbols
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Enumerations #
rc_proto:include/uapi/linux/lirc.h, line 205
IOCTL Commands #
LIRC_GET_FEATURES:include/uapi/linux/lirc.h, line 96LIRC_GET_MAX_TIMEOUT:include/uapi/linux/lirc.h, line 103LIRC_GET_MIN_TIMEOUT:include/uapi/linux/lirc.h, line 102LIRC_GET_REC_MODE:include/uapi/linux/lirc.h, line 99LIRC_GET_REC_RESOLUTION:include/uapi/linux/lirc.h, line 100LIRC_GET_REC_TIMEOUT:include/uapi/linux/lirc.h, line 144LIRC_GET_SEND_MODE:include/uapi/linux/lirc.h, line 98LIRC_SET_MEASURE_CARRIER_MODE:include/uapi/linux/lirc.h, line 130LIRC_SET_REC_CARRIER:include/uapi/linux/lirc.h, line 112LIRC_SET_REC_CARRIER_RANGE:include/uapi/linux/lirc.h, line 136LIRC_SET_REC_MODE:include/uapi/linux/lirc.h, line 109LIRC_SET_REC_TIMEOUT:include/uapi/linux/lirc.h, line 121LIRC_SET_SEND_CARRIER:include/uapi/linux/lirc.h, line 111LIRC_SET_SEND_DUTY_CYCLE:include/uapi/linux/lirc.h, line 113LIRC_SET_SEND_MODE:include/uapi/linux/lirc.h, line 108LIRC_SET_TRANSMITTER_MASK:include/uapi/linux/lirc.h, line 114LIRC_SET_WIDEBAND_RECEIVER:include/uapi/linux/lirc.h, line 138
Macros and Definitions #
LIRC_CAN_GET_REC_RESOLUTION:include/uapi/linux/lirc.h, line 78LIRC_CAN_MEASURE_CARRIER:include/uapi/linux/lirc.h, line 81LIRC_CAN_REC_LIRCCODE:include/uapi/linux/lirc.h, line 71LIRC_CAN_REC_MODE2:include/uapi/linux/lirc.h, line 69LIRC_CAN_REC_PULSE:include/uapi/linux/lirc.h, line 68LIRC_CAN_REC_RAW:include/uapi/linux/lirc.h, line 67LIRC_CAN_REC_SCANCODE:include/uapi/linux/lirc.h, line 70LIRC_CAN_SEND_LIRCCODE:include/uapi/linux/lirc.h, line 59LIRC_CAN_SEND_MODE2:include/uapi/linux/lirc.h, line 58LIRC_CAN_SEND_PULSE:include/uapi/linux/lirc.h, line 57LIRC_CAN_SEND_RAW:include/uapi/linux/lirc.h, line 56LIRC_CAN_SET_REC_CARRIER:include/uapi/linux/lirc.h, line 75LIRC_CAN_SET_REC_CARRIER_RANGE:include/uapi/linux/lirc.h, line 77LIRC_CAN_SET_REC_TIMEOUT:include/uapi/linux/lirc.h, line 79LIRC_CAN_SET_SEND_CARRIER:include/uapi/linux/lirc.h, line 63LIRC_CAN_SET_SEND_DUTY_CYCLE:include/uapi/linux/lirc.h, line 64LIRC_CAN_SET_TRANSMITTER_MASK:include/uapi/linux/lirc.h, line 65LIRC_CAN_USE_WIDEBAND_RECEIVER:include/uapi/linux/lirc.h, line 82LIRC_MODE2_FREQUENCY:include/uapi/linux/lirc.h, line 17LIRC_MODE_MODE2:include/uapi/linux/lirc.h, line 51LIRC_MODE_PULSE:include/uapi/linux/lirc.h, line 50LIRC_MODE_SCANCODE:include/uapi/linux/lirc.h, line 52LIRC_SCANCODE_FLAG_REPEAT:include/uapi/linux/lirc.h, line 170LIRC_SCANCODE_FLAG_TOGGLE:include/uapi/linux/lirc.h, line 168
Structures #
lirc_scancode:include/uapi/linux/lirc.h, line 159
LIRC read()
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
lirc-read - Read from a LIRC device
Synopsis #
ssize_t Arguments #
-
fdFile descriptor returned by
open(). -
bufBuffer to be filled
-
countMax number of bytes to read
Description #
read() attempts to read up to count bytes from file descriptor fd into the buffer starting at buf. If count is zero, read() returns zero and has no other results. If count is greater than SSIZE_MAX, the result is unspecified.
The exact format of the data depends on what LIRC modes a driver uses. Use ioctl LIRC_GET_FEATURES to get the supported mode, and use ioctls LIRC_GET_REC_MODE and LIRC_SET_REC_MODE set the current active mode.
The mode LIRC_MODE_MODE2 is for raw IR, in which packets containing an unsigned int value describing an IR signal are read from the chardev.
Alternatively, LIRC_MODE_SCANCODE can be available, in this mode scancodes which are either decoded by software decoders, or by hardware decoders. The rc_proto member is set to the IR protocol used for transmission, and scancode to the decoded scancode, and the keycode set to the keycode or KEY_RESERVED.
Return Value #
On success, the number of bytes read is returned. It is not an error if this number is smaller than the number of bytes requested, or the amount of data required for one frame. On error, -1 is returned, and the errno variable is set appropriately.
ioctl LIRC_SET_MEASURE_CARRIER_MODE
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_SET_MEASURE_CARRIER_MODE - enable or disable measure mode
Synopsis #
int ioctl(int fd, LIRC_SET_MEASURE_CARRIER_MODE, __u32 *enable)
Arguments #
-
fdFile descriptor returned by open().
-
enableenable = 1 means enable measure mode, enable = 0 means disable measure mode.
Description #
Enable or disable measure mode. If enabled, from the next key press on, the driver will send LIRC_MODE2_FREQUENCY packets. By default this should be turned off.
Return Value #
On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
ioctl LIRC_SET_REC_CARRIER_RANGE
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_SET_REC_CARRIER_RANGE - Set lower bound of the carrier used to modulate IR receive.
Synopsis #
int ioctl(int fd, LIRC_SET_REC_CARRIER_RANGE, __u32 *frequency)
Arguments #
-
fdFile descriptor returned by open().
-
frequencyFrequency of the carrier that modulates PWM data, in Hz.
Description #
This ioctl sets the upper range of carrier frequency that will be recognized by the IR receiver.
Return Value #
On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
ioctl LIRC_SET_REC_CARRIER
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_SET_REC_CARRIER - Set carrier used to modulate IR receive.
Synopsis #
int ioctl(int fd, LIRC_SET_REC_CARRIER, __u32 *frequency)
Arguments #
-
fdFile descriptor returned by open().
-
frequencyFrequency of the carrier that modulates PWM data, in Hz.
Description #
Set receive carrier used to modulate IR PWM pulses and spaces.
Return Value #
On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
ioctl LIRC_GET_REC_TIMEOUT and LIRC_SET_REC_TIMEOUT
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_GET_REC_TIMEOUT/LIRC_SET_REC_TIMEOUT - Get/set the integer value for IR inactivity timeout.
Synopsis #
int ioctl(int fd, LIRC_GET_REC_TIMEOUT, __u32 *timeout)
int ioctl(int fd, LIRC_SET_REC_TIMEOUT, __u32 *timeout)
Arguments #
-
fdFile descriptor returned by open().
-
timeoutTimeout, in microseconds.
Description #
Get and set the integer value for IR inactivity timeout.
If supported by the hardware, setting it to 0 disables all hardware timeouts and data should be reported as soon as possible. If the exact value cannot be set, then the next possible value _greater_ than the given value should be set.
Return Value #
On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
ioctl LIRC_SET_SEND_CARRIER
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_SET_SEND_CARRIER - Set send carrier used to modulate IR TX.
Synopsis #
int ioctl(int fd, LIRC_SET_SEND_CARRIER, __u32 *frequency)
Arguments #
-
fdFile descriptor returned by open().
-
frequencyFrequency of the carrier to be modulated, in Hz.
Description #
Set send carrier used to modulate IR PWM pulses and spaces.
Return Value #
On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
ioctl LIRC_SET_SEND_DUTY_CYCLE
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_SET_SEND_DUTY_CYCLE - Set the duty cycle of the carrier signal for IR transmit.
Synopsis #
int ioctl(int fd, LIRC_SET_SEND_DUTY_CYCLE, __u32 *duty_cycle)
Arguments #
-
fdFile descriptor returned by open().
-
duty_cycleDuty cycle, describing the pulse width in percent (from 1 to 99) of the total cycle. Values 0 and 100 are reserved.
Description #
Get/set the duty cycle of the carrier signal for IR transmit.
Currently, no special meaning is defined for 0 or 100, but this could be used to switch off carrier generation in the future, so these values should be reserved.
Return Value #
On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
ioctl LIRC_SET_TRANSMITTER_MASK
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_SET_TRANSMITTER_MASK - Enables send codes on a given set of transmitters
Synopsis #
int ioctl(int fd, LIRC_SET_TRANSMITTER_MASK, __u32 *mask)
Arguments #
-
fdFile descriptor returned by open().
-
maskMask with channels to enable tx. Channel 0 is the least significant bit.
Description #
Some IR TX devices have multiple output channels, in such case, LIRC_CAN_SET_TRANSMITTER_MASK is returned via ioctl LIRC_GET_FEATURES and this ioctl sets what channels will send IR codes.
This ioctl enables the given set of transmitters. The first transmitter is encoded by the least significant bit and so on.
When an invalid bit mask is given, i.e. a bit is set, even though the device does not have so many transitters, then this ioctl returns the number of available transitters and does nothing otherwise.
Return Value #
On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
ioctl LIRC_SET_WIDEBAND_RECEIVER
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
LIRC_SET_WIDEBAND_RECEIVER - enable wide band receiver.
Synopsis #
int ioctl(int fd, LIRC_SET_WIDEBAND_RECEIVER, __u32 *enable)
Arguments #
-
fdFile descriptor returned by open().
-
enableenable = 1 means enable wideband receiver, enable = 0 means disable wideband receiver.
Description #
Some receivers are equipped with special wide band receiver which is intended to be used to learn output of existing remote. This ioctl allows enabling or disabling it.
This might be useful of receivers that have otherwise narrow band receiver that prevents them to be used with some remotes. Wide band receiver might also be more precise. On the other hand its disadvantage it usually reduced range of reception.
Return Value #
On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
LIRC write()
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Name #
lirc-write - Write to a LIRC device
Synopsis #
ssize_t Arguments #
-
fdFile descriptor returned by
open(). -
bufBuffer with data to be written
-
countNumber of bytes at the buffer
Description #
write() writes up to count bytes to the device referenced by the file descriptor fd from the buffer starting at buf.
The exact format of the data depends on what mode a driver is in, use ioctl LIRC_GET_FEATURES to get the supported modes and use ioctls LIRC_GET_SEND_MODE and LIRC_SET_SEND_MODE set the mode.
When in LIRC_MODE_PULSE mode, the data written to the chardev is a pulse/space sequence of integer values. Pulses and spaces are only marked implicitly by their position. The data must start and end with a pulse, therefore, the data must always include an uneven number of samples. The write function blocks until the data has been transmitted by the hardware. If more data is provided than the hardware can send, the driver returns EINVAL.
When in LIRC_MODE_SCANCODE mode, one struct lirc_scancode must be written to the chardev at a time, else EINVAL is returned. Set the desired scancode in the scancode member, and the IR protocol in the rc_proto: member. All other members must be set to 0, else EINVAL is returned. If there is no protocol encoder for the protocol or the scancode is not valid for the specified protocol, EINVAL is returned. The write function blocks until the scancode is transmitted by the hardware.
Return Value #
On success, the number of bytes written is returned. It is not an error if this number is smaller than the number of bytes requested, or the amount of data required for one frame. On error, -1 is returned, and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
Introduction
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Currently, most analog and digital devices have a Infrared input for remote controllers. Each manufacturer has their own type of control. It is not rare for the same manufacturer to ship different types of controls, depending on the device.
A Remote Controller interface is mapped as a normal evdev/input interface, just like a keyboard or a mouse. So, it uses all ioctls already defined for any other input devices.
However, remove controllers are more flexible than a normal input device, as the IR receiver (and/or transmitter) can be used in conjunction with a wide variety of different IR remotes.
In order to allow flexibility, the Remote Controller subsystem allows controlling the RC-specific attributes via the sysfs class nodes.
Remote Controller Protocols and Scancodes
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
IR is encoded as a series of pulses and spaces, using a protocol. These protocols can encode e.g. an address (which device should respond) and a command: what it should do. The values for these are not always consistent across different devices for a given protocol.
Therefore out the output of the IR decoder is a scancode; a single u32 value. Using keymap tables this can be mapped to linux key codes.
Other things can be encoded too. Some IR protocols encode a toggle bit; this is to distinguish whether the same button is being held down, or has been released and pressed again. If has been released and pressed again, the toggle bit will invert from one IR message to the next.
Some remotes have a pointer-type device which can used to control the mouse; some air conditioning systems can have their target temperature target set in IR.
The following are the protocols the kernel knows about and also lists how scancodes are encoded for each protocol.
rc-5 (RC_PROTO_RC5) #
This IR protocol uses manchester encoding to encode 14 bits. There is a detailed description here https://www.sbprojects.net/knowledge/ir/rc5.php.
The scancode encoding is not consistent with the lirc daemon (lircd) rc5 protocol, or the manchester BPF decoder.
|
rc-5 bit |
scancode bit |
description |
|
1 |
none |
Start bit, always set |
|
1 |
6 (inverted) |
2nd start bit in rc5, re-used as 6th command bit |
|
1 |
none |
Toggle bit |
|
5 |
8 to 13 |
Address |
|
6 |
0 to 5 |
Command |
There is a variant of rc5 called either rc5x or extended rc5 where there the second stop bit is the 6th command bit, but inverted. This is done so it the scancodes and encoding is compatible with existing schemes. This bit is stored in bit 6 of the scancode, inverted. This is done to keep it compatible with plain rc-5 where there are two start bits.
rc-5-sz (RC_PROTO_RC5_SZ) #
This is much like rc-5 but one bit longer. The scancode is encoded differently.
|
rc-5-sz bits |
scancode bit |
description |
|
1 |
none |
Start bit, always set |
|
1 |
13 |
Address bit |
|
1 |
none |
Toggle bit |
|
6 |
6 to 11 |
Address |
|
6 |
0 to 5 |
Command |
rc-5x-20 (RC_PROTO_RC5X_20) #
This rc-5 extended to encoded 20 bits. The is a 3555 microseconds space after the 8th bit.
|
rc-5-sz bits |
scancode bit |
description |
|
1 |
none |
Start bit, always set |
|
1 |
14 |
Address bit |
|
1 |
none |
Toggle bit |
|
5 |
16 to 20 |
Address |
|
6 |
8 to 13 |
Address |
|
6 |
0 to 5 |
Command |
jvc (RC_PROTO_JVC) #
The jvc protocol is much like nec, without the inverted values. It is described here https://www.sbprojects.net/knowledge/ir/jvc.php.
The scancode is a 16 bits value, where the address is the lower 8 bits and the command the higher 8 bits; this is reversed from IR order.
sony-12 (RC_PROTO_SONY12) #
The sony protocol is a pulse-width encoding. There are three variants, which just differ in number of bits and scancode encoding.
|
sony-12 bits |
scancode bit |
description |
|
5 |
16 to 20 |
device |
|
7 |
0 to 6 |
function |
sony-15 (RC_PROTO_SONY15) #
The sony protocol is a pulse-width encoding. There are three variants, which just differ in number of bits and scancode encoding.
|
sony-12 bits |
scancode bit |
description |
|
8 |
16 to 23 |
device |
|
7 |
0 to 6 |
function |
sony-20 (RC_PROTO_SONY20) #
The sony protocol is a pulse-width encoding. There are three variants, which just differ in number of bits and scancode encoding.
|
sony-20 bits |
scancode bit |
description |
|
5 |
16 to 20 |
device |
|
7 |
0 to 7 |
device |
|
8 |
8 to 15 |
extended bits |
nec (RC_PROTO_NEC) #
The nec protocol encodes an 8 bit address and an 8 bit command. It is described here https://www.sbprojects.net/knowledge/ir/nec.php. Note that the protocol sends least significant bit first.
As a check, the nec protocol sends the address and command twice; the second time it is inverted. This is done for verification.
A plain nec IR message has 16 bits; the high 8 bits are the address and the low 8 bits are the command.
nec-x (RC_PROTO_NECX) #
Extended nec has a 16 bit address and a 8 bit command. This is encoded as a 24 bit value as you would expect, with the lower 8 bits the command and the upper 16 bits the address.
nec-32 (RC_PROTO_NEC32) #
nec-32 does not send an inverted address or an inverted command; the entire message, all 32 bits, are used.
For this to be decoded correctly, the second 8 bits must not be the inverted value of the first, and also the last 8 bits must not be the inverted value of the third 8 bit value.
The scancode has a somewhat unusual encoding.
|
nec-32 bits |
scancode bit |
|
First 8 bits |
16 to 23 |
|
Second 8 bits |
24 to 31 |
|
Third 8 bits |
0 to 7 |
|
Fourth 8 bits |
8 to 15 |
sanyo (RC_PROTO_SANYO) #
The sanyo protocol is like the nec protocol, but with 13 bits address rather than 8 bits. Both the address and the command are followed by their inverted versions, but these are not present in the scancodes.
Bis 8 to 20 of the scancode is the 13 bits address, and the lower 8 bits are the command.
mcir2-kbd (RC_PROTO_MCIR2_KBD) #
This protocol is generated by the Microsoft MCE keyboard for keyboard events. Refer to the ir-mce_kbd-decoder.c to see how it is encoded.
mcir2-mse (RC_PROTO_MCIR2_MSE) #
This protocol is generated by the Microsoft MCE keyboard for pointer events. Refer to the ir-mce_kbd-decoder.c to see how it is encoded.
rc-6-0 (RC_PROTO_RC6_0) #
This is the rc-6 in mode 0. rc-6 is described here https://www.sbprojects.net/knowledge/ir/rc6.php. The scancode is the exact 16 bits as in the protocol. There is also a toggle bit.
rc-6-6a-20 (RC_PROTO_RC6_6A_20) #
This is the rc-6 in mode 6a, 20 bits. rc-6 is described here https://www.sbprojects.net/knowledge/ir/rc6.php. The scancode is the exact 20 bits as in the protocol. There is also a toggle bit.
rc-6-6a-24 (RC_PROTO_RC6_6A_24) #
This is the rc-6 in mode 6a, 24 bits. rc-6 is described here https://www.sbprojects.net/knowledge/ir/rc6.php. The scancode is the exact 24 bits as in the protocol. There is also a toggle bit.
rc-6-6a-32 (RC_PROTO_RC6_6A_32) #
This is the rc-6 in mode 6a, 32 bits. rc-6 is described here https://www.sbprojects.net/knowledge/ir/rc6.php. The upper 16 bits are the vendor, and the lower 16 bits are the vendor-specific bits. This protocol is for the non-Microsoft MCE variant (vendor != 0x800f).
rc-6-mce (RC_PROTO_RC6_MCE) #
This is the rc-6 in mode 6a, 32 bits. The upper 16 bits are the vendor, and the lower 16 bits are the vendor-specific bits. This protocol is for the Microsoft MCE variant (vendor = 0x800f). The toggle bit in the protocol itself is ignored, and the 16th bit should be takes as the toggle bit.
sharp (RC_PROTO_SHARP) #
This is a protocol used by Sharp VCRs, is described here https://www.sbprojects.net/knowledge/ir/sharp.php. There is a very long (40ms) space between the normal and inverted values, and some IR receivers cannot decode this.
There is a 5 bit address and a 8 bit command. In the scancode the address is in bits 8 to 12, and the command in bits 0 to 7.
xmp (RC_PROTO_XMP) #
This protocol has several versions and only version 1 is supported. Refer to the decoder (ir-xmp-decoder.c) to see how it is encoded.
cec (RC_PROTO_CEC) #
This is not an IR protocol, this is a protocol over CEC. The CEC infrastructure uses rc-core for handling CEC commands, so that they can easily be remapped.
imon (RC_PROTO_IMON) #
This protocol is used by Antec Veris/SoundGraph iMON remotes.
The protocol describes both button presses and pointer movements. The protocol encodes 31 bits, and the scancode is simply the 31 bits with the top bit always 0.
rc-mm-12 (RC_PROTO_RCMM12) #
The rc-mm protocol is described here https://www.sbprojects.net/knowledge/ir/rcmm.php. The scancode is simply the 12 bits.
rc-mm-24 (RC_PROTO_RCMM24) #
The rc-mm protocol is described here https://www.sbprojects.net/knowledge/ir/rcmm.php. The scancode is simply the 24 bits.
rc-mm-32 (RC_PROTO_RCMM32) #
The rc-mm protocol is described here https://www.sbprojects.net/knowledge/ir/rcmm.php. The scancode is simply the 32 bits.
xbox-dvd (RC_PROTO_XBOX_DVD) #
This protocol is used by Xbox DVD Remote, which was made for the original Xbox. There is no in-kernel decoder or encoder for this protocol. The usb device decodes the protocol. There is a BPF decoder available in v4l-utils.
Remote Controller's sysfs nodes
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
As defined at Documentation/ABI/testing/sysfs-class-rc, those are the sysfs nodes that control the Remote Controllers:
/sys/class/rc/ #
The /sys/class/rc/ class sub-directory belongs to the Remote Controller core and provides a sysfs interface for configuring infrared remote controller receivers.
/sys/class/rc/rcN/ #
A /sys/class/rc/rcN directory is created for each remote control receiver device where N is the number of the receiver.
/sys/class/rc/rcN/protocols #
Reading this file returns a list of available protocols, something like:
rc5 [rc6] nec jvc [sony]
Enabled protocols are shown in [] brackets.
Writing "+proto" will add a protocol to the list of enabled protocols.
Writing "-proto" will remove a protocol from the list of enabled protocols.
Writing "proto" will enable only "proto".
Writing "none" will disable all protocols.
Write fails with EINVAL if an invalid protocol combination or unknown protocol name is used.
/sys/class/rc/rcN/filter #
Sets the scancode filter expected value.
Use in combination with /sys/class/rc/rcN/filter_mask to set the expected value of the bits set in the filter mask. If the hardware supports it then scancodes which do not match the filter will be ignored. Otherwise the write will fail with an error.
This value may be reset to 0 if the current protocol is altered.
/sys/class/rc/rcN/filter_mask #
Sets the scancode filter mask of bits to compare. Use in combination with /sys/class/rc/rcN/filter to set the bits of the scancode which should be compared against the expected value. A value of 0 disables the filter to allow all valid scancodes to be processed.
If the hardware supports it then scancodes which do not match the filter will be ignored. Otherwise the write will fail with an error.
This value may be reset to 0 if the current protocol is altered.
/sys/class/rc/rcN/wakeup_protocols #
Reading this file returns a list of available protocols to use for the wakeup filter, something like:
rc-5 nec nec-x rc-6-0 rc-6-6a-24 [rc-6-6a-32] rc-6-mce
Note that protocol variants are listed, so nec, sony, rc-5, rc-6 have their different bit length encodings listed if available.
Note that all protocol variants are listed.
The enabled wakeup protocol is shown in [] brackets.
Only one protocol can be selected at a time.
Writing "proto" will use "proto" for wakeup events.
Writing "none" will disable wakeup.
Write fails with EINVAL if an invalid protocol combination or unknown protocol name is used, or if wakeup is not supported by the hardware.
/sys/class/rc/rcN/wakeup_filter #
Sets the scancode wakeup filter expected value. Use in combination with /sys/class/rc/rcN/wakeup_filter_mask to set the expected value of the bits set in the wakeup filter mask to trigger a system wake event.
If the hardware supports it and wakeup_filter_mask is not 0 then scancodes which match the filter will wake the system from e.g. suspend to RAM or power off. Otherwise the write will fail with an error.
This value may be reset to 0 if the wakeup protocol is altered.
/sys/class/rc/rcN/wakeup_filter_mask #
Sets the scancode wakeup filter mask of bits to compare. Use in combination with /sys/class/rc/rcN/wakeup_filter to set the bits of the scancode which should be compared against the expected value to trigger a system wake event.
If the hardware supports it and wakeup_filter_mask is not 0 then scancodes which match the filter will wake the system from e.g. suspend to RAM or power off. Otherwise the write will fail with an error.
This value may be reset to 0 if the wakeup protocol is altered.
Changing default Remote Controller mappings
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
The event interface provides two ioctls to be used against the /dev/input/event device, to allow changing the default keymapping.
This program demonstrates how to replace the keymap tables.
Remote controller tables
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Unfortunately, for several years, there was no effort to create uniform IR keycodes for different devices. This caused the same IR keyname to be mapped completely differently on different IR devices. This resulted that the same IR keyname to be mapped completely different on different IR's. Due to that, V4L2 API now specifies a standard for mapping Media keys on IR.
This standard should be used by both V4L/DVB drivers and userspace applications
The modules register the remote as keyboard within the linux input layer. This means that the IR key strokes will look like normal keyboard key strokes (if CONFIG_INPUT_KEYBOARD is enabled). Using the event devices (CONFIG_INPUT_EVDEV) it is possible for applications to access the remote via /dev/input/event devices.
|
Key code |
Meaning |
Key examples on IR |
|
Numeric keys |
||
|
|
Keyboard digit 0 |
0 |
|
|
Keyboard digit 1 |
1 |
|
|
Keyboard digit 2 |
2 |
|
|
Keyboard digit 3 |
3 |
|
|
Keyboard digit 4 |
4 |
|
|
Keyboard digit 5 |
5 |
|
|
Keyboard digit 6 |
6 |
|
|
Keyboard digit 7 |
7 |
|
|
Keyboard digit 8 |
8 |
|
|
Keyboard digit 9 |
9 |
|
Movie play control |
||
|
|
Instantly advance in time |
>> / FORWARD |
|
|
Instantly go back in time |
<<< / BACK |
|
|
Play movie faster |
|
|
|
Play movie back |
REWIND / BACKWARD |
|
|
Select next chapter / sub-chapter / interval |
NEXT / SKIP |
|
|
Select previous chapter / sub-chapter / interval |
<< / PREV / PREVIOUS |
|
|
Repeat the video or a video interval |
REPEAT / LOOP / RECALL |
|
|
Pause stream |
PAUSE / FREEZE |
|
|
Play movie at the normal timeshift |
NORMAL TIMESHIFT / LIVE / > |
|
|
Alternate between play and pause |
PLAY / PAUSE |
|
|
Stop stream |
STOP |
|
|
Start/stop recording stream |
CAPTURE / REC / RECORD/PAUSE |
|
|
Take a picture of the image |
CAMERA ICON / CAPTURE / SNAPSHOT |
|
|
Enable shuffle mode |
SHUFFLE |
|
|
Activate time shift mode |
TIME SHIFT |
|
|
Allow changing the chapter |
CHAPTER |
|
|
Allow changing the subtitle |
SUBTITLE |
|
Image control |
||
|
|
Decrease Brightness |
BRIGHTNESS DECREASE |
|
|
Increase Brightness |
BRIGHTNESS INCREASE |
|
|
Switch video camera angle (on videos with more than one angle stored) |
ANGLE / SWAP |
|
|
Open the Elecrowonic Play Guide (EPG) |
EPG / GUIDE |
|
|
Activate/change closed caption mode |
CLOSED CAPTION/TELETEXT / DVD TEXT / TELETEXT / TTX |
|
Audio control |
||
|
|
Change audio source |
AUDIO SOURCE / AUDIO / MUSIC |
|
|
Mute/unmute audio |
MUTE / DEMUTE / UNMUTE |
|
|
Decrease volume |
VOLUME- / VOLUME DOWN |
|
|
Increase volume |
VOLUME+ / VOLUME UP |
|
|
Change sound mode |
MONO/STEREO |
|
|
Select Language |
1ST / 2ND LANGUAGE / DVD LANG / MTS/SAP / MTS SEL |
|
Channel control |
||
|
|
Go to the next favorite channel |
ALT / CHANNEL / CH SURFING / SURF / FAV |
|
|
Decrease channel sequentially |
CHANNEL - / CHANNEL DOWN / DOWN |
|
|
Increase channel sequentially |
CHANNEL + / CHANNEL UP / UP |
|
|
Use more than one digit for channel |
PLUS / 100/ 1xx / xxx / -/-- / Single Double Triple Digit |
|
|
Start channel autoscan |
SCAN / AUTOSCAN |
|
Colored keys |
||
|
|
IR Blue key |
BLUE |
|
|
IR Green Key |
GREEN |
|
|
IR Red key |
RED |
|
|
IR Yellow key |
YELLOW |
|
Media selection |
||
|
|
Change input source to Compact Disc |
CD |
|
|
Change input to DVD |
DVD / DVD MENU |
|
|
Open/close the CD/DVD player |
-> ) / CLOSE / OPEN |
|
|
Turn on/off Media application |
PC/TV / TURN ON/OFF APP |
|
|
Selects from TV to PC |
PC |
|
|
Put into AM/FM radio mode |
RADIO / TV/FM / TV/RADIO / FM / FM/RADIO |
|
|
Select tv mode |
TV / LIVE TV |
|
|
Select Cable mode |
AIR/CBL |
|
|
Select VCR mode |
VCR MODE / DTR |
|
|
Alternate between input modes |
SOURCE / SELECT / DISPLAY / SWITCH INPUTS / VIDEO |
|
Power control |
||
|
|
Turn on/off computer |
SYSTEM POWER / COMPUTER POWER |
|
|
Turn on/off application |
TV ON/OFF / POWER |
|
|
Activate sleep timer |
SLEEP / SLEEP TIMER |
|
|
Put computer into suspend mode |
STANDBY / SUSPEND |
|
Window control |
||
|
|
Stop stream and return to default input video/audio |
CLEAR / RESET / BOSS KEY |
|
|
Minimize windows and move to the next one |
ALT-TAB / MINIMIZE / DESKTOP |
|
|
Open the favorites stream window |
TV WALL / Favorites |
|
|
Call application menu |
2ND CONTROLS (USA: MENU) / DVD/MENU / SHOW/HIDE CTRL |
|
|
Open/Close Picture in Picture |
PIP |
|
|
Send a confirmation code to application |
OK / ENTER / RETURN |
|
|
Select screen aspect ratio |
4:3 16:9 SELECT |
|
|
Put device into zoom/full screen mode |
ZOOM / FULL SCREEN / ZOOM+ / HIDE PANEL / SWITCH |
|
Navigation keys |
||
|
|
Cancel current operation |
CANCEL / BACK |
|
|
Open a Help window |
HELP |
|
|
Navigate to Homepage |
HOME |
|
|
Open On Screen Display |
DISPLAY INFORMATION / OSD |
|
|
Open the default browser |
WEB |
|
|
Up key |
UP |
|
|
Down key |
DOWN |
|
|
Left key |
LEFT |
|
|
Right key |
RIGHT |
|
Miscellaneous keys |
||
|
|
Return a dot |
. |
|
|
Select a function |
FUNCTION |
It should be noted that, sometimes, there some fundamental missing keys at some cheaper IR's. Due to that, it is recommended to:
|
On simpler IR's, without separate channel keys, you need to map UP as |
|
On simpler IR's, without separate channel keys, you need to map DOWN as |
|
On simpler IR's, without separate volume keys, you need to map LEFT as |
|
On simpler IR's, without separate volume keys, you need to map RIGHT as |
Part III - Remote Controller API
Peios Kernel / Userspace interfaces / System and device interfaces / Remote control
Table of Contents
- Introduction
- Remote Controller's sysfs nodes
- Remote Controller Protocols and Scancodes
- Remote controller tables
- Changing default Remote Controller mappings
- LIRC Device Interface
Revision and Copyright #
Authors:
- Carvalho Chehab, Mauro <mchehab@kernel.org>
- Initial version.
Copyright © 2009-2016 : Mauro Carvalho Chehab
Revision History #
revision: 3.15 / 2014-02-06 (mcc)
Added the interface description and the RC sysfs class description.
revision: 1.0 / 2009-09-06 (mcc)
Initial revision