diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-06-18 18:09:33 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-06-22 11:21:50 -0700 |
commit | a95e4cb62f3642cb190d032dbf7dc40d9ecc6973 (patch) | |
tree | ae4437444a3d3ebeff48dabfd1e9c11fc14620ac /libs/ui/InputTransport.cpp | |
parent | ef730e6ececa96a3e0576140eea707f7c48cd66c (diff) |
First stab at attaching native event dispatching.
Provides the basic infrastructure for a
NativeActivity's native code to get an object representing
its event stream that can be used to read input events.
Still work to do, probably some API changes, and reasonable
default key handling (so that for example back will still
work).
Change-Id: I6db891bc35dc9683181d7708eaed552b955a077e
Diffstat (limited to 'libs/ui/InputTransport.cpp')
-rw-r--r-- | libs/ui/InputTransport.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/ui/InputTransport.cpp b/libs/ui/InputTransport.cpp index 86bbd3782d50..b2842d0aef81 100644 --- a/libs/ui/InputTransport.cpp +++ b/libs/ui/InputTransport.cpp @@ -686,3 +686,22 @@ void InputConsumer::populateMotionEvent(MotionEvent* motionEvent) const { } } // namespace android + +// --- input_queue_t --- + +using android::InputEvent; +using android::InputChannel; +using android::InputConsumer; +using android::sp; +using android::status_t; + +input_queue_t::input_queue_t(const sp<InputChannel>& channel) : + mConsumer(channel) { +} + +input_queue_t::~input_queue_t() { +} + +status_t input_queue_t::consume(InputEvent** event) { + return mConsumer.consume(&mInputEventFactory, event); +} |