How android translate kernel input events to userland input events锛

by Dianne Hackborn » Fri, 23 Oct 2009 11:56:40 GMT


Sponsored Links
 You can't handle input events in native code, the framework takes care of
that and you will break things if you fight with it (and can't anyway
because you shouldn't have permission to open the driver).
You can look at EventHub.cpp and KeyInputQueue.java to see how the framework
transforms the raw driver events into the MotionEvent and KeyEvent objects
your app receives, but you can't do anything like that in an application.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~



How android translate kernel input events to userland input events锛

by ZaichengQi » Fri, 23 Oct 2009 12:33:54 GMT


 Thanks for your help. I know that I can get root privilege only on my
dev phone, and I will not try to really handle these events by myself.




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. are they changing the names of these groups?

I swear ive been signed up for developers and beginners? Im guessing
its because of those sites that are trying to feed off copying posts?
And who keeps changing some of the groups to be called gay sex
photos ? Lol... iphone people?

-- 

2. Rendering problems with an Activity having android:screenOrientation="landscape"

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

I have a regular list with a list of names. When I pick one name, I
need to show it on the screen with the largest font size (they are
supposed to be made available for reading by the phone owner to other
people). On this purpose, I activate a new Activity that declares
android:screenOrientation="landscape" so it can take advantage of the
wider screen available. The Activity has also the FullScreen style.

It works, but for a couple of rendering details. First, the "slide in
screen" effect that I've configured on my Droid doesn't work - the
activity is rendered without any effect. Second, for a glimpse there
are foreign contents on the screen (they are parts of the last
notification screen that I opened). I presume it's a problem of the
frame buffer off-screen contents being not properly managed. If the
problem is not clear, I can later post a link to a short video.

If I start with the regular list already in landscape mode (because I
rotated the phone) everything works fine. The problem seems to be
transitioning from an activity in portrait mode directly to an
activity in landscape mode.
I guess I've hit a known bug...

I was thinking of trying the following thing:

1. Drop the android:screenOrientation="landscape" setting in the
AndroidManifest.xml
2. Keep the widgets on the Activity initially not visible, so a blank
activity slides in.
3. After a short delay, programmatically switching to landscape mode
and set the widgets visible
4. When quitting the activity, run the reverse steps (setting the
widgets to not visible, programmatically switching to portrait mode,
waiting for a short delay, finishing).

Thoughts? Better workarounds? Thanks.

- -- 
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
java.net/blog/fabriziogiudici - www.tidalwave.it/people
fabrizio.giud...@tidalwave.it
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxtR6wACgkQeDweFqgUGxcFbwCfTiiS0KpTECkLB5ZOuypNGSRe
rDwAn3PSPJE0+EhBLDoKhDa4qvCGXgiD
=YQq2
-----END PGP SIGNATURE-----

-- 

3. How to invoke another application on a Button Click?

4. Changing the arrow image in ExpandableListActivity

5. How the Activity updated in Pause State.

6. Modifying sensors.c, rebild, and test libsensors.so

7. KEYCODE_HOME