hal: Branch 'master'

Richard Hughes hughsient at kemper.freedesktop.org
Thu Jun 7 15:04:07 PDT 2007


 tools/hal-setup-keymap.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

New commits:
diff-tree a492453b15abfbaada99e1fd51a516acb480331d (from 86492b76139a273171157c42365c6232bca2fc7e)
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Jun 8 00:01:43 2007 +0100

    fix i8042 KBD keyboard mapping
    
    We need to convert the large values displayed in dmesg to sensible values that
    we can use with setkeycodes ioctl. We do this in the code rather than the fdi
    as the value is displayed in dmesg, and we don't want to make it even more
    complicated for the user.

diff --git a/tools/hal-setup-keymap.c b/tools/hal-setup-keymap.c
index dfc15ea..98d5408 100644
--- a/tools/hal-setup-keymap.c
+++ b/tools/hal-setup-keymap.c
@@ -120,6 +120,7 @@ main (int argc, char **argv)
 	}
 
 	/* get a file descriptor to the device */
+	fprintf (stderr, "hal-setup-keymap: Using device %s\n", device);
 	fd = evdev_open (device);
 	if (fd < 0) {
 		fprintf (stderr, "hal-setup-keymap: Could not open device\n");
@@ -130,11 +131,19 @@ main (int argc, char **argv)
 	do {
 		values = sscanf (keymap_list[i], "%x:%s", &scancode, keyname);
 		if (values == 2) {
-			/* use gperf as it's really quick */
+			/* fix for high scancodes on i8042 KBD - we do this here
+			 * and not in the fdi as the high value is displayed in
+			 * dmesg and we don't want the user to do more work */
+			if (scancode > 127) {
+				scancode -= 0xe000;
+				scancode += 128;
+			}
+
+			/* use gperf to convert as it's really quick */
 			name = lookup_key (keyname, strlen(keyname));
 			if (name != NULL) {
 				keycode = name->id;
-				fprintf (stderr, "hal-setup-keymap: parsed %s to (%x, %i)\n",
+				fprintf (stderr, "hal-setup-keymap: parsed %s to (0x%x, %i)\n",
 					 keymap_list[i], scancode, keycode);
 				evdev_set_keycode (fd, scancode, keycode);
 			} else {


More information about the hal-commit mailing list