qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/2] Rewrite the way keycode conversions are perform


From: Daniel P. Berrange
Subject: [Qemu-devel] [PATCH 1/2] Rewrite the way keycode conversions are performed
Date: Tue, 17 Jan 2012 19:35:06 +0000

From: "Daniel P. Berrange" <address@hidden>

The SDL video display code needs to convert between the SDL keyboard
event keycodes, and QEMU's internal keycode set (a variant of the
xt coding).  Currently the SDL code is only able todo this when it is
built for X11, and running against a Linux X11 server using evdev or
xfree86 keymaps.  If running against an OS-X or Win32 X11 server the
keycode mapping falls back to xfre86, which is completely wrong. There
is no mapping at all done, if built against an SDL library with direct
Win32 or Quartz display support.

After initial creation, this QEMU code was later copied into GTK-VNC
to deal with the same problem. GTK-VNC came across the same problem
described above and rewrote the mapping code from scratch. Instead
of creating two arrays for the specific conversions required, the
GTK-VNC code created a CSV file containing data for all commonly
known keycode sets (Linux evdev, OS-X, AT set1, AT set2, AT set3,
XT, XT Linux KBD driver, USB HID, Win32, Xwin XT variant, Xorg
KBD XT variant). A script is then used to generate C arrays for
the particular conversions required.  The CSV file has since been
reused in both the SPICE-GTK and libvirt codebases, unchanged.

This patch rewrites QEMU's SDL code to use this same approach, and
in the process adds support for 4 new targets, SDL X11 on Win32
Xorg server, SDL X11 on OS-X Xorg server, SDL Win32 and SDL Quartz.

In the near future the 'keymap-gen.pl' and 'keymaps.csv' files
will be placed into a dedicated GIT repo which can be added to
QEMU, libvirt, SPICE-GTK & GTK-VNC via a git submodule, instead
of requiring manual copying.

* Makefile: Add rules for generating keymap data files
* Makefile.objs: Replace x_keymap.o with sdl_keymap.o
* ui/keymap-gen.pl: Script for generating keycode mapping tables
* ui/keymaps.csv: Master datafile of keycode mappings
* ui/sdl.c: Rewrite sdl_keyevent_to_keycode to use new
  mapping code
* ui/sdl_keymap.c,ui/sdl_keymap.h: Add APIs for detecting
  suitable keymap tables & performing keymap conversions
* ui/x_keymap.[ch]: Remove obsolete files
---
 Makefile         |   40 +++++-
 Makefile.objs    |    2 +-
 ui/keymap-gen.pl |  210 ++++++++++++++++++++++++
 ui/keymaps.csv   |  464 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ui/sdl.c         |   88 ++---------
 ui/sdl_keymap.c  |  241 ++++++++++++++++++++++++++++
 ui/sdl_keymap.h  |   32 ++++
 ui/x_keymap.c    |  168 --------------------
 ui/x_keymap.h    |   32 ----
 9 files changed, 998 insertions(+), 279 deletions(-)
 create mode 100644 ui/keymap-gen.pl
 create mode 100644 ui/keymaps.csv
 create mode 100644 ui/sdl_keymap.c
 create mode 100644 ui/sdl_keymap.h
 delete mode 100644 ui/x_keymap.c
 delete mode 100644 ui/x_keymap.h

diff --git a/Makefile b/Makefile
index 2bbc547..f776c30 100644
--- a/Makefile
+++ b/Makefile
@@ -116,7 +116,45 @@ QEMU_CFLAGS+=$(GLIB_CFLAGS)
 
 ui/cocoa.o: ui/cocoa.m
 
-ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
+ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o ui/sdl_keymap.o baum.o: QEMU_CFLAGS += 
$(SDL_CFLAGS)
+
+KEYMAP_GEN = ui/keymap-gen.pl
+KEYMAP_CSV = ui/keymaps.csv
+
+SDL_KEYMAPS = \
+        ui/sdl_keymap_xorgevdev2rfb.c \
+        ui/sdl_keymap_xorgkbd2rfb.c \
+        ui/sdl_keymap_xorgxquartz2rfb.c \
+        ui/sdl_keymap_xorgxwin2rfb.c \
+        ui/sdl_keymap_osx2rfb.c \
+        ui/sdl_keymap_win322rfb.c
+
+$(SDL_KEYMAPS): $(KEYMAP_GEN) $(KEYMAP_CSV)
+GENERATED_SOURCES += $(SDL_KEYMAPS)
+
+# Avoid need for perl(Text::CSV) by end users
+# XXXX how does QEMU make file deal with this
+#EXTRA_DIST += $(SDL_KEYMAPS)
+
+ui/sdl_keymap.c: $(SDL_KEYMAPS)
+
+ui/sdl_keymap_xorgevdev2rfb.c: $(KEYMAP_CSV)
+       $(call quiet-command,perl $(KEYMAP_GEN) $< xorgevdev rfb > $@ || rm $@, 
"  GEN $@")
+
+ui/sdl_keymap_xorgkbd2rfb.c: $(KEYMAP_CSV)
+       $(call quiet-command,perl $(KEYMAP_GEN) $< xorgkbd rfb > $@ || rm $@, " 
 GEN $@")
+
+ui/sdl_keymap_xorgxquartz2rfb.c: $(KEYMAP_CSV)
+       $(call quiet-command,perl $(KEYMAP_GEN) $< xorgxquartz rfb > $@ || rm 
$@, "  GEN $@")
+
+ui/sdl_keymap_xorgxwin2rfb.c: $(KEYMAP_CSV)
+       $(call quiet-command,perl $(KEYMAP_GEN) $< xorgxwin rfb > $@ || rm $@, 
"  GEN $@")
+
+ui/sdl_keymap_osx2rfb.c: $(KEYMAP_CSV)
+       $(call quiet-command,perl $(KEYMAP_GEN) $< osx rfb > $@ || rm $@, "  
GEN $@")
+
+ui/sdl_keymap_win322rfb.c: $(KEYMAP_CSV)
+       $(call quiet-command,perl $(KEYMAP_GEN) $< win32 rfb > $@ || rm $@, "  
GEN $@")
 
 ui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
 
diff --git a/Makefile.objs b/Makefile.objs
index 4f6d26c..e549f7c 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -139,7 +139,7 @@ audio-obj-y += wavcapture.o
 common-obj-y += $(addprefix audio/, $(audio-obj-y))
 
 ui-obj-y += keymaps.o
-ui-obj-$(CONFIG_SDL) += sdl.o sdl_zoom.o x_keymap.o
+ui-obj-$(CONFIG_SDL) += sdl.o sdl_zoom.o sdl_keymap.o
 ui-obj-$(CONFIG_COCOA) += cocoa.o
 ui-obj-$(CONFIG_CURSES) += curses.o
 vnc-obj-y += vnc.o d3des.o
diff --git a/ui/keymap-gen.pl b/ui/keymap-gen.pl
new file mode 100644
index 0000000..3582e2b
--- /dev/null
+++ b/ui/keymap-gen.pl
@@ -0,0 +1,210 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Text::CSV;
+
+my %names = (
+    linux => [],
+    osx => []
+);
+
+my %namecolumns = (
+    linux => 0,
+    osx => 2,
+    win32 => 10,
+    );
+
+# Base data sources:
+#
+#  linux:     Linux: linux/input.h                                  (master 
set)
+#    osx:      OS-X: Carbon/HIToolbox/Events.h                      (manually 
mapped)
+# atset1:  AT Set 1: linux/drivers/input/keyboard/atkbd.c           
(atkbd_set2_keycode + atkbd_unxlate_table)
+# atset2:  AT Set 2: linux/drivers/input/keyboard/atkbd.c           
(atkbd_set2_keycode)
+# atset3:  AT Set 3: linux/drivers/input/keyboard/atkbd.c           
(atkbd_set3_keycode)
+#     xt:        XT: linux/drivers/input/keyboard/xt.c              
(xtkbd_keycode)
+#  xtkbd: Linux RAW: linux/drivers/char/keyboard.c                  
(x86_keycodes)
+#    usb:   USB HID: linux/drivers/hid/usbhid/usbkbd.c              
(usb_kbd_keycode)
+#  win32:     Win32: mingw32/winuser.h                              (manually 
mapped)
+# xwinxt:   XWin XT: xorg-server/hw/xwin/{winkeybd.c,winkeynames.h} (xt + 
manually transcribed)
+# xkbdxt:   XKBD XT: xf86-input-keyboard/src/at_scancode.c          (xt + 
manually transcribed)
+#
+# Derived data sources
+#
+#    xorgevdev: Xorg +  evdev: linux + an offset
+#      xorgkbd: Xorg +    kbd: xkbdxt + an offset
+#  xorgxquartz: Xorg +   OS-X: osx + an offset
+#     xorgxwin: Xorg + Cygwin: xwinxt + an offset
+#          rfb:   XT over RFB: xtkbd + special re-encoding of high bit
+
+my @basemaps = qw(linux osx atset1 atset2 atset3 xt xtkbd usb win32 xwinxt 
xkbdxt);
+my @derivedmaps = qw(xorgevdev xorgkbd xorgxquartz xorgxwin rfb);
+my @maps = (@basemaps, @derivedmaps);
+
+my %maps;
+
+foreach my $map (@maps) {
+    $maps{$map} = [ [], [] ];
+}
+my %mapcolumns = (
+    osx => 3,
+    atset1 => 4,
+    atset2 => 5,
+    atset3 => 6,
+    xt => 7,
+    xtkbd => 8,
+    usb => 9,
+    win32 => 11,
+    xwinxt => 12,
+    xkbdxt => 13,
+    );
+
+sub help {
+    my $msg = shift;
+    print $msg;
+    print "\n";
+    print "Valid keymaps are:\n";
+    print "\n";
+    foreach my $name (sort { $a cmp $b } keys %maps) {
+       print "  $name\n";
+    }
+    print "\n";
+    exit (1);
+}
+
+if ($#ARGV != 2) {
+    help("syntax: $0 KEYMAPS SRCMAP DSTMAP\n");
+}
+
+my $keymaps = shift @ARGV;
+my $src = shift @ARGV;
+my $dst = shift @ARGV;
+
+help("$src is not a known keymap\n") unless exists $maps{$src};
+help("$dst is not a known keymap\n") unless exists $maps{$dst};
+
+
+open CSV, $keymaps
+    or die "cannot read $keymaps: $!";
+
+my $csv = Text::CSV->new();
+# Discard column headings
+$csv->getline(\*CSV);
+
+my $row;
+while ($row = $csv->getline(\*CSV)) {
+    my $linux = $row->[1];
+
+    $linux = hex($linux) if $linux =~ /0x/;
+
+    my $to = $maps{linux}->[0];
+    my $from = $maps{linux}->[1];
+    $to->[$linux] = $linux;
+    $from->[$linux] = $linux;
+
+    foreach my $name (keys %namecolumns) {
+       my $col = $namecolumns{$name};
+       my $val = $row->[$col];
+
+       $val = "" unless defined $val;
+
+       $names{$name}->[$linux] = $val;
+    }
+
+    foreach my $name (keys %mapcolumns) {
+       my $col = $mapcolumns{$name};
+       my $val = $row->[$col];
+
+       next unless defined $val && $val ne "";
+       $val = hex($val) if $val =~ /0x/;
+
+       $to = $maps{$name}->[0];
+        $from = $maps{$name}->[1];
+       $to->[$linux] = $val;
+       $from->[$val] = $linux;
+    }
+
+    # XXX there are some special cases in kbd to handle
+    # Xorg KBD driver is the Xorg KBD XT codes offset by +8
+    # The XKBD XT codes are the same as normal XT codes
+    # for values <= 83, and completely made up for extended
+    # scancodes :-(
+    ($to, $from) = @{$maps{xorgkbd}};
+    if (defined $maps{xkbdxt}->[0]->[$linux]) {
+       $to->[$linux] = $maps{xkbdxt}->[0]->[$linux] + 8;
+       $from->[$to->[$linux]] = $linux;
+    }
+
+    # Xorg evdev is simply Linux keycodes offset by +8
+    ($to, $from) = @{$maps{xorgevdev}};
+    $to->[$linux] = $linux + 8;
+    $from->[$to->[$linux]] = $linux;
+
+    # Xorg XQuartz is simply OS-X keycodes offset by +8
+    ($to, $from) = @{$maps{xorgxquartz}};
+    if (defined $maps{osx}->[0]->[$linux]) {
+       $to->[$linux] = $maps{osx}->[0]->[$linux] + 8;
+       $from->[$to->[$linux]] = $linux;
+    }
+
+    # RFB keycodes are XT kbd keycodes with a slightly
+    # different encoding of 0xe0 scan codes. RFB uses
+    # the high bit of the first byte, instead of the low
+    # bit of the second byte.
+    ($to, $from) = @{$maps{rfb}};
+    my $xtkbd = $maps{xtkbd}->[0]->[$linux];
+    if (defined $xtkbd) {
+       $to->[$linux] = $xtkbd ? (($xtkbd & 0x100)>>1) | ($xtkbd & 0x7f) : 0;
+       $from->[$to->[$linux]] = $linux;
+    }
+
+    # Xorg Cygwin is the Xorg Cygwin XT codes offset by +8
+    # The Cygwin XT codes are the same as normal XT codes
+    # for values <= 83, and completely made up for extended
+    # scancodes :-(
+    ($to, $from) = @{$maps{xorgxwin}};
+    if (defined $maps{xwinxt}->[0]->[$linux]) {
+       $to->[$linux] = $maps{xwinxt}->[0]->[$linux] + 8;
+       $from->[$to->[$linux]] = $linux;
+    }
+
+#    print $linux, "\n";
+}
+
+close CSV;
+
+my $srcmap = $maps{$src}->[1];
+my $dstmap = $maps{$dst}->[0];
+
+printf "static const guint16 keymap_%s2%s[] = {\n", $src, $dst;
+
+for (my $i = 0 ; $i <= $#{$srcmap} ; $i++) {
+    my $linux = $srcmap->[$i] || 0;
+    my $j = $dstmap->[$linux];
+    next unless $linux && $j;
+
+    my $srcname = $names{$src}->[$linux] if exists $names{$src};
+    my $dstname = $names{$dst}->[$linux] if exists $names{$dst};
+    my $vianame = $names{linux}->[$linux] unless $src eq "linux" || $dst eq 
"linux";
+
+    $srcname = "" unless $srcname;
+    $dstname = "" unless $dstname;
+    $vianame = "" unless $vianame;
+    $srcname = " ($srcname)" if $srcname;
+    $dstname = " ($dstname)" if $dstname;
+    $vianame = " ($vianame)" if $vianame;
+
+    my $comment;
+    if ($src ne "linux" && $dst ne "linux") {
+       $comment = sprintf "%d%s => %d%s via %d%s", $i, $srcname, $j, $dstname, 
$linux, $vianame;
+    } else {
+       $comment = sprintf "%d%s => %d%s", $i, $srcname, $j, $dstname;
+    }
+
+    my $data = sprintf "[0x%x] = 0x%x,", $i, $j;
+
+    printf "  %-20s /* %s */\n", $data, $comment;
+}
+
+print "};\n";
diff --git a/ui/keymaps.csv b/ui/keymaps.csv
new file mode 100644
index 0000000..98c723b
--- /dev/null
+++ b/ui/keymaps.csv
@@ -0,0 +1,464 @@
+"Linux Name","Linux Keycode","OS-X Name","OS-X Keycode","AT set1 keycode","AT 
set2 keycode","AT set3 keycode",XT,"XT KBD","USB Keycodes","Win32 Name","Win32 
Keycode","Xwin XT","Xfree86 KBD XT"
+KEY_RESERVED,0,,,,,,,,,,,,
+KEY_ESC,1,Escape,0x35,1,118,8,1,1,41,VK_ESCAPE,0x1b,1,1
+KEY_1,2,ANSI_1,0x12,2,22,22,2,2,30,VK_1,0x31,2,2
+KEY_2,3,ANSI_2,0x13,3,30,30,3,3,31,VK_2,0x32,3,3
+KEY_3,4,ANSI_3,0x14,4,38,38,4,4,32,VK_3,0x33,4,4
+KEY_4,5,ANSI_4,0x15,5,37,37,5,5,33,VK_4,0x34,5,5
+KEY_5,6,ANSI_5,0x17,6,46,46,6,6,34,VK_5,0x35,6,6
+KEY_6,7,ANSI_6,0x16,7,54,54,7,7,35,VK_6,0x36,7,7
+KEY_7,8,ANSI_7,0x1a,8,61,61,8,8,36,VK_7,0x37,8,8
+KEY_8,9,ANSI_8,0x1c,9,62,62,9,9,37,VK_8,0x38,9,9
+KEY_9,10,ANSI_9,0x19,10,70,70,10,10,38,VK_9,0x39,10,10
+KEY_0,11,ANSI_0,0x1d,11,69,69,11,11,39,VK_0,0x30,11,11
+KEY_MINUS,12,ANSI_Minus,0x1b,12,78,78,12,12,45,VK_OEM_MINUS,0xbd,12,12
+KEY_EQUAL,13,ANSI_Equal,0x18,13,85,85,13,13,46,VK_OEM_PLUS,0xbb,13,13
+KEY_BACKSPACE,14,Delete,0x33,14,102,102,14,14,42,VK_BACK,0x08,14,14
+KEY_TAB,15,Tab,0x30,15,13,13,15,15,43,VK_TAB,0x09,15,15
+KEY_Q,16,ANSI_Q,0xc,16,21,21,16,16,20,VK_Q,0x51,16,16
+KEY_W,17,ANSI_W,0xd,17,29,29,17,17,26,VK_W,0x57,17,17
+KEY_E,18,ANSI_E,0xe,18,36,36,18,18,8,VK_E,0x45,18,18
+KEY_R,19,ANSI_R,0xf,19,45,45,19,19,21,VK_R,0x52,19,19
+KEY_T,20,ANSI_T,0x11,20,44,44,20,20,23,VK_T,0x54,20,20
+KEY_Y,21,ANSI_Y,0x10,21,53,53,21,21,28,VK_Y,0x59,21,21
+KEY_U,22,ANSI_U,0x20,22,60,60,22,22,24,VK_U,0x55,22,22
+KEY_I,23,ANSI_I,0x22,23,67,67,23,23,12,VK_I,0x49,23,23
+KEY_O,24,ANSI_O,0x1f,24,68,68,24,24,18,VK_O,0x4f,24,24
+KEY_P,25,ANSI_P,0x23,25,77,77,25,25,19,VK_P,0x50,25,25
+KEY_LEFTBRACE,26,ANSI_LeftBracket,0x21,26,84,84,26,26,47,VK_OEM_4,0xdb,26,26
+KEY_RIGHTBRACE,27,ANSI_RightBracket,0x1e,27,91,91,27,27,48,VK_OEM_6,0xdd,27,27
+KEY_ENTER,28,Return,0x24,28,90,90,28,28,40,VK_RETURN,0x0d,28,28
+KEY_LEFTCTRL,29,Control,0x3b,29,20,17,29,29,224,VK_LCONTROL,0xa2,29,29
+KEY_LEFTCTRL,29,Control,0x3b,29,20,17,29,29,224,VK_CONTROL,0x11,29,29
+KEY_A,30,ANSI_A,0x0,30,28,28,30,30,4,VK_A,0x41,30,30
+KEY_S,31,ANSI_S,0x1,31,27,27,31,31,22,VK_S,0x53,31,31
+KEY_D,32,ANSI_D,0x2,32,35,35,32,32,7,VK_D,0x44,32,32
+KEY_F,33,ANSI_F,0x3,33,43,43,33,33,9,VK_F,0x46,33,33
+KEY_G,34,ANSI_G,0x5,34,52,52,34,34,10,VK_G,0x47,34,34
+KEY_H,35,ANSI_H,0x4,35,51,51,35,35,11,VK_H,0x48,35,35
+KEY_J,36,ANSI_J,0x26,36,59,59,36,36,13,VK_J,0x4a,36,36
+KEY_K,37,ANSI_K,0x28,37,66,66,37,37,14,VK_K,0x4b,37,37
+KEY_L,38,ANSI_L,0x25,38,75,75,38,38,15,VK_L,0x4c,38,38
+KEY_SEMICOLON,39,ANSI_Semicolon,0x29,39,76,76,39,39,51,VK_OEM_1,0xba,39,39
+KEY_APOSTROPHE,40,ANSI_Quote,0x27,40,82,82,40,40,52,VK_OEM_2,0xbf,40,40
+KEY_GRAVE,41,ANSI_Grave,0x32,41,14,14,41,41,53,VK_OEM_3,0xc0,41,41
+KEY_SHIFT,42,Shift,0x38,42,18,18,42,42,225,VK_SHIFT,0x10,42,42
+KEY_LEFTSHIFT,42,Shift,0x38,42,18,18,42,42,225,VK_LSHIFT,0xa0,42,42
+KEY_BACKSLASH,43,ANSI_Backslash,0x2a,43,93,93,43,43,50,VK_OEM_5,0xdc,43,43
+KEY_Z,44,ANSI_Z,0x6,44,26,26,44,44,29,VK_Z,0x5a,44,44
+KEY_X,45,ANSI_X,0x7,45,34,34,45,45,27,VK_X,0x58,45,45
+KEY_C,46,ANSI_C,0x8,46,33,33,46,46,6,VK_C,0x43,46,46
+KEY_V,47,ANSI_V,0x9,47,42,42,47,47,25,VK_V,0x56,47,47
+KEY_B,48,ANSI_B,0xb,48,50,50,48,48,5,VK_B,0x42,48,48
+KEY_N,49,ANSI_N,0x2d,49,49,49,49,49,17,VK_N,0x4e,49,49
+KEY_M,50,ANSI_M,0x2e,50,58,58,50,50,16,VK_M,0x4d,50,50
+KEY_COMMA,51,ANSI_Comma,0x2b,51,65,65,51,51,54,VK_OEM_COMMA,0xbc,51,51
+KEY_DOT,52,ANSI_Period,0x2f,52,73,73,52,52,55,VK_OEM_PERIOD,0xbe,52,52
+KEY_SLASH,53,ANSI_Slash,0x2c,53,74,74,53,53,56,VK_OEM_2,0xbf,53,53
+KEY_RIGHTSHIFT,54,RightShift,0x3c,54,89,89,54,54,229,VK_RSHIFT,0xa1,54,54
+KEY_KPASTERISK,55,ANSI_KeypadMultiply,0x43,55,124,126,55,55,85,VK_MULTIPLY,0x6a,55,55
+KEY_LEFTALT,56,Option,0x3a,56,17,25,56,56,226,VK_LMENU,0xa4,56,56
+KEY_LEFTALT,56,Option,0x3a,56,17,25,56,56,226,VK_MENU,0x12,56,56
+KEY_SPACE,57,Space,0x31,57,41,41,57,57,44,VK_SPACE,0x20,57,57
+KEY_CAPSLOCK,58,CapsLock,0x39,58,88,20,58,58,57,VK_CAPITAL,0x14,58,58
+KEY_F1,59,F1,0x7a,59,5,7,59,59,58,VK_F1,0x70,59,59
+KEY_F2,60,F2,0x78,60,6,15,60,60,59,VK_F2,0x71,60,60
+KEY_F3,61,F3,0x63,61,4,23,61,61,60,VK_F3,0x72,61,61
+KEY_F4,62,F4,0x76,62,12,31,62,62,61,VK_F4,0x73,62,62
+KEY_F5,63,F5,0x60,63,3,39,63,63,62,VK_F5,0x74,63,63
+KEY_F6,64,F6,0x61,64,11,47,64,64,63,VK_F6,0x75,64,64
+KEY_F7,65,F7,0x62,65,259,55,65,65,64,VK_F7,0x76,65,65
+KEY_F8,66,F8,0x64,66,10,63,66,66,65,VK_F8,0x77,66,66
+KEY_F9,67,F9,0x65,67,1,71,67,67,66,VK_F9,0x78,67,67
+KEY_F10,68,F10,0x6d,68,9,79,68,68,67,VK_F10,0x79,68,68
+KEY_NUMLOCK,69,,,69,119,118,69,69,83,VK_NUMLOCK,0x90,69,69
+KEY_SCROLLLOCK,70,,,70,126,95,70,70,71,VK_SCROLL,0x91,70,70
+KEY_KP7,71,ANSI_Keypad7,0x59,71,108,108,71,71,95,VK_NUMPAD7,0x67,71,71
+KEY_KP8,72,ANSI_Keypad8,0x5b,72,117,117,72,72,96,VK_NUMPAD8,0x68,72,72
+KEY_KP9,73,ANSI_Keypad9,0x5c,73,125,125,73,73,97,VK_NUMPAD9,0x69,73,73
+KEY_KPMINUS,74,ANSI_KeypadMinus,0x4e,74,123,132,74,74,86,VK_SUBTRACT,0x6d,74,74
+KEY_KP4,75,ANSI_Keypad4,0x56,75,107,107,75,75,92,VK_NUMPAD4,0x64,75,75
+KEY_KP5,76,ANSI_Keypad5,0x57,76,115,115,76,76,93,VK_NUMPAD5,0x65,76,76
+KEY_KP6,77,ANSI_Keypad6,0x58,77,116,116,77,77,94,VK_NUMPAD6,0x66,77,77
+KEY_KPPLUS,78,ANSI_KeypadPlus,0x45,78,121,124,78,78,87,VK_ADD,0x6b,78,78
+KEY_KP1,79,ANSI_Keypad1,0x53,79,105,105,79,79,89,VK_NUMPAD1,0x61,79,79
+KEY_KP2,80,ANSI_Keypad2,0x54,80,114,114,80,80,90,VK_NUMPAD2,0x62,80,80
+KEY_KP3,81,ANSI_Keypad3,0x55,81,122,122,81,81,91,VK_NUMPAD3,0x63,81,81
+KEY_KP0,82,ANSI_Keypad0,0x52,82,112,112,82,82,98,VK_NUMPAD0,0x60,82,82
+KEY_KPDOT,83,ANSI_KeypadDecimal,0x41,83,113,113,83,83,99,VK_DECIMAL,0x6e,83,83
+,84,,,,,,,84,,,,,
+KEY_ZENKAKUHANKAKU,85,,,118,95,,,118,148,,,,
+KEY_102ND,86,,,86,97,19,,86,100,VK_OEM_102,0xe1,,
+KEY_F11,87,F11,0x67,87,120,86,101,87,68,VK_F11,0x7a,,
+KEY_F12,88,F12,0x6f,88,7,94,102,88,69,VK_F12,0x7b,,
+KEY_RO,89,,,115,81,,,115,135,,,,
+KEY_KATAKANA,90,JIS_Kana????,0x68,120,99,,,120,146,VK_KANA,0x15,,
+KEY_HIRAGANA,91,,,119,98,,,119,147,,,,
+KEY_HENKAN,92,,,121,100,134,,121,138,,,,
+KEY_KATAKANAHIRAGANA,93,,,112,19,135,,112,136,,,0xc8,0xc8
+KEY_MUHENKAN,94,,,123,103,133,,123,139,,,,
+KEY_KPJPCOMMA,95,JIS_KeypadComma,0x5f,92,39,,,92,140,,,,
+KEY_KPENTER,96,ANSI_KeypadEnter,0x4c,,158,121,,284,88,,,0x64,0x64
+KEY_RIGHTCTRL,97,RightControl,0x3e,,,88,,285,228,VK_RCONTROL,0xa3,0x65,0x65
+KEY_KPSLASH,98,ANSI_KeypadDivide,0x4b,,181,119,,309,84,VK_DIVIDE,0x6f,0x68,0x68
+KEY_SYSRQ,99,,,84,260,87,,84,70,"VK_SNAPSHOT ???",0x2c,0x67,0x67
+KEY_RIGHTALT,100,RightOption,0x3d,,,57,,312,230,VK_RMENU,0xa5,0x69,0x69
+KEY_LINEFEED,101,,,,,,,91,,,,,
+KEY_HOME,102,Home,0x73,,224,110,,327,74,VK_HOME,0x24,0x59,0x59
+KEY_UP,103,UpArrow,0x7e,,236,99,109,328,82,VK_UP,0x26,0x5a,0x5a
+KEY_PAGEUP,104,PageUp,0x74,,201,111,,329,75,VK_PRIOR,0x21,0x5b,0x5b
+KEY_LEFT,105,LeftArrow,0x7b,,203,97,111,331,80,VK_LEFT,0x25,0x5c,0x5c
+KEY_RIGHT,106,RightArrow,0x7c,,205,106,112,333,79,VK_RIGHT,0x27,0x5e,0x5e
+KEY_END,107,End,0x77,,225,101,,335,77,VK_END,0x23,0x5f,0x5f
+KEY_DOWN,108,DownArrow,0x7d,,254,96,110,336,81,VK_DOWN,0x28,0x60,0x60
+KEY_PAGEDOWN,109,PageDown,0x79,,243,109,,337,78,VK_NEXT,0x22,0x61,0x61
+KEY_INSERT,110,,,,210,103,107,338,73,VK_INSERT,0x2d,0x62,0x62
+KEY_DELETE,111,ForwardDelete,0x75,,244,100,108,339,76,VK_DELETE,0x2e,0x63,0x63
+KEY_MACRO,112,,,,239,142,,367,,,,,
+KEY_MUTE,113,Mute,0x4a,,251,156,,288,239,VK_VOLUME_MUTE,0xad,,
+KEY_VOLUMEDOWN,114,VolumeDown,0x49,,,157,,302,238,VK_VOLUME_DOWN,0xae,,
+KEY_VOLUMEUP,115,VolumeUp,0x48,,233,149,,304,237,VK_VOLUME_UP,0xaf,,
+KEY_POWER,116,,,,,,,350,102,,,,
+KEY_KPEQUAL,117,ANSI_KeypadEquals,0x51,89,15,,,89,103,,,0x76,0x76
+KEY_KPPLUSMINUS,118,,,,206,,,334,,,,,
+KEY_PAUSE,119,,,,198,98,,326,72,VK_PAUSE,0x013,0x66,0x66
+KEY_SCALE,120,,,,,,,267,,,,,
+KEY_KPCOMMA,121,ANSI_KeypadClear????,0x47,126,109,,,126,133,VK_SEPARATOR??,0x6c,,
+KEY_HANGEUL,122,,,,,,,,144,VK_HANGEUL,0x15,,
+KEY_HANJA,123,,,,,,,269,145,VK_HANJA,0x19,,
+KEY_YEN,124,JIS_Yen,0x5d,125,106,,,125,137,,,0x7d,0x7d
+KEY_LEFTMETA,125,Command,0x37,,,139,,347,227,VK_LWIN,0x5b,0x6b,0x6b
+KEY_RIGHTMETA,126,,,,,140,,348,231,VK_RWIN,0x5c,0x6c,0x6c
+KEY_COMPOSE,127,Function,0x3f,,,141,,349,101,VK_APPS,0x5d,0x6d,0x6d
+KEY_STOP,128,,,,,10,,360,243,VK_BROWSER_STOP,0xa9,,
+KEY_AGAIN,129,,,,,11,,261,121,,,,
+KEY_PROPS,130,,,,,12,,262,118,,,,
+KEY_UNDO,131,,,,,16,,263,122,,,,
+KEY_FRONT,132,,,,,,,268,119,,,,
+KEY_COPY,133,,,,,24,,376,124,,,,
+KEY_OPEN,134,,,,,32,,100,116,,,,
+KEY_PASTE,135,,,,,40,,101,125,,,,
+KEY_FIND,136,,,,,48,,321,244,,,,
+KEY_CUT,137,,,,,56,,316,123,,,,
+KEY_HELP,138,,,,,9,,373,117,VK_HELP,0x2f,,
+KEY_MENU,139,,,,,145,,286,,,,,
+KEY_CALC,140,,,,174,163,,289,251,,,,
+KEY_SETUP,141,,,,,,,102,,,,,
+KEY_SLEEP,142,,,,,,,351,248,VK_SLEEP,0x5f,,
+KEY_WAKEUP,143,,,,,,,355,,,,,
+KEY_FILE,144,,,,,,,103,,,,,
+KEY_SENDFILE,145,,,,,,,104,,,,,
+KEY_DELETEFILE,146,,,,,,,105,,,,,
+KEY_XFER,147,,,,,162,,275,,,,,
+KEY_PROG1,148,,,,,160,,287,,,,,
+KEY_PROG2,149,,,,,161,,279,,,,,
+KEY_WWW,150,,,,,,,258,240,,,,
+KEY_MSDOS,151,,,,,,,106,,,,,
+KEY_SCREENLOCK,152,,,,,150,,274,249,,,,
+KEY_DIRECTION,153,,,,,,,107,,,,,
+KEY_CYCLEWINDOWS,154,,,,,155,,294,,,,,
+KEY_MAIL,155,,,,,,,364,,,,,
+KEY_BOOKMARKS,156,,,,,,,358,,,,,
+KEY_COMPUTER,157,,,,,,,363,,,,,
+KEY_BACK,158,,,,,,,362,241,VK_BROWSER_BACK,0xa6,,
+KEY_FORWARD,159,,,,,,,361,242,VK_BROWSER_FORWARD,0xa7,,
+KEY_CLOSECD,160,,,,,154,,291,,,,,
+KEY_EJECTCD,161,,,,,,,108,236,,,,
+KEY_EJECTCLOSECD,162,,,,,,,381,,,,,
+KEY_NEXTSONG,163,,,,241,147,,281,235,VK_MEDIA_NEXT_TRACK,0xb0,,
+KEY_PLAYPAUSE,164,,,,173,,,290,232,VK_MEDIA_PLAY_PAUSE,0xb3,,
+KEY_PREVIOUSSONG,165,,,,250,148,,272,234,VK_MEDIA_PREV_TRACK,0xb1,,
+KEY_STOPCD,166,,,,164,152,,292,233,VK_MEDIA_STOP,0xb2,,
+KEY_RECORD,167,,,,,158,,305,,,,,
+KEY_REWIND,168,,,,,159,,280,,,,,
+KEY_PHONE,169,,,,,,,99,,,,,
+KEY_ISO,170,ISO_Section,0xa,,,,,112,,,,,
+KEY_CONFIG,171,,,,,,,257,,,,,
+KEY_HOMEPAGE,172,,,,178,151,,306,,VK_BROWSER_HOME,0xac,,
+KEY_REFRESH,173,,,,,,,359,250,VK_BROWSER_REFRESH,0xa8,,
+KEY_EXIT,174,,,,,,,113,,,,,
+KEY_MOVE,175,,,,,,,114,,,,,
+KEY_EDIT,176,,,,,,,264,247,,,,
+KEY_SCROLLUP,177,,,,,,,117,245,,,,
+KEY_SCROLLDOWN,178,,,,,,,271,246,,,,
+KEY_KPLEFTPAREN,179,,,,,,,374,182,,,,
+KEY_KPRIGHTPAREN,180,,,,,,,379,183,,,,
+KEY_NEW,181,,,,,,,265,,,,,
+KEY_REDO,182,,,,,,,266,,,,,
+KEY_F13,183,F13,0x69,93,47,127,,93,104,VK_F13,0x7c,0x6e,0x6e
+KEY_F14,184,F14,0x6b,94,55,128,,94,105,VK_F14,0x7d,0x6f,0x6f
+KEY_F15,185,F15,0x71,95,63,129,,95,106,VK_F15,0x7e,0x70,0x70
+KEY_F16,186,F16,0x6a,,,130,,85,107,VK_F16,0x7f,0x71,0x71
+KEY_F17,187,F17,0x40,,,131,,259,108,VK_F17,0x80,0x72,0x72
+KEY_F18,188,F18,0x4f,,,,,375,109,VK_F18,0x81,,
+KEY_F19,189,F19,0x50,,,,,260,110,VK_F19,0x82,,
+KEY_F20,190,F20,0x5a,,,,,90,111,VK_F20,0x83,,
+KEY_F21,191,,,,,,,116,112,VK_F21,0x84,,
+KEY_F22,192,,,,,,,377,113,VK_F22,0x85,,
+KEY_F23,193,,,,,,,109,114,VK_F23,0x86,,
+KEY_F24,194,,,,,,,111,115,VK_F24,0x87,,
+,195,,,,,,,277,,,,,
+,196,,,,,,,278,,,,,
+,197,,,,,,,282,,,,,
+,198,,,,,,,283,,,,,
+,199,,,,,,,295,,,,,
+KEY_PLAYCD,200,,,,,,,296,,,,,
+KEY_PAUSECD,201,,,,,,,297,,,,,
+KEY_PROG3,202,,,,,,,299,,,,,
+KEY_PROG4,203,,,,,,,300,,,,,
+KEY_DASHBOARD,204,,,,,,,301,,,,,
+KEY_SUSPEND,205,,,,,,,293,,,,,
+KEY_CLOSE,206,,,,,,,303,,,,,
+KEY_PLAY,207,,,,,,,307,,VK_PLAY,0xfa,,
+KEY_FASTFORWARD,208,,,,,,,308,,,,,
+KEY_BASSBOOST,209,,,,,,,310,,,,,
+KEY_PRINT,210,,,,,,,313,,VK_PRINT,0x2a,,
+KEY_HP,211,,,,,,,314,,,,,
+KEY_CAMERA,212,,,,,,,315,,,,,
+KEY_SOUND,213,,,,,,,317,,,,,
+KEY_QUESTION,214,,,,,,,318,,,,,
+KEY_EMAIL,215,,,,,,,319,,VK_LAUNCH_MAIL,0xb4,,
+KEY_CHAT,216,,,,,,,320,,,,,
+KEY_SEARCH,217,,,,,,,357,,VK_BROWSER_SEARCH,0xaa,,
+KEY_CONNECT,218,,,,,,,322,,,,,
+KEY_FINANCE,219,,,,,,,323,,,,,
+KEY_SPORT,220,,,,,,,324,,,,,
+KEY_SHOP,221,,,,,,,325,,,,,
+KEY_ALTERASE,222,,,,,,,276,,,,,
+KEY_CANCEL,223,,,,,,,330,,,,,
+KEY_BRIGHTNESSDOWN,224,,,,,,,332,,,,,
+KEY_BRIGHTNESSUP,225,,,,,,,340,,,,,
+KEY_MEDIA,226,,,,,,,365,,,,,
+KEY_SWITCHVIDEOMODE,227,,,,,,,342,,,,,
+KEY_KBDILLUMTOGGLE,228,,,,,,,343,,,,,
+KEY_KBDILLUMDOWN,229,,,,,,,344,,,,,
+KEY_KBDILLUMUP,230,,,,,,,345,,,,,
+KEY_SEND,231,,,,,,,346,,,,,
+KEY_REPLY,232,,,,,,,356,,,,,
+KEY_FORWARDMAIL,233,,,,,,,270,,,,,
+KEY_SAVE,234,,,,,,,341,,,,,
+KEY_DOCUMENTS,235,,,,,,,368,,,,,
+KEY_BATTERY,236,,,,,,,369,,,,,
+KEY_BLUETOOTH,237,,,,,,,370,,,,,
+KEY_WLAN,238,,,,,,,371,,,,,
+KEY_UWB,239,,,,,,,372,,,,,
+KEY_UNKNOWN,240,,,,,,,,,,,,
+KEY_VIDEO_NEXT,241,,,,,,,,,,,,
+KEY_VIDEO_PREV,242,,,,,,,,,,,,
+KEY_BRIGHTNESS_CYCLE,243,,,,,,,,,,,,
+KEY_BRIGHTNESS_ZERO,244,,,,,,,,,,,,
+KEY_DISPLAY_OFF,245,,,,,,,,,,,,
+KEY_WIMAX,246,,,,,,,,,,,,
+,247,,,,,,,,,,,,
+,248,,,,,,,,,,,,
+,249,,,,,,,,,,,,
+,250,,,,,,,,,,,,
+,251,,,,,,,,,,,,
+,252,,,,,,,,,,,,
+,253,,,,,,,,,,,,
+,254,,,,,,,,,,,,
+,255,,,,182,,,,,,,,
+BTN_MISC,0x100,,,,,,,,,,,,
+BTN_0,0x100,,,,,,,,,VK_LBUTTON,0x01,,
+BTN_1,0x101,,,,,,,,,VK_RBUTTON,0x02,,
+BTN_2,0x102,,,,,,,,,VK_MBUTTON,0x04,,
+BTN_3,0x103,,,,,,,,,VK_XBUTTON1,0x05,,
+BTN_4,0x104,,,,,,,,,VK_XBUTTON2,0x06,,
+BTN_5,0x105,,,,,,,,,,,,
+BTN_6,0x106,,,,,,,,,,,,
+BTN_7,0x107,,,,,,,,,,,,
+BTN_8,0x108,,,,,,,,,,,,
+BTN_9,0x109,,,,,,,,,,,,
+BTN_MOUSE,0x110,,,,,,,,,,,,
+BTN_LEFT,0x110,,,,,,,,,,,,
+BTN_RIGHT,0x111,,,,,,,,,,,,
+BTN_MIDDLE,0x112,,,,,,,,,,,,
+BTN_SIDE,0x113,,,,,,,,,,,,
+BTN_EXTRA,0x114,,,,,,,,,,,,
+BTN_FORWARD,0x115,,,,,,,,,,,,
+BTN_BACK,0x116,,,,,,,,,,,,
+BTN_TASK,0x117,,,,,,,,,,,,
+BTN_JOYSTICK,0x120,,,,,,,,,,,,
+BTN_TRIGGER,0x120,,,,,,,,,,,,
+BTN_THUMB,0x121,,,,,,,,,,,,
+BTN_THUMB2,0x122,,,,,,,,,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ND,0x20b,,,,,,,,,,,,
+KEY_RFKILL,0x20c,,,,,,,,,,,,
diff --git a/ui/sdl.c b/ui/sdl.c
index 8cafc44..d865d2b 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -31,7 +31,7 @@
 #include "qemu-common.h"
 #include "console.h"
 #include "sysemu.h"
