Blame qemu-sasl-03-display-keymaps.patch

Daniel P. Berrange 42af21
Each of the graphical frontends #include a .c file, for keymap code
Daniel P. Berrange 42af21
resulting in duplicated definitions & duplicated compiled code. A
Daniel P. Berrange 42af21
couple of small changes allowed this to be sanitized, so instead of
Daniel P. Berrange 42af21
doing a #include "keymaps.c", duplicating all code, we can have a
Daniel P. Berrange 42af21
shared keymaps.h file, and only compile code once. This allows the
Daniel P. Berrange 42af21
next patch to move the VncState struct out into a header file without
Daniel P. Berrange 42af21
causing clashing definitions.
Daniel P. Berrange 42af21
Daniel P. Berrange 42af21
Daniel P. Berrange 42af21
 Makefile      |    9 +++++---
Daniel P. Berrange 42af21
 b/keymaps.h   |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Daniel P. Berrange 42af21
 curses.c      |    3 --
Daniel P. Berrange 42af21
 curses_keys.h |    9 +++-----
Daniel P. Berrange 42af21
 keymaps.c     |   45 ++++++++++++++++---------------------------
Daniel P. Berrange 42af21
 sdl.c         |    3 --
Daniel P. Berrange 42af21
 sdl_keysym.h  |    7 ++----
Daniel P. Berrange 42af21
 vnc.c         |    5 +---
Daniel P. Berrange 42af21
 vnc_keysym.h  |    7 ++----
Daniel P. Berrange 42af21
 9 files changed, 97 insertions(+), 51 deletions(-)
Daniel P. Berrange 42af21
Daniel P. Berrange 42af21
   Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Daniel P. Berrange 42af21
Glauber Costa 8571d0
Index: kvm-84.git-snapshot-20090303/qemu/Makefile
Glauber Costa 8571d0
===================================================================
Glauber Costa 8571d0
--- kvm-84.git-snapshot-20090303.orig/qemu/Makefile
Glauber Costa 8571d0
+++ kvm-84.git-snapshot-20090303/qemu/Makefile
Glauber Costa 8571d0
@@ -141,6 +141,7 @@ endif
Daniel P. Berrange 42af21
 AUDIO_OBJS+= wavcapture.o
Daniel P. Berrange 42af21
 OBJS+=$(addprefix audio/, $(AUDIO_OBJS))
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
+OBJS+=keymaps.o
Daniel P. Berrange 42af21
 ifdef CONFIG_SDL
Daniel P. Berrange 42af21
 OBJS+=sdl.o x_keymap.o
Daniel P. Berrange 42af21
 endif
Glauber Costa 8571d0
@@ -165,15 +166,17 @@ LIBS+=$(VDE_LIBS)
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
 cocoa.o: cocoa.m
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
-sdl.o: sdl.c keymaps.c sdl_keysym.h
Daniel P. Berrange 42af21
+keymaps.o: keymaps.c keymaps.h
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+sdl.o: sdl.c keymaps.h sdl_keysym.h
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
 sdl.o audio/sdlaudio.o: CFLAGS += $(SDL_CFLAGS)
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
-vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
Daniel P. Berrange 42af21
+vnc.o: vnc.c keymaps.h sdl_keysym.h vnchextile.h d3des.c d3des.h
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
 vnc.o: CFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
-curses.o: curses.c keymaps.c curses_keys.h
Daniel P. Berrange 42af21
+curses.o: curses.c keymaps.h curses_keys.h
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
 bt-host.o: CFLAGS += $(CONFIG_BLUEZ_CFLAGS)
Daniel P. Berrange 42af21
 
