Emit MOVE type drag_state_change event regardless of button type 00/112900/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 3 Feb 2017 07:15:48 +0000 (16:15 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Fri, 3 Feb 2017 08:17:27 +0000 (17:17 +0900)
Change-Id: Ie2b0cc03560dd7d8e7e6b3f5b8e7ea9deeaf10c3

scl/sclcontroller.cpp

index 9834155..38b3217 100644 (file)
@@ -2914,6 +2914,25 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
             }
         }
 
+        SclUIEventDesc desc;
+        SCLShiftState shift_index = context->get_shift_state();
+        if (context->get_caps_lock_mode()) {
+            shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+        }
+        if (coordinate) {
+            desc.key_type = coordinate->key_type;
+            desc.key_value = coordinate->key_value[shift_index][0];
+            desc.key_event = coordinate->key_event[shift_index][0];
+        }
+        desc.event_type = EVENT_TYPE_MOVE;
+        desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
+        desc.mouse_current_point = context->get_cur_moving_point(touch_id);
+        desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
+
+        if (handler && handler->on_event_drag_state_changed(desc) != SCL_EVENT_PASS_ON) {
+            return FALSE;
+        }
+
         /* FIXME : Add a condition to skip this code if longkey timer is not active */
         /* If the mouse has moved out of threshold value of longkey keypress area, destroy longkey timer */
         if (m_long_key_cancel_distance > 0) {
@@ -3042,21 +3061,7 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
                     }
                 }
                 if (dist > direction_recog_dist) {
-                    SclUIEventDesc desc;
-                    SCLShiftState shift_index = context->get_shift_state();
-                    if (context->get_caps_lock_mode()) {
-                        shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
-                    }
-                    desc.key_type = coordinate->key_type;
-                    desc.key_value = coordinate->key_value[shift_index][0];
-                    desc.key_event = coordinate->key_event[shift_index][0];
-                    desc.event_type = EVENT_TYPE_MOVE;
-                    desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
-                    desc.mouse_current_point = context->get_cur_moving_point(touch_id);
-                    desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
-                    desc.key_modifier = key_modifier;
-
-                    if (handler && handler->on_event_drag_state_changed(desc) && context->get_magnifier_enabled()) {
+                    if (context->get_magnifier_enabled()) {
                         update_magnifier = TRUE;
                     }
                 }
@@ -3118,21 +3123,7 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
                             }
                         }
 
-                        SclUIEventDesc desc;
-                        SCLShiftState shift_index = context->get_shift_state();
-                        if (context->get_caps_lock_mode()) {
-                            shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
-                        }
-                        desc.key_type = coordinate->key_type;
-                        desc.key_value = coordinate->key_value[shift_index][0];
-                        desc.key_event = coordinate->key_event[shift_index][0];
-                        desc.event_type = EVENT_TYPE_MOVE;
-                        desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
-                        desc.mouse_current_point = context->get_cur_moving_point(touch_id);
-                        desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
-                        desc.key_modifier = key_modifier;
-
-                        if (handler && handler->on_event_drag_state_changed(desc) && context->get_magnifier_enabled()) {
+                        if (context->get_magnifier_enabled()) {
                             update_magnifier = TRUE;
                         }
                     }