Modified to reset multitap index when MULTITAP timer expired 86/96486/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Wed, 9 Nov 2016 05:38:20 +0000 (14:38 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Wed, 9 Nov 2016 07:06:28 +0000 (16:06 +0900)
Change-Id: I7c6464238e55e990611c17ebe4ea7eaf3766ffd7

scl/sclcontroller.cpp

index b652ada..ea9d472 100644 (file)
@@ -3574,6 +3574,24 @@ CSCLController::timer_event(const scl32 data)
         handler->on_event_key_clicked(key_event_desc);
 
         events->destroy_timer(id);
+
+        /* We have to reset multitap button state when MULTITAP timer expired */
+        sclboolean ended = FALSE;
+        sclwindow window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+        for (int loop = 0;loop < MAX_KEY && !ended;loop++) {
+            SclButtonContext *button_context = cache->get_cur_button_context(window, loop);
+            if (button_context) {
+                if (!(button_context->used)) {
+                    ended = TRUE;
+                } else {
+                    const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
+                    if (coordinate && coordinate->button_type == BUTTON_TYPE_MULTITAP) {
+                        button_context->multitap_index = 0;
+                    }
+                }
+            }
+        }
+
         return FALSE;
     }
     break;