Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi, all,
I am trying to port a game on LG6000, However, there was a bug for the game.
I used a variable (keycode) to save key pressed when EVT_KEY_PRESS, and when EVT_KEY_RELEASE I set the keycode to 0, and in a main loop timer callback I will handling the key input.
The problem occurs when a SMS received, if user press a key before the SMS and then SMS comes, the EVT_KEY_RELEASE will not work, so I add code to release key in EVT_RESUME.
This can work but only if user NOT ignore SMS, if user ignores SMS, I found the key is not released. while if user accept the SMS, the code in EVT_RESUME is working.
I tried also add code to release key in EVT_SUSPEND. but it seems if user ignores SMS, THE EVT_SUSPEND not work.
Can anybody give me some suggestions? Thank you.

Whenever I resume an application I simply reset all my internal key states because it is impossible for you to know whether a key is pressed or not at that time, and chances are, no key is actually pressed at all. That solved all problems for me.
If you have problems catching an AVK_RESUME, alternatively you can also reset all your keystates as soon as you receive an AVK_SUSPEND event. The effect should virtually be the same.

Whenever I resume an application I simply reset all my internal key states because it is impossible for you to know whether a key is pressed or not at that time, and chances are, no key is actually pressed at all. That solved all problems for me.
If you have problems catching an AVK_RESUME, alternatively you can also reset all your keystates as soon as you receive an AVK_SUSPEND event. The effect should virtually be the same.