More guards were added to hopefully link the mouse down and up events that should be executed in sequence, albeit delayed
Also a new case was added for a delayed mouse up event (in JE_MULTI) to avoid it being executed out of order / too soon.
We set up touch mode in graphics managers constructor.
At this point, the _graphicsManager variable was pointed to the freshly
deleted old manager instead of being null.
When we are in this position, assume the cursor is at top left.
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.
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.
and joystick deadzone. By supporting kFeatureKbdMouseSpeed and kFeatureJoystickDeadzone and registering default values
Both of these config settings (kbdmouse_speed, joystick_deadzone) factor in virtual mouse movement.
Helps handle virtual mouse pointer speed when controlled with DPAD or is too fast for the user
And some fixes for DPAD handling
More fixes for DPAD will be coming. We currently don't handle DPAD Center, and also do not handle the case where DPAD is HATs (motion events)
Previously joystick motion inputs were being translated to direct mouse
movement events. This changes those into Joystick AXIS events instead.
Also updates joystick button inputs into joystick button events instead
of mouse clicks and key presses.
Previously most buttons were being ignored and A and B were mapped to
mouse clicks. This maps A and B and several more buttons to Joypad
button presses instead.
Needed for Myst 3 mouse look, probably other games too
This should be followed up by similar update of relMouse for the cases of mouse look using a hardware mouse, a joystick, trackball, pen etc. We should also check if we need to do this for the cases of moving the mouse while holding down a button and for multitouch events that emulate that (eg. hold two fingers down and move).
Also added various comments to document behavior.
Minor JE_MULTI event (Fix concerned bad brackets code in the events.cpp for JE_MULTI (multiple fingers held down)
) fix and comments for mouse behavior
Allow onHover to catch the mouse events instead of OnTrackBallEvent()
Also the "system back" button is ignored for the Trackball too because we treat it as mouse in isMouse(e) check
Add multitouch handler class. Handling and early filtering of multitouch events is moved in the new class.