Without this, when the application is in background, it is stuck waiting
for threads to join.
This is handful when, for example, there is an error while the
application got in background.
This hack was simulating repeated key presses (EVENT_KEYDOWN, then EVENT_KEYUP) for the arrow keys like the ones a physical keyboard sends
The hack could potentially cause further issues like spamming the events queue with many unnecessary events, and sending the events too quickly for some engines to handle
(thus missing some of them). We're now making use of the allowKbdRepeats() for the Up/Down/Left/Right event actions in the gui-manager, which will handle the case of a key
being kept pressed, sending an initial EVENT_KEYDOWN event and then subsequent EVENT_KEYDOWN events with the kbdRepeat flag set, and finally a single EVENT_KEYUP in the end.
Android itself handles repeated key events similarily (instead of a kbdRepeat flag, it updates a counter for the key repeats, which we translate to a simple flag).
This (and the hack that this replaces) affect things like moving the selection in the GUI lists (like the added games list) upwards or downwards continuously
while keeping the respective arrow key from the Android virtual keyboard pressed down.
Removed unnecessary normalization as Android already does this
Also fixed a wrong comparison in a clause for deciding to stop movement that was repeating
Some bluetooth keyboards also need "navigation" supported as configuration change
Tested with a new Lamtech bluetooth (BLE5) keyboard and also this is suggested here as well:
https://stackoverflow.com/a/27238892
This fixes right click and hold behavior to choose a verb action from the "verb coin" in tony tough
Previously, in direct touch mode, the action selected would refer to the previous item that was under the cursor
before the jump to the new touch point.
Some engines seems to also expect such a delay (tested with Curse of Monkey Island and Tony Tough).
Without this added delay, direct touch mode would work ok in the launcher and GMM GUI but in-game there would be issues.
In Curse of Monkey Island, early difficult selection screen, it was not possible to select the difficulty with a simple tap (direct touch mode).
And in gameplay proper, a simple tap would move the cursor to the touched position but Guybrush would walk to the last position of the cursor (before it jumped to the new one)
Tony Tough had similar issues with its menu.
Basically treats the arrow keys from the virtual keyboard in a special manner
It translates them to KEYCODE_UP(/DOWN/LEFT/RIGHT) and if held down sents consecutive KEYUP / KEYDOWN events
instead of the previous behavior of setting the kbdRepeat flag and just sending repeated KEYDOWN events and one final KEYUP.
Previous behavior would result in poor navigation on lists when the arror keys were held down. The new system works better.
This can lead to race conditions.
When synchronizing virtual keyboard state, just set a variable in UI
thread.
The variable will be read in worker thread during event polling, this
will ensure that graphics code is configured at a proper time.