×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    25

    Mouse Events N810

    Hey all!

    I have a simple scribble app on the N810 using jalimo and SWT for the GUI. The creation of the drawing on screen is done in response to mouse events...

    However it seems the mouse move event doesn't fire nearly as much as when I'm debugging on my desktop machine. For example I could draw a small house and the event only fired 2 or 3 times, when hundreds is a more desirable figure.

    Has anybody come across this before? or even a workaround?

    Paul

  2. #2
    Nokia Developer Expert
    Join Date
    Nov 2008
    Posts
    72

    Re: Mouse Events N810

    Are you listening for mouse move events?

  3. #3
    Registered User
    Join Date
    Aug 2008
    Posts
    25

    Re: Mouse Events N810

    yeah, for example if i use this code which is independant of my own:

    Code:
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Event;
    import org.eclipse.swt.widgets.Listener;
    import org.eclipse.swt.widgets.Shell;
    
    public class ListenerTest {
      public ListenerTest() {
        Display display = new Display();
        Shell shell = new Shell(display);
        shell.setText("Left click your mouse");
        shell.setSize(200, 100);
        shell.open();    
        
        shell.addListener(SWT.MouseDown, new SimpleListener("Shell mouse
    down listener"));
        
        shell.addListener(SWT.MouseMove, new SimpleListener("Shell mouse move listener"));
    
        display.addFilter(SWT.MouseDown, new SimpleListener("Display mouse down Listener"));
        display.addFilter(SWT.MouseUp, new SimpleListener("Display mouse up Listener"));
    display.addFilter(SWT.MouseMove, new SimpleListener("Display mouse move Listener"));
        
        while(! shell.isDisposed()) {
          if(! display.readAndDispatch()) {// If no more entries in event queue
            display.sleep();
          }
        }
        
        display.dispose();
      }
      
      class SimpleListener implements Listener{
        String name;
        
        public SimpleListener(String name) {
          this.name = name;
        }
    
        public void handleEvent(Event e) {
          System.out.println("Event: [" + e.type + "] from " + name + ". \tCurrent Time (in ms):  " + System.currentTimeMillis());
        }
      }
    
      public static void main(String[] args) {
        new ListenerTest();
      }
    }

    When making the same drawing whilst Debugging on my desktop computer there are are hundreds of events fired purely from the MouseMove event, but on my device there are 12.

    Even when executing some simple scribbling code found on the web the events don't fire enough to make even a simple drawing.

    I'm wondering is there another method to get better granularity of these events?
    Last edited by dunff2k; 2008-11-25 at 13:46.

  4. #4
    Nokia Developer Expert
    Join Date
    Nov 2008
    Posts
    72

    Re: Mouse Events N810

    I think this is because the SWT you are using is for desktop PC with a mouse. On desktop PCs mouse cursor is always present and the events are sent all the time, whereas in stylus the mousemove events are generated only after mousedown. My guess is the logic of desktop SWT is not able to handle the difference.

  5. #5
    Registered User
    Join Date
    Jun 2009
    Posts
    1

    Re: Mouse Events N810

    I have the same problem, using the exact same set up on the n800. Mouse down / up events are detected fine but mouse move events are not useful.

    Not sure how to combat this one

Similar Threads

  1. BT GPS mouse not detected
    By ueffchen in forum Mobile Web Server
    Replies: 3
    Last Post: 2007-06-14, 13:07
  2. Replies: 0
    Last Post: 2007-04-03, 17:22
  3. Catching events with RSystemAgent
    By d00mo in forum Symbian
    Replies: 3
    Last Post: 2005-06-27, 18:04
  4. Handling multiple events.
    By Lebihen in forum Symbian
    Replies: 1
    Last Post: 2004-01-22, 19:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×