Skip to contentSkip to conversation

Add more function keys support

PATCH In review John Arbuckle 2 participants 4 messages Jul 31, 2017 – Aug 1, 2017

lore
Share & tools
lore
#0 lore raw

v3 cover Add more function keys support

QEMU can only handle up to function key F15. These patches extend QEMU to F24.

John Arbuckle (2):
Add more function keys to QEMU
Add more function keys to cocoa.m

 qapi-schema.json  | 16 +++++++++++++++-
 ui/cocoa.m        |  5 +++++
 ui/input-keymap.c | 12 ++++++++++++
 3 files changed, 32 insertions(+), 1 deletion(-)
Signature · 1 line
2.11.0 (Apple Git-81)
#1 lore raw

PATCH v3 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  | 16 +++++++++++++++-
 ui/input-keymap.c | 12 ++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
qapi-schema.json +15 -1
index c96f0a26f6..f3433aabe6 100644
@@ -4862,6 +4862,18 @@
 # @ac_refresh: since 2.10
 # @ac_bookmarks: since 2.10
 # altgr, altgr_r: dropped in 2.10
+# @f13: since 2.11
+# @f14: since 2.11
+# @f15: since 2.11
+# @f16: since 2.11
+# @f17: since 2.11
+# @f18: since 2.11
+# @f19: since 2.11
+# @f20: since 2.11
+# @f21: since 2.11
+# @f22: since 2.11
+# @f23: since 2.11
+# @f24: since 2.11
 #
 # Since: 1.3.0
 #
@@ -4888,7 +4900,9 @@
             'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute',
             'volumeup', 'volumedown', 'mediaselect',
             'mail', 'calculator', 'computer',
-            'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmarks' ] }
+            'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmarks',
+            'f13', 'f14', 'f15', 'f16', 'f17', 'f18', 'f19', 'f20', 'f21',
+            'f22', 'f23', 'f24']}
 
 ##
 # @KeyValue:
ui/input-keymap.c +12 -0
index cf979c2ce9..21a25d9c63 100644
@@ -251,6 +251,18 @@ static const int qcode_to_number[] = {
 
     [Q_KEY_CODE_F11] = 0x57,
     [Q_KEY_CODE_F12] = 0x58,
+    [Q_KEY_CODE_F13] = 0x5d,
+    [Q_KEY_CODE_F14] = 0x5e,
+    [Q_KEY_CODE_F15] = 0x5f,
+    [Q_KEY_CODE_F16] = 0x55,
+    [Q_KEY_CODE_F17] = 0x83,
+    [Q_KEY_CODE_F18] = 0xf7,
+    [Q_KEY_CODE_F19] = 0x84,
+    [Q_KEY_CODE_F20] = 0x5a,
+    [Q_KEY_CODE_F21] = 0x74,
+    [Q_KEY_CODE_F22] = 0xf9,
+    [Q_KEY_CODE_F23] = 0x6d,
+    [Q_KEY_CODE_F24] = 0x6f,
 
     [Q_KEY_CODE_PRINT] = 0xb7,
 
Signature · 1 line
2.11.0 (Apple Git-81)
Reviewed-by on v3 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH v3 1/2] Add more function keys to QEMU

Quoted 7 lines · John Arbuckle

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

---
 qapi-schema.json  | 16 +++++++++++++++-
 ui/input-keymap.c | 12 ++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
Quoted 61 lines
qapi-schema.json +15 -1
index c96f0a26f6..f3433aabe6 100644
@@ -4862,6 +4862,18 @@
 # @ac_refresh: since 2.10
 # @ac_bookmarks: since 2.10
 # altgr, altgr_r: dropped in 2.10
+# @f13: since 2.11
+# @f14: since 2.11
+# @f15: since 2.11
+# @f16: since 2.11
+# @f17: since 2.11
+# @f18: since 2.11
+# @f19: since 2.11
+# @f20: since 2.11
+# @f21: since 2.11
+# @f22: since 2.11
+# @f23: since 2.11
+# @f24: since 2.11
 #
 # Since: 1.3.0
 #
@@ -4888,7 +4900,9 @@
             'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute',
             'volumeup', 'volumedown', 'mediaselect',
             'mail', 'calculator', 'computer',
-            'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmarks' ] }
+            'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmarks',
+            'f13', 'f14', 'f15', 'f16', 'f17', 'f18', 'f19', 'f20', 'f21',
+            'f22', 'f23', 'f24']}
 
 ##
 # @KeyValue:
ui/input-keymap.c +12 -0
index cf979c2ce9..21a25d9c63 100644
@@ -251,6 +251,18 @@ static const int qcode_to_number[] = {
 
     [Q_KEY_CODE_F11] = 0x57,
     [Q_KEY_CODE_F12] = 0x58,
+    [Q_KEY_CODE_F13] = 0x5d,
+    [Q_KEY_CODE_F14] = 0x5e,
+    [Q_KEY_CODE_F15] = 0x5f,
+    [Q_KEY_CODE_F16] = 0x55,
+    [Q_KEY_CODE_F17] = 0x83,
+    [Q_KEY_CODE_F18] = 0xf7,
+    [Q_KEY_CODE_F19] = 0x84,
+    [Q_KEY_CODE_F20] = 0x5a,
+    [Q_KEY_CODE_F21] = 0x74,
+    [Q_KEY_CODE_F22] = 0xf9,
+    [Q_KEY_CODE_F23] = 0x6d,
+    [Q_KEY_CODE_F24] = 0x6f,
 
     [Q_KEY_CODE_PRINT] = 0xb7,
 
Signature · 1 line
2.11.0 (Apple Git-81)

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 :|
#3 lore raw

PATCH v3 2/2 Add more function keys to cocoa.m

In reply to John Arbuckle
---
 ui/cocoa.m | 5 +++++
 1 file changed, 5 insertions(+)
ui/cocoa.m +5 -0
index 93e56d0518..edc7a65f7c 100644
@@ -225,6 +225,11 @@
     [kVK_F13] = Q_KEY_CODE_PRINT,
     [kVK_F14] = Q_KEY_CODE_SCROLL_LOCK,
     [kVK_F15] = Q_KEY_CODE_PAUSE,
+    [kVK_F16] = Q_KEY_CODE_F16,
+    [kVK_F17] = Q_KEY_CODE_F17,
+    [kVK_F18] = Q_KEY_CODE_F18,
+    [kVK_F19] = Q_KEY_CODE_F19,
+    [kVK_F20] = Q_KEY_CODE_F20
 
     /*
      * The eject and volume keys can't be used here because they are handled at
Signature · 1 line
2.11.0 (Apple Git-81)