How do I get pen type events in my app?

by walnutchen » Fri, 04 Feb 2011 05:19:29 GMT

Sponsored Links
 So the driver guy tells me that I have an input device that is capable
of inputting the "pen" type.  This is custom hardware, of course.

He says he is calling:

input_report_key(dev, BTN_TOOL_PEN, 1);
input_report_key(dev, BTN_TOOL_RUBBER,1);

and also reporting the X and Y coordinates with ABS_X and ABS_Y.

I can get the ACTION_DOWN and ACTION_UP and (x,y) in my app with
motionEvents.  For the life of me I cannot figure out how to get the
pen "type" events.  Is that a keyEvent?  I tried to listen to
keyEvents but I never hear anything about pen type...

Please help.  Thanks.


Other Threads

1. Observe Sync Status


I'm trying to write a simple App that turns on wifi, starts the sync
(calendar, contacts ...) and, when sync is finished, turns wifi off.

I accomplished almost everything, but I still don't know when syncing
is finished.
The SDK says:
"If you want to monitor the progress of the sync you may register a
But... there is no SyncObserver anywhere to be found.

I also looked at the source from the synchronization-settings app from
the framework and found old code that was removed in android 1.5 ...
so there must be a way, because the "start sync" button knows when
sync is finished.

I hope anyone knows a way to observe the sync status.


2. developing the acceleration related apps with Emulator ?

hello everyone . I am a colledge student  and I'm now working on a
project about apps developed on android system , we want to create an
window-container or somewhat like that(sorry for my poor English..-_-
#),the main purpose of that is to avoid screen-swaying when we are
walking,on a bus and just reading E-books ,that is to say the canvas
of the screen will do a proper replacement to anti the phisycal sway
so we can keep our eyes steady rather than seek for the words we are
just looking at embarrassly..

so I've got some problems here :

1.can I emulate the acceleration and there are so few APIs about
that ? how can I do that or should I borrow / buy a G1.

2.there are so many demos on the Internet to guide to Android but some
are just using an old API , Do you guy have some good tutorials
(better in a series or an e-book maybe) through which I can  get
familied with android and thus create android apps proficiently..?

Thank you..


3. MediaPlayer: "Prepare failed.: status=0xFFFFFFFC"

4. Threaded Horizontal Scrolling

5. How to use other class in other package?

6. How to implement a link view

7. Calendar - invite guest