aboutsummaryrefslogtreecommitdiff
path: root/hw/char/escc.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/char/escc.c')
-rw-r--r--hw/char/escc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/char/escc.c b/hw/char/escc.c
index 98a1c21a89..c7a24ac421 100644
--- a/hw/char/escc.c
+++ b/hw/char/escc.c
@@ -842,14 +842,16 @@ static void sunkbd_handle_event(DeviceState *dev, QemuConsole *src,
{
ChannelState *s = (ChannelState *)dev;
int qcode, keycode;
+ InputKeyEvent *key;
assert(evt->type == INPUT_EVENT_KIND_KEY);
- qcode = qemu_input_key_value_to_qcode(evt->u.key->key);
+ key = evt->u.key;
+ qcode = qemu_input_key_value_to_qcode(key->key);
trace_escc_sunkbd_event_in(qcode, QKeyCode_lookup[qcode],
- evt->u.key->down);
+ key->down);
if (qcode == Q_KEY_CODE_CAPS_LOCK) {
- if (evt->u.key->down) {
+ if (key->down) {
s->caps_lock_mode ^= 1;
if (s->caps_lock_mode == 2) {
return; /* Drop second press */
@@ -863,7 +865,7 @@ static void sunkbd_handle_event(DeviceState *dev, QemuConsole *src,
}
if (qcode == Q_KEY_CODE_NUM_LOCK) {
- if (evt->u.key->down) {
+ if (key->down) {
s->num_lock_mode ^= 1;
if (s->num_lock_mode == 2) {
return; /* Drop second press */
@@ -877,7 +879,7 @@ static void sunkbd_handle_event(DeviceState *dev, QemuConsole *src,
}
keycode = qcode_to_keycode[qcode];
- if (!evt->u.key->down) {
+ if (!key->down) {
keycode |= 0x80;
}
trace_escc_sunkbd_event_out(keycode);