Kernel patch: keyboard.

From: RaúlNúñez de Arenas Coronado (dervishd@linuxfreak.com)
Date: Mon Mar 20 2000 - 16:04:36 EST


    Hello everybody :))

    First of all, excuse me if this is not the proper place for sending
this patch, but I am somewhat... lost :(((

    I have tested this on ten keyboards, five of them under Debian 2.1,
three under Suse 6.2 and two under a-kind-of-red-hat-5.1, and worked
OK under all of them. I hope to see this patch included in, at
least, a prepatch version of the kernel :))))

    Well, this patch is about these three new keys that some new
keyboards have: suspend, resume and poweroff. These keys don't work
on Linux by default, and I have decoded their scancodes and included
them in the kernel keyboard conversion tables.

    Please, feel free to send this patch to whoever you want, and
thank you very much for your time and effort :)

    Raúl

--- BEGIN pc_keyb.c.diff ---
--- drivers/char/pc_keyb.c.orig Mon Aug 9 21:04:39 1999
+++ drivers/char/pc_keyb.c Mon Mar 20 21:40:25 2000
@@ -13,6 +13,8 @@
  * Code fixes to handle mouse ACKs properly.
  * C. Scott Ananian <cananian@alumni.princeton.edu> 1999-01-29.
  *
+ * Support for operation keys (Suspend, Resume and Power Off).
+ * Raúl Núñez de Arenas Coronado <dervishd@linuxfreak.com> 2000-02-29
  */
 
 #include <linux/config.h>
@@ -214,6 +216,23 @@
 #define E0_MSRW 126
 #define E0_MSTM 127
 
+/*
+ * New keyboard extension: the Suspend, Resume and Poweroff keys.
+ * They are located above PrScr/ScrollLock/Pause, of below Del/End/PgDn
+ * Their names use to be Suspend, Resume and Poweroff, but I have seen
+ * them labeled Sleep, WakeUp and PowerDown, too. It depends on the model
+ * of keyboard...
+ * Their scancodes are:
+ * e0 63 (WakeUp/Resume)
+ * e0 5f (Sleep/Suspend)
+ * e0 5e (Poweroff/PowerDown)
+ *
+ * [dervishd@linuxfreak.com]
+ */
+#define E0_AWAKE 122
+#define E0_SLEEP 123
+#define E0_POWER 124
+
 static unsigned char e0_keys[128] = {
   0, 0, 0, 0, 0, 0, 0, 0, /* 0x00-0x07 */
   0, 0, 0, 0, 0, 0, 0, 0, /* 0x08-0x0f */
@@ -226,8 +245,8 @@
   E0_DO, E0_F17, 0, 0, 0, 0, E0_BREAK, E0_HOME, /* 0x40-0x47 */
   E0_UP, E0_PGUP, 0, E0_LEFT, E0_OK, E0_RIGHT, E0_KPMINPLUS, E0_END,/* 0x48-0x4f */
   E0_DOWN, E0_PGDN, E0_INS, E0_DEL, 0, 0, 0, 0, /* 0x50-0x57 */
- 0, 0, 0, E0_MSLW, E0_MSRW, E0_MSTM, 0, 0, /* 0x58-0x5f */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60-0x67 */
+ 0, 0, 0, E0_MSLW, E0_MSRW, E0_MSTM, E0_POWER, E0_SLEEP,/* 0x58-0x5f */
+ 0, 0, 0, E0_AWAKE, 0, 0, 0, 0, /* 0x60-0x67 */
   0, 0, 0, 0, 0, 0, 0, E0_MACRO, /* 0x68-0x6f */
   0, 0, 0, 0, 0, 0, 0, 0, /* 0x70-0x77 */
   0, 0, 0, 0, 0, 0, 0, 0 /* 0x78-0x7f */
--- END pc_keyb.c.diff ---

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:39 EST