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
Contributor
sanshah90
Posts: 36
Registered: ‎06-28-2012
My Device: BB10
My Carrier: RIM
Accepted Solution

Access Touch Pressure in Cascades..

I want to access touch pressure in blackberry cascades. Is there any API available for that??

 

Thanks...

Please use plain text.
Contributor
rasmadrak
Posts: 13
Registered: ‎06-17-2013
My Device: Z10, STL100-2
My Carrier: Telenor

Re: Access Touch Pressure in Cascades..

Is it even possible? :/

Please use plain text.
Developer
DrShavargo
Posts: 133
Registered: ‎05-10-2013
My Device: Blackberry Z10
My Carrier: -

Re: Access Touch Pressure in Cascades..

There's an API for HTML5 WebWorks, but I can't find an API for Cascades or Native. Also, the associated link of the force method links to this page, which doesn't mention a force element. Seeing as the screen is heat/elec sensitive, and not pressure sensitive, I doubt it's possible.

----------------------------------------
Remember to mark the thread as solved at the post that solved your problem, and if you like a post, like it!
Please use plain text.
Developer
Innovatology
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: Access Touch Pressure in Cascades..

[ Edited ]

If you press down harder, the patch of your finger making contact with the screen gets bigger.Some devices measure and intepret the size of this touch area as "pressure". The problem is that the angle of your finger usually changes as you slide it across the screen, changing the shape and area of the touch too.

 

The native SDK has a structure called mtouch_event which contains the width & height of the touch. You might be able to approximate the area from that, assuming a fixed circular touch shape. It also contains a pressure member, but the docs state it is not implemented. Not sure if there's something similar in Cascades, or whether you can access the raw native mtouch_event data.

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Please use plain text.
Developer
DrShavargo
Posts: 133
Registered: ‎05-10-2013
My Device: Blackberry Z10
My Carrier: -

Re: Access Touch Pressure in Cascades..

Innovatology said: The native SDK has a structure called mtouch_event which contains the width & height of the touch. You might be able to approximate the area from that, assuming a fixed circular touch shape.

------

 

I've looked into mtouch_event, and although you could theoretically get pressure, as you've said, finger angle and position can alter the result. In fact, finger angle and which part of the finger touches the screen are much greater factors to touch size then pressure.

 

It is possible to use it in a Cascades app, nevertheless, by importing event_types.h and a few other classes. Can't see it as being very accurate though.

----------------------------------------
Remember to mark the thread as solved at the post that solved your problem, and if you like a post, like it!
Please use plain text.
Contributor
sanshah90
Posts: 36
Registered: ‎06-28-2012
My Device: BB10
My Carrier: RIM

Re: Access Touch Pressure in Cascades..

Can u give me an example of using that method of native feature in cascades ??

 

Thanks...

Please use plain text.