You are not logged in.

#1 2010-08-05 19:18:50

pramod1561
Member
Registered: 2010-07-21
Posts: 42

Detecting Touchscreen Events

Is there a way to detect the touch screen events? I am trying to store the timestamps when the last 10 touchscreen events happened. Also, Can it be done using Python?

Thanks

Offline

#2 2010-08-05 20:27:14

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,333

Re: Detecting Touchscreen Events

"...touch screen events..."
What?

Is this a phone?, netbook, laptop?, external monitor?
Do you know anything about the controller chip?
Does it already act like a mouse?
Is i9t detected according to Dmesg? Does it have a device node?

Throw us bone.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2010-08-05 23:04:30

pramod1561
Member
Registered: 2010-07-21
Posts: 42

Re: Detecting Touchscreen Events

Hi Ewaller,

Sorry that I dint give the full information you needed.

*Its a Tablet PC.
*I don't know about the controller chip.
*What do you mean by "Does it already act like a mouse?".
The mouse pointer moves to the place where I touch. So, I think the answer for this is yes.
*How do I find it out?

I have installed egalaxtouch driver.

Offline

#4 2010-08-06 00:21:06

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 859
Website

Re: Detecting Touchscreen Events

Maybe read the source code for the egalaxtouch driver?  Also, I seriously doubt it can be accomplished with only python.

Offline

#5 2010-08-06 17:59:05

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,333

Re: Detecting Touchscreen Events

Sorry I did not get back to you yesterday -- it has been crazy.

It does sound like the touch screen is acting like a mouse already.  That simplifies things a lot.

For the record, it looks like your touch screen probably shows up as a device and conforms (mostly) to the HID (Human Interface Device) standards.  You could very that by doing an <i>lsusb</i> command.  It could also use an I2c or serial port, but a really is neither here nor there...

So, more about your application.  You want to know if you can capture touch events.  The simple answer is -- yes.

As they say, the devil is in the details.  What are you trying to do?  Are you planning on developing an application in python in which you want to capture the events?  If so, you can create a nice GUI under Python using PyGtk (using Gtk), PyQt (using Qt), or PyWidgets (using wxWidgets).  You can set those up so that each widget (control) responds to mouse events.  The controls could then generate appropriate log entries.  This method depends upon X Server events and does not care whether the "touches" come from a mouse, the touch screen, or messages generated by other programs.

On the other hand,  If you are trying to do something like logging touches to existing applications, you will have to functions like XButtonEvent, and XGrabButton.  I must admit I tried to coble some code together to do this, but did not succeed in the half hour I played with it.  You might look at the code for 'xeyes' for ideas.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2010-08-06 21:22:59

pramod1561
Member
Registered: 2010-07-21
Posts: 42

Re: Detecting Touchscreen Events

I am actually trying to get the last time a touchevent happened and report it to the server. This would be running in the background as a daemon.

Thanks for the try Ewaller. I tried the xeyes command and looks like a client comes up in the monitor which is not the sort of thing I would need. May be I need to dig a bit more and see if there is anyway to do it with xeyes running in the daemon. If you have any other suggestion, let me know. I will try in that direction too.

Offline

Board footer

Powered by FluxBB