* [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input @ 2017-12-22 15:25 Miika S 2017-12-22 15:25 ` [Qemu-devel] [PATCH 1/3] input: add missing JIS keys " Miika S ` (3 more replies) 0 siblings, 4 replies; 9+ messages in thread From: Miika S @ 2017-12-22 15:25 UTC (permalink / raw) To: qemu-devel; +Cc: kraxel, berrange, Miika S This patchset adds some missing keys and mouse buttons to hw/input/virtio-input-hid.c. On a JIS keyboard such as this one (106/109 - JIS) https://upload.wikimedia.org/wikipedia/commons/b/b2/Physical_keyboard_layouts_comparison_ANSI_ISO_KS_ABNT_JIS.png the keys are located as follows: muhenkan: left of spacebar henkan: right of spacebar katakanahiragana: right of henkan compose: the same as menu but the existing one didn't work ro: left of right shift (this produces the same key code as the key right of left shift on 102/105 ISO keyboard in the linked picture and consequently this patch also adds support for those keyboards) yen: left of backspace The mouse buttons "side" and "extra" are the ones you use to go to the previous and next page in modern web browsers such as Firefox and Chrome. The last patch fixes mouse wheel event sent for both button up and down by only forwarding the event when the button state is down. Miika S (3): input: add missing JIS keys to virtio input input: add mouse side buttons to virtio input input: virtio: don't send mouse wheel event twice hw/input/virtio-input-hid.c | 15 +++++++++++++-- qapi/ui.json | 5 ++++- ui/keycodemapdb | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) -- 2.15.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH 1/3] input: add missing JIS keys to virtio input 2017-12-22 15:25 [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input Miika S @ 2017-12-22 15:25 ` Miika S 2018-01-15 10:40 ` Daniel P. Berrange 2017-12-22 15:25 ` [Qemu-devel] [PATCH 2/3] input: add mouse side buttons " Miika S ` (2 subsequent siblings) 3 siblings, 1 reply; 9+ messages in thread From: Miika S @ 2017-12-22 15:25 UTC (permalink / raw) To: qemu-devel; +Cc: kraxel, berrange, Miika S keycodemapdb updated to add the QKeyCodes muhenkan and katakanahiragana Signed-off-by: Miika S <miika9764@gmail.com> --- hw/input/virtio-input-hid.c | 7 +++++++ qapi/ui.json | 5 ++++- ui/keycodemapdb | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c index e78faec0b1..9628d289f9 100644 --- a/hw/input/virtio-input-hid.c +++ b/hw/input/virtio-input-hid.c @@ -139,6 +139,13 @@ static const unsigned int keymap_qcode[Q_KEY_CODE__MAX] = { [Q_KEY_CODE_META_L] = KEY_LEFTMETA, [Q_KEY_CODE_META_R] = KEY_RIGHTMETA, [Q_KEY_CODE_MENU] = KEY_MENU, + + [Q_KEY_CODE_MUHENKAN] = KEY_MUHENKAN, + [Q_KEY_CODE_HENKAN] = KEY_HENKAN, + [Q_KEY_CODE_KATAKANAHIRAGANA] = KEY_KATAKANAHIRAGANA, + [Q_KEY_CODE_COMPOSE] = KEY_COMPOSE, + [Q_KEY_CODE_RO] = KEY_RO, + [Q_KEY_CODE_YEN] = KEY_YEN, }; static const unsigned int keymap_button[INPUT_BUTTON__MAX] = { diff --git a/qapi/ui.json b/qapi/ui.json index 07b468f625..d6679aa8f5 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -748,6 +748,9 @@ # @ac_bookmarks: since 2.10 # altgr, altgr_r: dropped in 2.10 # +# @muhenkan: since 2.12 +# @katakanahiragana: since 2.12 +# # 'sysrq' was mistakenly added to hack around the fact that # the ps2 driver was not generating correct scancodes sequences # when 'alt+print' was pressed. This flaw is now fixed and the @@ -775,7 +778,7 @@ 'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again', 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut', 'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause', - 'ro', 'hiragana', 'henkan', 'yen', + 'ro', 'hiragana', 'henkan', 'yen', 'muhenkan', 'katakanahiragana', 'kp_comma', 'kp_equals', 'power', 'sleep', 'wake', 'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute', 'volumeup', 'volumedown', 'mediaselect', diff --git a/ui/keycodemapdb b/ui/keycodemapdb index 10739aa260..05dad417e9 160000 --- a/ui/keycodemapdb +++ b/ui/keycodemapdb @@ -1 +1 @@ -Subproject commit 10739aa26051a5d49d88132604539d3ed085e72e +Subproject commit 05dad417e9d0b37ee1fba33056d91a6b734b3357 -- 2.15.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] input: add missing JIS keys to virtio input 2017-12-22 15:25 ` [Qemu-devel] [PATCH 1/3] input: add missing JIS keys " Miika S @ 2018-01-15 10:40 ` Daniel P. Berrange 0 siblings, 0 replies; 9+ messages in thread From: Daniel P. Berrange @ 2018-01-15 10:40 UTC (permalink / raw) To: Miika S; +Cc: qemu-devel, kraxel On Fri, Dec 22, 2017 at 05:25:29PM +0200, Miika S wrote: > keycodemapdb updated to add the QKeyCodes muhenkan and katakanahiragana > > Signed-off-by: Miika S <miika9764@gmail.com> > --- > hw/input/virtio-input-hid.c | 7 +++++++ > qapi/ui.json | 5 ++++- > ui/keycodemapdb | 2 +- > 3 files changed, 12 insertions(+), 2 deletions(-) Reviewed-by: Daniel P. Berrange <berrange@redhat.com> 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] 9+ messages in thread
* [Qemu-devel] [PATCH 2/3] input: add mouse side buttons to virtio input 2017-12-22 15:25 [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input Miika S 2017-12-22 15:25 ` [Qemu-devel] [PATCH 1/3] input: add missing JIS keys " Miika S @ 2017-12-22 15:25 ` Miika S 2017-12-22 15:25 ` [Qemu-devel] [PATCH 3/3] input: virtio: don't send mouse wheel event twice Miika S 2018-01-15 15:18 ` [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input Gerd Hoffmann 3 siblings, 0 replies; 9+ messages in thread From: Miika S @ 2017-12-22 15:25 UTC (permalink / raw) To: qemu-devel; +Cc: kraxel, berrange, Miika S Signed-off-by: Miika S <miika9764@gmail.com> --- hw/input/virtio-input-hid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c index 9628d289f9..2cac659469 100644 --- a/hw/input/virtio-input-hid.c +++ b/hw/input/virtio-input-hid.c @@ -154,6 +154,8 @@ static const unsigned int keymap_button[INPUT_BUTTON__MAX] = { [INPUT_BUTTON_MIDDLE] = BTN_MIDDLE, [INPUT_BUTTON_WHEEL_UP] = BTN_GEAR_UP, [INPUT_BUTTON_WHEEL_DOWN] = BTN_GEAR_DOWN, + [INPUT_BUTTON_SIDE] = BTN_SIDE, + [INPUT_BUTTON_EXTRA] = BTN_EXTRA, }; static const unsigned int axismap_rel[INPUT_AXIS__MAX] = { -- 2.15.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH 3/3] input: virtio: don't send mouse wheel event twice 2017-12-22 15:25 [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input Miika S 2017-12-22 15:25 ` [Qemu-devel] [PATCH 1/3] input: add missing JIS keys " Miika S 2017-12-22 15:25 ` [Qemu-devel] [PATCH 2/3] input: add mouse side buttons " Miika S @ 2017-12-22 15:25 ` Miika S 2018-01-15 15:18 ` [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input Gerd Hoffmann 3 siblings, 0 replies; 9+ messages in thread From: Miika S @ 2017-12-22 15:25 UTC (permalink / raw) To: qemu-devel; +Cc: kraxel, berrange, Miika S On Linux, a mouse event is generated for both down and up when mouse wheel is used. This caused virtio_input_send() to be called twice each time the wheel was used. This commit adds a check for the button down state and only calls virtio_input_send() when it is true. Signed-off-by: Miika S <miika9764@gmail.com> --- hw/input/virtio-input-hid.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c index 2cac659469..587616a932 100644 --- a/hw/input/virtio-input-hid.c +++ b/hw/input/virtio-input-hid.c @@ -225,8 +225,10 @@ static void virtio_input_handle_event(DeviceState *dev, QemuConsole *src, break; case INPUT_EVENT_KIND_BTN: btn = evt->u.btn.data; - if (vhid->wheel_axis && (btn->button == INPUT_BUTTON_WHEEL_UP || - btn->button == INPUT_BUTTON_WHEEL_DOWN)) { + if (vhid->wheel_axis && + (btn->button == INPUT_BUTTON_WHEEL_UP || + btn->button == INPUT_BUTTON_WHEEL_DOWN) && + btn->down) { event.type = cpu_to_le16(EV_REL); event.code = cpu_to_le16(REL_WHEEL); event.value = cpu_to_le32(btn->button == INPUT_BUTTON_WHEEL_UP -- 2.15.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input 2017-12-22 15:25 [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input Miika S ` (2 preceding siblings ...) 2017-12-22 15:25 ` [Qemu-devel] [PATCH 3/3] input: virtio: don't send mouse wheel event twice Miika S @ 2018-01-15 15:18 ` Gerd Hoffmann 2018-01-15 15:32 ` Daniel P. Berrange 3 siblings, 1 reply; 9+ messages in thread From: Gerd Hoffmann @ 2018-01-15 15:18 UTC (permalink / raw) To: Miika S; +Cc: qemu-devel, berrange Hi, > Miika S (3): > input: add mouse side buttons to virtio input > input: virtio: don't send mouse wheel event twice Cherry-picked these two ad the kbd update depends on the not-yet merged keycodemapdb update for virtio-keyboard. thanks, Gerd ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input 2018-01-15 15:18 ` [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input Gerd Hoffmann @ 2018-01-15 15:32 ` Daniel P. Berrange 2018-01-25 15:29 ` Gerd Hoffmann 0 siblings, 1 reply; 9+ messages in thread From: Daniel P. Berrange @ 2018-01-15 15:32 UTC (permalink / raw) To: Gerd Hoffmann; +Cc: Miika S, qemu-devel On Mon, Jan 15, 2018 at 04:18:53PM +0100, Gerd Hoffmann wrote: > Hi, > > > Miika S (3): > > input: add mouse side buttons to virtio input > > input: virtio: don't send mouse wheel event twice > > Cherry-picked these two ad the kbd update depends on the not-yet merged > keycodemapdb update for virtio-keyboard. It is merged actually in, so you can include the keycode fix too: https://git.qemu.org/gitweb.cgi?p=keycodemapdb.git;a=commit;h=05dad417e9d0b37ee1fba33056d91a6b734b3357 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] 9+ messages in thread
* Re: [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input 2018-01-15 15:32 ` Daniel P. Berrange @ 2018-01-25 15:29 ` Gerd Hoffmann 2018-01-25 15:33 ` Daniel P. Berrangé 0 siblings, 1 reply; 9+ messages in thread From: Gerd Hoffmann @ 2018-01-25 15:29 UTC (permalink / raw) To: Daniel P. Berrange; +Cc: Miika S, qemu-devel On Mon, Jan 15, 2018 at 03:32:33PM +0000, Daniel P. Berrange wrote: > On Mon, Jan 15, 2018 at 04:18:53PM +0100, Gerd Hoffmann wrote: > > Hi, > > > > > Miika S (3): > > > input: add mouse side buttons to virtio input > > > input: virtio: don't send mouse wheel event twice > > > > Cherry-picked these two ad the kbd update depends on the not-yet merged > > keycodemapdb update for virtio-keyboard. > > It is merged actually in, so you can include the keycode fix too: > > https://git.qemu.org/gitweb.cgi?p=keycodemapdb.git;a=commit;h=05dad417e9d0b37ee1fba33056d91a6b734b3357 To be exact: it conflicts (and I think also is obsoleted by) your patch "hw: convert virtio-input-hid device to keycodemapdb". cheers, Gerd ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input 2018-01-25 15:29 ` Gerd Hoffmann @ 2018-01-25 15:33 ` Daniel P. Berrangé 0 siblings, 0 replies; 9+ messages in thread From: Daniel P. Berrangé @ 2018-01-25 15:33 UTC (permalink / raw) To: Gerd Hoffmann; +Cc: Miika S, qemu-devel On Thu, Jan 25, 2018 at 04:29:23PM +0100, Gerd Hoffmann wrote: > On Mon, Jan 15, 2018 at 03:32:33PM +0000, Daniel P. Berrange wrote: > > On Mon, Jan 15, 2018 at 04:18:53PM +0100, Gerd Hoffmann wrote: > > > Hi, > > > > > > > Miika S (3): > > > > input: add mouse side buttons to virtio input > > > > input: virtio: don't send mouse wheel event twice > > > > > > Cherry-picked these two ad the kbd update depends on the not-yet merged > > > keycodemapdb update for virtio-keyboard. > > > > It is merged actually in, so you can include the keycode fix too: > > > > https://git.qemu.org/gitweb.cgi?p=keycodemapdb.git;a=commit;h=05dad417e9d0b37ee1fba33056d91a6b734b3357 > > To be exact: it conflicts (and I think also is obsoleted by) your patch > "hw: convert virtio-input-hid device to keycodemapdb". That patch doesn't touch keycodemapdb. I did obsolete it though in an unrelated series: https://lists.gnu.org/archive/html/qemu-devel/2018-01/msg03528.html You should be fine to just include all 3 of the patches in this series, if you do a pull request for this series, before that py3 series gets pulled. 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] 9+ messages in thread
end of thread, other threads:[~2018-01-25 15:33 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-12-22 15:25 [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input Miika S 2017-12-22 15:25 ` [Qemu-devel] [PATCH 1/3] input: add missing JIS keys " Miika S 2018-01-15 10:40 ` Daniel P. Berrange 2017-12-22 15:25 ` [Qemu-devel] [PATCH 2/3] input: add mouse side buttons " Miika S 2017-12-22 15:25 ` [Qemu-devel] [PATCH 3/3] input: virtio: don't send mouse wheel event twice Miika S 2018-01-15 15:18 ` [Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input Gerd Hoffmann 2018-01-15 15:32 ` Daniel P. Berrange 2018-01-25 15:29 ` Gerd Hoffmann 2018-01-25 15:33 ` Daniel P. Berrangé
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).