-#include "x_keymap.h"
+#include "sdl_keymap.h"
 #include "sdl_zoom.h"
 
 static DisplayChangeListener *dcl;
@@ -245,92 +245,26 @@ static uint8_t sdl_keyevent_to_keycode_generic(const 
SDL_KeyboardEvent *ev)
     return keysym2scancode(kbd_layout, keysym) & SCANCODE_KEYMASK;
 }
 
-/* specific keyboard conversions from scan codes */
-
-#if defined(_WIN32)
-
-static uint8_t sdl_keyevent_to_keycode(const SDL_KeyboardEvent *ev)
-{
-    return ev->keysym.scancode;
-}
-
-#else
-
-#if defined(SDL_VIDEO_DRIVER_X11)
-#include <X11/XKBlib.h>
-
-static int check_for_evdev(void)
-{
-    SDL_SysWMinfo info;
-    XkbDescPtr desc = NULL;
-    int has_evdev = 0;
-    char *keycodes = NULL;
-
-    SDL_VERSION(&info.version);
-    if (!SDL_GetWMInfo(&info)) {
-        return 0;
-    }
-    desc = XkbGetKeyboard(info.info.x11.display,
-                          XkbGBN_AllComponentsMask,
-                          XkbUseCoreKbd);
-    if (desc && desc->names) {
-        keycodes = XGetAtomName(info.info.x11.display, desc->names->keycodes);
-        if (keycodes == NULL) {
-            fprintf(stderr, "could not lookup keycode name\n");
-        } else if (strstart(keycodes, "evdev", NULL)) {
-            has_evdev = 1;
-        } else if (!strstart(keycodes, "xfree86", NULL)) {
-            fprintf(stderr, "unknown keycodes `%s', please report to "
-                    "address@hidden", keycodes);
-        }
-    }
-
-    if (desc) {
-        XkbFreeKeyboard(desc, XkbGBN_AllComponentsMask, True);
-    }
-    if (keycodes) {
-        XFree(keycodes);
-    }
-    return has_evdev;
-}
-#else
-static int check_for_evdev(void)
-{
-       return 0;
-}
-#endif
 
 static uint8_t sdl_keyevent_to_keycode(const SDL_KeyboardEvent *ev)
 {
     int keycode;
-    static int has_evdev = -1;
+    static int detect_keymap = 1;
+    static const guint16 *keymap = NULL;
+    static size_t keymap_len = 0;
 
-    if (has_evdev == -1)
-        has_evdev = check_for_evdev();
+    if (detect_keymap) {
+       keymap = qemu_sdl_keymap_detect_table(&keymap_len);
+       detect_keymap = 0;
+    }
 
     keycode = ev->keysym.scancode;
+    if (!keymap)
+       return keycode;
 
-    if (keycode < 9) {
-        keycode = 0;
-    } else if (keycode < 97) {
-        keycode -= 8; /* just an offset */
-    } else if (keycode < 158) {
-        /* use conversion table */
-        if (has_evdev)
-            keycode = translate_evdev_keycode(keycode - 97);
-        else
-            keycode = translate_xfree86_keycode(keycode - 97);
-    } else if (keycode == 208) { /* Hiragana_Katakana */
-        keycode = 0x70;
-    } else if (keycode == 211) { /* backslash */
-        keycode = 0x73;
-    } else {
-        keycode = 0;
-    }
-    return keycode;
+    return qemu_sdl_keymap_convert(keymap, keymap_len, keycode);
 }
 
