diff options
author | jinhyung.jo <jinhyung.jo@samsung.com> | 2013-07-08 16:18:03 +0900 |
---|---|---|
committer | jinhyung.jo <jinhyung.jo@samsung.com> | 2013-07-08 16:18:03 +0900 |
commit | 1c0416cbdd536c4d06bca5b7f9ac6fdf6b5938c1 (patch) | |
tree | 13dff1ca59dfa34bd5c202c12886a7b1d86ec092 /ui | |
parent | ed2adbfb4b187b76e6dfb9b6b56a50454571dedb (diff) | |
download | qemu-1c0416cbdd536c4d06bca5b7f9ac6fdf6b5938c1.tar.gz qemu-1c0416cbdd536c4d06bca5b7f9ac6fdf6b5938c1.tar.bz2 qemu-1c0416cbdd536c4d06bca5b7f9ac6fdf6b5938c1.zip |
merge some files, and delete some duplicated files
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/input.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/ui/input.c b/ui/input.c index 8ca1a03e12..b4a43e84a8 100644 --- a/ui/input.c +++ b/ui/input.c @@ -28,6 +28,9 @@ #include "qapi/error.h" #include "qmp-commands.h" #include "qapi-types.h" +//#include "tizen/src/debug_ch.h" + +//MULTI_DEBUG_CHANNEL(tizen, input); struct QEMUPutMouseEntry { QEMUPutMouseEvent *qemu_put_mouse_event; @@ -61,6 +64,10 @@ static QTAILQ_HEAD(, QEMUPutMouseEntry) mouse_handlers = QTAILQ_HEAD_INITIALIZER(mouse_handlers); static NotifierList mouse_mode_notifiers = NOTIFIER_LIST_INITIALIZER(mouse_mode_notifiers); +#ifdef CONFIG_MARU +static QTAILQ_HEAD(, QEMUPutKbdEntry) ps2kbd_handlers = + QTAILQ_HEAD_INITIALIZER(ps2kbd_handlers); +#endif static const int key_defs[] = { [Q_KEY_CODE_SHIFT] = 0x2a, @@ -327,6 +334,25 @@ void qemu_remove_kbd_event_handler(QEMUPutKbdEntry *entry) QTAILQ_REMOVE(&kbd_handlers, entry, next); } +#ifdef CONFIG_MARU +/* use ps2kbd device as a hardkey device. */ +QEMUPutKbdEntry *qemu_add_ps2kbd_event_handler(QEMUPutKBDEvent *func, void *opaque) +{ + QEMUPutKbdEntry *entry; + + entry = g_malloc0(sizeof(QEMUPutKbdEntry)); + entry->put_kbd = func; + entry->opaque = opaque; + QTAILQ_INSERT_HEAD(&ps2kbd_handlers, entry, next); + return entry; +} + +void qemu_remove_ps2kbd_event_handler(QEMUPutKbdEntry *entry) +{ + QTAILQ_REMOVE(&ps2kbd_handlers, entry, next); +} +#endif + static void check_mode_change(void) { static int current_is_absolute, current_has_absolute; @@ -417,6 +443,16 @@ void kbd_put_keycode(int keycode) entry->put_kbd(entry->opaque, keycode); } } +#ifdef CONFIG_MARU +void kbd_put_keycode(int keycode) +{ + QEMUPutKbdEntry *entry = QTAILQ_FIRST(&ps2kbd_handlers); + + if (entry) { + entry->put_kbd(entry->opaque, keycode); + } +} +#endif void kbd_put_ledstate(int ledstate) { @@ -440,11 +476,32 @@ void kbd_mouse_event(int dx, int dy, int dz, int buttons_state) if (QTAILQ_EMPTY(&mouse_handlers)) { return; } +#if defined (CONFIG_MARU) + QTAILQ_FOREACH(entry, &mouse_handlers, node) { + /* if mouse event is wheelup ,wheeldown or move + then go to ps2 mouse event(index == 0) */ + if((buttons_state > 3 && entry->index == 0)) { + //INFO("input device: %s, event: %d\n", entry->qemu_put_mouse_event_name, buttons_state); + buttons_state = 0;~ + mouse_event = entry->qemu_put_mouse_event; + mouse_event_opaque = entry->qemu_put_mouse_event_opaque; + break; + } + } + /* other events(mouse up, down and drag), go to touch screen */ + if(!entry) { + entry = QTAILQ_FIRST(&mouse_handlers); + mouse_event = entry->qemu_put_mouse_event; + mouse_event_opaque = entry->qemu_put_mouse_event_opaque; + //INFO("input device: %s, event: %d\n", entry->qemu_put_mouse_event_name, buttons_state); + } +#else entry = QTAILQ_FIRST(&mouse_handlers); mouse_event = entry->qemu_put_mouse_event; mouse_event_opaque = entry->qemu_put_mouse_event_opaque; +#endif if (mouse_event) { if (entry->qemu_put_mouse_event_absolute) { |