From ed7b2624f241b58ca9e5437470339d60bf87e231 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 17 Jan 2018 16:47:14 +0000 Subject: ui: convert the SDL2 frontend to keycodemapdb The SDL2 scancodes are conveniently identical to the USB scancodes. Replace the sdl2_scancode_to_qcode table with an automatically generated table. Missing entries in sdl2_scancode_to_qcode now fixed: - 0x32 -> Q_KEY_CODE_BACKSLASH - 0x66 -> Q_KEY_CODE_POWER - 0x67 -> Q_KEY_CODE_KP_EQUALS - 0x74 -> Q_KEY_CODE_OPEN - 0x77 -> Q_KEY_CODE_FRONT - 0x7f -> Q_KEY_CODE_AUDIOMUTE - 0x80 -> Q_KEY_CODE_VOLUMEUP - 0x81 -> Q_KEY_CODE_VOLUMEDOWN - 0x85 -> Q_KEY_CODE_KP_COMMA - 0x87 -> Q_KEY_CODE_RO - 0x89 -> Q_KEY_CODE_YEN - 0x8a -> Q_KEY_CODE_HENKAN - 0x93 -> Q_KEY_CODE_HIRAGANA - 0xe8 -> Q_KEY_CODE_AUDIOPLAY - 0xe9 -> Q_KEY_CODE_AUDIOSTOP - 0xea -> Q_KEY_CODE_AUDIOPREV - 0xeb -> Q_KEY_CODE_AUDIONEXT - 0xed -> Q_KEY_CODE_VOLUMEUP - 0xee -> Q_KEY_CODE_VOLUMEDOWN - 0xef -> Q_KEY_CODE_AUDIOMUTE - 0xf1 -> Q_KEY_CODE_AC_BACK - 0xf2 -> Q_KEY_CODE_AC_FORWARD - 0xf3 -> Q_KEY_CODE_STOP - 0xf4 -> Q_KEY_CODE_FIND - 0xf8 -> Q_KEY_CODE_SLEEP - 0xfa -> Q_KEY_CODE_AC_REFRESH - 0xfb -> Q_KEY_CODE_CALCULATOR And some mistakes corrected: - 0x65 -> Q_KEY_CODE_COMPOSE, not duplicating Q_KEY_CODE_MENU Signed-off-by: Daniel P. Berrange Message-id: 20180117164717.15855-2-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- include/ui/input.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/ui/input.h b/include/ui/input.h index 5cc76d6e41..0d289e4142 100644 --- a/include/ui/input.h +++ b/include/ui/input.h @@ -80,4 +80,7 @@ extern const guint16 qemu_input_map_qnum_to_qcode[]; extern const guint qemu_input_map_qcode_to_linux_len; extern const guint16 qemu_input_map_qcode_to_linux[]; +extern const guint qemu_input_map_usb_to_qcode_len; +extern const guint16 qemu_input_map_usb_to_qcode[]; + #endif /* INPUT_H */ -- cgit v1.2.3 From 2ec78706d188df7d3dab43d07b19b05ef7800a44 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 17 Jan 2018 16:47:15 +0000 Subject: ui: convert GTK and SDL1 frontends to keycodemapdb The x_keycode_to_pc_keycode and evdev_keycode_to_pc_keycode tables are replaced with automatically generated tables. In addition the X11 heuristics are improved to detect running on XQuartz and XWin X11 servers, to activate the correct OS-X and Win32 keycode maps. Signed-off-by: Daniel P. Berrange Message-id: 20180117164717.15855-3-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- include/ui/input.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include') diff --git a/include/ui/input.h b/include/ui/input.h index 0d289e4142..05aab2db5c 100644 --- a/include/ui/input.h +++ b/include/ui/input.h @@ -68,6 +68,9 @@ void qemu_input_check_mode_change(void); void qemu_add_mouse_mode_change_notifier(Notifier *notify); void qemu_remove_mouse_mode_change_notifier(Notifier *notify); +extern const guint qemu_input_map_atset1_to_qcode_len; +extern const guint16 qemu_input_map_atset1_to_qcode[]; + extern const guint qemu_input_map_linux_to_qcode_len; extern const guint16 qemu_input_map_linux_to_qcode[]; @@ -83,4 +86,22 @@ extern const guint16 qemu_input_map_qcode_to_linux[]; extern const guint qemu_input_map_usb_to_qcode_len; extern const guint16 qemu_input_map_usb_to_qcode[]; +extern const guint qemu_input_map_win32_to_qcode_len; +extern const guint16 qemu_input_map_win32_to_qcode[]; + +extern const guint qemu_input_map_x11_to_qcode_len; +extern const guint16 qemu_input_map_x11_to_qcode[]; + +extern const guint qemu_input_map_xorgevdev_to_qcode_len; +extern const guint16 qemu_input_map_xorgevdev_to_qcode[]; + +extern const guint qemu_input_map_xorgkbd_to_qcode_len; +extern const guint16 qemu_input_map_xorgkbd_to_qcode[]; + +extern const guint qemu_input_map_xorgxquartz_to_qcode_len; +extern const guint16 qemu_input_map_xorgxquartz_to_qcode[]; + +extern const guint qemu_input_map_xorgxwin_to_qcode_len; +extern const guint16 qemu_input_map_xorgxwin_to_qcode[]; + #endif /* INPUT_H */ -- cgit v1.2.3 From 04ff1a398a8d6e912eceaca9b62af0a09e927d63 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 15 Jan 2018 16:48:55 +0100 Subject: sdl: reorganize -no-frame support Drop no_frame flag from sdl_display_init argument list, use a global variable instead. This is temporary until -no-frame support is dropped altogether when we remove sdl1 support. Remove any traces of noframe from sdl2 code. It is just dead code as sdl2 doesn't support the SDL_NOFRAME window flag any more. Signed-off-by: Gerd Hoffmann Message-id: 20180115154855.30850-3-kraxel@redhat.com --- include/sysemu/sysemu.h | 1 + include/ui/console.h | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 31612caf10..1c925309e3 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -112,6 +112,7 @@ extern const char *keyboard_layout; extern int win2k_install_hack; extern int alt_grab; extern int ctrl_grab; +extern int no_frame; extern int smp_cpus; extern unsigned int max_cpus; extern int cursor_hide; diff --git a/include/ui/console.h b/include/ui/console.h index 580dfc57ee..7b35778444 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -436,7 +436,7 @@ void surface_gl_setup_viewport(QemuGLShader *gls, /* sdl.c */ #ifdef CONFIG_SDL void sdl_display_early_init(int opengl); -void sdl_display_init(DisplayState *ds, int full_screen, int no_frame); +void sdl_display_init(DisplayState *ds, int full_screen); #else static inline void sdl_display_early_init(int opengl) { @@ -444,8 +444,7 @@ static inline void sdl_display_early_init(int opengl) error_report("SDL support is disabled"); abort(); } -static inline void sdl_display_init(DisplayState *ds, int full_screen, - int no_frame) +static inline void sdl_display_init(DisplayState *ds, int full_screen) { /* This must never be called if CONFIG_SDL is disabled */ error_report("SDL support is disabled"); -- cgit v1.2.3