[Title] state_mask processing in do_key_event
authorgiwoong.kim <giwoong.kim@samsung.com>
Thu, 13 Sep 2012 11:54:59 +0000 (20:54 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Thu, 13 Sep 2012 11:54:59 +0000 (20:54 +0900)
[Type] enhancement
[Module] Emulator / touch
[Priority] major
[Jira#] N_SE-4001
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/maru_finger.c
tizen/src/maru_finger.h
tizen/src/skin/maruskin_operation.c

index c38a7d6..c42dbca 100644 (file)
@@ -279,7 +279,7 @@ FingerPoint *get_finger_point_search(int x, int y)
 static int _grab_finger_id = 0;
 #define QEMU_MOUSE_PRESSED 1
 #define QEMU_MOUSE_RELEASEED 0
-void maru_finger_processing_A(int touch_type, int origin_x, int origin_y, int x, int y)
+void maru_finger_processing_1(int touch_type, int origin_x, int origin_y, int x, int y)
 {
     MultiTouchState *mts = get_emul_multi_touch_state();
     FingerPoint *finger = NULL;
@@ -341,7 +341,7 @@ void maru_finger_processing_A(int touch_type, int origin_x, int origin_y, int x,
     }
 }
 
-void maru_finger_processing_B(int touch_type, int origin_x, int origin_y, int x, int y)
+void maru_finger_processing_2(int touch_type, int origin_x, int origin_y, int x, int y)
 {
     MultiTouchState *mts = get_emul_multi_touch_state();
     FingerPoint *finger = NULL;
index ad3b343..e004fd8 100644 (file)
@@ -64,8 +64,8 @@ void set_multi_touch_enable(int enable);
 int get_multi_touch_enable(void);
 FingerPoint *get_finger_point_from_slot(int index);
 FingerPoint *get_finger_point_search(int x, int y);
-void maru_finger_processing_A(int touch_type, int origin_x, int origin_y, int x, int y);
-void maru_finger_processing_B(int touch_type, int origin_x, int origin_y, int x, int y);
+void maru_finger_processing_1(int touch_type, int origin_x, int origin_y, int x, int y);
+void maru_finger_processing_2(int touch_type, int origin_x, int origin_y, int x, int y);
 int rearrange_finger_points(int lcd_w, int lcd_h, double scale_factor, int rotaton_type);
 void clear_finger_slot(void);
 void cleanup_multi_touch_state(void);
index b7cfb80..8c6e406 100644 (file)
@@ -97,10 +97,10 @@ void do_mouse_event(int button_type, int event_type,
 #ifndef USE_SHM
     /* multi-touch */
     if (get_emul_multi_touch_state()->multitouch_enable == 1) {
-        maru_finger_processing_A(event_type, origin_x, origin_y, x, y);
+        maru_finger_processing_1(event_type, origin_x, origin_y, x, y);
         return;
     } else if (get_emul_multi_touch_state()->multitouch_enable == 2) {
-        maru_finger_processing_B(event_type, origin_x, origin_y, x, y);
+        maru_finger_processing_2(event_type, origin_x, origin_y, x, y);
         return;
     }
 #endif
@@ -156,31 +156,36 @@ void do_key_event(int event_type, int keycode, int state_mask, int key_location)
 #ifndef USE_SHM
     //is multi-touch mode ?
     if (get_emul_max_touch_point() > 1) {
-        if (keycode == JAVA_KEYCODE_BIT_CTRL) {
+        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 = 1;
-                INFO("1)multi-touch enabled = A\n");
-            } else if (KEY_RELEASED == event_type) {
-                get_emul_multi_touch_state()->multitouch_enable = 0;
-                clear_finger_slot();
-                INFO("1)multi-touch disabled\n");
-            }
-        } else if (keycode == (JAVA_KEYCODE_NO_FOCUS | JAVA_KEYCODE_BIT_CTRL)) {
-            //release ctrl key when dragging
-            if (KEY_RELEASED == event_type) {
-                get_emul_multi_touch_state()->multitouch_enable = 0;
-                clear_finger_slot();
-                INFO("2)multi-touch disabled\n");
+                get_emul_multi_touch_state()->multitouch_enable = 2;
+                INFO("enable multi-touch = mode2\n");
             }
-        } else if (keycode == (JAVA_KEYCODE_BIT_SHIFT | JAVA_KEYCODE_BIT_CTRL)) {
+        }
+        else if (keycode == JAVA_KEYCODE_BIT_CTRL ||
+            keycode == JAVA_KEYCODE_BIT_SHIFT)
+        {
             if (KEY_PRESSED == event_type) {
-                get_emul_multi_touch_state()->multitouch_enable = 2;
-                INFO("2)multi-touch enabled = B\n");
-            } else if (KEY_RELEASED == event_type) {
                 get_emul_multi_touch_state()->multitouch_enable = 1;
-                INFO("2)multi-touch enabled = A\n");
+                INFO("enable multi-touch = mode1\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 = mode1\'\n");
+                } else {
+                    get_emul_multi_touch_state()->multitouch_enable = 0;
+                    clear_finger_slot();
+                    INFO("disable multi-touch\n");
+                }
             }
         }
+
     }
 #endif