Received: from eggs.gnu.org ([2001:4830:134:3::10]:55537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vujkt-0004TO-Ep for qemu-devel@nongnu.org; Sun, 22 Dec 2013 09:11:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vujks-0007u1-De for qemu-devel@nongnu.org; Sun, 22 Dec 2013 09:11:43 -0500 Received: from qemu.weilnetz.de ([2a03:4000:2:362::1]:46786 helo=v2201305906712890.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vujks-0007tx-6F for qemu-devel@nongnu.org; Sun, 22 Dec 2013 09:11:42 -0500 From: Stefan Weil Date: Sun, 22 Dec 2013 15:11:36 +0100 Message-Id: <1387721496-28197-1-git-send-email-sw@weilnetz.de> Subject: [Qemu-devel] [PATCH] mainstone: Fix duplicate array values for key 'space' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-stable@nongnu.org, Stefan Weil cgcc reported a duplicate initialisation. Mainstone includes a matrix keyboard where two different positions map to 'space'. QEMU uses the reversed mapping and cannot map 'space' to two different matrix positions. Signed-off-by: Stefan Weil --- Of course we could also randomly select one of the two matrix positions, but I assume that this is not necessary. I don't know any mainstone internals, so I had to look into the Linux code where I noticed some discrepancies which should be clarified: Extract from Linux: KEY(1, 5, KEY_LEFTSHIFT), KEY(2, 5, KEY_SPACE), KEY(3, 5, KEY_SPACE), KEY(4, 5, KEY_ENTER), KEY(5, 5, KEY_BACKSPACE), Extract from QEMU: [0x2a] = {5,1}, /* shift */ [0x39] = {5,2}, /* space */ [0x39] = {5,3}, /* space */ [0x1c] = {5,5}, /* enter */ It looks like the 'enter' key is not mapped correctly, and 'backspace' is missing. Regards, Stefan hw/arm/mainstone.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c index 9402c84..223a4b1 100644 --- a/hw/arm/mainstone.c +++ b/hw/arm/mainstone.c @@ -76,7 +76,9 @@ static struct keymap map[0xE0] = { [0xc7] = {5,0}, /* Home */ [0x2a] = {5,1}, /* shift */ [0x39] = {5,2}, /* space */ +#if 0 /* always map to first column, row pair */ [0x39] = {5,3}, /* space */ +#endif [0x1c] = {5,5}, /* enter */ [0xc8] = {6,0}, /* up */ [0xd0] = {6,1}, /* down */ -- 1.7.10.4