virtio-keyboard : Fixed a bug that some key events send wrong values.
authorKitae Kim <kt920.kim@samsung.com>
Mon, 17 Dec 2012 06:23:14 +0000 (15:23 +0900)
committerKitae Kim <kt920.kim@samsung.com>
Mon, 17 Dec 2012 06:23:14 +0000 (15:23 +0900)
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 <kt920.kim@samsung.com>
tizen/src/hw/maru_virtio_keyboard.c

index 9926a5f..ce005c2 100644 (file)
@@ -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);
 }