Please help: Key 'locked' after returning from one SDL app to the caller SDL app

Hello all,

I’m facing the following problem:
I’m using an SDL front-end to start an SDL MAME game. When I exit the game,
and try to start another (or the same) game, the front-end doesn’t react to
that “start” key. I can select other games, so the front end reacts fine to
the other keys. Once I’ve pressed the “start” key, the front-end will react
properly the next time I press that key. This problem only occurs when I
start the front-end from the console. If I run it under X or from a console
under X it works fine. If I don’t use an SDL version of the MAME emulator,
the problem also doesn’t occur.

As an example (the 1 is the start key) (between “()” is optional):

  • start front-end from console
    (- select game using the keys)
  • press 1 -> game starts
    (- play game)
  • press esc -> exit game
    (- select another game)
  • press 1 -> no reaction
    (- select another game)
  • press 1 -> game starts

Anyone have an idea what might be causing this?

Regards,

Pieter Hulshoff

Hello,

Try to call game in SDL_KEYUP and not KEYDOWN,

when your front-end return to run, (after game) SDL still thinks that
the key “1” is pressed…

I’m not sure, but, try it :wink:
Excuse my poor english, i’m brazilian.

[]'s
JudisonOn Sun, 27 Feb 2005 12:07:10 +0100, Pieter Hulshoff wrote:

Hello all,

I’m facing the following problem:
I’m using an SDL front-end to start an SDL MAME game. When I exit the game,
and try to start another (or the same) game, the front-end doesn’t react to
that “start” key. I can select other games, so the front end reacts fine to
the other keys. Once I’ve pressed the “start” key, the front-end will react
properly the next time I press that key. This problem only occurs when I
start the front-end from the console. If I run it under X or from a console
under X it works fine. If I don’t use an SDL version of the MAME emulator,
the problem also doesn’t occur.

As an example (the 1 is the start key) (between “()” is optional):

  • start front-end from console
    (- select game using the keys)
  • press 1 -> game starts
    (- play game)
  • press esc -> exit game
    (- select another game)
  • press 1 -> no reaction
    (- select another game)
  • press 1 -> game starts

Anyone have an idea what might be causing this?

Regards,

Pieter Hulshoff


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Judison
@Judison

That does indeed appear to be the case. I’ll have a closer look at it to see
if there are alternative ways to deal with this problem (I don’t wish to have
to wait for a release of the play key), but you’ve put me on the right track.
Thanx! :slight_smile:

Regards,

Pieter HulshoffOn Sunday 27 February 2005 15:58, Judison wrote:

Try to call game in SDL_KEYUP and not KEYDOWN,
when your front-end return to run, (after game) SDL still thinks that
the key “1” is pressed…
I’m not sure, but, try it :wink: