From e35a282e7df68e54ab79d0e24d0f473f6408821d Mon Sep 17 00:00:00 2001 From: Kitae Kim Date: Mon, 17 Dec 2012 15:23:14 +0900 Subject: [PATCH] virtio-keyboard : Fixed a bug that some key events send wrong values. There is a bug that right ctrl, alt and enter of keypad in the keyboard send wrong value because a routine for those keys was missing. In addition, removed sonar violations in C. Signed-off-by: Kitae Kim --- tizen/src/hw/maru_virtio_keyboard.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tizen/src/hw/maru_virtio_keyboard.c b/tizen/src/hw/maru_virtio_keyboard.c index 9926a5f..ce005c2 100644 --- a/tizen/src/hw/maru_virtio_keyboard.c +++ b/tizen/src/hw/maru_virtio_keyboard.c @@ -92,7 +92,6 @@ void virtio_keyboard_notify(void *opaque) return; } - // TODO : need to lock?? qemu_mutex_lock(&vkbd->event_mutex); written_cnt = vkbd->kbdqueue.wptr; TRACE("[Enter] virtqueue notifier. %d\n", written_cnt); @@ -165,6 +164,15 @@ static void virtio_keyboard_event(void *opaque, int keycode) if (keycode < 0xe0) { if (vkbd->extension_key) { switch (keycode & 0x7f) { + case 28: // KP_Enter + kbdevt.code = 96; + break; + case 29: // Right Ctrl + kbdevt.code = 97; + break; + case 56: // Right Alt + kbdevt.code = 100; + break; case 71: // Home kbdevt.code = 102; break; @@ -247,7 +255,6 @@ VirtIODevice *virtio_keyboard_init(DeviceState *dev) memset(&vkbd->kbdqueue, 0x00, sizeof(vkbd->kbdqueue)); vkbd->extension_key = 0; -// vkbd->attached = 1; qemu_mutex_init(&vkbd->event_mutex); @@ -266,6 +273,5 @@ void virtio_keyboard_exit(VirtIODevice *vdev) VirtIOKeyboard *vkbd = (VirtIOKeyboard *)vdev; INFO("destroy device\n"); -// vkbd->attached = 0; virtio_cleanup(vdev); } -- 2.7.4