Some questions about key_entry in kernal
I study drivers about ACPI in kernel, find some codes like below:
//from drivers/platform/x86/ideapad-laptop.c
static const struct key_entry ideapad_keymap[] = {
{ KE_KEY, 0x06, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x0D, { KEY_WLAN } },
{ KE_END, 0 },
};
and found key_entry define as below:
/**
* struct key_entry - keymap entry for use in sparse keymap
* @type: Type of the key entry (KE_KEY, KE_SW, KE_VSW, KE_END);
* drivers are allowed to extend the list with their own
* private definitions.
* @code: Device-specific data identifying the button/switch
* @keycode: KEY_* code assigned to a key/button
* @sw.code: SW_* code assigned to a switch
* @sw.value: Value that should be sent in an input even when KE_SW
* switch is toggled. KE_VSW switches ignore this field and
* expect driver to supply value for the event.
*
* This structure defines an entry in a sparse keymap used by some
* input devices for which traditional table-based approach is not
* suitable.
*/
struct key_entry {
int type; /* See KE_* above */
u32 code;
union {
u16 keycode; /* For KE_KEY */
struct { /* For KE_SW, KE_VSW */
u8 code;
u8 value; /* For KE_SW, ignored by KE_VSW */
} sw;
};
};
My question is:
1. where can i get code value for a laptop? In this example,it is 0x06 for { KEY_SWITCHVIDEOMODE }.
2. what does this code stand for?
Last edited by kinbo; 02-19-2012 at 08:50 PM.
|