Glauber Costa 8571d0
Index: kvm-84.git-snapshot-20090303/qemu/curses.c
Glauber Costa 8571d0
===================================================================
Glauber Costa 8571d0
--- kvm-84.git-snapshot-20090303.orig/qemu/curses.c
Glauber Costa 8571d0
+++ kvm-84.git-snapshot-20090303/qemu/curses.c
Daniel P. Berrange 42af21
@@ -158,7 +158,6 @@ static void curses_cursor_position(Displ
Daniel P. Berrange 42af21
 /* generic keyboard conversion */
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
 #include "curses_keys.h"
Daniel P. Berrange 42af21
-#include "keymaps.c"
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
 static kbd_layout_t *kbd_layout = 0;
Daniel P. Berrange 42af21
 static int keycode2keysym[CURSES_KEYS];
Daniel P. Berrange 42af21
@@ -311,7 +310,7 @@ static void curses_keyboard_setup(void)
Daniel P. Berrange 42af21
         keyboard_layout = "en-us";
Daniel P. Berrange 42af21
 #endif
Daniel P. Berrange 42af21
     if(keyboard_layout) {
Daniel P. Berrange 42af21
-        kbd_layout = init_keyboard_layout(keyboard_layout);
Daniel P. Berrange 42af21
+        kbd_layout = init_keyboard_layout(name2keysym, keyboard_layout);
Daniel P. Berrange 42af21
         if (!kbd_layout)
Daniel P. Berrange 42af21
             exit(1);
Daniel P. Berrange 42af21
     }
Glauber Costa 8571d0
Index: kvm-84.git-snapshot-20090303/qemu/curses_keys.h
Glauber Costa 8571d0
===================================================================
Glauber Costa 8571d0
--- kvm-84.git-snapshot-20090303.orig/qemu/curses_keys.h
Glauber Costa 8571d0
+++ kvm-84.git-snapshot-20090303/qemu/curses_keys.h
Daniel P. Berrange 42af21
@@ -21,6 +21,10 @@
Daniel P. Berrange 42af21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
Daniel P. Berrange 42af21
  * THE SOFTWARE.
Daniel P. Berrange 42af21
  */
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+#include "keymaps.h"
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
 #define KEY_RELEASE         0x80
Daniel P. Berrange 42af21
 #define KEY_MASK            0x7f
Daniel P. Berrange 42af21
 #define SHIFT_CODE          0x2a
Daniel P. Berrange 42af21
@@ -239,11 +243,6 @@ static const int curses2keysym[CURSES_KE
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
 };
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
-typedef struct {
Daniel P. Berrange 42af21
-	const char* name;
Daniel P. Berrange 42af21
-	int keysym;
Daniel P. Berrange 42af21
-} name2keysym_t;
Daniel P. Berrange 42af21
-
Daniel P. Berrange 42af21
 static const name2keysym_t name2keysym[] = {
Daniel P. Berrange 42af21
     /* Plain ASCII */
Daniel P. Berrange 42af21
     { "space", 0x020 },
Glauber Costa 8571d0
Index: kvm-84.git-snapshot-20090303/qemu/keymaps.c
Glauber Costa 8571d0
===================================================================
Glauber Costa 8571d0
--- kvm-84.git-snapshot-20090303.orig/qemu/keymaps.c
Glauber Costa 8571d0
+++ kvm-84.git-snapshot-20090303/qemu/keymaps.c
Daniel P. Berrange 42af21
@@ -22,34 +22,20 @@
Daniel P. Berrange 42af21
  * THE SOFTWARE.
Daniel P. Berrange 42af21
  */
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
-static int get_keysym(const char *name)
Daniel P. Berrange 42af21
+#include "keymaps.h"
Daniel P. Berrange 42af21
+#include "sysemu.h"
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+static int get_keysym(const name2keysym_t *table,
Daniel P. Berrange 42af21
+		      const char *name)
Daniel P. Berrange 42af21
 {
Daniel P. Berrange 42af21
     const name2keysym_t *p;
Daniel P. Berrange 42af21
-    for(p = name2keysym; p->name != NULL; p++) {
Daniel P. Berrange 42af21
+    for(p = table; p->name != NULL; p++) {
Daniel P. Berrange 42af21
         if (!strcmp(p->name, name))
Daniel P. Berrange 42af21
             return p->keysym;
Daniel P. Berrange 42af21
     }
Daniel P. Berrange 42af21
     return 0;
Daniel P. Berrange 42af21
 }
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
-struct key_range {
Daniel P. Berrange 42af21
-    int start;
Daniel P. Berrange 42af21
-    int end;
Daniel P. Berrange 42af21
-    struct key_range *next;
Daniel P. Berrange 42af21
-};
Daniel P. Berrange 42af21
-
Daniel P. Berrange 42af21
-#define MAX_NORMAL_KEYCODE 512
Daniel P. Berrange 42af21
-#define MAX_EXTRA_COUNT 256
Daniel P. Berrange 42af21
-typedef struct {
Daniel P. Berrange 42af21
-    uint16_t keysym2keycode[MAX_NORMAL_KEYCODE];
Daniel P. Berrange 42af21
-    struct {
Daniel P. Berrange 42af21
-	int keysym;
Daniel P. Berrange 42af21
-	uint16_t keycode;
Daniel P. Berrange 42af21
-    } keysym2keycode_extra[MAX_EXTRA_COUNT];
Daniel P. Berrange 42af21
-    int extra_count;
Daniel P. Berrange 42af21
-    struct key_range *keypad_range;
Daniel P. Berrange 42af21
-    struct key_range *numlock_range;
Daniel P. Berrange 42af21
-} kbd_layout_t;
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
 static void add_to_key_range(struct key_range **krp, int code) {
Daniel P. Berrange 42af21
     struct key_range *kr;
Daniel P. Berrange 42af21
@@ -73,7 +59,8 @@ static void add_to_key_range(struct key_
Daniel P. Berrange 42af21
     }
Daniel P. Berrange 42af21
 }
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
-static kbd_layout_t *parse_keyboard_layout(const char *language,
Daniel P. Berrange 42af21
+static kbd_layout_t *parse_keyboard_layout(const name2keysym_t *table,
Daniel P. Berrange 42af21
+					   const char *language,
Daniel P. Berrange 42af21
 					   kbd_layout_t * k)
Daniel P. Berrange 42af21
 {
Daniel P. Berrange 42af21
     FILE *f;
Daniel P. Berrange 42af21
@@ -102,7 +89,7 @@ static kbd_layout_t *parse_keyboard_layo
Daniel P. Berrange 42af21
 	if (!strncmp(line, "map ", 4))
Daniel P. Berrange 42af21
 	    continue;
Daniel P. Berrange 42af21
 	if (!strncmp(line, "include ", 8)) {
Daniel P. Berrange 42af21
-	    parse_keyboard_layout(line + 8, k);
Daniel P. Berrange 42af21
+	    parse_keyboard_layout(table, line + 8, k);
Daniel P. Berrange 42af21
         } else {
Daniel P. Berrange 42af21
 	    char *end_of_keysym = line;
Daniel P. Berrange 42af21
 	    while (*end_of_keysym != 0 && *end_of_keysym != ' ')
Daniel P. Berrange 42af21
@@ -110,7 +97,7 @@ static kbd_layout_t *parse_keyboard_layo
Daniel P. Berrange 42af21
 	    if (*end_of_keysym) {
Daniel P. Berrange 42af21
 		int keysym;
Daniel P. Berrange 42af21
 		*end_of_keysym = 0;
Daniel P. Berrange 42af21
-		keysym = get_keysym(line);
Daniel P. Berrange 42af21
+		keysym = get_keysym(table, line);
Daniel P. Berrange 42af21
 		if (keysym == 0) {
Daniel P. Berrange 42af21
                     //		    fprintf(stderr, "Warning: unknown keysym %s\n", line);
Daniel P. Berrange 42af21
 		} else {
Daniel P. Berrange 42af21
@@ -154,12 +141,14 @@ static kbd_layout_t *parse_keyboard_layo
Daniel P. Berrange 42af21
     return k;
Daniel P. Berrange 42af21
 }
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
-static void *init_keyboard_layout(const char *language)
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+void *init_keyboard_layout(const name2keysym_t *table, const char *language)
Daniel P. Berrange 42af21
 {
Daniel P. Berrange 42af21
-    return parse_keyboard_layout(language, 0);
Daniel P. Berrange 42af21
+    return parse_keyboard_layout(table, language, 0);
Daniel P. Berrange 42af21
 }
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
-static int keysym2scancode(void *kbd_layout, int keysym)
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+int keysym2scancode(void *kbd_layout, int keysym)
Daniel P. Berrange 42af21
 {
Daniel P. Berrange 42af21
     kbd_layout_t *k = kbd_layout;
Daniel P. Berrange 42af21
     if (keysym < MAX_NORMAL_KEYCODE) {
Daniel P. Berrange 42af21
@@ -180,7 +169,7 @@ static int keysym2scancode(void *kbd_lay
Daniel P. Berrange 42af21
     return 0;
Daniel P. Berrange 42af21
 }
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
-static inline int keycode_is_keypad(void *kbd_layout, int keycode)
Daniel P. Berrange 42af21
+int keycode_is_keypad(void *kbd_layout, int keycode)
Daniel P. Berrange 42af21
 {
Daniel P. Berrange 42af21
     kbd_layout_t *k = kbd_layout;
Daniel P. Berrange 42af21
     struct key_range *kr;
Daniel P. Berrange 42af21
@@ -191,7 +180,7 @@ static inline int keycode_is_keypad(void
Daniel P. Berrange 42af21
     return 0;
Daniel P. Berrange 42af21
 }
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
-static inline int keysym_is_numlock(void *kbd_layout, int keysym)
Daniel P. Berrange 42af21
+int keysym_is_numlock(void *kbd_layout, int keysym)
Daniel P. Berrange 42af21
 {
Daniel P. Berrange 42af21
     kbd_layout_t *k = kbd_layout;
Daniel P. Berrange 42af21
     struct key_range *kr;
Glauber Costa 8571d0
Index: kvm-84.git-snapshot-20090303/qemu/keymaps.h
Glauber Costa 8571d0
===================================================================
Glauber Costa 8571d0
--- /dev/null
Glauber Costa 8571d0
+++ kvm-84.git-snapshot-20090303/qemu/keymaps.h
Daniel P. Berrange 42af21
@@ -0,0 +1,60 @@
Daniel P. Berrange 42af21
+/*
Daniel P. Berrange 42af21
+ * QEMU keysym to keycode conversion using rdesktop keymaps
Daniel P. Berrange 42af21
+ *
Daniel P. Berrange 42af21
+ * Copyright (c) 2004 Johannes Schindelin
Daniel P. Berrange 42af21
+ *
Daniel P. Berrange 42af21
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
Daniel P. Berrange 42af21
+ * of this software and associated documentation files (the "Software"), to deal
Daniel P. Berrange 42af21
+ * in the Software without restriction, including without limitation the rights
Daniel P. Berrange 42af21
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Daniel P. Berrange 42af21
+ * copies of the Software, and to permit persons to whom the Software is
Daniel P. Berrange 42af21
+ * furnished to do so, subject to the following conditions:
Daniel P. Berrange 42af21
+ *
Daniel P. Berrange 42af21
+ * The above copyright notice and this permission notice shall be included in
Daniel P. Berrange 42af21
+ * all copies or substantial portions of the Software.
Daniel P. Berrange 42af21
+ *
Daniel P. Berrange 42af21
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Daniel P. Berrange 42af21
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Daniel P. Berrange 42af21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
Daniel P. Berrange 42af21
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Daniel P. Berrange 42af21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Daniel P. Berrange 42af21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
Daniel P. Berrange 42af21
+ * THE SOFTWARE.
Daniel P. Berrange 42af21
+ */
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+#ifndef __QEMU_KEYMAPS_H__
Daniel P. Berrange 42af21
+#define __QEMU_KEYMAPS_H__
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+#include "qemu-common.h"
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+typedef struct {
Daniel P. Berrange 42af21
+	const char* name;
Daniel P. Berrange 42af21
+	int keysym;
Daniel P. Berrange 42af21
+} name2keysym_t;
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+struct key_range {
Daniel P. Berrange 42af21
+    int start;
Daniel P. Berrange 42af21
+    int end;
Daniel P. Berrange 42af21
+    struct key_range *next;
Daniel P. Berrange 42af21
+};
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+#define MAX_NORMAL_KEYCODE 512
Daniel P. Berrange 42af21
+#define MAX_EXTRA_COUNT 256
Daniel P. Berrange 42af21
+typedef struct {
Daniel P. Berrange 42af21
+    uint16_t keysym2keycode[MAX_NORMAL_KEYCODE];
Daniel P. Berrange 42af21
+    struct {
Daniel P. Berrange 42af21
+	int keysym;
Daniel P. Berrange 42af21
+	uint16_t keycode;
Daniel P. Berrange 42af21
+    } keysym2keycode_extra[MAX_EXTRA_COUNT];
Daniel P. Berrange 42af21
+    int extra_count;
Daniel P. Berrange 42af21
+    struct key_range *keypad_range;
Daniel P. Berrange 42af21
+    struct key_range *numlock_range;
Daniel P. Berrange 42af21
+} kbd_layout_t;
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+void *init_keyboard_layout(const name2keysym_t *table, const char *language);
Daniel P. Berrange 42af21
+int keysym2scancode(void *kbd_layout, int keysym);
Daniel P. Berrange 42af21
+int keycode_is_keypad(void *kbd_layout, int keycode);
Daniel P. Berrange 42af21
+int keysym_is_numlock(void *kbd_layout, int keysym);
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+#endif /* __QEMU_KEYMAPS_H__ */
Glauber Costa 8571d0
Index: kvm-84.git-snapshot-20090303/qemu/sdl.c
Glauber Costa 8571d0
===================================================================
Glauber Costa 8571d0
--- kvm-84.git-snapshot-20090303.orig/qemu/sdl.c
Glauber Costa 8571d0
+++ kvm-84.git-snapshot-20090303/qemu/sdl.c
Daniel P. Berrange 42af21
@@ -107,7 +107,6 @@ static void sdl_resize(DisplayState *ds)
Daniel P. Berrange 42af21
 /* generic keyboard conversion */
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
 #include "sdl_keysym.h"
Daniel P. Berrange 42af21
-#include "keymaps.c"
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
 static kbd_layout_t *kbd_layout = NULL;
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
@@ -623,7 +622,7 @@ void sdl_display_init(DisplayState *ds, 
Daniel P. Berrange 42af21
         keyboard_layout = "en-us";
Daniel P. Berrange 42af21
 #endif
Daniel P. Berrange 42af21
     if(keyboard_layout) {
Daniel P. Berrange 42af21
-        kbd_layout = init_keyboard_layout(keyboard_layout);
Daniel P. Berrange 42af21
+        kbd_layout = init_keyboard_layout(name2keysym, keyboard_layout);
Daniel P. Berrange 42af21
         if (!kbd_layout)
Daniel P. Berrange 42af21
             exit(1);
Daniel P. Berrange 42af21
     }
Glauber Costa 8571d0
Index: kvm-84.git-snapshot-20090303/qemu/sdl_keysym.h
Glauber Costa 8571d0
===================================================================
Glauber Costa 8571d0
--- kvm-84.git-snapshot-20090303.orig/qemu/sdl_keysym.h
Glauber Costa 8571d0
+++ kvm-84.git-snapshot-20090303/qemu/sdl_keysym.h
Daniel P. Berrange 42af21
@@ -1,7 +1,6 @@
Daniel P. Berrange 42af21
-typedef struct {
Daniel P. Berrange 42af21
-	const char* name;
Daniel P. Berrange 42af21
-	int keysym;
Daniel P. Berrange 42af21
-} name2keysym_t;
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+#include "keymaps.h"
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
 static const name2keysym_t name2keysym[]={
Daniel P. Berrange 42af21
 /* ascii */
Daniel P. Berrange 42af21
     { "space",                0x020},
Glauber Costa 8571d0
Index: kvm-84.git-snapshot-20090303/qemu/vnc.c
Glauber Costa 8571d0
===================================================================
Glauber Costa 8571d0
--- kvm-84.git-snapshot-20090303.orig/qemu/vnc.c
Glauber Costa 8571d0
+++ kvm-84.git-snapshot-20090303/qemu/vnc.c
Daniel P. Berrange 42af21
@@ -35,7 +35,6 @@
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
 #include "vnc.h"
Daniel P. Berrange 42af21
 #include "vnc_keysym.h"
Daniel P. Berrange 42af21
-#include "keymaps.c"
Daniel P. Berrange 42af21
 #include "d3des.h"
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
 #ifdef CONFIG_VNC_TLS
Daniel P. Berrange 42af21
@@ -2420,9 +2419,9 @@ void vnc_display_init(DisplayState *ds)
Daniel P. Berrange 42af21
     vs->ds = ds;
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
     if (keyboard_layout)
Daniel P. Berrange 42af21
-        vs->kbd_layout = init_keyboard_layout(keyboard_layout);
Daniel P. Berrange 42af21
+        vs->kbd_layout = init_keyboard_layout(name2keysym, keyboard_layout);
Daniel P. Berrange 42af21
     else
Daniel P. Berrange 42af21
-        vs->kbd_layout = init_keyboard_layout("en-us");
Daniel P. Berrange 42af21
+        vs->kbd_layout = init_keyboard_layout(name2keysym, "en-us");
Daniel P. Berrange 42af21
 
Daniel P. Berrange 42af21
     if (!vs->kbd_layout)
Daniel P. Berrange 42af21
 	exit(1);
Glauber Costa 8571d0
Index: kvm-84.git-snapshot-20090303/qemu/vnc_keysym.h
Glauber Costa 8571d0
===================================================================
Glauber Costa 8571d0
--- kvm-84.git-snapshot-20090303.orig/qemu/vnc_keysym.h
Glauber Costa 8571d0
+++ kvm-84.git-snapshot-20090303/qemu/vnc_keysym.h
Daniel P. Berrange 42af21
@@ -1,7 +1,6 @@
Daniel P. Berrange 42af21
-typedef struct {
Daniel P. Berrange 42af21
-	const char* name;
Daniel P. Berrange 42af21
-	int keysym;
Daniel P. Berrange 42af21
-} name2keysym_t;
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
+#include "keymaps.h"
Daniel P. Berrange 42af21
+
Daniel P. Berrange 42af21
 static const name2keysym_t name2keysym[]={
Daniel P. Berrange 42af21
 /* ascii */
Daniel P. Berrange 42af21
     { "space",                0x020},