From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41900 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PpKzi-0005mP-NY for qemu-devel@nongnu.org; Tue, 15 Feb 2011 08:31:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PpKzg-0002UI-EV for qemu-devel@nongnu.org; Tue, 15 Feb 2011 08:31:05 -0500 Received: from mail-fx0-f45.google.com ([209.85.161.45]:63720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PpKzg-0002Qd-8k for qemu-devel@nongnu.org; Tue, 15 Feb 2011 08:31:04 -0500 Received: by mail-fx0-f45.google.com with SMTP id 12so192316fxm.4 for ; Tue, 15 Feb 2011 05:31:04 -0800 (PST) From: Vasily Khoruzhick Date: Tue, 15 Feb 2011 15:27:29 +0200 Message-Id: <1297776449-26609-2-git-send-email-anarsoul@gmail.com> In-Reply-To: <1297776449-26609-1-git-send-email-anarsoul@gmail.com> References: <1297776449-26609-1-git-send-email-anarsoul@gmail.com> Subject: [Qemu-devel] [PATCH 2/2] pxa2xx_keypad: Handle 0xe0xx keycodes List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" Cc: Vasily Khoruzhick Add handling of 0xe0xx keycodes to pxa2xx_driver. Extended keycodes in keymap should be marked with most significant bit set (i.e. 0x80). Without this patch it's not possible to handle i.e. cursor keys. Signed-off-by: Vasily Khoruzhick --- hw/pxa2xx_keypad.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/pxa2xx_keypad.c b/hw/pxa2xx_keypad.c index 5b8890b..d77dbf1 100644 --- a/hw/pxa2xx_keypad.c +++ b/hw/pxa2xx_keypad.c @@ -83,6 +83,7 @@ struct PXA2xxKeyPadState { qemu_irq irq; struct keymap *map; int pressed_cnt; + int alt_code; uint32_t kpc; uint32_t kpdk; @@ -116,6 +117,11 @@ static void pxa27x_keyboard_event (PXA2xxKeyPadState *kp, int keycode) int row, col, rel, assert_irq = 0; uint32_t val; + if (keycode == 0xe0) { + kp->alt_code = 1; + return; + } + if(!(kp->kpc & KPC_ME)) /* skip if not enabled */ return; @@ -125,6 +131,10 @@ static void pxa27x_keyboard_event (PXA2xxKeyPadState *kp, int keycode) rel = (keycode & 0x80) ? 1 : 0; /* key release from qemu */ keycode &= ~(0x80); /* strip qemu key release bit */ + if (kp->alt_code) { + keycode |= 0x80; + kp->alt_code = 0; + } row = kp->map[keycode].row; col = kp->map[keycode].column; -- 1.7.4