×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    3

    Simple question about keypress event and keyrepeated event of fulllcanvas.

    Good day gurus and mobile game developers ..

    I have got a problem about keyevents especially the transition of the keypressed and keyrepeated events. I believe that there is about 2.5 seconds difference between the two if i try to press A for example. Do you have any suggestions on how to fix that problem? Or how to implement a solution to that problem? Is there a property in the FullCanvas for the sensibility of the events? Really need this asap. Thanks and more power.

  2. #2
    Registered User
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113
    If I understood you correctly you can just also listen to KeyReleased and implement simulation of repeated keypresses.

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    3

    Problem

    How can i make the response time of the keyrepeated event faster? Because my test took about 2.5 seconds before the keyrepeated event was recognized.

  4. #4
    Registered User
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113
    Just don't use KeyRepeated if it's that problematic.
    Track KeyPressed, KeyReleased and do KeyRepeated yourself

  5. #5
    Registered User
    Join Date
    Oct 2003
    Posts
    3
    do u have any sample codes on how to make my own keyrepeated event? using maybe low level api? thanks in advance

  6. #6
    Registered User
    Join Date
    Nov 2003
    Posts
    2
    Here is simple sample code that should work... works fine for me

    private boolean keyDown, keyUp, keyLeft, keyRight;

    public void keyPressed(int key)
    {
    if(key == -1) keyUp = true;
    if(key == -2) keyDown = true;
    if(key == -3) keyLeft = true;
    if(key == -4) keyRight = true;
    }

    public void keyReleased(int key)
    {
    keyUp = false;
    keyDown = false;
    keyLeft = false;
    keyRight = false;
    }

Posting Permissions

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