All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/3] Ui 20170728 patches
@ 2017-07-28 12:59 Gerd Hoffmann
  2017-07-28 12:59 ` [Qemu-devel] [PULL 1/3] ui: correctly detect spice PAUSE scancode sequence Gerd Hoffmann
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2017-07-28 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: berrange, Gerd Hoffmann

The following changes since commit e01151de165070c25a1b202e9e2392950bd7c8da:

  Merge remote-tracking branch 'remotes/kraxel/tags/ui-20170727-pull-request' into staging (2017-07-27 15:27:06 +0100)

are available in the git repository at:

  git://git.kraxel.org/qemu tags/ui-20170728-pull-request

for you to fetch changes up to ef58430d5daeac4c18e4072f5860e25700aa8af6:

  ui: add pause key to linux_to_qcode (2017-07-28 12:35:40 +0200)

----------------------------------------------------------------
ui: more keymap fixes for 2.10

----------------------------------------------------------------

Daniel P. Berrange (1):
  ui: correctly detect spice PAUSE scancode sequence

Gerd Hoffmann (2):
  ui: drop ac_search and ac_stop
  ui: add pause key to linux_to_qcode

 hw/input/ps2.c    |  8 ++++----
 ui/input-keymap.c |  9 +++++----
 ui/spice-input.c  | 32 +++++++++++++-------------------
 qapi-schema.json  |  5 +----
 4 files changed, 23 insertions(+), 31 deletions(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PULL 1/3] ui: correctly detect spice PAUSE scancode sequence
  2017-07-28 12:59 [Qemu-devel] [PULL 0/3] Ui 20170728 patches Gerd Hoffmann
@ 2017-07-28 12:59 ` Gerd Hoffmann
  2017-07-28 12:59 ` [Qemu-devel] [PULL 2/3] ui: drop ac_search and ac_stop Gerd Hoffmann
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2017-07-28 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: berrange, Gerd Hoffmann

From: "Daniel P. Berrange" <berrange@redhat.com>

The SPICE input code is currently detcting 0xe1 0x1d 0x45 as
the PAUSE key make sequence and 0xe1 0x9d 0xc5 as the break
sequence. This is incorrect, because all 6 scancodes together
are the make sequence, and there is no break sequence.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 20170727174640.30359-1-berrange@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-input.c | 32 +++++++++++++-------------------
 1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/ui/spice-input.c b/ui/spice-input.c
index cda9976469..3d41aa1831 100644
--- a/ui/spice-input.c
+++ b/ui/spice-input.c
@@ -50,6 +50,7 @@ static const SpiceKbdInterface kbd_interface = {
 
 static void kbd_push_key(SpiceKbdInstance *sin, uint8_t scancode)
 {
+    static const uint8_t pauseseq[] = { 0xe1, 0x1d, 0x45, 0xe1, 0x9d, 0xc5 };
     QemuSpiceKbd *kbd = container_of(sin, QemuSpiceKbd, sin);
     int keycode;
     bool up;
@@ -58,6 +59,18 @@ static void kbd_push_key(SpiceKbdInstance *sin, uint8_t scancode)
         kbd->emul0 = true;
         return;
     }
+
+    if (scancode == pauseseq[kbd->pauseseq]) {
+        kbd->pauseseq++;
+        if (kbd->pauseseq == G_N_ELEMENTS(pauseseq)) {
+            qemu_input_event_send_key_qcode(NULL, Q_KEY_CODE_PAUSE, true);
+            kbd->pauseseq = 0;
+        }
+        return;
+    } else {
+        kbd->pauseseq = 0;
+    }
+
     keycode = scancode & ~SCANCODE_UP;
     up = scancode & SCANCODE_UP;
     if (kbd->emul0) {
@@ -65,25 +78,6 @@ static void kbd_push_key(SpiceKbdInstance *sin, uint8_t scancode)
         keycode |= SCANCODE_GREY;
     }
 
-    if (scancode == SCANCODE_EMUL1) {
-        kbd->pauseseq++;
-        return;
-    } else if (kbd->pauseseq == 1) {
-        if (keycode == 0x1d) {
-            kbd->pauseseq++;
-            return;
-        } else {
-            kbd->pauseseq = 0;
-        }
-    } else if (kbd->pauseseq == 2) {
-        if (keycode == 0x45) {
-            qemu_input_event_send_key_qcode(NULL, Q_KEY_CODE_PAUSE, !up);
-            kbd->pauseseq = 0;
-            return;
-        }
-        kbd->pauseseq = 0;
-    }
-
     qemu_input_event_send_key_number(NULL, keycode, !up);
 }
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PULL 2/3] ui: drop ac_search and ac_stop
  2017-07-28 12:59 [Qemu-devel] [PULL 0/3] Ui 20170728 patches Gerd Hoffmann
  2017-07-28 12:59 ` [Qemu-devel] [PULL 1/3] ui: correctly detect spice PAUSE scancode sequence Gerd Hoffmann
