From: GiWoong Kim Date: Mon, 29 Dec 2014 08:08:44 +0000 (+0900) Subject: touch: define multitouch_toggle_key_checking function X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~570 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F58%2F35258%2F2;p=sdk%2Femulator%2Fqemu.git touch: define multitouch_toggle_key_checking function Change-Id: I0584df8f97a2d01a027e32cd4e4132b77e92ef5e Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index e1bb9743b5..e2ea3bfdc4 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -200,73 +200,85 @@ void do_qt_keyboard_key_event(int event_type, int keycode) { } } -void do_keyboard_key_event(int event_type, +#if !defined(CONFIG_USE_SHM) && defined(CONFIG_SDL) +static void multitouch_toggle_key_checking(int event_type, int keycode, int state_mask, int key_location) { - int scancode = -1; + /* multi-touch checking */ + state_mask &= ~JAVA_KEYCODE_NO_FOCUS; - TRACE("Keyboard Key : event_type=%d, keycode=%d," - "state_mask=%d, key_location=%d\n", - event_type, keycode, state_mask, key_location); + if ((keycode == JAVA_KEYCODE_BIT_SHIFT && state_mask == JAVA_KEYCODE_BIT_CTRL) || + (keycode == JAVA_KEYCODE_BIT_CTRL && state_mask == JAVA_KEYCODE_BIT_SHIFT)) + { + if (KEY_PRESSED == event_type) { + get_emul_multi_touch_state()->multitouch_enable = 2; + + /* Before the Emulator starts multi-touch processing, + * add a first finger if user just switches on to the multi-touch mode + * while display dragging. */ + if (pressing_x != -1 && pressing_y != -1 && + pressing_origin_x != -1 && pressing_origin_y != -1) { + add_finger_point( + pressing_origin_x, pressing_origin_y, + pressing_x, pressing_y); + pressing_x = pressing_y = -1; + pressing_origin_x = pressing_origin_y = -1; -#if !defined(CONFIG_USE_SHM) && defined(CONFIG_SDL) - if (get_emul_max_touch_point() > 1) { - /* multi-touch checking */ - int state_mask_temp = state_mask & ~JAVA_KEYCODE_NO_FOCUS; - - if ((keycode == JAVA_KEYCODE_BIT_SHIFT && - state_mask_temp == JAVA_KEYCODE_BIT_CTRL) || - (keycode == JAVA_KEYCODE_BIT_CTRL && - state_mask_temp == JAVA_KEYCODE_BIT_SHIFT)) - { - if (KEY_PRESSED == event_type) { - get_emul_multi_touch_state()->multitouch_enable = 2; - - /* add a finger before start the multi-touch processing - if already exist the pressed touch in display */ - if (pressing_x != -1 && pressing_y != -1 && - pressing_origin_x != -1 && pressing_origin_y != -1) { - add_finger_point( - pressing_origin_x, pressing_origin_y, - pressing_x, pressing_y); - pressing_x = pressing_y = -1; - pressing_origin_x = pressing_origin_y = -1; - } - - INFO("enable multi-touch = mode 2\n"); + maru_display_update(); } - } - else if (keycode == JAVA_KEYCODE_BIT_CTRL || - keycode == JAVA_KEYCODE_BIT_SHIFT) - { - if (KEY_PRESSED == event_type) { - get_emul_multi_touch_state()->multitouch_enable = 1; - /* add a finger before start the multi-touch processing - if already exist the pressed touch in display */ - if (pressing_x != -1 && pressing_y != -1 && - pressing_origin_x != -1 && pressing_origin_y != -1) { - add_finger_point( - pressing_origin_x, pressing_origin_y, - pressing_x, pressing_y); - pressing_x = pressing_y = -1; - pressing_origin_x = pressing_origin_y = -1; - } - - INFO("enable multi-touch = mode 1\n"); - } else if (KEY_RELEASED == event_type) { - if (state_mask_temp == (JAVA_KEYCODE_BIT_CTRL | JAVA_KEYCODE_BIT_SHIFT)) { - get_emul_multi_touch_state()->multitouch_enable = 1; - INFO("enabled multi-touch = mode 1\'\n"); - } else { - clear_finger_slot(false); - INFO("disable multi-touch\n"); - } + INFO("enable multi-touch mode 2\n"); + } + } + else if (keycode == JAVA_KEYCODE_BIT_CTRL || + keycode == JAVA_KEYCODE_BIT_SHIFT) + { + if (KEY_PRESSED == event_type) { + get_emul_multi_touch_state()->multitouch_enable = 1; + + /* Before the Emulator starts multi-touch processing, + * add a first finger if user just switches on to the multi-touch mode + * while display dragging. */ + if (pressing_x != -1 && pressing_y != -1 && + pressing_origin_x != -1 && pressing_origin_y != -1) { + add_finger_point( + pressing_origin_x, pressing_origin_y, + pressing_x, pressing_y); + pressing_x = pressing_y = -1; + pressing_origin_x = pressing_origin_y = -1; maru_display_update(); } + + INFO("enable multi-touch mode 1\n"); + } else if (KEY_RELEASED == event_type) { + if (state_mask == (JAVA_KEYCODE_BIT_CTRL | JAVA_KEYCODE_BIT_SHIFT)) { + get_emul_multi_touch_state()->multitouch_enable = 1; + INFO("enable multi-touch mode 2->1\n"); + } else { + clear_finger_slot(false); + INFO("disable multi-touch\n"); + } + + maru_display_update(); } + } +} +#endif +void do_keyboard_key_event(int event_type, + int keycode, int state_mask, int key_location) +{ + int scancode = -1; + + TRACE("Keyboard Key : event_type=%d, keycode=%d," + "state_mask=%d, key_location=%d\n", + event_type, keycode, state_mask, key_location); + +#if !defined(CONFIG_USE_SHM) && defined(CONFIG_SDL) + if (get_emul_max_touch_point() > 1) { + multitouch_toggle_key_checking(event_type, + keycode, state_mask, key_location); } #endif