On 08/10/2017 10:55 AM, Daniel P. Berrange wrote:
> Always use QKeyCode in the InputKeyEvent struct, by converting key
> numbers to QKeyCode at the time the event is created.
> 
> Signed-off-by: Daniel P. Berrange <berra...@redhat.com>
> ---
>  ui/input.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 

Reviewed-by: Eric Blake <ebl...@redhat.com>

> diff --git a/ui/input.c b/ui/input.c
> index af05f06368..64e9103a61 100644
> --- a/ui/input.c
> +++ b/ui/input.c
> @@ -400,10 +400,8 @@ void qemu_input_event_send_key(QemuConsole *src, 
> KeyValue *key, bool down)
>  
>  void qemu_input_event_send_key_number(QemuConsole *src, int num, bool down)
>  {
> -    KeyValue *key = g_new0(KeyValue, 1);
> -    key->type = KEY_VALUE_KIND_NUMBER;
> -    key->u.number.data = num;
> -    qemu_input_event_send_key(src, key, down);
> +    QKeyCode code = qemu_input_key_number_to_qcode(num);
> +    qemu_input_event_send_key_qcode(src, code, down);
>  }
>  
>  void qemu_input_event_send_key_qcode(QemuConsole *src, QKeyCode q, bool down)
> 

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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to