@ 2017-07-28 12:59 ` Gerd Hoffmann
  2017-07-28 12:59 ` [Qemu-devel] [PULL 3/3] ui: add pause key to linux_to_qcode Gerd Hoffmann
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2017-07-28 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: berrange, Gerd Hoffmann, Eric Blake, Markus Armbruster

Both keys exist already: "ac_search" is "find" and "ac_stop" is "stop".

Fixes: 37810e80553c19f0dac3644924895a9bf5c70785
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 20170728063415.27480-1-kraxel@redhat.com
---
 hw/input/ps2.c    | 8 ++++----
 ui/input-keymap.c | 8 ++++----
 qapi-schema.json  | 5 +----
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 9f057e46ea..77906d5f46 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -239,11 +239,11 @@ static const uint16_t qcode_to_keycode_set1[Q_KEY_CODE__MAX] = {
     [Q_KEY_CODE_MAIL] = 0xe06c,
     [Q_KEY_CODE_CALCULATOR] = 0xe021,
     [Q_KEY_CODE_COMPUTER] = 0xe06b,
-    [Q_KEY_CODE_AC_SEARCH] = 0xe065,
+    [Q_KEY_CODE_FIND] = 0xe065,
     [Q_KEY_CODE_AC_HOME] = 0xe032,
     [Q_KEY_CODE_AC_BACK] = 0xe06a,
     [Q_KEY_CODE_AC_FORWARD] = 0xe069,
-    [Q_KEY_CODE_AC_STOP] = 0xe068,
+    [Q_KEY_CODE_STOP] = 0xe068,
     [Q_KEY_CODE_AC_REFRESH] = 0xe067,
     [Q_KEY_CODE_AC_BOOKMARKS] = 0xe066,
 
@@ -379,11 +379,11 @@ static const uint16_t qcode_to_keycode_set2[Q_KEY_CODE__MAX] = {
     [Q_KEY_CODE_MAIL] = 0xe048,
     [Q_KEY_CODE_CALCULATOR] = 0xe02b,
     [Q_KEY_CODE_COMPUTER] = 0xe040,
-    [Q_KEY_CODE_AC_SEARCH] = 0xe010,
+    [Q_KEY_CODE_FIND] = 0xe010,
     [Q_KEY_CODE_AC_HOME] = 0xe03a,
     [Q_KEY_CODE_AC_BACK] = 0xe038,
     [Q_KEY_CODE_AC_FORWARD] = 0xe030,
-    [Q_KEY_CODE_AC_STOP] = 0xe028,
+    [Q_KEY_CODE_STOP] = 0xe028,
     [Q_KEY_CODE_AC_REFRESH] = 0xe020,
     [Q_KEY_CODE_AC_BOOKMARKS] = 0xe018,
 
diff --git a/ui/input-keymap.c b/ui/input-keymap.c
index 0d9ddde9c9..cdad5652d3 100644
--- a/ui/input-keymap.c
+++ b/ui/input-keymap.c
@@ -123,13 +123,13 @@ static int linux_to_qcode[KEY_CNT] = {
     [KEY_MAIL]           = Q_KEY_CODE_MAIL,
     [KEY_COMPUTER]       = Q_KEY_CODE_COMPUTER,
 
-    [KEY_STOP]           = Q_KEY_CODE_AC_STOP,
+    [KEY_STOP]           = Q_KEY_CODE_STOP,
     [KEY_BOOKMARKS]      = Q_KEY_CODE_AC_BOOKMARKS,
     [KEY_BACK]           = Q_KEY_CODE_AC_BACK,
     [KEY_FORWARD]        = Q_KEY_CODE_AC_FORWARD,
     [KEY_HOMEPAGE]       = Q_KEY_CODE_AC_HOME,
     [KEY_REFRESH]        = Q_KEY_CODE_AC_REFRESH,
-    [KEY_FIND]           = Q_KEY_CODE_AC_SEARCH,
+    [KEY_FIND]           = Q_KEY_CODE_FIND,
 
     [KEY_NEXTSONG]       = Q_KEY_CODE_AUDIONEXT,
     [KEY_PREVIOUSSONG]   = Q_KEY_CODE_AUDIOPREV,
@@ -279,13 +279,13 @@ static const int qcode_to_number[] = {
     [Q_KEY_CODE_MAIL] = 0xec,
     [Q_KEY_CODE_COMPUTER] = 0xeb,
 
-    [Q_KEY_CODE_AC_STOP] = 0xe8,
+    [Q_KEY_CODE_STOP] = 0xe8,
     [Q_KEY_CODE_AC_BOOKMARKS] = 0xe6,
     [Q_KEY_CODE_AC_BACK] = 0xea,
     [Q_KEY_CODE_AC_FORWARD] = 0xe9,
     [Q_KEY_CODE_AC_HOME] = 0xb2,
     [Q_KEY_CODE_AC_REFRESH] = 0xe7,
-    [Q_KEY_CODE_AC_SEARCH] = 0xe5,
+    [Q_KEY_CODE_FIND] = 0xe5,
 
     [Q_KEY_CODE_AUDIONEXT] = 0x99,
     [Q_KEY_CODE_AUDIOPREV] = 0x90,
diff --git a/qapi-schema.json b/qapi-schema.json
index dcc12c83a9..c96f0a26f6 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -4856,11 +4856,9 @@
 # @mail: since 2.10
 # @calculator: since 2.10
 # @computer: since 2.10
-# @ac_search: since 2.10
 # @ac_home: since 2.10
 # @ac_back: since 2.10
 # @ac_forward: since 2.10
-# @ac_stop: since 2.10
 # @ac_refresh: since 2.10
 # @ac_bookmarks: since 2.10
 # altgr, altgr_r: dropped in 2.10
@@ -4890,8 +4888,7 @@
             'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute',
             'volumeup', 'volumedown', 'mediaselect',
             'mail', 'calculator', 'computer',
-            'ac_search', 'ac_home', 'ac_back', 'ac_forward', 'ac_stop',
-            'ac_refresh', 'ac_bookmarks' ] }
+            'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmarks' ] }
 
 ##
 # @KeyValue:
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PULL 3/3] ui: add pause key to linux_to_qcode
  2017-07-28 12:59 [Qemu-devel] [PULL 0/3] Ui 20170728 patches Gerd Hoffmann
  2017-07-28 12:59 ` [Qemu-devel] [PULL 1/3] ui: correctly detect spice PAUSE scancode sequence Gerd Hoffmann
  2017-07-28 12:59 ` [Qemu-devel] [PULL 2/3] ui: drop ac_search and ac_stop Gerd Hoffmann
@ 2017-07-28 12:59 ` Gerd Hoffmann
  2017-07-28 13:20 ` [Qemu-devel] [PULL 0/3] Ui 20170728 patches Gerd Hoffmann
  2017-07-28 14:32 ` Peter Maydell
  4 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2017-07-28 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: berrange, Gerd Hoffmann

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 20170728063432.27578-1-kraxel@redhat.com
---
 ui/input-keymap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui/input-keymap.c b/ui/input-keymap.c
index cdad5652d3..cf979c2ce9 100644
--- a/ui/input-keymap.c
+++ b/ui/input-keymap.c
@@ -116,6 +116,7 @@ static int linux_to_qcode[KEY_CNT] = {
     [KEY_LEFTMETA]       = Q_KEY_CODE_META_L,
     [KEY_RIGHTMETA]      = Q_KEY_CODE_META_R,
     [KEY_MENU]           = Q_KEY_CODE_MENU,
+    [KEY_PAUSE]          = Q_KEY_CODE_PAUSE,
 
     [KEY_SLEEP]          = Q_KEY_CODE_SLEEP,
     [KEY_WAKEUP]         = Q_KEY_CODE_WAKE,
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PULL 0/3] Ui 20170728 patches
  2017-07-28 12:59 [Qemu-devel] [PULL 0/3] Ui 20170728 patches Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2017-07-28 12:59 ` [Qemu-devel] [PULL 3/3] ui: add pause key to linux_to_qcode Gerd Hoffmann
@ 2017-07-28 13:20 ` Gerd Hoffmann
  2017-07-28 13:25   ` Daniel P. Berrange
  2017-07-28 14:32 ` Peter Maydell
  4 siblings, 1 reply; 7+ messages in thread
From: Gerd Hoffmann @ 2017-07-28 13:20 UTC (permalink / raw)
  To: qemu-devel

  Hi,

> ui: more keymap fixes for 2.10

Rushing things a bit, because I'm about to disappear into my summer
vacation, so I want get the fixes out of the door.

This is just incremental fixes to yesterdays (somewhat rushed too) pull
request, so I don't expect more problems.  Should that not be the case:
 Daniel, can you take care while I'm offline?

thanks,
  Gerd

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PULL 0/3] Ui 20170728 patches
  2017-07-28 13:20 ` [Qemu-devel] [PULL 0/3] Ui 20170728 patches Gerd Hoffmann
@ 2017-07-28 13:25   ` Daniel P. Berrange
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel P. Berrange @ 2017-07-28 13:25 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On Fri, Jul 28, 2017 at 03:20:49PM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> > ui: more keymap fixes for 2.10
> 
> Rushing things a bit, because I'm about to disappear into my summer
> vacation, so I want get the fixes out of the door.
> 
> This is just incremental fixes to yesterdays (somewhat rushed too) pull
> request, so I don't expect more problems.  Should that not be the case:
>  Daniel, can you take care while I'm offline?

Sure, happy to look after any further release critical keymap or ui issues
while you're out.  NB, i'll be off from Aug 16th too though for the USA
Eclipse :-)

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] 7+ messages in thread

* Re: [Qemu-devel] [PULL 0/3] Ui 20170728 patches
  2017-07-28 12:59 [Qemu-devel] [PULL 0/3] Ui 20170728 patches Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2017-07-28 13:20 ` [Qemu-devel] [PULL 0/3] Ui 20170728 patches Gerd Hoffmann
@ 2017-07-28 14:32 ` Peter Maydell
  4 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2017-07-28 14:32 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 28 July 2017 at 13:59, Gerd Hoffmann <kraxel@redhat.com> wrote:
> The following changes since commit e01151de165070c25a1b202e9e2392950bd7c8da:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/ui-20170727-pull-request' into staging (2017-07-27 15:27:06 +0100)
>
> are available in the git repository at:
>
>   git://git.kraxel.org/qemu tags/ui-20170728-pull-request
>
> for you to fetch changes up to ef58430d5daeac4c18e4072f5860e25700aa8af6:
>
>   ui: add pause key to linux_to_qcode (2017-07-28 12:35:40 +0200)
>
> ----------------------------------------------------------------
> ui: more keymap fixes for 2.10
>
> ----------------------------------------------------------------
>
> Daniel P. Berrange (1):
>   ui: correctly detect spice PAUSE scancode sequence
>
> Gerd Hoffmann (2):
>   ui: drop ac_search and ac_stop
>   ui: add pause key to linux_to_qcode

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-07-28 14:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-28 12:59 [Qemu-devel] [PULL 0/3] Ui 20170728 patches Gerd Hoffmann
2017-07-28 12:59 ` [Qemu-devel] [PULL 1/3] ui: correctly detect spice PAUSE scancode sequence Gerd Hoffmann
2017-07-28 12:59 ` [Qemu-devel] [PULL 2/3] ui: drop ac_search and ac_stop Gerd Hoffmann
2017-07-28 12:59 ` [Qemu-devel] [PULL 3/3] ui: add pause key to linux_to_qcode Gerd Hoffmann
2017-07-28 13:20 ` [Qemu-devel] [PULL 0/3] Ui 20170728 patches Gerd Hoffmann
2017-07-28 13:25   ` Daniel P. Berrange
2017-07-28 14:32 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.