[clutter/android-enter-leave: 9/29] android: more keycode support
- From: Lionel Landwerlin <llandwerlin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/android-enter-leave: 9/29] android: more keycode support
- Date: Wed, 11 Jul 2012 17:07:49 +0000 (UTC)
commit 04842a781b31f30ba88bf04f055224dd9d413206
Author: Lionel Landwerlin <llandwerlin gmail com>
Date: Sun May 27 22:46:34 2012 +0100
android: more keycode support
clutter/android/clutter-android-application.c | 11 +-
clutter/android/clutter-android-keycodes.c | 297 ++++++++++++++++++++++---
2 files changed, 266 insertions(+), 42 deletions(-)
---
diff --git a/clutter/android/clutter-android-application.c b/clutter/android/clutter-android-application.c
index 11dbcad..d0b2f6d 100644
--- a/clutter/android/clutter-android-application.c
+++ b/clutter/android/clutter-android-application.c
@@ -39,6 +39,7 @@
#include "clutter-stage-private.h"
#include "clutter-android-application-private.h"
+#include "clutter-android-keycodes.h"
#include "clutter-stage-android.h"
#include "android_native_app_glue.h"
@@ -334,7 +335,7 @@ translate_key_event (AInputEvent *a_event)
return FALSE;
}
- _clutter_android_translate_key_event (event,
+ _clutter_android_translate_key_event ((ClutterKeyEvent *) event,
application->modifier_state,
a_event);
@@ -427,12 +428,12 @@ clutter_android_application_show_keyboard (ClutterAndroidApplication *applicatio
g_message ("hiding keyboard");
if (implicit)
ret = _android_show_keyboard (application->android_application,
- JNI_FALSE,
- ANATIVEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY);
+ JNI_FALSE,
+ ANATIVEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY);
else
ret = _android_show_keyboard (application->android_application,
- JNI_FALSE,
- ANATIVEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS);
+ JNI_FALSE,
+ ANATIVEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS);
}
g_message ("THE FucK %i", ret);
diff --git a/clutter/android/clutter-android-keycodes.c b/clutter/android/clutter-android-keycodes.c
index 86d1b65..2c01050 100644
--- a/clutter/android/clutter-android-keycodes.c
+++ b/clutter/android/clutter-android-keycodes.c
@@ -56,32 +56,32 @@ static guint keycodes[AKEYCODE_BUTTON_MODE + 1] = {
CLUTTER_KEY_PowerOff, /* AKEYCODE_POWER = 26, */
CLUTTER_KEY_WebCam, /* AKEYCODE_CAMERA = 27, */
CLUTTER_KEY_Clear, /* AKEYCODE_CLEAR = 28, */
- CLUTTER_KEY_A, /* AKEYCODE_A = 29, */
- CLUTTER_KEY_B, /* AKEYCODE_B = 30, */
- CLUTTER_KEY_C, /* AKEYCODE_C = 31, */
- CLUTTER_KEY_D, /* AKEYCODE_D = 32, */
- CLUTTER_KEY_E, /* AKEYCODE_E = 33, */
- CLUTTER_KEY_F, /* AKEYCODE_F = 34, */
- CLUTTER_KEY_G, /* AKEYCODE_G = 35, */
- CLUTTER_KEY_H, /* AKEYCODE_H = 36, */
- CLUTTER_KEY_I, /* AKEYCODE_I = 37, */
- CLUTTER_KEY_J, /* AKEYCODE_J = 38, */
- CLUTTER_KEY_K, /* AKEYCODE_K = 39, */
- CLUTTER_KEY_L, /* AKEYCODE_L = 40, */
- CLUTTER_KEY_M, /* AKEYCODE_M = 41, */
- CLUTTER_KEY_N, /* AKEYCODE_N = 42, */
- CLUTTER_KEY_O, /* AKEYCODE_O = 43, */
- CLUTTER_KEY_P, /* AKEYCODE_P = 44, */
- CLUTTER_KEY_Q, /* AKEYCODE_Q = 45, */
- CLUTTER_KEY_R, /* AKEYCODE_R = 46, */
- CLUTTER_KEY_S, /* AKEYCODE_S = 47, */
- CLUTTER_KEY_T, /* AKEYCODE_T = 48, */
- CLUTTER_KEY_U, /* AKEYCODE_U = 49, */
- CLUTTER_KEY_V, /* AKEYCODE_V = 50, */
- CLUTTER_KEY_W, /* AKEYCODE_W = 51, */
- CLUTTER_KEY_X, /* AKEYCODE_X = 52, */
- CLUTTER_KEY_Y, /* AKEYCODE_Y = 53, */
- CLUTTER_KEY_Z, /* AKEYCODE_Z = 54, */
+ CLUTTER_KEY_a, /* AKEYCODE_A = 29, */
+ CLUTTER_KEY_b, /* AKEYCODE_B = 30, */
+ CLUTTER_KEY_c, /* AKEYCODE_C = 31, */
+ CLUTTER_KEY_d, /* AKEYCODE_D = 32, */
+ CLUTTER_KEY_e, /* AKEYCODE_E = 33, */
+ CLUTTER_KEY_f, /* AKEYCODE_F = 34, */
+ CLUTTER_KEY_g, /* AKEYCODE_G = 35, */
+ CLUTTER_KEY_h, /* AKEYCODE_H = 36, */
+ CLUTTER_KEY_i, /* AKEYCODE_I = 37, */
+ CLUTTER_KEY_j, /* AKEYCODE_J = 38, */
+ CLUTTER_KEY_k, /* AKEYCODE_K = 39, */
+ CLUTTER_KEY_l, /* AKEYCODE_L = 40, */
+ CLUTTER_KEY_m, /* AKEYCODE_M = 41, */
+ CLUTTER_KEY_n, /* AKEYCODE_N = 42, */
+ CLUTTER_KEY_o, /* AKEYCODE_O = 43, */
+ CLUTTER_KEY_p, /* AKEYCODE_P = 44, */
+ CLUTTER_KEY_q, /* AKEYCODE_Q = 45, */
+ CLUTTER_KEY_r, /* AKEYCODE_R = 46, */
+ CLUTTER_KEY_s, /* AKEYCODE_S = 47, */
+ CLUTTER_KEY_t, /* AKEYCODE_T = 48, */
+ CLUTTER_KEY_u, /* AKEYCODE_U = 49, */
+ CLUTTER_KEY_v, /* AKEYCODE_V = 50, */
+ CLUTTER_KEY_w, /* AKEYCODE_W = 51, */
+ CLUTTER_KEY_x, /* AKEYCODE_X = 52, */
+ CLUTTER_KEY_y, /* AKEYCODE_Y = 53, */
+ CLUTTER_KEY_z, /* AKEYCODE_Z = 54, */
CLUTTER_KEY_comma, /* AKEYCODE_COMMA = 55, */
CLUTTER_KEY_period, /* AKEYCODE_PERIOD = 56, */
CLUTTER_KEY_Alt_L, /* AKEYCODE_ALT_LEFT = 57, */
@@ -140,6 +140,234 @@ static guint keycodes[AKEYCODE_BUTTON_MODE + 1] = {
CLUTTER_KEY_VoidSymbol /* AKEYCODE_BUTTON_MODE = 110, */
};
+static guint shifted_keycodes[AKEYCODE_BUTTON_MODE + 1] = {
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_UNKNOWN = 0, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SOFT_LEFT = 1, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SOFT_RIGHT = 2, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_HOME = 3, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BACK = 4, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_CALL = 5, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_ENDCALL = 6, */
+ CLUTTER_KEY_parenright, /* AKEYCODE_0 = 7, */
+ CLUTTER_KEY_exclam, /* AKEYCODE_1 = 8, */
+ CLUTTER_KEY_quotedbl, /* AKEYCODE_2 = 9, */
+ CLUTTER_KEY_ssharp, /* AKEYCODE_3 = 10, */
+ CLUTTER_KEY_dollar, /* AKEYCODE_4 = 11, */
+ CLUTTER_KEY_percent, /* AKEYCODE_5 = 12, */
+ CLUTTER_KEY_upcaret, /* AKEYCODE_6 = 13, */
+ CLUTTER_KEY_ampersand, /* AKEYCODE_7 = 14, */
+ CLUTTER_KEY_asterisk, /* AKEYCODE_8 = 15, */
+ CLUTTER_KEY_parenleft, /* AKEYCODE_9 = 16, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_STAR = 17, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_POUND = 18, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_DPAD_UP = 19, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_DPAD_DOWN = 20, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_DPAD_LEFT = 21, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_DPAD_RIGHT = 22, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_DPAD_CENTER = 23, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_VOLUME_UP = 24, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_VOLUME_DOWN = 25, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_POWER = 26, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_CAMERA = 27, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_CLEAR = 28, */
+ CLUTTER_KEY_A, /* AKEYCODE_A = 29, */
+ CLUTTER_KEY_B, /* AKEYCODE_B = 30, */
+ CLUTTER_KEY_C, /* AKEYCODE_C = 31, */
+ CLUTTER_KEY_D, /* AKEYCODE_D = 32, */
+ CLUTTER_KEY_E, /* AKEYCODE_E = 33, */
+ CLUTTER_KEY_F, /* AKEYCODE_F = 34, */
+ CLUTTER_KEY_G, /* AKEYCODE_G = 35, */
+ CLUTTER_KEY_H, /* AKEYCODE_H = 36, */
+ CLUTTER_KEY_I, /* AKEYCODE_I = 37, */
+ CLUTTER_KEY_J, /* AKEYCODE_J = 38, */
+ CLUTTER_KEY_K, /* AKEYCODE_K = 39, */
+ CLUTTER_KEY_L, /* AKEYCODE_L = 40, */
+ CLUTTER_KEY_M, /* AKEYCODE_M = 41, */
+ CLUTTER_KEY_N, /* AKEYCODE_N = 42, */
+ CLUTTER_KEY_O, /* AKEYCODE_O = 43, */
+ CLUTTER_KEY_P, /* AKEYCODE_P = 44, */
+ CLUTTER_KEY_Q, /* AKEYCODE_Q = 45, */
+ CLUTTER_KEY_R, /* AKEYCODE_R = 46, */
+ CLUTTER_KEY_S, /* AKEYCODE_S = 47, */
+ CLUTTER_KEY_T, /* AKEYCODE_T = 48, */
+ CLUTTER_KEY_U, /* AKEYCODE_U = 49, */
+ CLUTTER_KEY_V, /* AKEYCODE_V = 50, */
+ CLUTTER_KEY_W, /* AKEYCODE_W = 51, */
+ CLUTTER_KEY_X, /* AKEYCODE_X = 52, */
+ CLUTTER_KEY_Y, /* AKEYCODE_Y = 53, */
+ CLUTTER_KEY_Z, /* AKEYCODE_Z = 54, */
+ CLUTTER_KEY_less, /* AKEYCODE_COMMA = 55, */
+ CLUTTER_KEY_period, /* AKEYCODE_PERIOD = 56, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_ALT_LEFT = 57, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_ALT_RIGHT = 58, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SHIFT_LEFT = 59, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SHIFT_RIGHT = 60, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_TAB = 61, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SPACE = 62, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SYM = 63, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_EXPLORER = 64, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_ENVELOPE = 65, */
+ CLUTTER_KEY_Return, /* AKEYCODE_ENTER = 66, */
+ CLUTTER_KEY_BackSpace, /* AKEYCODE_DEL = 67, */
+ CLUTTER_KEY_asciitilde, /* AKEYCODE_GRAVE = 68, */
+ CLUTTER_KEY_underscore, /* AKEYCODE_MINUS = 69, */
+ CLUTTER_KEY_equal, /* AKEYCODE_EQUALS = 70, */
+ CLUTTER_KEY_braceleft, /* AKEYCODE_LEFT_BRACKET = 71, */
+ CLUTTER_KEY_braceright, /* AKEYCODE_RIGHT_BRACKET = 72, */
+ CLUTTER_KEY_vertbar, /* AKEYCODE_BACKSLASH = 73, */
+ CLUTTER_KEY_colon, /* AKEYCODE_SEMICOLON = 74, */
+ CLUTTER_KEY_asciitilde, /* AKEYCODE_APOSTROPHE = 75, */
+ CLUTTER_KEY_question, /* AKEYCODE_SLASH = 76, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_AT = 77, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_NUM = 78, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_HEADSETHOOK = 79, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_FOCUS = 80, // *Camera* focus */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_PLUS = 81, */
+ CLUTTER_KEY_Menu, /* AKEYCODE_MENU = 82, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_NOTIFICATION = 83, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SEARCH = 84, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MEDIA_PLAY_PAUSE= 85, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MEDIA_STOP = 86, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MEDIA_NEXT = 87, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MEDIA_PREVIOUS = 88, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MEDIA_REWIND = 89, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MEDIA_FAST_FORWARD = 90, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MUTE = 91, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_PAGE_UP = 92, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_PAGE_DOWN = 93, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_PICTSYMBOLS = 94, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SWITCH_CHARSET = 95, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_A = 96, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_B = 97, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_C = 98, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_X = 99, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_Y = 100, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_Z = 101, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_L1 = 102, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_R1 = 103, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_L2 = 104, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_R2 = 105, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_THUMBL = 106, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_THUMBR = 107, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_START = 108, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_SELECT = 109, */
+ CLUTTER_KEY_VoidSymbol /* AKEYCODE_BUTTON_MODE = 110, */
+};
+
+static guint alted_keycodes[AKEYCODE_BUTTON_MODE + 1] = {
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_UNKNOWN = 0, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SOFT_LEFT = 1, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SOFT_RIGHT = 2, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_HOME = 3, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BACK = 4, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_CALL = 5, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_ENDCALL = 6, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_0 = 7, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_1 = 8, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_2 = 9, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_3 = 10, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_4 = 11, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_5 = 12, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_6 = 13, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_7 = 14, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_8 = 15, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_9 = 16, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_STAR = 17, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_POUND = 18, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_DPAD_UP = 19, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_DPAD_DOWN = 20, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_DPAD_LEFT = 21, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_DPAD_RIGHT = 22, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_DPAD_CENTER = 23, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_VOLUME_UP = 24, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_VOLUME_DOWN = 25, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_POWER = 26, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_CAMERA = 27, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_CLEAR = 28, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_A = 29, */
+ CLUTTER_KEY_less, /* AKEYCODE_B = 30, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_C = 31, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_D = 32, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_E = 33, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_F = 34, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_G = 35, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_H = 36, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_I = 37, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_J = 38, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_K = 39, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_L = 40, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_M = 41, */
+ CLUTTER_KEY_greater, /* AKEYCODE_N = 42, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_O = 43, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_P = 44, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_Q = 45, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_R = 46, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_S = 47, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_T = 48, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_U = 49, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_V = 50, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_W = 51, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_X = 52, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_Y = 53, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_Z = 54, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_COMMA = 55, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_PERIOD = 56, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_ALT_LEFT = 57, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_ALT_RIGHT = 58, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SHIFT_LEFT = 59, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SHIFT_RIGHT = 60, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_TAB = 61, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SPACE = 62, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SYM = 63, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_EXPLORER = 64, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_ENVELOPE = 65, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_ENTER = 66, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_DEL = 67, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_GRAVE = 68, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MINUS = 69, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_EQUALS = 70, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_LEFT_BRACKET = 71, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_RIGHT_BRACKET = 72, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BACKSLASH = 73, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SEMICOLON = 74, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_APOSTROPHE = 75, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SLASH = 76, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_AT = 77, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_NUM = 78, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_HEADSETHOOK = 79, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_FOCUS = 80, // *Camera* focus */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_PLUS = 81, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MENU = 82, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_NOTIFICATION = 83, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SEARCH = 84, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MEDIA_PLAY_PAUSE= 85, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MEDIA_STOP = 86, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MEDIA_NEXT = 87, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MEDIA_PREVIOUS = 88, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MEDIA_REWIND = 89, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MEDIA_FAST_FORWARD = 90, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_MUTE = 91, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_PAGE_UP = 92, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_PAGE_DOWN = 93, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_PICTSYMBOLS = 94, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_SWITCH_CHARSET = 95, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_A = 96, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_B = 97, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_C = 98, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_X = 99, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_Y = 100, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_Z = 101, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_L1 = 102, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_R1 = 103, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_L2 = 104, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_R2 = 105, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_THUMBL = 106, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_THUMBR = 107, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_START = 108, */
+ CLUTTER_KEY_VoidSymbol, /* AKEYCODE_BUTTON_SELECT = 109, */
+ CLUTTER_KEY_VoidSymbol /* AKEYCODE_BUTTON_MODE = 110, */
+};
+
static ClutterModifierType
_translate_modifier_state (int32_t modifier_state)
{
@@ -167,18 +395,13 @@ _clutter_android_translate_key_event (ClutterKeyEvent *event,
return;
}
- if (keycode >= AKEYCODE_A && keycode < AKEYCODE_Z)
- {
- if (modifier_state & AMETA_SHIFT_ON)
- event->unicode_value =
- clutter_keysym_to_unicode (CLUTTER_KEY_A + (keycode - AKEYCODE_A));
- else
- event->unicode_value =
- clutter_keysym_to_unicode (CLUTTER_KEY_a + (keycode - AKEYCODE_A));
- }
+ if (modifier_state & AMETA_SHIFT_ON)
+ event->keyval = shifted_keycodes[keycode];
+ else if (modifier_state & AMETA_ALT_ON)
+ event->keyval = alted_keycodes[keycode];
else
- event->unicode_value = clutter_keysym_to_unicode (keycodes[keycode]);
+ event->keyval = keycodes[keycode];
event->modifier_state = _translate_modifier_state (modifier_state);
- event->keyval = keycode;
+ event->unicode_value = clutter_keysym_to_unicode (event->keyval);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]