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

Java Development

Reply
Highlighted
Developer
Posts: 246
Registered: ‎12-13-2010
My Device: Not Specified
Accepted Solution

how to detect trackpad hold?

I've tried using navigationClick and navigationUnclick times but they are the same. The navigationClick method doesn't get called until I release the trackpad.

 

Does anyone know of some easy method to detect a long press of trackpad?

Developer
Posts: 246
Registered: ‎12-13-2010
My Device: Not Specified

Re: how to detect trackpad hold?

No one knows how to do something like this?

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: how to detect trackpad hold?

I think we can safely say it is not supported with the current API. 

Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: how to detect trackpad hold?

Dont use the time passed into the functions track the time yourself using system.getTimeMillis().
Developer
Posts: 246
Registered: ‎12-13-2010
My Device: Not Specified

Re: how to detect trackpad hold?

When the hold occurs, the navigationClick doesn't fire until you let go. Immediately navigationUnclick is called so it returns 0 time.

 

It is probably an undocumentated function because in the native blackberry applications you can perform trackpad hold to make the context menu appear.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: how to detect trackpad hold?

"in the native blackberry applications you can perform trackpad hold to make the context menu appear"

 

I thought this was just caused by pressing the trackpad, not how long you press it. 

Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: how to detect trackpad hold?

I used to check for this in some old code I have. I'll have to look for it to see how I did it. I think the way I did it was by doing it backwards. If you just normally click the trackpad I think there is a slight delay in the calls but if you hold it there isnt. So if the times are the same it was held otherwise it wasn't.
Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: how to detect trackpad hold?

Wow - that's so very backwards! RIM never ceases to surprise me with their technical decisions...

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Developer
Posts: 246
Registered: ‎12-13-2010
My Device: Not Specified

Re: how to detect trackpad hold?

[ Edited ]

CMV: Please let me know if you find it.

Developer
Posts: 246
Registered: ‎12-13-2010
My Device: Not Specified

Re: how to detect trackpad hold?

Peter:

 

If you click the trackpad in the "Messages" application it just opens the message.

 

If you click & hold the trackpad while a message is focused it brings up the context menu. So, there must be some way to do it.