Add support for Extended Gamepad controllers. What defines extended
gamepad controllers can be found here:
https://developer.apple.com/documentation/gamecontroller/gcextendedgamepad
Support has been added for controlling the pointer position using the
left thumbstick, left clicks using the A-button and right clicks using
the B-button. Also the Main menu can be accessed using the Home/Menu
button.
The thumbstick values are received when changed, however if holding the
thumbstick in the same position the valueChangedHandler will not be
called. Therefore store the X- and Y-axis values and begin to poll
readings of the stored values for as long as the thumbstick is out of
the center position.
Move touch inputs to a TouchController class to move some logic from the
iPhoneView class. Only do this for touches on screen since connected
trackpads can generate touches as well. The latter ones are of type
UITouchTypeIndirectPointer while touches on screen are of type
UITouchTypeDirect. They are separated thanks to the preference key
UIApplicationSupportsIndirectInputEvents set to YES in Info.plist.
Without the preference above, there is no way to distinguish touches
from screen from a trackpad.
Add the GameController framework to the project and enable support for
controller user interaction in the Info.plist file. This allows for
Game Controller compatible devices to notify the application when
connected.
Add GameController framework to configure and ports.mk if not using
Xcode to build the target.
This partially revert commit 0ff00cca2a and should hopefully
fix bug #12647.
The issue is that the executable name in the Info.plist did not
match the name of the executable generated by Xcode (ScummVM vs
scummvm). I changed it back to $(EXECUTABLE_NAME), which is
automatically replaced by Xcode, and added a sed command to the
make target to replace it with the actual executable name (as
we did with the $(PRODUCT_BUNDLE_IDENTIFIER) already).
An alternative would be to hardcode the name to "scummvm" in the
Info.plist and change the iphonebundle and ios7bundle target to
also use all lower case scummvm when copying the executable.
iOS 12 drops support for libstdc++, so the project needs to be compiled explicitly using libc++.
Support the "safe area" when redrawing the view to leave space for the notch in portrait and
landscape orientations.