Pass on the auto repeat information for key events
Task-number: QTBUG-45340 Change-Id: Iecc55987fa784e4bf14317d9d4a085a8f0b58451 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>bb10
parent
f98d125b29
commit
4f81719983
|
|
@ -983,7 +983,7 @@ public class QtActivityDelegate
|
|||
if (!m_backKeyPressedSent)
|
||||
return true;
|
||||
}
|
||||
QtNative.keyDown(keyCode, c, event.getMetaState());
|
||||
QtNative.keyDown(keyCode, c, event.getMetaState(), event.getRepeatCount() > 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1007,7 +1007,7 @@ public class QtActivityDelegate
|
|||
}
|
||||
|
||||
m_metaState = MetaKeyKeyListener.handleKeyUp(m_metaState, keyCode, event);
|
||||
QtNative.keyUp(keyCode, event.getUnicodeChar(), event.getMetaState());
|
||||
QtNative.keyUp(keyCode, event.getUnicodeChar(), event.getMetaState(), event.getRepeatCount() > 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1018,8 +1018,8 @@ public class QtActivityDelegate
|
|||
&& event.getCharacters() != null
|
||||
&& event.getCharacters().length() == 1
|
||||
&& event.getKeyCode() == 0) {
|
||||
QtNative.keyDown(0, event.getCharacters().charAt(0), event.getMetaState());
|
||||
QtNative.keyUp(0, event.getCharacters().charAt(0), event.getMetaState());
|
||||
QtNative.keyDown(0, event.getCharacters().charAt(0), event.getMetaState(), event.getRepeatCount() > 0);
|
||||
QtNative.keyUp(0, event.getCharacters().charAt(0), event.getMetaState(), event.getRepeatCount() > 0);
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
@ -1195,7 +1195,6 @@ public class QtActivityDelegate
|
|||
} else {
|
||||
m_activity.getWindow().setBackgroundDrawable(m_activity.getResources().getDrawable(attr.resourceId));
|
||||
}
|
||||
|
||||
if (m_dummyView != null) {
|
||||
m_layout.removeView(m_dummyView);
|
||||
m_dummyView = null;
|
||||
|
|
|
|||
|
|
@ -593,8 +593,8 @@ public class QtNative
|
|||
// pointer methods
|
||||
|
||||
// keyboard methods
|
||||
public static native void keyDown(int key, int unicode, int modifier);
|
||||
public static native void keyUp(int key, int unicode, int modifier);
|
||||
public static native void keyDown(int key, int unicode, int modifier, boolean autoRepeat);
|
||||
public static native void keyUp(int key, int unicode, int modifier, boolean autoRepeat);
|
||||
public static native void keyboardVisibilityChanged(boolean visibility);
|
||||
// keyboard methods
|
||||
|
||||
|
|
|
|||
|
|
@ -663,24 +663,24 @@ namespace QtAndroidInput
|
|||
return unicode ? QString(QChar(unicode)) : QString();
|
||||
}
|
||||
|
||||
static void keyDown(JNIEnv */*env*/, jobject /*thiz*/, jint key, jint unicode, jint modifier)
|
||||
static void keyDown(JNIEnv */*env*/, jobject /*thiz*/, jint key, jint unicode, jint modifier, jboolean autoRepeat)
|
||||
{
|
||||
QWindowSystemInterface::handleKeyEvent(0,
|
||||
QEvent::KeyPress,
|
||||
mapAndroidKey(key),
|
||||
mapAndroidModifiers(modifier),
|
||||
toString(unicode),
|
||||
false);
|
||||
autoRepeat);
|
||||
}
|
||||
|
||||
static void keyUp(JNIEnv */*env*/, jobject /*thiz*/, jint key, jint unicode, jint modifier)
|
||||
static void keyUp(JNIEnv */*env*/, jobject /*thiz*/, jint key, jint unicode, jint modifier, jboolean autoRepeat)
|
||||
{
|
||||
QWindowSystemInterface::handleKeyEvent(0,
|
||||
QEvent::KeyRelease,
|
||||
mapAndroidKey(key),
|
||||
mapAndroidModifiers(modifier),
|
||||
toString(unicode),
|
||||
false);
|
||||
autoRepeat);
|
||||
}
|
||||
|
||||
static void keyboardVisibilityChanged(JNIEnv */*env*/, jobject /*thiz*/, jboolean visibility)
|
||||
|
|
@ -702,8 +702,8 @@ namespace QtAndroidInput
|
|||
{"mouseUp", "(III)V", (void *)mouseUp},
|
||||
{"mouseMove", "(III)V", (void *)mouseMove},
|
||||
{"longPress", "(III)V", (void *)longPress},
|
||||
{"keyDown", "(III)V", (void *)keyDown},
|
||||
{"keyUp", "(III)V", (void *)keyUp},
|
||||
{"keyDown", "(IIIZ)V", (void *)keyDown},
|
||||
{"keyUp", "(IIIZ)V", (void *)keyUp},
|
||||
{"keyboardVisibilityChanged", "(Z)V", (void *)keyboardVisibilityChanged}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue