×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Registered User
    Join Date
    Jan 2011
    Location
    The Heart of India
    Posts
    41

    Thumbs up hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    Hi, i am trying to develop a cursor. Using drawImage() i sucessfully draw crusor in the Midlet2.0 canvas screen but i am unable to move the cursor because of unsupportable hasPointerEvents() method. Over all pointerPressed(int x,int y) is also not doing anything.... My mobile is NOKIA 2730 and i am working on Netbeans 6.9 Midlet 2.0.

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    2730 is not a touch device, right? So it does not have a pointer.
    hasPointerEvents() should return true if pointer events are supported. If it doesn't, pointer is not supported. you have to use the keypad for navigation
    The MIDP specification contains more information about pointer (search for "Pointer Input")

    Hartti
    Last edited by hartti; 2011-02-07 at 05:30. Reason: added a comma

  3. #3
    Registered User
    Join Date
    Jan 2011
    Location
    The Heart of India
    Posts
    41

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    thank you hartti.... actually i am trying to develop cursor which can be 4ways controlled by navigation keys (i mean the middle key.). i have already draw cursor using drawImage() method but now i don't know how to change the coordinate (x,y) of cursor image to make cursor movable with navigation key. I was thinking that if there is any method like
    pulic void pointerPressed(int x,int y)
    {
    cursorX=x;
    cursorY=y;
    repaint();
    }
    so that it would be very easy for me to move that cursor image. Can you tell me what should be the procedure for this........

  4. #4
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    If you really want have something like this, you should be listening to key presses (up, down, left, right) and move the cursor amount x (you define that) to the direction defined by key presses. There is likely some code examples available in FN wiki
    http://wiki.forum.nokia.com/index.ph..._Code_Examples
    here is one example on how to handle key events
    http://wiki.forum.nokia.com/index.ph...nts_in_Java_ME

    However if you have buttons on the screen which needs to be pressed, an alternative method would be that you highlight a button and with the navigation keys you move the highlight to the button in that direction.

    Hartti

  5. #5
    Registered User
    Join Date
    Jan 2011
    Location
    The Heart of India
    Posts
    41

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    hey, i was thinking on this concept also... and finally i used this method
    void keyPressed(int keyCode){
    int key=keyCode;
    switch(key){
    case -1: // to move up the cursor
    cursorY--;
    repaint();
    break;
    case -2: // to move down the cursor
    cursorY++;
    repaint();
    break;
    case -1: // to move left the cursor
    cursorX--;
    repaint();
    break;
    case -1: // to move right the cursor
    cursorX++;
    repaint();
    break;
    default:
    repaint();
    break;
    }
    }

    this code is working properly but the only one problem is that to move the cursor from top to bottom, i have to press down key so many times.... I don't need this thing... I need any dragging concept to move the cursor.... i mean once i keep pressed a key for some time, cursor moves continue. In the above program, to move cursor, one has to keep press and unpressed the key continue.

    i checked the method pulic void pointerPressed(int x,int y) in my mobile phone and it was not working. I need the same method pointerPressed(int x,int y) supported by Nokia series 40.

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    Are you putting the cursor inside the Text-box or Text Field ?

    You can change the position inside the protected void keyRepeated(int keyCode) and this will be done..
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Jan 2011
    Location
    The Heart of India
    Posts
    41

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    hi raj, i am developing a canvas application.... no text box or text filed .....

  8. #8
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    Quote Originally Posted by ravi.joshi53 View Post
    hi raj, i am developing a canvas application.... no text box or text filed .....
    You can change the position inside the protected void keyRepeated(int keyCode) and this will be done..
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  9. #9
    Registered User
    Join Date
    Jan 2011
    Location
    The Heart of India
    Posts
    41

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    ya... it's working now..... thank you.....

  10. #10
    Registered User
    Join Date
    Jan 2011
    Location
    The Heart of India
    Posts
    41

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    Quote Originally Posted by raj_J2ME View Post
    You can change the position inside the protected void keyRepeated(int keyCode) and this will be done..
    hi raj, now cursor is moving using protected void keyRepeated(int keyCode) method but the old cursor is also drawn ...
    protected void keyRepeated(int keyCode){
    int key=keyCode;
    switch(key){
    case -1: // to move up the cursor
    cursorY--;
    repaint();
    break;
    case -2: // to move down the cursor
    cursorY++;
    repaint();
    break;
    case -1: // to move left the cursor
    cursorX--;
    repaint();
    break;
    case -1: // to move right the cursor
    cursorX++;
    repaint();
    break;
    default:
    repaint();
    break;
    }
    }

  11. #11
    Registered User
    Join Date
    Jan 2011
    Location
    The Heart of India
    Posts
    41

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    Quote Originally Posted by raj_J2ME View Post
    You can change the position inside the protected void keyRepeated(int keyCode) and this will be done..
    hi raj, now cursor is moving using protected void keyRepeated(int keyCode) method but the old cursor is also drawn ...
    protected void keyRepeated(int keyCode){
    int key=keyCode;
    switch(key){
    case -1: // to move up the cursor
    cursorY--;
    repaint();
    break;
    case -2: // to move down the cursor
    cursorY++;
    repaint();
    break;
    case -1: // to move left the cursor
    cursorX--;
    repaint();
    break;
    case -1: // to move right the cursor
    cursorX++;
    repaint();
    break;
    default:
    repaint();
    break;
    }
    }
    i don't know whats wrong going on.. Is this the problem of repaint() method.

  12. #12
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    This seems to be very complex to Exactly understand your issue right now, what do you mean by :

    but the old cursor is also drawn ...
    As you are calling the repaint() after every key events and hence I wonder of this could be the issue of the repaint. However your paint()'s definition will of interest to check the same.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  13. #13
    Registered User
    Join Date
    Jan 2011
    Location
    The Heart of India
    Posts
    41

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    Hi Raj, I was saying that whenever i press key, cursor moves on that direction as mentioned in the program but at the same time the previous position of the cursor are also visible in the screen. I mean you can see the locus of the cursor on the exact cursor. I don't know why this is happening because to paint the canvas again, i am using repaint() method. but still this is happening. Current position of the cursor and all the previous positions are visible in the screen.

    -Ravi Joshi

  14. #14
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    Are you painting the cursor using the arrays of the x and y offsets, if yes then make these position singular and let the cursor gets rendered on the single x and y position at any time.

    How are you rendering the cursor, please share the code,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  15. #15
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: hasPointerEvents() is unsupported in series 40 NOKIA 2730 classic

    Quote Originally Posted by ravi.joshi53 View Post
    Hi Raj, I was saying that whenever i press key, cursor moves on that direction as mentioned in the program but at the same time the previous position of the cursor are also visible in the screen. I mean you can see the locus of the cursor on the exact cursor. I don't know why this is happening because to paint the canvas again, i am using repaint() method. but still this is happening. Current position of the cursor and all the previous positions are visible in the screen.

    -Ravi Joshi
    Please Cut&Paste all your code in the paint() method for review.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. Nokia 2730 Classic: Hide Operator TEXT in Standby Mode?
    By eladnava in forum General Development Questions
    Replies: 1
    Last Post: 2010-09-27, 12:47
  2. how to install j2me midlet application on Nokia 2730 classic
    By harish_goel in forum Mobile Java General
    Replies: 2
    Last Post: 2010-09-06, 11:21
  3. What issues were fixed in firmware rm-578 v10.40 nokia 2730 classic
    By tuanluoi in forum General Development Questions
    Replies: 2
    Last Post: 2010-06-26, 18:43
  4. Replies: 1
    Last Post: 2010-03-13, 11:34
  5. what is alternate for KEY_SOFTKEYs in nokia 40 series?
    By Gnanasekarcm in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-08-19, 15:39

Posting Permissions

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