RE: FYI: ACPI 'sleep 1' resets atkbd keycodes

From: Yu, Luming <hidden>
Date: 2004-02-03 06:27:12
Also in: lkml

quoted
quoted
This may be just a minor issue:
I had to use the setkeycodes utility to enable some extra 
keys (that
quoted
quoted
weren't mapped by kernel's atkbd tables).
After waking from sleep 1, those keys were reset. That 
is, I had to
quoted
quoted
use 'setkeycodes' again to customize the tables again.

IMHO the way kernel works now is correct. It should *not* 
have extra
quoted
quoted
code just to handle that. Just make sure anybody that 
alters his kbd
quoted
quoted
tables puts some extra script to recover the tables after an ACPI
wake.
This should be more like a note to Linux distributors.

Have a nice day.
Do you need a event through /proc/acpi/event that can notify userland of
resuming happend,
And let userland app have chance to invoke setkeycode, and other similar
things.
-	/*
-	 * Here we probably should check if the keyboard has 
the same set that
-         * it had before and bail out if it's different. But 
this will most likely
-         * cause new keyboard device be created... and for 
the user it will look
-         * like keyboard is lost
-	 */
+	if (atkbd->set != old_set) {
+		/*
+		 * ok, we woke up with a different keyboard 
attached. Alhtough we could just
+		 * signal failure it's not very nice as it will 
most likely cause new keyboard
+		 * device be created... and for the user it 
will look like keyboard is lost.
+		 */
+		atkbd_set_name(atkbd);
Is it correct to think if the keyboard has the different set that it
had before , then keyboard has been replaced, without considering
it could be changed by setkeycode.

--Luming
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help