qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vasily Khoruzhick <anarsoul@gmail.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Vasily Khoruzhick <anarsoul@gmail.com>
Subject: [Qemu-devel] [PATCH 2/2] pxa2xx_keypad: Handle 0xe0xx keycodes
Date: Tue, 15 Feb 2011 15:27:29 +0200	[thread overview]
Message-ID: <1297776449-26609-2-git-send-email-anarsoul@gmail.com> (raw)
In-Reply-To: <1297776449-26609-1-git-send-email-anarsoul@gmail.com>

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 <anarsoul@gmail.com>
---
 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

  reply	other threads:[~2011-02-15 13:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 13:27 [Qemu-devel] [PATCH 1/2] pxa2xx_keypad: enhance emulation of KPAS, KPASMKP regs Vasily Khoruzhick
2011-02-15 13:27 ` Vasily Khoruzhick [this message]
2011-02-20 14:20 ` [Qemu-devel] " Vasily Khoruzhick
2011-02-20 19:29 ` [Qemu-devel] " Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1297776449-26609-2-git-send-email-anarsoul@gmail.com \
    --to=anarsoul@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).