summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-07-16 09:12:29 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-07-16 09:12:29 -0700
commit781d34747941f3534b2a985ff57368ad89855d7d (patch)
treed7a87b96737fa8dfe18bb3d2b2985a77898123c2 /native
parentfb4e1e24a93c7e6bc0fcdb3f5cfadfbc19503cd8 (diff)
parent9c37e5add9d7678a29b4e0d1e178fe78a13db961 (diff)
downloadframeworks_base-781d34747941f3534b2a985ff57368ad89855d7d.zip
frameworks_base-781d34747941f3534b2a985ff57368ad89855d7d.tar.gz
frameworks_base-781d34747941f3534b2a985ff57368ad89855d7d.tar.bz2
am 9c37e5ad: am 75a91389: Merge "Implement native key pre-dispatching to IMEs." into gingerbread
Merge commit '9c37e5add9d7678a29b4e0d1e178fe78a13db961' * commit '9c37e5add9d7678a29b4e0d1e178fe78a13db961': Implement native key pre-dispatching to IMEs.
Diffstat (limited to 'native')
-rw-r--r--native/android/input.cpp6
-rw-r--r--native/include/android/input.h12
2 files changed, 16 insertions, 2 deletions
diff --git a/native/android/input.cpp b/native/android/input.cpp
index 4e1b6dc..59bf711 100644
--- a/native/android/input.cpp
+++ b/native/android/input.cpp
@@ -248,7 +248,7 @@ void AInputQueue_detachLooper(AInputQueue* queue) {
queue->detachLooper();
}
-int AInputQueue_hasEvents(AInputQueue* queue) {
+int32_t AInputQueue_hasEvents(AInputQueue* queue) {
return queue->hasEvents();
}
@@ -256,6 +256,10 @@ int32_t AInputQueue_getEvent(AInputQueue* queue, AInputEvent** outEvent) {
return queue->getEvent(outEvent);
}
+int32_t AInputQueue_preDispatchEvent(AInputQueue* queue, AInputEvent* event) {
+ return queue->preDispatchEvent(event) ? 1 : 0;
+}
+
void AInputQueue_finishEvent(AInputQueue* queue, AInputEvent* event, int handled) {
queue->finishEvent(event, handled != 0);
}
diff --git a/native/include/android/input.h b/native/include/android/input.h
index ce79cd4..0b8c7e4 100644
--- a/native/include/android/input.h
+++ b/native/include/android/input.h
@@ -607,7 +607,7 @@ void AInputQueue_detachLooper(AInputQueue* queue);
* input queue. Returns 1 if the queue has events; 0 if
* it does not have events; and a negative value if there is an error.
*/
-int AInputQueue_hasEvents(AInputQueue* queue);
+int32_t AInputQueue_hasEvents(AInputQueue* queue);
/*
* Returns the next available event from the queue. Returns a negative
@@ -616,6 +616,16 @@ int AInputQueue_hasEvents(AInputQueue* queue);
int32_t AInputQueue_getEvent(AInputQueue* queue, AInputEvent** outEvent);
/*
+ * Sends the key for standard pre-dispatching -- that is, possibly deliver
+ * it to the current IME to be consumed before the app. Returns 0 if it
+ * was not pre-dispatched, meaning you can process it right now. If non-zero
+ * is returned, you must abandon the current event processing and allow the
+ * event to appear again in the event queue (if it does not get consumed during
+ * pre-dispatching).
+ */
+int32_t AInputQueue_preDispatchEvent(AInputQueue* queue, AInputEvent* event);
+
+/*
* Report that dispatching has finished with the given event.
* This must be called after receiving an event with AInputQueue_get_event().
*/