提交 582798b5 编写于 作者: V Vasily Khoruzhick 提交者: Aurelien Jarno

pxa2xx_keypad: Handle 0xe0xx keycodes

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: NVasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 b976b4c0
...@@ -83,6 +83,7 @@ struct PXA2xxKeyPadState { ...@@ -83,6 +83,7 @@ struct PXA2xxKeyPadState {
qemu_irq irq; qemu_irq irq;
struct keymap *map; struct keymap *map;
int pressed_cnt; int pressed_cnt;
int alt_code;
uint32_t kpc; uint32_t kpc;
uint32_t kpdk; uint32_t kpdk;
...@@ -116,6 +117,11 @@ static void pxa27x_keyboard_event (PXA2xxKeyPadState *kp, int keycode) ...@@ -116,6 +117,11 @@ static void pxa27x_keyboard_event (PXA2xxKeyPadState *kp, int keycode)
int row, col, rel, assert_irq = 0; int row, col, rel, assert_irq = 0;
uint32_t val; uint32_t val;
if (keycode == 0xe0) {
kp->alt_code = 1;
return;
}
if(!(kp->kpc & KPC_ME)) /* skip if not enabled */ if(!(kp->kpc & KPC_ME)) /* skip if not enabled */
return; return;
...@@ -125,6 +131,10 @@ static void pxa27x_keyboard_event (PXA2xxKeyPadState *kp, int keycode) ...@@ -125,6 +131,10 @@ static void pxa27x_keyboard_event (PXA2xxKeyPadState *kp, int keycode)
rel = (keycode & 0x80) ? 1 : 0; /* key release from qemu */ rel = (keycode & 0x80) ? 1 : 0; /* key release from qemu */
keycode &= ~(0x80); /* strip qemu key release bit */ keycode &= ~(0x80); /* strip qemu key release bit */
if (kp->alt_code) {
keycode |= 0x80;
kp->alt_code = 0;
}
row = kp->map[keycode].row; row = kp->map[keycode].row;
col = kp->map[keycode].column; col = kp->map[keycode].column;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册