Re: How to get pen pressure under Opie?

Holger Schurig <[email protected]>
Newsgroups gmane.comp.handhelds.opie.devel
Message-ID <[email protected]>
> PetitePainture uses a patched kernel that has a duplicate touchscreen
> device. I wanted to add a portable way of getting pen pressure for
> inclusion in the OE version of PetitePainture...

Qt/E simulates a mouse based on data of the touchscreen. For it's 
Event-Handling, it uses QMouseEvent. If you look at the documentation of 
this, you won't see a field for pressure.

http://doc.trolltech.com/2.3/qmouseevent.html


So you need to find out if your Paint application can open your touchscreen a 
second time, either via tslib (preferred) or if this doesn't work, then do it 
directly.

So inside your paint program open ts_open() the file getenv("TSLIB_TSDEVICE") 
or /dev/ts. Then connect a QSocketNotifier to this thingy in the activated() 
slot you can ts_read() a "struct ts_sample". Basically, you do something 
similar as in the OE' patched Qt/E, file src/kernel/qwsmouse_qws.cpp, near 
the QT_QWS_TSLIB defines.

This way you get the touch screen data in a raw format. You just won't emit a 
mouseChanged()-Signal with the X/Y-coordinates, but use them on your own, 
together with the pressure.
_______________________________________________

http://opie.handhelds.org/cgi-bin/moin.cgi/DeveloperWikiIndex

Opie-devel mailing list
[email protected]
https://handhelds.org/mailman/listinfo/opie-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.