From b284fd19f08cbacf797f662b6e5fc69d62580a6d Mon Sep 17 00:00:00 2001 From: "don.hong" Date: Mon, 19 Mar 2012 23:34:42 +0900 Subject: [PATCH] [Title] Fixed a bug that emulator passes key inputs even though there is no usb keyboard. [Type] BugFix [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- input.c | 1 - tizen/src/mloop_event.c | 5 +++++ tizen/src/mloop_event.h | 3 +++ tizen/src/skin/maruskin_operation.c | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/input.c b/input.c index b5e42af667..37c88c7895 100644 --- a/input.c +++ b/input.c @@ -57,7 +57,6 @@ void qemu_remove_kbd_event_handler(void) void qemu_add_ps2kbd_event_handler(QEMUPutKBDEvent *func, void *opaque) { - qemu_add_kbd_event_handler(func,opaque); // temporary code for compatibility with Xserver qemu_put_ps2kbd_event_opaque = opaque; qemu_put_ps2kbd_event = func; } diff --git a/tizen/src/mloop_event.c b/tizen/src/mloop_event.c index cb4a60a1e0..dd78596e27 100644 --- a/tizen/src/mloop_event.c +++ b/tizen/src/mloop_event.c @@ -266,3 +266,8 @@ void mloop_evcmd_usbkbd_off(void) struct mloop_evpack pack = { htons(MLOOP_EVTYPE_USB_DEL), htons(13), "keyboard" }; mloop_evsock_send(&mloop, &pack); } + +int mloop_evcmd_get_usbkbd_status(void) +{ + return (usbkbd ? 1 : 0); +} diff --git a/tizen/src/mloop_event.h b/tizen/src/mloop_event.h index cc656a9ce9..48ae5089ca 100644 --- a/tizen/src/mloop_event.h +++ b/tizen/src/mloop_event.h @@ -38,6 +38,9 @@ void mloop_ev_stop(void); void mloop_evcmd_usbkbd_on(void); void mloop_evcmd_usbkbd_off(void); +int mloop_evcmd_get_usbkbd_status(void); + + #ifdef __cplusplus } #endif diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index f59b5f3a1c..cae7280575 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -85,6 +85,10 @@ void do_mouse_event( int event_type, int x, int y, int z ) { void do_key_event( int event_type, int keycode ) { TRACE( "key_event event_type:%d, keycode:%d\n", event_type, keycode ); + if (!mloop_evcmd_get_usbkbd_status()) { + return; + } + int scancode = javakeycode_to_scancode(keycode); if (scancode == -1) { INFO("cannot find scancode\n"); -- 2.34.1