[Android] Fixed unicode value of text entered event is always 0

This commit is contained in:
Jonathan De Wachter 2014-03-11 21:44:13 +01:00
parent 67c7a5d176
commit 2d682d324f

View File

@ -604,7 +604,7 @@ int WindowImplAndroid::getUnicode(AInputEvent* event)
// Construct a KeyEvent object from the event data // Construct a KeyEvent object from the event data
jclass ClassKeyEvent = lJNIEnv->FindClass("android/view/KeyEvent"); jclass ClassKeyEvent = lJNIEnv->FindClass("android/view/KeyEvent");
jmethodID KeyEventConstructor = lJNIEnv->GetMethodID(ClassKeyEvent, "<init>", "(JJIIIIIIII)V"); jmethodID KeyEventConstructor = lJNIEnv->GetMethodID(ClassKeyEvent, "<init>", "(JJIIIIIIII)V");
jobject ObjectKeyEvent = lJNIEnv->NewObject(ClassKeyEvent, KeyEventConstructor, (jvalue*)downTime, (jvalue*)eventTime, (jvalue*)action, (jvalue*)code, (jvalue*)repeat, (jvalue*)metaState, (jvalue*)deviceId, (jvalue*)scancode, (jvalue*)flags, (jvalue*)source); jobject ObjectKeyEvent = lJNIEnv->NewObject(ClassKeyEvent, KeyEventConstructor, downTime, eventTime, action, code, repeat, metaState, deviceId, scancode, flags, source);
// Call its getUnicodeChar() method to get the unicode value // Call its getUnicodeChar() method to get the unicode value
jmethodID MethodGetUnicode = lJNIEnv->GetMethodID(ClassKeyEvent, "getUnicodeChar", "(I)I"); jmethodID MethodGetUnicode = lJNIEnv->GetMethodID(ClassKeyEvent, "getUnicodeChar", "(I)I");