×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    3

    A bug in input handling in current Nokia MIDP 0.3 development tools?

    Has anyone else noticed that in current Nokia MIDP emulators and runtimes, when the user keeps a key pressed for a longer time the runtime generates the following sequence of events:
    keyPressed, keyReleased, (keyrepeat start wait time), keyPressed, keyReleased, keyPressed, keyReleased, keyPressed, keyReleased, keyPressed, keyReleased...keyReleased

    When in fact it should generate the following sequence of events:
    keyPressed, (keyrepeat start wait time), keyRepeat, keyRepeat, keyRepeat, keyRepeat, keyRepeat, keyRepeat, keyRepeat, keyRepeat...keyReleased

    In current implementation it's really impossible to read the keyboard reliably in an interactive game that runs in it's own thread as sometimes the thread will see the key pressed and sometime it will see it as released. I've tried various solutions like setting the a flag in keyPressed callback method and resetting it after reading it in the main loop of the game, but you still get very choppy and random looking behaviour as the keyPressed callback method switches the flag on every n:th game loop cycle. If the keyboard callback would work as it should in MIDP implementations I could set the flag in keyPressed method, clear it in keyReleased method and just read it's current state in game loop.

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    60

    RE: A bug in input handling in current Nokia MIDP 0.3 development tools?

    hi,
    i have the same problem with series 60 MIDP SDK/Emulator - in my game my player should run when the player press the cursor keys - this works but some times it gets keyreleased events but no key was released - so the animation of the player "stuks"
    i dont have any solution for this - only to test it on a real device!

    if anybody has any idea - it will be great
    regards
    andreas

Posting Permissions

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