* Re: [Qemu-devel] [PATCH v5 08/12] char: convert the escc device to keycodemapdb @ 2017-09-15 18:32 Programmingkid 2017-09-18 9:28 ` Daniel P. Berrange 0 siblings, 1 reply; 4+ messages in thread From: Programmingkid @ 2017-09-15 18:32 UTC (permalink / raw) To: Daniel P. Berrange; +Cc: qemu-devel@nongnu.org qemu-devel Sorry but I saw this error when I tried your patches: OBJC ui/cocoa.o CC ui/curses.o ui/input-keymap.c:17:10: fatal error: 'ui/input-keymap-qcode-to-sun.c' file not found #include "ui/input-keymap-qcode-to-sun.c" ^ 1 error generated. make: *** [ui/input-keymap.o] Error 1 make: *** Waiting for unfinished jobs.... I could not find this file. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v5 08/12] char: convert the escc device to keycodemapdb 2017-09-15 18:32 [Qemu-devel] [PATCH v5 08/12] char: convert the escc device to keycodemapdb Programmingkid @ 2017-09-18 9:28 ` Daniel P. Berrange 2017-09-18 14:49 ` Programmingkid 0 siblings, 1 reply; 4+ messages in thread From: Daniel P. Berrange @ 2017-09-18 9:28 UTC (permalink / raw) To: Programmingkid; +Cc: qemu-devel@nongnu.org qemu-devel On Fri, Sep 15, 2017 at 02:32:14PM -0400, Programmingkid wrote: > Sorry but I saw this error when I tried your patches: > > OBJC ui/cocoa.o > CC ui/curses.o > ui/input-keymap.c:17:10: fatal error: 'ui/input-keymap-qcode-to-sun.c' file not > found > #include "ui/input-keymap-qcode-to-sun.c" > ^ > 1 error generated. > make: *** [ui/input-keymap.o] Error 1 > make: *** Waiting for unfinished jobs.... > > > I could not find this file. Yes, its a bug in this series - just build without the sparc system emulators to avoid it. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :| ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v5 08/12] char: convert the escc device to keycodemapdb 2017-09-18 9:28 ` Daniel P. Berrange @ 2017-09-18 14:49 ` Programmingkid 0 siblings, 0 replies; 4+ messages in thread From: Programmingkid @ 2017-09-18 14:49 UTC (permalink / raw) To: Daniel P. Berrange; +Cc: qemu-devel@nongnu.org qemu-devel > On Sep 18, 2017, at 5:28 AM, Daniel P. Berrange <berrange@redhat.com> wrote: > > On Fri, Sep 15, 2017 at 02:32:14PM -0400, Programmingkid wrote: >> Sorry but I saw this error when I tried your patches: >> >> OBJC ui/cocoa.o >> CC ui/curses.o >> ui/input-keymap.c:17:10: fatal error: 'ui/input-keymap-qcode-to-sun.c' file not >> found >> #include "ui/input-keymap-qcode-to-sun.c" >> ^ >> 1 error generated. >> make: *** [ui/input-keymap.o] Error 1 >> make: *** Waiting for unfinished jobs.... >> >> >> I could not find this file. > > Yes, its a bug in this series - just build without the sparc system > emulators to avoid it. I did not build with the spare system emulator. My configure command looks like this: ./configure --target-list=i386-softmmu,ppc-softmmu Thank you. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH v5 00/12] Convert over to use keycodemapdb @ 2017-09-12 12:37 Daniel P. Berrange 2017-09-12 12:37 ` [Qemu-devel] [PATCH v5 08/12] char: convert the escc device to keycodemapdb Daniel P. Berrange 0 siblings, 1 reply; 4+ messages in thread From: Daniel P. Berrange @ 2017-09-12 12:37 UTC (permalink / raw) To: qemu-devel; +Cc: Gerd Hoffmann, Eric Blake, Daniel P. Berrange An update of: v1: https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg02047.html v2: https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg02471.html v3: https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg02517.html v4: https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg02708.html The keycodemap project[1] provides a database mapping between many different keysym/keycode/scancode sets, along with a tool to generate mapping/lookup tables in various programming languages. It is already used by GTK-VNC, SPICE-GTK and libvirt. This series enables its use in QEMU, thus fixing a great many bugs/ommissions in the 15+ key mapping tables people have manually written for QEMU. The keycodemapdb code is designed to be used as a git sub-module, it is not an external dependancy you need installed before use. In this version, however, the sub-module is not directly use. Instead all the generated files are checked into GIT. The downside to this is that we get an enourmous pile of errors from checkpatch.pl. The tool that generates the mapping files doesn't care about QEMU's coding style rules, because it is a general purpose tool intended for use by many different projects. As such I'm not very happy about the idea of checking the generated files into GIT, and would prefer to go back to generating the files from the submodule on every build, as was done in v4. I did this this in v5 way to illustrate the approach, but on balance I think v4 approach was better. Using the v4 approach would also means when updating the submodule later on, we don't have to post largely meaningless patches of diffs to all the generated files. This series converts all the front ends and all the input devices which are using the new InputEvent framework. A handful of devices still use the legacy kbd handler $ git grep -l add_kbd_event_handler hw hw/arm/musicpal.c hw/arm/nseries.c hw/arm/palm.c hw/arm/spitz.c hw/input/pxa2xx_keypad.c hw/input/stellaris_input.c and could be usefully converted too. I've not done much realworld testing of this yet. I did however write code that compared the mapping tables before and after conversion to identify what mapping changes have resulted in each frontend/backend. What I still need to go back and validate is the Print/Sysrq handling, because that is special everywhere and I'm not entirely sure I've done that correctly yet. The GTK frontend should now work correctly when run on X11 servers on Win32 and OS-X, as well as when run on native Win32/OS-X display backends. [1] https://gitlab.com/keycodemap/keycodemapdb/ Changed in v5: - Don't try to initialize git submodule at all - Store generate keymap files in GIT Changed in v4: - Run submodule update in source_dir for vpath builds (patchew) - Force submodule update in docker rules in case they are run without configure (patchew) Changed in v3: - Ensure docker builds pull in keycodemapdb submodule (patchew) - Add compat with py26 for RHEL-6 in keycodemapdb tools (patchew) - Initialize submodule in configure script (patchew) Changed in v2: - Change filename pattern to 'ui/input-keymap-$SRC-to-$DST.c' and map names 'qemu_input_map_$SRC_to_$DST' (Eric) - Fix typos (Eric) - Drop changes to InputKeyEvent struct (Eric) - Fix VPATH build (patchew) - Fix code style errors (patchew) Daniel P. Berrange (12): ui: add keycodemapdb repository as a GIT submodule ui: convert common input code to keycodemapdb ui: convert key events to QKeyCodes immediately ui: don't export qemu_input_event_new_key input: convert virtio-input-hid device to keycodemapdb input: convert ps2 device to keycodemapdb input: convert the adb device to keycodemapdb char: convert the escc device to keycodemapdb ui: convert cocoa frontend to keycodemapdb ui: convert the SDL2 frontend to keycodemapdb ui: convert GTK and SDL1 frontends to keycodemapdb display: convert XenInput keyboard to keycodemapdb .gitmodules | 3 + hw/char/escc.c | 126 +-------- hw/display/xenfb.c | 133 +++------- hw/input/adb.c | 124 +-------- hw/input/ps2.c | 406 +---------------------------- hw/input/virtio-input-hid.c | 136 +--------- include/hw/input/adb-keys.h | 141 ---------- include/ui/input.h | 57 +++- ui/Makefile.objs | 43 ++- ui/cocoa.m | 129 +-------- ui/gtk.c | 205 +++++++++------ ui/input-keymap-atset1-to-qcode.c | 245 +++++++++++++++++ ui/input-keymap-linux-to-qcode.c | 463 +++++++++++++++++++++++++++++++++ ui/input-keymap-osx-to-qcode.c | 128 +++++++++ ui/input-keymap-qcode-to-adb.c | 156 +++++++++++ ui/input-keymap-qcode-to-atset1.c | 154 +++++++++++ ui/input-keymap-qcode-to-atset2.c | 142 ++++++++++ ui/input-keymap-qcode-to-atset3.c | 138 ++++++++++ ui/input-keymap-qcode-to-linux.c | 156 +++++++++++ ui/input-keymap-qcode-to-qnum.c | 154 +++++++++++ ui/input-keymap-qnum-to-qcode.c | 245 +++++++++++++++++ ui/input-keymap-usb-to-qcode.c | 177 +++++++++++++ ui/input-keymap-win32-to-qcode.c | 157 +++++++++++ ui/input-keymap-x11-to-qcode.c | 163 ++++++++++++ ui/input-keymap-xorgevdev-to-qcode.c | 463 +++++++++++++++++++++++++++++++++ ui/input-keymap-xorgkbd-to-qcode.c | 122 +++++++++ ui/input-keymap-xorgxquartz-to-qcode.c | 128 +++++++++ ui/input-keymap-xorgxwin-to-qcode.c | 122 +++++++++ ui/input-keymap.c | 341 +++--------------------- ui/input.c | 8 +- ui/keycodemapdb | 1 + ui/sdl.c | 105 +++----- ui/sdl2-input.c | 16 +- ui/sdl2-keymap.h | 267 ------------------- ui/trace-events | 9 +- ui/x_keymap.c | 250 +++++++----------- ui/x_keymap.h | 8 +- 37 files changed, 3774 insertions(+), 2047 deletions(-) delete mode 100644 include/hw/input/adb-keys.h create mode 100644 ui/input-keymap-atset1-to-qcode.c create mode 100644 ui/input-keymap-linux-to-qcode.c create mode 100644 ui/input-keymap-osx-to-qcode.c create mode 100644 ui/input-keymap-qcode-to-adb.c create mode 100644 ui/input-keymap-qcode-to-atset1.c create mode 100644 ui/input-keymap-qcode-to-atset2.c create mode 100644 ui/input-keymap-qcode-to-atset3.c create mode 100644 ui/input-keymap-qcode-to-linux.c create mode 100644 ui/input-keymap-qcode-to-qnum.c create mode 100644 ui/input-keymap-qnum-to-qcode.c create mode 100644 ui/input-keymap-usb-to-qcode.c create mode 100644 ui/input-keymap-win32-to-qcode.c create mode 100644 ui/input-keymap-x11-to-qcode.c create mode 100644 ui/input-keymap-xorgevdev-to-qcode.c create mode 100644 ui/input-keymap-xorgkbd-to-qcode.c create mode 100644 ui/input-keymap-xorgxquartz-to-qcode.c create mode 100644 ui/input-keymap-xorgxwin-to-qcode.c create mode 160000 ui/keycodemapdb delete mode 100644 ui/sdl2-keymap.h -- 2.13.5 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH v5 08/12] char: convert the escc device to keycodemapdb 2017-09-12 12:37 [Qemu-devel] [PATCH v5 00/12] Convert over to use keycodemapdb Daniel P. Berrange @ 2017-09-12 12:37 ` Daniel P. Berrange 0 siblings, 0 replies; 4+ messages in thread From: Daniel P. Berrange @ 2017-09-12 12:37 UTC (permalink / raw) To: qemu-devel; +Cc: Gerd Hoffmann, Eric Blake, Daniel P. Berrange Replace the qcode_to_keycode table with automatically generated tables. Missing entries in qcode_to_keycode now fixed: - Q_KEY_CODE_KP_COMMA -> 0x2d Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- hw/char/escc.c | 126 +++-------------------------------------------------- include/ui/input.h | 3 ++ ui/Makefile.objs | 1 + ui/input-keymap.c | 1 + 4 files changed, 10 insertions(+), 121 deletions(-) diff --git a/hw/char/escc.c b/hw/char/escc.c index 3ab831a6a7..449bf2fc63 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -717,126 +717,6 @@ MemoryRegion *escc_init(hwaddr base, qemu_irq irqA, qemu_irq irqB, return &d->mmio; } -static const uint8_t qcode_to_keycode[Q_KEY_CODE__MAX] = { - [Q_KEY_CODE_SHIFT] = 99, - [Q_KEY_CODE_SHIFT_R] = 110, - [Q_KEY_CODE_ALT] = 19, - [Q_KEY_CODE_ALT_R] = 13, - [Q_KEY_CODE_CTRL] = 76, - [Q_KEY_CODE_CTRL_R] = 76, - [Q_KEY_CODE_ESC] = 29, - [Q_KEY_CODE_1] = 30, - [Q_KEY_CODE_2] = 31, - [Q_KEY_CODE_3] = 32, - [Q_KEY_CODE_4] = 33, - [Q_KEY_CODE_5] = 34, - [Q_KEY_CODE_6] = 35, - [Q_KEY_CODE_7] = 36, - [Q_KEY_CODE_8] = 37, - [Q_KEY_CODE_9] = 38, - [Q_KEY_CODE_0] = 39, - [Q_KEY_CODE_MINUS] = 40, - [Q_KEY_CODE_EQUAL] = 41, - [Q_KEY_CODE_BACKSPACE] = 43, - [Q_KEY_CODE_TAB] = 53, - [Q_KEY_CODE_Q] = 54, - [Q_KEY_CODE_W] = 55, - [Q_KEY_CODE_E] = 56, - [Q_KEY_CODE_R] = 57, - [Q_KEY_CODE_T] = 58, - [Q_KEY_CODE_Y] = 59, - [Q_KEY_CODE_U] = 60, - [Q_KEY_CODE_I] = 61, - [Q_KEY_CODE_O] = 62, - [Q_KEY_CODE_P] = 63, - [Q_KEY_CODE_BRACKET_LEFT] = 64, - [Q_KEY_CODE_BRACKET_RIGHT] = 65, - [Q_KEY_CODE_RET] = 89, - [Q_KEY_CODE_A] = 77, - [Q_KEY_CODE_S] = 78, - [Q_KEY_CODE_D] = 79, - [Q_KEY_CODE_F] = 80, - [Q_KEY_CODE_G] = 81, - [Q_KEY_CODE_H] = 82, - [Q_KEY_CODE_J] = 83, - [Q_KEY_CODE_K] = 84, - [Q_KEY_CODE_L] = 85, - [Q_KEY_CODE_SEMICOLON] = 86, - [Q_KEY_CODE_APOSTROPHE] = 87, - [Q_KEY_CODE_GRAVE_ACCENT] = 42, - [Q_KEY_CODE_BACKSLASH] = 88, - [Q_KEY_CODE_Z] = 100, - [Q_KEY_CODE_X] = 101, - [Q_KEY_CODE_C] = 102, - [Q_KEY_CODE_V] = 103, - [Q_KEY_CODE_B] = 104, - [Q_KEY_CODE_N] = 105, - [Q_KEY_CODE_M] = 106, - [Q_KEY_CODE_COMMA] = 107, - [Q_KEY_CODE_DOT] = 108, - [Q_KEY_CODE_SLASH] = 109, - [Q_KEY_CODE_ASTERISK] = 47, - [Q_KEY_CODE_SPC] = 121, - [Q_KEY_CODE_CAPS_LOCK] = 119, - [Q_KEY_CODE_F1] = 5, - [Q_KEY_CODE_F2] = 6, - [Q_KEY_CODE_F3] = 8, - [Q_KEY_CODE_F4] = 10, - [Q_KEY_CODE_F5] = 12, - [Q_KEY_CODE_F6] = 14, - [Q_KEY_CODE_F7] = 16, - [Q_KEY_CODE_F8] = 17, - [Q_KEY_CODE_F9] = 18, - [Q_KEY_CODE_F10] = 7, - [Q_KEY_CODE_NUM_LOCK] = 98, - [Q_KEY_CODE_SCROLL_LOCK] = 23, - [Q_KEY_CODE_KP_DIVIDE] = 46, - [Q_KEY_CODE_KP_MULTIPLY] = 47, - [Q_KEY_CODE_KP_SUBTRACT] = 71, - [Q_KEY_CODE_KP_ADD] = 125, - [Q_KEY_CODE_KP_ENTER] = 90, - [Q_KEY_CODE_KP_DECIMAL] = 50, - [Q_KEY_CODE_KP_0] = 94, - [Q_KEY_CODE_KP_1] = 112, - [Q_KEY_CODE_KP_2] = 113, - [Q_KEY_CODE_KP_3] = 114, - [Q_KEY_CODE_KP_4] = 91, - [Q_KEY_CODE_KP_5] = 92, - [Q_KEY_CODE_KP_6] = 93, - [Q_KEY_CODE_KP_7] = 68, - [Q_KEY_CODE_KP_8] = 69, - [Q_KEY_CODE_KP_9] = 70, - [Q_KEY_CODE_LESS] = 124, - [Q_KEY_CODE_F11] = 9, - [Q_KEY_CODE_F12] = 11, - [Q_KEY_CODE_HOME] = 52, - [Q_KEY_CODE_PGUP] = 96, - [Q_KEY_CODE_PGDN] = 123, - [Q_KEY_CODE_END] = 74, - [Q_KEY_CODE_LEFT] = 24, - [Q_KEY_CODE_UP] = 20, - [Q_KEY_CODE_DOWN] = 27, - [Q_KEY_CODE_RIGHT] = 28, - [Q_KEY_CODE_INSERT] = 44, - [Q_KEY_CODE_DELETE] = 66, - [Q_KEY_CODE_STOP] = 1, - [Q_KEY_CODE_AGAIN] = 3, - [Q_KEY_CODE_PROPS] = 25, - [Q_KEY_CODE_UNDO] = 26, - [Q_KEY_CODE_FRONT] = 49, - [Q_KEY_CODE_COPY] = 51, - [Q_KEY_CODE_OPEN] = 72, - [Q_KEY_CODE_PASTE] = 73, - [Q_KEY_CODE_FIND] = 95, - [Q_KEY_CODE_CUT] = 97, - [Q_KEY_CODE_LF] = 111, - [Q_KEY_CODE_HELP] = 118, - [Q_KEY_CODE_META_L] = 120, - [Q_KEY_CODE_META_R] = 122, - [Q_KEY_CODE_COMPOSE] = 67, - [Q_KEY_CODE_PRINT] = 22, - [Q_KEY_CODE_SYSRQ] = 21, -}; static void sunkbd_handle_event(DeviceState *dev, QemuConsole *src, InputEvent *evt) @@ -879,7 +759,11 @@ static void sunkbd_handle_event(DeviceState *dev, QemuConsole *src, } } - keycode = qcode_to_keycode[qcode]; + if (qcode > qemu_input_map_qcode_to_sun_len) { + return; + } + + keycode = qemu_input_map_qcode_to_sun[qcode]; if (!key->down) { keycode |= 0x80; } diff --git a/include/ui/input.h b/include/ui/input.h index 4aa5655a0b..4ba7340b7b 100644 --- a/include/ui/input.h +++ b/include/ui/input.h @@ -89,6 +89,9 @@ extern const guint16 qemu_input_map_qcode_to_linux[]; extern const guint qemu_input_map_qcode_to_qnum_len; extern const guint16 qemu_input_map_qcode_to_qnum[]; +extern const guint qemu_input_map_qcode_to_sun_len; +extern const guint16 qemu_input_map_qcode_to_sun[]; + extern const guint qemu_input_map_qnum_to_qcode_len; extern const guint16 qemu_input_map_qnum_to_qcode[]; diff --git a/ui/Makefile.objs b/ui/Makefile.objs index 6846636f39..3cd1122ea9 100644 --- a/ui/Makefile.objs +++ b/ui/Makefile.objs @@ -61,6 +61,7 @@ KEYCODEMAP_FILES = \ ui/input-keymap-qcode-to-atset3.c \ ui/input-keymap-qcode-to-linux.c \ ui/input-keymap-qcode-to-qnum.c \ + ui/input-keymap-qcode-to-sun.c \ ui/input-keymap-qnum-to-qcode.c \ $(NULL) diff --git a/ui/input-keymap.c b/ui/input-keymap.c index 5d97a38c42..1b53cb4d0a 100644 --- a/ui/input-keymap.c +++ b/ui/input-keymap.c @@ -12,6 +12,7 @@ #include "ui/input-keymap-qcode-to-atset3.c" #include "ui/input-keymap-qcode-to-linux.c" #include "ui/input-keymap-qcode-to-qnum.c" +#include "ui/input-keymap-qcode-to-sun.c" #include "ui/input-keymap-qnum-to-qcode.c" int qemu_input_linux_to_qcode(unsigned int lnx) -- 2.13.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-09-18 14:49 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-09-15 18:32 [Qemu-devel] [PATCH v5 08/12] char: convert the escc device to keycodemapdb Programmingkid 2017-09-18 9:28 ` Daniel P. Berrange 2017-09-18 14:49 ` Programmingkid -- strict thread matches above, loose matches on Subject: below -- 2017-09-12 12:37 [Qemu-devel] [PATCH v5 00/12] Convert over to use keycodemapdb Daniel P. Berrange 2017-09-12 12:37 ` [Qemu-devel] [PATCH v5 08/12] char: convert the escc device to keycodemapdb Daniel P. Berrange
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).