[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 16/44] adb.c: prevent NO_KEY value from going to guest
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 16/44] adb.c: prevent NO_KEY value from going to guest |
Date: |
Thu, 22 Sep 2016 16:37:14 +1000 |
From: John Arbuckle <address@hidden>
The NO_KEY value should not be sent to the guest. This patch drops that value.
Signed-off-by: John Arbuckle <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/input/adb.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/hw/input/adb.c b/hw/input/adb.c
index 12c6333..3d39368 100644
--- a/hw/input/adb.c
+++ b/hw/input/adb.c
@@ -62,6 +62,9 @@ do { printf("ADB: " fmt , ## __VA_ARGS__); } while (0)
/* error codes */
#define ADB_RET_NOTPRESENT (-2)
+/* The adb keyboard doesn't have every key imaginable */
+#define NO_KEY 0xff
+
static void adb_device_reset(ADBDevice *d)
{
qdev_reset_all(DEVICE(d));
@@ -191,6 +194,8 @@ typedef struct ADBKeyboardClass {
} ADBKeyboardClass;
int qcode_to_adb_keycode[] = {
+ /* Make sure future additions are automatically set to NO_KEY */
+ [0 ... 0xff] = NO_KEY,
[Q_KEY_CODE_SHIFT] = ADB_KEY_LEFT_SHIFT,
[Q_KEY_CODE_SHIFT_R] = ADB_KEY_RIGHT_SHIFT,
@@ -306,19 +311,6 @@ int qcode_to_adb_keycode[] = {
[Q_KEY_CODE_PGUP] = ADB_KEY_PAGE_UP,
[Q_KEY_CODE_PGDN] = ADB_KEY_PAGE_DOWN,
- [Q_KEY_CODE_LESS] = 0xa,
- [Q_KEY_CODE_STOP] = 0,
- [Q_KEY_CODE_AGAIN] = 0,
- [Q_KEY_CODE_PROPS] = 0,
- [Q_KEY_CODE_UNDO] = 0,
- [Q_KEY_CODE_FRONT] = 0,
- [Q_KEY_CODE_COPY] = 0,
- [Q_KEY_CODE_OPEN] = 0,
- [Q_KEY_CODE_PASTE] = 0,
- [Q_KEY_CODE_FIND] = 0,
- [Q_KEY_CODE_CUT] = 0,
- [Q_KEY_CODE_LF] = 0,
- [Q_KEY_CODE_COMPOSE] = 0,
[Q_KEY_CODE_POWER] = ADB_KEY_POWER
};
@@ -446,7 +438,10 @@ static void adb_keyboard_event(DeviceState *dev,
QemuConsole *src,
return;
}
keycode = qcode_to_adb_keycode[qcode];
-
+ if (keycode == NO_KEY) { /* We don't want to send this to the guest */
+ ADB_DPRINTF("Ignoring NO_KEY\n");
+ return;
+ }
if (evt->u.key.data->down == false) { /* if key release event */
keycode = keycode | 0x80; /* create keyboard break code */
}
--
2.7.4
- [Qemu-ppc] [PULL 12/44] MAINTAINERS: add sPAPR tests, (continued)
- [Qemu-ppc] [PULL 12/44] MAINTAINERS: add sPAPR tests, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 20/44] spapr_llan: convert to trace framework instead of DPRINTF, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 32/44] target-ppc: add lxsi[bw]zx instruction, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 36/44] target-ppc: add TLB_NEED_LOCAL_FLUSH flag, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 40/44] ppc/xics: account correct irq status, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 31/44] target-ppc: add xxspltib instruction, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 35/44] spapr: Introduce sPAPRCPUCoreClass, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 10/44] libqos: define SPAPR libqos functions, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 18/44] spapr_rtas: convert to trace framework instead of DPRINTF, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 17/44] spapr_drc: convert to trace framework instead of DPRINTF, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 16/44] adb.c: prevent NO_KEY value from going to guest,
David Gibson <=
- [Qemu-ppc] [PULL 15/44] adb.c: correct several key assignments, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 09/44] qtest: replace strtoXX() by qemu_strtoXX(), David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 33/44] target-ppc: add stxsi[bh]x instruction, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 34/44] target-ppc: implement darn instruction, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 42/44] ppc/kvm: Mark 64kB page size support as disabled if not available, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 43/44] linux-user: ppc64: fix ARCH_206 bit in AT_HWCAP, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 26/44] target-ppc: convert st64 to use new macro, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 23/44] target-ppc: convert ld64 to use new macro, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 08/44] ppc: Fix signal delivery in ppc-user and ppc64-user, David Gibson, 2016/09/22
- [Qemu-ppc] [PULL 22/44] target-ppc: consolidate load operations, David Gibson, 2016/09/22