}
}
-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