LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-19-2012, 08:13 PM   #1
kinbo
LQ Newbie
 
Registered: Oct 2007
Posts: 4

Rep: Reputation: 0
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dyne:Bolic 2 Kernal questions 3l3vans Linux - Newbie 0 03-13-2009 01:39 AM
kernal panic after update redhat enterprice 4 from kernal(2.6.9-5) to kernal(2.6.9-42 TAREK-SALAMA Linux - Enterprise 3 09-10-2006 09:07 AM
Kernal questions to better understand. mrkawphy Linux - Newbie 4 07-19-2006 02:58 PM
few questions about kernal compling dr_zayus69 Linux - Software 6 01-07-2005 06:06 AM
questions about upgrading kernal dmarotto Linux - General 1 02-15-2004 09:40 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration