Skip to contentSkip to conversation

Add more function keys to QEMU

PATCH Superseded Programmingkid 3 participants 7 messages Jul 27, 2017 – Jul 28, 2017

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Add more function keys to QEMU

There are now keyboards that have 19 function keys. This patch extends QEMU so these function keys can be used.

---
 qapi-schema.json  | 6 +++++-
 ui/input-keymap.c | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)
qapi-schema.json +5 -1
index 9c6c3e1..a051820 100644
@@ -4842,6 +4842,10 @@
 # @hiragana: since 2.9
 # @henkan: since 2.9
 # @yen: since 2.9
+# @f16: since 2.10
+# @f17: since 2.10
+# @f18: since 2.10
+# @f19: since 2.10
 #
 # Since: 1.3.0
 #
@@ -4864,7 +4868,7 @@
             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
             'ro', 'hiragana', 'henkan', 'yen',
-            'kp_comma', 'kp_equals', 'power' ] }
+            'kp_comma', 'kp_equals', 'power', 'f16', 'f17', 'f18', 'f19'] }
 
 ##
 # @KeyValue:
ui/input-keymap.c +4 -0
index 8a1476f..d1169e3 100644
@@ -114,6 +114,10 @@ static const int qcode_to_number[] = {
 
     [Q_KEY_CODE_F11] = 0x57,
     [Q_KEY_CODE_F12] = 0x58,
+    [Q_KEY_CODE_F16] = 0x59,
+    [Q_KEY_CODE_F17] = 0x5a,
+    [Q_KEY_CODE_F18] = 0x5b,
+    [Q_KEY_CODE_F19] = 0x5c,
 
     [Q_KEY_CODE_PRINT] = 0xb7,
 
Signature · 1 line
2.7.2
#1 lore raw
Quoted 25 lines · Programmingkid

There are now keyboards that have 19 function keys. This patch extends QEMU so these function keys can be used.

---
 qapi-schema.json  | 6 +++++-
 ui/input-keymap.c | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)
qapi-schema.json +4 -0
index 9c6c3e1..a051820 100644
@@ -4842,6 +4842,10 @@
 # @hiragana: since 2.9
 # @henkan: since 2.9
 # @yen: since 2.9
+# @f16: since 2.10
+# @f17: since 2.10
+# @f18: since 2.10
+# @f19: since 2.10
 #
 # Since: 1.3.0
 #

qapi-schema.json line 4871

Quoted 5 lines
qapi-schema.json +1 -1
@@ -4864,7 +4868,7 @@
             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
             'ro', 'hiragana', 'henkan', 'yen',
-            'kp_comma', 'kp_equals', 'power' ] }
+            'kp_comma', 'kp_equals', 'power', 'f16', 'f17', 'f18', 'f19'] }

Linux and AT set 1 go all the way to F24, and OS-X goes to F20, so don't arbitrarily stop short at F19

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#2 lore raw
Quoted 38 lines · Daniel P. Berrange
Quoted 25 lines · Programmingkid

There are now keyboards that have 19 function keys. This patch extends QEMU so these function keys can be used.

---
qapi-schema.json | 6 +++++-
ui/input-keymap.c | 4 ++++

2 files changed, 9 insertions(+), 1 deletion(-)
qapi-schema.json +4 -0
index 9c6c3e1..a051820 100644
@@ -4842,6 +4842,10 @@
 # @hiragana: since 2.9
 # @henkan: since 2.9
 # @yen: since 2.9
+# @f16: since 2.10
+# @f17: since 2.10
+# @f18: since 2.10
+# @f19: since 2.10
 #
 # Since: 1.3.0
 #

qapi-schema.json line 4871

Quoted 5 lines
qapi-schema.json +1 -1
@@ -4864,7 +4868,7 @@
            'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
            'ro', 'hiragana', 'henkan', 'yen',
-            'kp_comma', 'kp_equals', 'power' ] }
+            'kp_comma', 'kp_equals', 'power', 'f16', 'f17', 'f18', 'f19'] }

Linux and AT set 1 go all the way to F24, and OS-X goes to F20, so don't arbitrarily stop short at F19

Quoted 2 lines

Regards,
Daniel

I think I will future-proof this patch by going all the way to F30.

#3 lore raw
Quoted 38 lines · Programmingkid
Quoted 29 lines · Daniel P. Berrange
Quoted 25 lines · Programmingkid

There are now keyboards that have 19 function keys. This patch extends QEMU so these function keys can be used.

---
qapi-schema.json | 6 +++++-
ui/input-keymap.c | 4 ++++

2 files changed, 9 insertions(+), 1 deletion(-)
qapi-schema.json +4 -0
index 9c6c3e1..a051820 100644
@@ -4842,6 +4842,10 @@
 # @hiragana: since 2.9
 # @henkan: since 2.9
 # @yen: since 2.9
+# @f16: since 2.10
+# @f17: since 2.10
+# @f18: since 2.10
+# @f19: since 2.10
 #
 # Since: 1.3.0
 #
@@ -4864,7 +4868,7 @@
Quoted 8 lines

qapi-schema.json line 4871

Quoted 5 lines
qapi-schema.json +1 -1
            'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
            'ro', 'hiragana', 'henkan', 'yen',
-            'kp_comma', 'kp_equals', 'power' ] }
+            'kp_comma', 'kp_equals', 'power', 'f16', 'f17', 'f18', 'f19'] }

Linux and AT set 1 go all the way to F24, and OS-X goes to F20, so don't arbitrarily stop short at F19

Quoted 1 line

I think I will future-proof this patch by going all the way to F30.

No, don't do that - we only want QKeyCodes that have a corresponding mapping in the Linux key names, so F24 is the max we should have.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#4 lore raw
In reply to Programmingkid

On 07/27/2017 09:51 AM, Programmingkid wrote:

You forgot in-reply-to: and references: headers, meaning this was not threaded with your 0/2 patch.

Quoted 7 lines

There are now keyboards that have 19 function keys. This patch extends QEMU so these function keys can be used.

---
 qapi-schema.json  | 6 +++++-
 ui/input-keymap.c | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

Conflicts with Gerd's pending UI pull; so you'll need to rebase. Furthermore, while Gerd added keys after softfreeze (necessary to fix a regression), your additions seem to be a new feature rather than a bug fix, and may therefore be more appropriate for 2.11.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#5 lore raw
Quoted 7 lines · Eric Blake

On 07/27/2017 09:51 AM, Programmingkid wrote:

You forgot in-reply-to: and references: headers, meaning this was not threaded with your 0/2 patch.

Git send-email doesn't work for me. It complains about missing Perl modules.

Quoted 9 lines
Quoted 8 lines

There are now keyboards that have 19 function keys. This patch extends QEMU so these function keys can be used.

---
qapi-schema.json | 6 +++++-
ui/input-keymap.c | 4 ++++

2 files changed, 9 insertions(+), 1 deletion(-)
Quoted 4 lines

Conflicts with Gerd's pending UI pull; so you'll need to rebase. Furthermore, while Gerd added keys after softfreeze (necessary to fix a regression), your additions seem to be a new feature rather than a bug fix, and may therefore be more appropriate for 2.11.

Good idea. I will change the 'since' values to 2.11 in the next patch.

#6 lore raw
Quoted 9 lines · Programmingkid
Quoted 7 lines · Eric Blake

On 07/27/2017 09:51 AM, Programmingkid wrote:

You forgot in-reply-to: and references: headers, meaning this was not threaded with your 0/2 patch.

Git send-email doesn't work for me. It complains about missing Perl modules.

Then install those modules. Need help? Pasting the actual error message (or googling for it) will probably speed you up.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org