×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    May 2010
    Posts
    94

    Problem with Double Click

    My Application is ready.
    I want to include a feature that
    when i double click on the emulator then the that thing should be opened.
    IT is Possible or not if yes then How.

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Problem with Double Click

    Quote Originally Posted by nitinverma274 View Post
    My Application is ready.
    I want to include a feature that
    when i double click on the emulator then the that thing should be opened.
    IT is Possible or not if yes then How.
    It is possible in j2me MIDP if you are using Canvas and you need to handle KeyPress() method yourself. Take System.timestamp() on first key press and treat it as double click if the same key is pressed again within 100ms.
    Thanks,
    Ekta

  3. #3
    Regular Contributor
    Join Date
    May 2010
    Posts
    94

    Re: Problem with Double Click

    Thank u Ekta. I'll try.

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

    Re: Problem with Double Click

    Quote Originally Posted by nitinverma274 View Post
    My Application is ready.
    I want to include a feature that
    when i double click on the emulator then the that thing should be opened.
    IT is Possible or not if yes then How.
    Even you can take one counter and keep the same on the first keypressed/pointerpressed and process the keycode if the counter value has been increased by 1 and again reset the value of the same after pressing the key 2 times...
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Regular Contributor
    Join Date
    May 2010
    Posts
    94

    Re: Problem with Double Click

    can anybody show me the sample code for this.

  6. #6
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Problem with Double Click

    Quote Originally Posted by nitinverma274 View Post
    can anybody show me the sample code for this.
    It can be done like this:
    Code:
    int lastkey=-999;
    long lastkeyTime=10000;
    public void keyPressed(int key)
    {
    if(key==lastkey && (System.currentTimeMillis()-lastkeyTime)<500) 
       {
       // do what you want to do with double click
       }
     lastkey =key;
     lastkeyTime=System.currentTimeMillis();
    }
    Last edited by ektasrv; 2010-06-23 at 08:21.
    Thanks,
    Ekta

  7. #7
    Regular Contributor
    Join Date
    May 2010
    Posts
    94

    Re: Problem with Double Click

    Thank u Ekta, Thank u Very much.

  8. #8
    Registered User
    Join Date
    Sep 2009
    Location
    Bangalore, India
    Posts
    49

    Re: Problem with Double Click

    Quote Originally Posted by ektasrv View Post
    It can be done like this:
    Code:
    int lastkey=-999;
    long lastkeyTime=10000;
    public void keyPressed(int key)
    {
    if(key==lastkey && (System.currentTimeMillis()-lastkeyTime)<500) 
       {
       // do what you want to do with double click
       }
     lastkey =key;
    }
    A little chages in Ekta's Code is required..

    PHP Code:
    int lastkey=0;
    long lastkeyTime=0;
    public 
    void keyPressed(int key) {
    lastkey=key;        
       if(
    key==lastkey && (System.currentTimeMillis()-lastkeyTime)<500) {
           
    // do what you want to do with double click
           
    System.out.println("Double click Event occured");
       }
       
    lastkey =key;
       
    lastkeyTime=System.currentTimeMillis();
        } 
    Now it works fine
    Regards
    Nilanchala

Similar Threads

  1. CAknRadioButtonSetting-Derived not updated with double click
    By olivier_randria in forum Symbian User Interface
    Replies: 1
    Last Post: 2010-02-09, 14:13
  2. Web browser zooms on double click
    By ranco in forum [Archived] Flash Lite on Nokia Devices
    Replies: 8
    Last Post: 2010-01-19, 11:15
  3. double click on a word
    By oyuky in forum Symbian
    Replies: 3
    Last Post: 2009-04-15, 17:22
  4. Capture Key double click
    By morost in forum Symbian
    Replies: 1
    Last Post: 2008-05-22, 12:23
  5. Double Click Detection
    By earamsey in forum Symbian
    Replies: 0
    Last Post: 2003-04-22, 23:57

Posting Permissions

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