diff mbox

[1/2] Add more function keys to QEMU

Message ID 1920BE03-56F6-4E44-B9D2-0638A86FACB2@gmail.com
State New
Headers show

Commit Message

Programmingkid July 27, 2017, 2:51 p.m. UTC
There are now keyboards that have 19 function keys. This patch extends QEMU so these function keys can be used. 

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
---
 qapi-schema.json  | 6 +++++-
 ui/input-keymap.c | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

Comments

Daniel P. Berrangé July 27, 2017, 2:54 p.m. UTC | #1
On Thu, Jul 27, 2017 at 10:51:33AM -0400, Programmingkid wrote:
> There are now keyboards that have 19 function keys. This patch extends
> QEMU so these function keys can be used. 
> 
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> ---
>  qapi-schema.json  | 6 +++++-
>  ui/input-keymap.c | 4 ++++
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 9c6c3e1..a051820 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -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'] }

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
Eric Blake July 27, 2017, 2:55 p.m. UTC | #2
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.

> There are now keyboards that have 19 function keys. This patch extends QEMU so these function keys can be used. 
> 
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> ---
>  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.
Programmingkid July 28, 2017, 2:36 a.m. UTC | #3
> On Jul 27, 2017, at 10:54 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
> 
> On Thu, Jul 27, 2017 at 10:51:33AM -0400, Programmingkid wrote:
>> There are now keyboards that have 19 function keys. This patch extends
>> QEMU so these function keys can be used. 
>> 
>> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
>> ---
>> qapi-schema.json  | 6 +++++-
>> ui/input-keymap.c | 4 ++++
>> 2 files changed, 9 insertions(+), 1 deletion(-)
>> 
>> diff --git a/qapi-schema.json b/qapi-schema.json
>> index 9c6c3e1..a051820 100644
>> --- a/qapi-schema.json
>> +++ b/qapi-schema.json
>> @@ -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'] }
> 
> 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

I think I will future-proof this patch by going all the way to F30.
Programmingkid July 28, 2017, 2:37 a.m. UTC | #4
> On Jul 27, 2017, at 10:55 AM, Eric Blake <eblake@redhat.com> wrote:
> 
> 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. 

> 
>> There are now keyboards that have 19 function keys. This patch extends QEMU so these function keys can be used. 
>> 
>> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
>> ---
>> 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.

Good idea. I will change the 'since' values to 2.11 in the next patch.
Daniel P. Berrangé July 28, 2017, 8:15 a.m. UTC | #5
On Thu, Jul 27, 2017 at 10:36:02PM -0400, Programmingkid wrote:
> 
> > On Jul 27, 2017, at 10:54 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
> > 
> > On Thu, Jul 27, 2017 at 10:51:33AM -0400, Programmingkid wrote:
> >> There are now keyboards that have 19 function keys. This patch extends
> >> QEMU so these function keys can be used. 
> >> 
> >> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> >> ---
> >> qapi-schema.json  | 6 +++++-
> >> ui/input-keymap.c | 4 ++++
> >> 2 files changed, 9 insertions(+), 1 deletion(-)
> >> 
> >> diff --git a/qapi-schema.json b/qapi-schema.json
> >> index 9c6c3e1..a051820 100644
> >> --- a/qapi-schema.json
> >> +++ b/qapi-schema.json
> >> @@ -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'] }
> > 
> > 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
> 
> 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
Eric Blake July 28, 2017, 12:01 p.m. UTC | #6
On 07/27/2017 09:37 PM, Programmingkid wrote:
> 
>> On Jul 27, 2017, at 10:55 AM, Eric Blake <eblake@redhat.com> wrote:
>>
>> 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.
diff mbox

Patch

diff --git a/qapi-schema.json b/qapi-schema.json
index 9c6c3e1..a051820 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -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:
diff --git a/ui/input-keymap.c b/ui/input-keymap.c
index 8a1476f..d1169e3 100644
--- a/ui/input-keymap.c
+++ b/ui/input-keymap.c
@@ -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,