qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/2] ui/kbd-state: QAPI'fy QKbdModifier


From: Akihiko Odaki
Subject: Re: [PATCH 0/2] ui/kbd-state: QAPI'fy QKbdModifier
Date: Sat, 25 Feb 2023 12:19:37 +0900
User-agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2

On 2023/02/24 20:01, Philippe Mathieu-Daudé wrote:
QAPI seems designed to maintain such enums,
so convert QKbdModifier to be QAPI generated.
Besides, this is how QKeyCode is maintained.

I recognize QkbdModifier as more like an internal detail of displays so I'm not convinced it should be converted to QAPI.

The interface of QEMU's input subsystem is so simple: send key up or key down events for QKeyCode. The modifiers are not exceptions. However, some display backends (cocoa, sdl2, and vnc) are not designed this way, and has internal states for modifiers. For such displays, QkbdState maintains the states to help them convert their internal key state representation to key up/down events of QKeyCode.

QKbdModifier is used by displays only to query these internal states QkbdState holds. As such, the definition of QKbdModifier is very dependent of the internal working of displays. It is particularly designed to match the needs of vnc, and I even wonder if the modifier state tracking should be moved away from the common code of QkbdState to vnc.

Regards,
Akihiko Odaki


Philippe Mathieu-Daudé (2):
   ui/kbd-state: Rename QKbdModifier enum definitions
   ui/kbd-state: QAPI'fy QKbdModifier

  include/ui/kbd-state.h | 16 ----------------
  qapi/ui.json           | 10 ++++++++++
  ui/cocoa.m             |  2 +-
  ui/kbd-state.c         | 14 +++++++-------
  ui/keymaps.c           |  6 +++---
  ui/sdl2-input.c        |  2 +-
  ui/vnc.c               | 16 ++++++++--------
  7 files changed, 30 insertions(+), 36 deletions(-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]