patch-2.3.99-pre3 linux/drivers/usb/keybdev.c

Next file: linux/drivers/usb/mdc800.c
Previous file: linux/drivers/usb/hid.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre2/linux/drivers/usb/keybdev.c linux/drivers/usb/keybdev.c
@@ -58,7 +58,8 @@
 
 #endif
 
-struct input_handler keybdev_handler;
+static struct input_handler keybdev_handler;
+static int keybdev_alt = 0;
 
 void keybdev_ledfunc(unsigned int led)
 {
@@ -93,14 +94,22 @@
 		handle_scancode(0x1d, down);
 		handle_scancode(0x45, down);
 	} else if (code >= 96) {
-		handle_scancode(0xe0, 1);
-		handle_scancode(keybdev_x86_e0s[code - 96], down);
-		if (code == 99) {
+		if (code == 99 && keybdev_alt) {
+			 handle_scancode(84, down);
+		} else {
 			handle_scancode(0xe0, 1);
-			handle_scancode(0x37, down);
+			handle_scancode(keybdev_x86_e0s[code - 96], down);
+			if (code == 99) {
+				handle_scancode(0xe0, 1);
+				handle_scancode(0x37, down);
+			}
 		}
+	} else if (code == 84) {
+		handle_scancode(43, down);
 	} else handle_scancode(code, down);
 
+	if (code == 56 || code == 100) keybdev_alt = down;
+
 #elif CONFIG_ADB_KEYBOARD
 
 	if (code < 128 && keybdev_mac_codes[code]) 
@@ -152,7 +161,7 @@
 	kfree(handle);
 }
 	
-struct input_handler keybdev_handler = {
+static struct input_handler keybdev_handler = {
 	event:		keybdev_event,
 	connect:	keybdev_connect,
 	disconnect:	keybdev_disconnect,

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)