05-12-2012, 03:22 AM | #1 |
Connoisseur
Posts: 73
Karma: 7140
Join Date: Feb 2012
Device: Kindle Touch
|
Touch screen events
How to get touch screen events(click, double click)? menu button's events?
|
05-12-2012, 04:00 AM | #2 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Touchpaint2
You can ignore all the unfinished motion predicition code. I was going to use that for touchscreen capture point compression, but I did not finish it... (Yes, the deeper derivatives of motion are named after a breakfast cereal. In real life motion control, people rarely go deeper than snap vector analysis.)
This is working code that was not cleaned up and not documented for publication. It writes binary directly to the framebuffer. It reads binary directly from the device input events. C code can do this same stuff. It is here to show you how you can read touchscreen data directly from the touchscreen device. This method is similar to how the myts onscreen terminal program reads keyboard events on a K3. This old version contains debug code that displays all the touchscreen events, which I removed from later (better) code that I use elsewhere. I thought this old (unfinished "dirty") version with the debug stuff would be more helpful in this case, so here it is... PHP Code:
I have newer code that supports two finger drawing, pinch and stretch, and limited rotate, but that is missing the debug output messages that you probably could use. I may publish a newer version soon. I plan to port this stuff to C soon. It is all from the "eink algorithmic art" collection (but not yet published). You should exit by pressing the "Exit" button in the lower right corner to resume Xorg and cvm. My newer versions of this script intercept ctrl-c and do a proper shutdown that includes resuming the framework. Not this old one. P.S. Firmware for 5.0.x (and perhaps 5.1.x) has a bug when you are moving two fingers on the screen: when rotating, when both fingers cross the same X coord or Y coord, sometimes the OTHER coordinates get swapped (and stay swapped). This makes it return coordinates for other untouched coordinates of the bounding box. That is not a problem for pinch and stretch though. ToDo: You can see in the myts program from matan, how to capture an input device so that the touches (in this case) are not passed through to the framework. I like to do touchscreen stuff in diags, where there is a menu item that stops looking at the touchscreen events until the menu button is pressed. (See the old Touchpaint 1.0 thread for details). Last edited by geekmaster; 05-16-2012 at 03:56 PM. |
Advert | |
|
05-14-2012, 11:48 AM | #3 |
Connoisseur
Posts: 73
Karma: 7140
Join Date: Feb 2012
Device: Kindle Touch
|
Thank you for the detailed information.
|
05-16-2012, 03:33 PM | #4 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
You are welcome. You can see a simplified version of this script that assumes only one finger touching, in my "signature capture" thread. This one is more useful for extracting gestures, but if you want to be even more advanced, you can process the event timestamps that I discard here. Or you can just extract gestures from the Xorg log file.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-650 Touch screen sensibility and screen protector | bookmeal | Sony Reader | 16 | 09-18-2011 09:26 PM |
book reader that supports touch screen tablets and has touch control | colint3 | General Discussions | 1 | 06-22-2011 02:47 PM |
How about an Events section? | nigeldb | Feedback | 2 | 11-01-2009 10:37 PM |
3 Ebook Events in May | Nate the great | News | 2 | 03-18-2009 08:11 PM |