Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
opax
Posts: 6
Registered: ‎12-03-2012
My Device: NAN
My Carrier: NAN
Accepted Solution

Pressure

Hello everybody

 

I would like to catch the pressure of a touch, is there a way to get it?

 

With Qt, there is two properties in the touchEvent that can satisfy my demand : pressure and rect

http://doc.qt.digia.com/qt/qtouchevent-touchpoint.html

 

I have search in doc but I have not find anything relevant.

I tried to cast the TouchEvent to Qt's TouchEvent..but I did not succeed...

 

does anyone could help me?

thank you!

 

Please use plain text.
Developer
lewellyn
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: Pressure

It seems that we only have binary on/off values for touch state, at least right now. I am not finding any evidence of multiple pressures. :smileysad:

Perhaps filing a JIRA issue will get this resolved in future OSes, if the hardware supports it. Otherwise, hopefully it will guide their future plans for hardware.

This is definitely something that would be nice to have at times, indeed!


Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy:
Please use plain text.
Regular Contributor
xsacha
Posts: 55
Registered: ‎10-30-2011
My Device: Blackberry Playbook
My Carrier: Telstra LTE

Re: Pressure

First, you have to realise that the screen isn't really designed for pressure sensitivity. It isn't a digitizer.

 

With that said, you can grab sensitivity values from the device's touch events using the Native SDK. You must have missed these, but they are with the native Screen API. This is the Native Development forum so I guess you're using that.

It does seem to work and it gets realistic values too.

 

 

SCREEN_PROPERTY_TOUCH_PRESSURE A single integer that indicates the multi-touch pressure associated with the specific event; a property of an event object.

When retrieving or setting this property type, ensure that you have sufficient storage or one integer. This property is only applicable for the following events: events:

 

See here: http://origin-developer.blackberry.com/native/reference/bb10/screen_libref/topic/screen_8h_1Screen_P...

Please use plain text.
Developer
lewellyn
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: Pressure

I had not thought to look for it in BB10. This property is not documented for the PlayBook (which I naïvely assumed the question was regarding).  Do you know of documentation for this property on Tablet OS, xsacha?

 

I suppose it would also know which platform the original question was regarding…



Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy:
Please use plain text.
Regular Contributor
xsacha
Posts: 55
Registered: ‎10-30-2011
My Device: Blackberry Playbook
My Carrier: Telstra LTE

Re: Pressure

It is also in the Playbook documentation. It is listed but has no detail/message attached to it. I remember using it a long time ago (before 'BB10' existed):

 

http://origin-developer.blackberry.com/native/reference/playbook/com.qnx.doc.screen.lib_ref/topic/rs...

Please use plain text.
Developer
lewellyn
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: Pressure

Good find. That is way too well-hidden to be useful to most people. I certainly don't recall finding it when I looked before.



Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy:
Please use plain text.