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. Bluetooth SPP question

Hello All,
I have a simple device, not developed by me, that uses SPP to send out
a simple 55 byte data packet once every second.  The device accepts no
communication other than any needed for pairing/connection.  Once it
has been connected it is supposed to start sending the 1Hz packets

I can pair the device just fine, but have yet to be able to establish
a connection.  If I try setting up a BluetoothSocket using the connect
() method, it fails with an error related to services, i.e. no known
services are on the device.  I figure this isn't a big deal, as connect
() appears to be only for the outgoing data, but then I try to listen
using   BluetoothServerSocket::listenUsingRfcommWithServiceRecord()
but get nothing.  It seems that I should need to actively do something
to establish the connection, but don't see anything in the javadocs
that look liek what I think I need.  I just want to connect the device
and start catching the packets so I can move on to coding the real


2. Porting android on a AT91SAM9G20 with 64MByte of RAM and 8MByte dataflash memory

Hi all,

New on this Group i'am the french google moderator of "groupe de
discussion autour de Netus G20 et FOX Board G20".

I have a Fox Board G20 based on ARM926EJ-S ARM with ARM9 at 400MHz,
64MByte of RAM and 8MByte dataflash memory. My question is: It is
possible to port android on this board.

For more information on the board,

Feel free to consult this links:

Thanks for your answer.


3. Record raw Audio, process audio and save as ogg or another compressed format

4. Find out if the user rated my application in the Market

5. Is there a way to refer to a group of attributes

6. Request is not from browser- need help

7. Search AndroidMarket from my app