From a95e4cb62f3642cb190d032dbf7dc40d9ecc6973 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Fri, 18 Jun 2010 18:09:33 -0700 Subject: 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 --- libs/ui/InputTransport.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libs/ui/InputTransport.cpp') diff --git a/libs/ui/InputTransport.cpp b/libs/ui/InputTransport.cpp index 86bbd37..b2842d0 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& channel) : + mConsumer(channel) { +} + +input_queue_t::~input_queue_t() { +} + +status_t input_queue_t::consume(InputEvent** event) { + return mConsumer.consume(&mInputEventFactory, event); +} -- cgit v1.1