Specifications
CHAPTER 5. IMPLEMENTATION 55
is similar to the translation of a scancode value to its corresponding description. The values
for the function events received by polling the Toshiba ACPI driver’s user space interface are
reported as a unique numeric value.
The structure Key represents a function key combination. The structure has two members:
value and descr:
struct Key {
const int value;
const char *descr;
};
The value corresponds to the numeric value of the function key combination and descr is
a string containing a description for the function key. The second, static data structure keys
required for the translation of a function key event is an array with elements of type Key:
static struct Key keys[] = {
{0x100, "Fn-Escape (Mute)"},
{0x101, "Fn-1 (Volume Down)"},
{0x102, "Fn-2 (Volume Up)"},
...
{0xb85, "Hotbutton (TV-Button)"},
{0xb86, "Hotbutton (E-Button)"},
{0xb87, "Hotbutton (I-Button)"},
{0, NULL}
};
This array is iterated by the module’s function toshiba fnkey description() to gather
a function key’s description. Once a function key event has occurred and the corresponding
description is acquired, toshiba key poll() calls toshiba event send(). This function cre-
ates an abstract input event (type IalEvent) and sends the event to the Input Abstraction
Layer’s output interface. The members of the abstract input event event are set up with the
following values:
– event.sender is set to the module’s token (toshiba)
– event.source is set to /proc/acpi/toshiba/keys
– event.name is set to the description of the function key
– event.raw is set to numeric value of the function key
For example, if the function key Fn-Escape is pressed, the module obtains the value 0x001.
The description Fn-Escape (Mute) for this function key is acquired afterwards. At last the
abstract input event is created and filled with the values common for all function keys (sender
and source) as well as with the unique values for name (0x001 ) and raw (Fn-Escape (Mute)).