summaryrefslogtreecommitdiffstats
path: root/native/android/input.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'native/android/input.cpp')
-rw-r--r--native/android/input.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/native/android/input.cpp b/native/android/input.cpp
index e0544a1..8498840 100644
--- a/native/android/input.cpp
+++ b/native/android/input.cpp
@@ -225,6 +225,15 @@ int32_t AInputQueue_getEvent(AInputQueue* queue, AInputEvent** outEvent) {
void AInputQueue_finishEvent(AInputQueue* queue, AInputEvent* event,
int handled) {
+ if (!handled && ((InputEvent*)event)->getType() == INPUT_EVENT_TYPE_KEY
+ && ((KeyEvent*)event)->hasDefaultAction()) {
+ // The app didn't handle this, but it may have a default action
+ // associated with it. We need to hand this back to Java to be
+ // executed.
+ queue->doDefaultKey((KeyEvent*)event);
+ return;
+ }
+
int32_t res = queue->getConsumer().sendFinishedSignal();
if (res != android::OK) {
LOGW("Failed to send finished signal on channel '%s'. status=%d",