All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: akong@redhat.com, qemu-devel@nongnu.org, avi@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/3] qmp: qmp_send_key(): accept key codes in hex
Date: Fri, 21 Sep 2012 12:18:36 -0600	[thread overview]
Message-ID: <505CAF7C.5040403@redhat.com> (raw)
In-Reply-To: <20120921142634.2d4707c4@doriath.home>

[-- Attachment #1: Type: text/plain, Size: 1051 bytes --]

On 09/21/2012 11:26 AM, Luiz Capitulino wrote:
> On Fri, 21 Sep 2012 13:42:34 -0300
> Luiz Capitulino <lcapitulino@redhat.com> wrote:
> 

>>>> +{ 'union': 'KeyValue',
>>>> +  'data': {
>>>> +    'hex': 'int',
     +    'qcode': 'QKeyCode',
>>>
>>> Don't you find it a bit odd to name this 'hex', even though it works to
>>> do 'hex':32 as a synonym for 'hex':0x20?  Should we instead name it
>>> 'value', since we don't care in what base the value was represented,
>>> only that JSON was able to decode the base into a value?
>>
>> Yes, that's a good point. I'll respin.
> 
> Actually, this also has drawbacks:
> 
>             keylist->value->kind = KEY_VALUE_KIND_VALUE;
>             keylist->value->value = value;

> Any better ideas?

Maybe s/hex/number/, as in:

JSON: 'number':0x20

C code: keylist->value->number = number;

that is, you are passing the value either as a keycode name, or as a number.

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 617 bytes --]

  reply	other threads:[~2012-09-21 18:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 14:55 [Qemu-devel] [PATCH v2 0/3]: qmp: send-key: accept key codes in hex Luiz Capitulino
2012-09-21 14:55 ` [Qemu-devel] [PATCH 1/3] input: qmp_send_key(): simplify Luiz Capitulino
2012-09-21 14:55 ` [Qemu-devel] [PATCH 2/3] qmp: qmp_send_key(): accept key codes in hex Luiz Capitulino
2012-09-21 16:31   ` Eric Blake
2012-09-21 16:42     ` Luiz Capitulino
2012-09-21 17:26       ` Luiz Capitulino
2012-09-21 18:18         ` Eric Blake [this message]
2012-09-21 18:20           ` Eric Blake
2012-09-23  8:49             ` Avi Kivity
2012-09-21 18:20         ` Markus Armbruster
2012-09-21 14:55 ` [Qemu-devel] [PATCH 3/3] input: index_from_key(): drop unused code Luiz Capitulino
2012-09-21 16:32 ` [Qemu-devel] [PATCH v2 0/3]: qmp: send-key: accept key codes in hex Eric Blake
  -- strict thread matches above, loose matches on Subject: below --
2012-09-26 20:25 [Qemu-devel] [PATCH v3 0/3] " Luiz Capitulino
2012-09-26 20:25 ` [Qemu-devel] [PATCH 2/3] qmp: qmp_send_key(): " Luiz Capitulino
2012-09-27 11:42   ` Markus Armbruster
2012-09-27 12:57     ` Luiz Capitulino
2012-09-20 18:17 [Qemu-devel] [PATCH 0/3]: qmp: send-key: " Luiz Capitulino
2012-09-20 18:18 ` [Qemu-devel] [PATCH 2/3] qmp: qmp_send_key(): " Luiz Capitulino
2012-09-20 20:36   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505CAF7C.5040403@redhat.com \
    --to=eblake@redhat.com \
    --cc=akong@redhat.com \
    --cc=avi@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.