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
New Contributor
Posts: 4
Registered: ‎02-15-2011
My Device: Not Specified

How to catch context/pop-up menu event for the browser in OS 6

I've developed an HTML5 weather app using the canvas element and I'm having issues with my zooming on the Blackberry OS 6 emulator.  To zoom on my app, the user holds their finger on the screen for 1/2 a second to put the app in zooming mode.  They can then push their finger up to zoom in and down to zoom out.  The issue I'm having is that a context/pop-up menu appears in the Blackberry browser when I hold my finger on the screen of 1/2 second.  This causes my app to loose focus and therefore not perform zooming.  Is there a way in Javascript to catch this context/pop-up menu event so I can tell it not to display?  I really need it to not display so my zooming functionality will work on my HTML5 canvas element.

Developer
Posts: 128
Registered: ‎08-01-2008
My Device: Bold 9900, 9810, 9780, 9650 and so many others

Re: How to catch context/pop-up menu event for the browser in OS 6

Did you try calling preventDefault method in the onTouch event?I havent tried it but it should (in theory) work.
New Contributor
Posts: 4
Registered: ‎02-15-2011
My Device: Not Specified

Re: How to catch context/pop-up menu event for the browser in OS 6

Yes, I'm calling the preventDefault method. That does not help. Thanks.
New Contributor
Posts: 4
Registered: ‎02-15-2011
My Device: Not Specified

Re: How to catch context/pop-up menu event for the browser in OS 6

That didn't come out right.  What I meant to say is that I am calling the preventDefaults function in my touchStart event.  Calling this function does not cause the menu to stop appearing.  It will still appear even when the preventDefaults method is called from within the touchStart event.

Developer
Posts: 128
Registered: ‎08-01-2008
My Device: Bold 9900, 9810, 9780, 9650 and so many others

Re: How to catch context/pop-up menu event for the browser in OS 6

What about some of the other touch events? Did you try preventDefault from the other touch events?
New Contributor
Posts: 4
Registered: ‎02-15-2011
My Device: Not Specified

Re: How to catch context/pop-up menu event for the browser in OS 6

Yes, I'm calling the preventDefaults function on the touchMove and touchEnd events as well.  Is there any other touch events that I need to be grabbing?  My code works as it should on the iPhone and all Android phones, but OS 6 pops up the shortcut menu when a touch occurs without a move for 1/2 seconds.  I can change the "hover" option to 1000 milliseconds in the Blackberry options page and that keep the menu from popping up until you hold you finger down for 1 second.  But I would like to stop the menu from popping up altogether when the canvas element is being touched. 

Developer
Posts: 128
Registered: ‎08-01-2008
My Device: Bold 9900, 9810, 9780, 9650 and so many others

Re: How to catch context/pop-up menu event for the browser in OS 6

To be honest that's all I got. May want to log it as a bug or see if there's an updated version of OS 6. I know we're clutching at straws now...