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.
"Touchpad mode" is a mode where the mouse cursor is moved based on touch
movements rather on clicks. The problem was that when "touchpad mode"
was enabled it was very hard to click on items because the cursor moved
on every single click.
Make the action occur based on the current pointer position rather on
the touch location when in "touchpad mode".
Make the movement more intuitive when in "touchpad mode" by calculating
the delta of locations of touches and update the pointerPosition based
on that. That will give a feeling of using a real touchpad where the
location of where the touch occur doesn't matter for the cursor.
This will solve issue #13917
They're the recommended APIs now, and openFile is deprecated starting
with macOS 11.0. openURLs:withApplicationAtURL (for TextEdit usage)
requires macOS 10.15+, so we need different code paths.
The default cursor speed is too fast to navigate the menus and
pixel-hunt. Reduces the default speed to 2 ("8") to make it manageable.
Also makes the cursor speed configurable from the UI.
The current code checked for the CPU type to determine if we were
building for the older macOS releases requiring this older API, but
we can just check MAC_OS_X_VERSION_MAX_ALLOWED which is clearer and
more accurate.
Apart from simplification, this also lets one build ScummVM for x86
again on Tiger. I haven't checked this case, though :)
Note that the ComponentDescription -> AudioComponentDescription change
was done in macOS 10.6 and not macOS 10.5, so this also fixes this
case.
Tested on macOS 10.4, 10.5, 10.5 with the 10.4 SDK, and on 12.6.
NSUInteger should be an `unsigned int` on 32-bit Tiger, and an
`unsigned long` on 64-bit Tiger. In practice, this wasn't really a
problem since we were always using `unsigned long` which has the same
width on 32-bit Tiger, but still it's more correct to do what the
official 10.5 SDK does.
The preprocessor defines come from Apple's documentation and from
their SDK. We can use it as-is, since we're in the backend code, and
already in an ifdef only targeting Tiger (where I've tested this
change).
Also fix a small GCC warning while there.