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

Web and WebWorks Development

Reply
Highlighted
Developer
Posts: 78
Registered: ‎01-14-2013
My Device: Games
My Carrier: Not yet
Accepted Solution

[Webworks long press event]

HI all,

How to get long press event on an item of  list item?

Thanks.

Dennis Ritchie.

Developer
Posts: 1,230
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: [Webworks long press event]

The touchevent DOM records this kind of information

 

Your question is a little vague so all I can really say that trapping the touch events provides this information in the event's timeStamp record so...

 

ontouchstart - grab the timeStamp

ontouchEnd - grab the timeStamp

 

Subtract the two and you have the milli-seconds the user pressed for

 

The same kinda thing exists for mouse events

 

The other touch events are also important - particularly ontouchmove as the user may move out of the clickable area - e.g. accidentally click Quit, move outside it to stop that happening so you need to cater for that as well

 

It's easy to work out the specifics in Ripple using the debugger by setting break-points on your event handlers

 

It's handy setting up a simple little test-app so you can also see exactly what the events are doing




Click the like button if you find my posts useful!
Developer
Posts: 78
Registered: ‎01-14-2013
My Device: Games
My Carrier: Not yet

Re: [Webworks long press event]

Thank you so much.