-#endif
 
 static void reset_keys(void)
 {
diff --git a/ui/sdl_keymap.c b/ui/sdl_keymap.c
new file mode 100644
index 0000000..7b666ab
--- /dev/null
+++ b/ui/sdl_keymap.c
@@ -0,0 +1,241 @@
+/*
+ * QEMU SDL keycode mapping
+ *
+ * Copyright (C) 2006  Anthony Liguori <address@hidden>
+ * Copyright (C) 2009-2012 Daniel P. Berrange <address@hidden>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.0 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 
USA
+ */
+
+/* Avoid compiler warning because macro is redefined in SDL_syswm.h. */
+#undef WIN32_LEAN_AND_MEAN
+
+#include <SDL.h>
+#include <SDL_syswm.h>
+
+#include "sdl_keymap.h"
+
+
+#if defined(SDL_VIDEO_DRIVER_X11)
+
+/* Xorg Linux + kbd (offset + mangled XT keycodes) */
+#include "sdl_keymap_xorgkbd2rfb.c"
+/* Xorg Linux + evdev (offset evdev keycodes) */
+#include "sdl_keymap_xorgevdev2rfb.c"
+/* Xorg OS-X aka XQuartz (offset OS-X keycodes) */
+#include "sdl_keymap_xorgxquartz2rfb.c"
+/* Xorg Cygwin aka XWin (offset + mangled XT keycodes) */
+#include "sdl_keymap_xorgxwin2rfb.c"
+
+#elif defined(SDL_VIDEO_DRIVER_WINDIB)
+
+#include "sdl_keymap_win322rfb.c"
+
+#elif defined(SDL_VIDEO_DRIVER_QUARTZ)
+
+#include "sdl_keymap_osx2rfb.c"
+
+#endif
+
+
+#define STRPREFIX(a,b) (strncmp((a),(b),strlen((b))) == 0)
+
+#if 0
+#define SDL_DEBUG(msg) fprintf(stderr, "%s\n", msg)
+#else
+#define SDL_DEBUG(msg) do { } while (0)
+#endif
+
+#if defined(SDL_VIDEO_DRIVER_X11)
+#include <X11/XKBlib.h>
+
+
+/*
+ * The Win32 X server was nice enough to have a different
+ * vendor name we can check for
+ */
+static gboolean check_for_xwin(Display *dpy)
+{
+    char *vendor = ServerVendor(dpy);
+
+    if (strstr(vendor, "Cygwin/X"))
+        return TRUE;
+
+    return FALSE;
+}
+
+
+/*
+ * The OS-X X server is a build of Xorg, but there is
+ * nothing uniquely identifying about it, except for
+ * the existance of the Apple-DRI/VM extensions in
+ * the display.
+ */
+static gboolean check_for_xquartz(Display *dpy)
+{
+    int nextensions;
+    int i;
+    gboolean match = FALSE;
+    char **extensions = XListExtensions(dpy,
+                                        &nextensions);
+    for (i = 0 ; extensions != NULL && i < nextensions ; i++) {
+        if (strcmp(extensions[i], "Apple-WM") == 0 ||
+            strcmp(extensions[i], "Apple-DRI") == 0)
+            match = TRUE;
+    }
+    if (extensions)
+        XFreeExtensionList(extensions);
+
+    return match;
+}
+#endif
+
+
+/**
+ * qemu_sdl_keymap_detect_table:
+ * @maplen: filled with the number of entries in the returned map
+ *
+ * Examine the SDL display and determine what data table to
+ * use for mapping between SDL event keycodes and QEMU's
+ * internal keycodes.
+ *
+ * The SDL event keycodes are annoying ill-defined, varying
+ * according to the video target that SDL was built against,
+ * as well as the actual display SDL is running against.
+ *
+ * Currently this code has heuristics able to deal with X11
+ * OS-X & Win32 video targets, and distinguish Xorg servers
+ * running on Linux (xfree + evdev), Win32 or OS-X platforms.
+ * Other targets/X servers will likely need more heuristics.
+ *
+ * Returns a keymap of size @maplen, or NULL on error
+ */
+const guint16 *qemu_sdl_keymap_detect_table(size_t *maplen)
+{
+#if defined(SDL_VIDEO_DRIVER_X11)
+    XkbDescPtr desc;
+    const gchar *keycodes = NULL;
+    SDL_SysWMinfo info;
+
+    SDL_VERSION(&info.version);
+    if (!SDL_GetWMInfo(&info)) {
+        return NULL;
+    }
+
+    /* There is no easy way to determine what X11 server
+     * and platform & keyboard driver is in use. Thus we
+     * do best guess heuristics.
+     *
+     * This will need more work for people with other
+     * X servers..... patches welcomed.
+     */
+    desc = XkbGetKeyboard(info.info.x11.display,
+                         XkbGBN_AllComponentsMask,
+                         XkbUseCoreKbd);
+    if (desc) {
+       if (desc->names) {
+           keycodes = XGetAtomName(info.info.x11.display, 
desc->names->keycodes);
+           if (!keycodes)
+               g_warning("could not lookup keycode name");
+       }
+       XkbFreeKeyboard(desc, XkbGBN_AllComponentsMask, True);
+    }
+
+    if (check_for_xwin(info.info.x11.display)) {
+       SDL_DEBUG("Using xwin keycode mapping");
+       *maplen = G_N_ELEMENTS(keymap_xorgxwin2rfb);
+       return keymap_xorgxwin2rfb;
+    } else if (check_for_xquartz(info.info.x11.display)) {
+       SDL_DEBUG("Using xquartz keycode mapping");
+       *maplen = G_N_ELEMENTS(keymap_xorgxquartz2rfb);
+       return keymap_xorgxquartz2rfb;
+    } else if (keycodes && STRPREFIX(keycodes, "evdev_")) {
+       SDL_DEBUG("Using evdev keycode mapping");
+       *maplen = G_N_ELEMENTS(keymap_xorgevdev2rfb);
+       return keymap_xorgevdev2rfb;
+    } else if (keycodes && STRPREFIX(keycodes, "xfree86_")) {
+       SDL_DEBUG("Using xfree86 keycode mapping");
+       *maplen = G_N_ELEMENTS(keymap_xorgkbd2rfb);
+       return keymap_xorgkbd2rfb;
+    } else {
+       g_warning("Unknown keycode mapping '%s'.\n"
+                 "Please report to  address@hidden"
+                 "including the following information:\n"
+                 "\n"
+                 "  - Operating system\n"
+                 "  - SDL windowing system build\n"
+                 "  - X11 Server\n"
+                 "  - xprop -root\n"
+                 "  - xdpyinfo\n",
+                 keycodes);
+       return NULL;
+    }
+
+#elif defined(SDL_VIDEO_DRIVER_WINDIB)
+
+    SDL_DEBUG("Using Win32 virtual keycode mapping");
+    *maplen = G_N_ELEMENTS(keymap_win322rfb);
+    return keymap_win322rfb;
+
+#elif defined(SDL_VIDEO_DRIVER_QUARTZ)
+
+    SDL_DEBUG("Using Quartz virtual keycode mapping");
+    *maplen = G_N_ELEMENTS(keymap_osx2rfb);
+    return keymap_osx2rfb;
+
+#else
+
+#warning "Unsupported SDL Windowing platform.\n" \
+    "Disabling extended keycode tables.\n"      \
+    "Please report to address@hidden"   \
+    "including the following information:\n"    \
+    "\n"                                        \
+    "  - Operating system\n"                    \
+    "  - SDL windowing system build\n");
+
+#endif
+
+    g_warning("Unsupported SDL Windowing platform.\n"
+              "Disabling extended keycode tables.\n"
+              "Please report to address@hidden"
+              "including the following information:\n"
+              "\n"
+              "  - Operating system\n"
+              "  - SDL windowing system build\n");
+    return NULL;
+}
+
+
+/**
+ * qemu_sdl_keymap_convert:
+ * @keycode_map: the keycode mapping table
+ * @keymap_maplen: number of entries in the keycode mapping table
+ * @keycode: the SDL event keycode
+ *
+ * Converts from the SDL event keycode, to the QEMU internal
+ * keycode, using @keycode_map
+ *
+ * Returns the QEMU keycode, or 0 if no suitable mapping exists
+ */
+guint16 qemu_sdl_keymap_convert(const guint16 *keycode_map,
+                               size_t keycode_maplen,
+                               guint16 keycode)
+{
+    if (!keycode_map)
+        return 0;
+    if (keycode >= keycode_maplen)
+        return 0;
+    return keycode_map[keycode];
+}
diff --git a/ui/sdl_keymap.h b/ui/sdl_keymap.h
new file mode 100644
index 0000000..fb51e16
--- /dev/null
+++ b/ui/sdl_keymap.h
@@ -0,0 +1,32 @@
+/*
+ * QEMU SDL keycode mapping
+ *
+ * Copyright (C) 2006  Anthony Liguori <address@hidden>
+ * Copyright (C) 2009-2012 Daniel P. Berrange <address@hidden>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.0 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 
USA
+ */
+
+#ifndef QEMU_SDL_KEYMAP_H
+#define QEMU_SDL_KEYMAP_H
+
+#include <glib.h>
+
+const guint16 *qemu_sdl_keymap_detect_table(size_t *maplen);
+guint16 qemu_sdl_keymap_convert(const guint16 *keycode_map,
+                               size_t keycode_maplen,
+                               guint16 keycode);
+
+#endif /* QEMU_SDL_KEYMAP_H */
diff --git a/ui/x_keymap.c b/ui/x_keymap.c
deleted file mode 100644
index b9b0944..0000000
--- a/ui/x_keymap.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * QEMU SDL display driver
- *
- * Copyright (c) 2003 Fabrice Bellard
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-#include "qemu-common.h"
-#include "x_keymap.h"
-
-static const uint8_t x_keycode_to_pc_keycode[115] = {
-   0xc7,      /*  97  Home   */
-   0xc8,      /*  98  Up     */
-   0xc9,      /*  99  PgUp   */
-   0xcb,      /* 100  Left   */
-   0x4c,        /* 101  KP-5   */
-   0xcd,      /* 102  Right  */
-   0xcf,      /* 103  End    */
-   0xd0,      /* 104  Down   */
-   0xd1,      /* 105  PgDn   */
-   0xd2,      /* 106  Ins    */
-   0xd3,      /* 107  Del    */
-   0x9c,      /* 108  Enter  */
-   0x9d,      /* 109  Ctrl-R */
-   0x0,       /* 110  Pause  */
-   0xb7,      /* 111  Print  */
-   0xb5,      /* 112  Divide */
-   0xb8,      /* 113  Alt-R  */
-   0xc6,      /* 114  Break  */
-   0x0,         /* 115 */
-   0x0,         /* 116 */
-   0x0,         /* 117 */
-   0x0,         /* 118 */
-   0x0,         /* 119 */
-   0x0,         /* 120 */
-   0x0,         /* 121 */
-   0x0,         /* 122 */
-   0x0,         /* 123 */
-   0x0,         /* 124 */
-   0x0,         /* 125 */
-   0x0,         /* 126 */
-   0x0,         /* 127 */
-   0x0,         /* 128 */
-   0x79,         /* 129 Henkan */
-   0x0,         /* 130 */
-   0x7b,         /* 131 Muhenkan */
-   0x0,         /* 132 */
-   0x7d,         /* 133 Yen */
-   0x0,         /* 134 */
-   0x0,         /* 135 */
-   0x47,         /* 136 KP_7 */
-   0x48,         /* 137 KP_8 */
-   0x49,         /* 138 KP_9 */
-   0x4b,         /* 139 KP_4 */
-   0x4c,         /* 140 KP_5 */
-   0x4d,         /* 141 KP_6 */
-   0x4f,         /* 142 KP_1 */
-   0x50,         /* 143 KP_2 */
-   0x51,         /* 144 KP_3 */
-   0x52,         /* 145 KP_0 */
-   0x53,         /* 146 KP_. */
-   0x47,         /* 147 KP_HOME */
-   0x48,         /* 148 KP_UP */
-   0x49,         /* 149 KP_PgUp */
-   0x4b,         /* 150 KP_Left */
-   0x4c,         /* 151 KP_ */
-   0x4d,         /* 152 KP_Right */
-   0x4f,         /* 153 KP_End */
-   0x50,         /* 154 KP_Down */
-   0x51,         /* 155 KP_PgDn */
-   0x52,         /* 156 KP_Ins */
-   0x53,         /* 157 KP_Del */
-};
-
-/* This table is generated based off the xfree86 -> scancode mapping above
- * and the keycode mappings in /usr/share/X11/xkb/keycodes/evdev
- * and  /usr/share/X11/xkb/keycodes/xfree86
- */
-
-static const uint8_t evdev_keycode_to_pc_keycode[61] = {
-    0,         /*  97 EVDEV - RO   ("Internet" Keyboards) */
-    0,         /*  98 EVDEV - KATA (Katakana) */
-    0,         /*  99 EVDEV - HIRA (Hiragana) */
-    0x79,      /* 100 EVDEV - HENK (Henkan) */
-    0x70,      /* 101 EVDEV - HKTG (Hiragana/Katakana toggle) */
-    0x7b,      /* 102 EVDEV - MUHE (Muhenkan) */
-    0,         /* 103 EVDEV - JPCM (KPJPComma) */
-    0x9c,      /* 104 KPEN */
-    0x9d,      /* 105 RCTL */
-    0xb5,      /* 106 KPDV */
-    0xb7,      /* 107 PRSC */
-    0xb8,      /* 108 RALT */
-    0,         /* 109 EVDEV - LNFD ("Internet" Keyboards) */
-    0xc7,      /* 110 HOME */
-    0xc8,      /* 111 UP */
-    0xc9,      /* 112 PGUP */
-    0xcb,      /* 113 LEFT */
-    0xcd,      /* 114 RGHT */
-    0xcf,      /* 115 END */
-    0xd0,      /* 116 DOWN */
-    0xd1,      /* 117 PGDN */
-    0xd2,      /* 118 INS */
-    0xd3,      /* 119 DELE */
-    0,         /* 120 EVDEV - I120 ("Internet" Keyboards) */
-    0,         /* 121 EVDEV - MUTE */
-    0,         /* 122 EVDEV - VOL- */
-    0,         /* 123 EVDEV - VOL+ */
-    0,         /* 124 EVDEV - POWR */
-    0,         /* 125 EVDEV - KPEQ */
-    0,         /* 126 EVDEV - I126 ("Internet" Keyboards) */
-    0,         /* 127 EVDEV - PAUS */
-    0,         /* 128 EVDEV - ???? */
-    0,         /* 129 EVDEV - I129 ("Internet" Keyboards) */
-    0xf1,      /* 130 EVDEV - HNGL (Korean Hangul Latin toggle) */
-    0xf2,      /* 131 EVDEV - HJCV (Korean Hangul Hanja toggle) */
-    0x7d,      /* 132 AE13 (Yen)*/
-    0xdb,      /* 133 EVDEV - LWIN */
-    0xdc,      /* 134 EVDEV - RWIN */
-    0xdd,      /* 135 EVDEV - MENU */
-    0,         /* 136 EVDEV - STOP */
-    0,         /* 137 EVDEV - AGAI */
-    0,         /* 138 EVDEV - PROP */
-    0,         /* 139 EVDEV - UNDO */
-    0,         /* 140 EVDEV - FRNT */
-    0,         /* 141 EVDEV - COPY */
-    0,         /* 142 EVDEV - OPEN */
-    0,         /* 143 EVDEV - PAST */
-    0,         /* 144 EVDEV - FIND */
-    0,         /* 145 EVDEV - CUT  */
-    0,         /* 146 EVDEV - HELP */
-    0,         /* 147 EVDEV - I147 */
-    0,         /* 148 EVDEV - I148 */
-    0,         /* 149 EVDEV - I149 */
-    0,         /* 150 EVDEV - I150 */
-    0,         /* 151 EVDEV - I151 */
-    0,         /* 152 EVDEV - I152 */
-    0,         /* 153 EVDEV - I153 */
-    0,         /* 154 EVDEV - I154 */
-    0,         /* 155 EVDEV - I156 */
-    0,         /* 156 EVDEV - I157 */
-    0,         /* 157 EVDEV - I158 */
-};
-
-uint8_t translate_xfree86_keycode(const int key)
-{
-    return x_keycode_to_pc_keycode[key];
-}
-
-uint8_t translate_evdev_keycode(const int key)
-{
-    return evdev_keycode_to_pc_keycode[key];
-}
diff --git a/ui/x_keymap.h b/ui/x_keymap.h
deleted file mode 100644
index afde2e9..0000000
--- a/ui/x_keymap.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * QEMU SDL display driver
- *
- * Copyright (c) 2003 Fabrice Bellard
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef QEMU_X_KEYMAP_H
-#define QEMU_X_KEYMAP_H
-
-uint8_t translate_xfree86_keycode(const int key);
-
-uint8_t translate_evdev_keycode(const int key);
-
-#endif
-- 
1.7.7.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]