×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    39

    handling key events

    I have a regular game loop;

    maincanvas::run
    {
    while in thread
    tick
    wait for next frame
    }

    maincanvas::tick
    {
    update state (or pass control to somewhere to update its own state)
    repaint
    servicerepaints
    }

    maincanvas::keyPressed
    {
    pass keycode to somewhere to handle it
    }

    I had a problem with this, I havent found it yet, the application stops responding and quits both on emulator and on device without any exception throwed when playing with keys. I think it is because keypress and game loop is in different threads. Is it a usual practice to store the key state somewhere and handle them in game loop since it is not possible to check keys in other places in midp 1.0 ?

    Thanks..

    MB

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280

    Re: handling key events

    Originally posted by metebalci
    Is it a usual practice to store the key state somewhere and handle them in game loop since it is not possible to check keys in other places in midp 1.0 ?
    Yes.

    shmoove

Posting Permissions

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