m_last_pressed_window = window;
}
+ scl8 get_last_event_fired_key() {
+ return m_last_event_fired_key;
+ }
+ void set_last_event_fired_key(scl8 val) {
+ m_last_event_fired_key = val;
+ }
+ sclwindow get_last_event_fired_window() {
+ return m_last_event_fired_window;
+ }
+ void set_last_event_fired_window(sclwindow window) {
+ m_last_event_fired_window = window;
+ }
+
scltouchdevice get_last_touch_device_id() const {
return m_last_touch_device_id;
}
sclwindow m_last_pressed_window;
scl8 m_last_pressed_key;
+ sclwindow m_last_event_fired_window;
+ scl8 m_last_event_fired_key;
+
sclboolean m_tts_enabled;
scl8 m_cur_highlighted_key;
sclwindow m_cur_highlighted_window;
sub_layout_match = FALSE;
}
}
+
/* If this button is pressed */
if ( x >= coordinate->x - coordinate->add_hit_left &&
x < coordinate->x + coordinate->width + coordinate->add_hit_right &&
y < coordinate->y + coordinate->height + coordinate->add_hit_bottom &&
/* Process the event only if the this item's sublayout id is active one */
sub_layout_match ) {
- //utils->log("process_button_pressed_event___TRUE\n");
+ /* If currently shift mode is ON, and the last key was multitap, this means the shift did not
+ turned off because of multitap button. So we need to turn it off here forcibly */
+ sclwindow last_win = context->get_last_event_fired_window();
+ scl8 last_key = context->get_last_event_fired_key();
+ LOGD("last_win : %p last_key : :%d", last_win, last_key);
+ const SclLayoutKeyCoordinate *last_coordinate = cache->get_cur_layout_key_coordinate(last_win, last_key);
+ if (last_coordinate) {
+ LOGD("last_coordinate->button_type : %d", last_coordinate->button_type);
+ if (last_coordinate->button_type == BUTTON_TYPE_MULTITAP && context->get_shift_state() == SCL_SHIFT_STATE_ON) {
+ /* And if the multitap button was different from the one we are dealing with... */
+ LOGD("last_win %p window %p last_key %d key_index %d", last_win, window, last_key, key_index);
+ if (last_win != window || last_key != key_index) {
+ SclNotiShiftStateChangeDesc desc;
+ desc.ui_event_desc = NULL;
+ desc.shift_state = SCL_SHIFT_STATE_OFF;
+
+ SCLEventReturnType ret = handler->on_event_notification(SCL_UINOTITYPE_SHIFT_STATE_CHANGE, &desc);
+ if (ret == SCL_EVENT_PASS_ON) {
+ context->set_shift_state(SCL_SHIFT_STATE_OFF);
+ windows->update_window(windows->get_base_window());
+ }
+ }
+ }
+ }
/* If newly pressed key has type MULTI_TOUCH_TYPE_EXCLUSIVE, release all existing pressed events */
if (actual_event) {
sclboolean ret = FALSE;
sclboolean redraw = FALSE;
- sclboolean fireEvt = FALSE;
+ sclboolean fire_event = FALSE;
SCLKeyModifier key_modifier = KEY_MODIFIER_NONE;
- static sclwindow lastFiredWin = SCLWINDOW_INVALID;
- static sclbyte lastFiredKey = NOT_USED;
-
CSCLUtils *utils = CSCLUtils::get_instance();
CSCLFeedback *feedback = CSCLFeedback::get_instance();
CSCLWindows *windows = CSCLWindows::get_instance();
/* If this button's index is the same as the one initially pressed */
if (pressed_window == window && pressed_key == key_index) {
- fireEvt = TRUE;
+ fire_event = TRUE;
targetCoordinate = coordinate;
} else {
const SclLayoutKeyCoordinate *pressed_coordinate =
if (pressed_coordinate) {
if (check_event_transition_enabled(pressed_coordinate, coordinate)) {
- fireEvt = TRUE;
+ fire_event = TRUE;
targetCoordinate = pressed_coordinate;
} else {
ret = FALSE;
}
/* In case of mode change buttons, event should be fired only when it was pressed lastly */
- if (fireEvt) {
+ if (fire_event) {
if (coordinate->key_type == KEY_TYPE_MODECHANGE) {
if (touch_id != context->get_last_touch_device_id()) {
- fireEvt = FALSE;
+ fire_event = FALSE;
}
}
}
/* If this key's modifier is LONGKEY, this means the event is already fired so skip this one */
if (context->get_cur_key_modifier(touch_id) == KEY_MODIFIER_LONGKEY) {
- fireEvt = FALSE;
+ fire_event = FALSE;
}
/* Don't fire any events if we're in longkey state */
state->get_cur_action_state() != ACTION_STATE_POPUP_LONGKEY &&
state->get_cur_action_state() != ACTION_STATE_POPUP_REPEATKEY) {
/* An event occured? */
- if (fireEvt) {
+ if (fire_event) {
if (targetCoordinate) {
SCLShiftState shift_index = context->get_shift_state();
if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
case BUTTON_TYPE_MULTITAP:
case BUTTON_TYPE_ROTATION: {
if (targetCoordinate->button_type == BUTTON_TYPE_MULTITAP) {
- if (window == lastFiredWin && key_index == lastFiredKey) {
+ if (window == context->get_last_event_fired_window() &&
+ key_index == context->get_last_event_fired_key()) {
key_modifier = KEY_MODIFIER_MULTITAP_REPEAT;
} else {
key_modifier = KEY_MODIFIER_MULTITAP_START;
}
}
- lastFiredWin = window;
- lastFiredKey = key_index;
+ context->set_last_event_fired_window(window);
+ context->set_last_event_fired_key(key_index);
}
} else {
if (targetCoordinate) {