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
philipjmurphy
Posts: 8
Registered: ‎11-07-2011
My Device: BlackBerry Z10

Javascript onmousemove doesn't fire when mouse pointer at bottom of screen using trackball

Hi,

 

I'm trying to detect when the trackball is used. However, the onmousemove event does not fire when the mouse pointer is at the bottom of the screen (I guess this is because the mouse is not moving at this point). However, does anyone know what event I can listen to detect trackball events (even when mouse pointer is at window boundary)?

 

Here is a snippet of code that demonstrates the problem. Try to position the mouse at the bottom of the screen before loading it as it will display a lot of alert boxes as you move the mouse down the page.

  

 

<!DOCTYPE HTML>
<html>
<body onmousemove="alert('moving...');">
1<br/>
2<br/>
3<br/>
4<br/>
5<br/>
6<br/>
7<br/>
8<br/>
9<br/>
10<br/>
11<br/>
12<br/>
13<br/>
14<br/>
15<br/>
</body>
</html>

 

PS To make it easier to debug you may want to use the following asynchronous alert box (compliments of http://javascript.nwbox.com/asyncAlert/). Just add it between the html and body tags.

 

<head>
    <style type="text/css">
    .notifier {	z-index: 100;	margin: 0px 0px;	padding: 8px 8px;	border: 1px solid #f00;	background-color: #fc0;}
    </style>
    <script type="text/javascript" src="http://javascript.nwbox.com/asyncAlert/async_alerts.js"></script>
</head>

 

New Contributor
philipjmurphy
Posts: 8
Registered: ‎11-07-2011
My Device: BlackBerry Z10

Re: Javascript onmousemove doesn't fire when mouse pointer at bottom of screen using trackball

*Bump*
Developer
squished18
Posts: 289
Registered: ‎10-17-2008
My Device: Torch 9800

Re: Javascript onmousemove doesn't fire when mouse pointer at bottom of screen using trackball

Hi philipjmurphy,

Have you considered using focus-based navigation?

https://bdsc.webapps.blackberry.com/html5/apis/blackberry.focus.html

Cheers,
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
New Contributor
philipjmurphy
Posts: 8
Registered: ‎11-07-2011
My Device: BlackBerry Z10

Re: Javascript onmousemove doesn't fire when mouse pointer at bottom of screen using trackball

Hi,

 

Thanks for the suggestion. I can't use focus navigation as I am actually trying to simulate scrolling on a Sencha Touch web page, which I would be able to do if the trackball fired any events after the mouse reached the bottom of the page. It's surprising that the trackball does not let the web page know that the user is using it.

 

So, I still need a solution for this one.

 

Thanks,

 

Philip