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

Posts: 37
Registered: ‎03-12-2009
My Device: Not Specified

How to manage Storm touch screen



I would like to manage with my javascript widget the touch screen on a blackberry storm.

Especially the drag movements from left to right and right to left on the screen.


I try to use "onmousemove" to detect direction of the finger movement, I also associate this event with

"onmousedown" and "onmouseup" events to differentiate click to touch.


This doesn't run in the simulator (Storm 2 9550 (, it seems that when using the right mouse button to simulate touch screen (not click) no mouse events are raised.


Does it exist an another mean to manage the screen touch for a Storm device ?

Posts: 37
Registered: ‎03-12-2009
My Device: Not Specified

Re: How to manage Storm touch screen

See below the code I use to manage the touch screen detection :



var __originX = -1;
var __dir = 0;
var __onSel = null;

function mouseMove(e){
    var relTarg = e.relatedTarget || e.fromElement;
    if(__originX != -1){
        if (e.pageX > __originX) __dir = 2;
        else __dir = 1;

function mousePress(e){
    var relTarg = e.relatedTarget || e.fromElement;
    __onSel = relTarg;
    __originX = e.pageX;

function mouseRelease(e){
    var relTarg = e.relatedTarget || e.fromElement;
    if(__onSel === relTarg){
        if(__originX == e.pageX){

function dragElem(){
    alert("DRAG TOUCH ....");

function clickElem(){
    alert("CLICK ....");







            __myElem.onmousedown = mousePress;
            __myElem.onmouseup = mouseRelease;
            __myElem.onmousemove = mouseMove;


Posts: 12
Registered: ‎03-20-2011
My Device: 9800
My Carrier: none

Re: How to manage Storm touch screen

I am trying to do the same, but the onmousemove event is not firing on the Storm ( simulator.

I tryied the right click , left click, multi touch.


my code is similar to the below

myElement.onmousemove = function(e) { alert('test mouse move');  }


How do i get touch events on the Storm to work?