From: Kitae Kim Date: Mon, 17 Dec 2012 06:23:14 +0000 (+0900) Subject: virtio-keyboard : Fixed a bug that some key events send wrong values. X-Git-Tag: TizenStudio_2.0_p2.3~1144 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e35a282e7df68e54ab79d0e24d0f473f6408821d;p=sdk%2Femulator%2Fqemu.git 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 --- 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); }