[Scummvm-git-logs] scummvm master -> e37ab61eca1288e99a88184da910d4467af4c073
sev-
noreply at scummvm.org
Sun Dec 3 20:00:38 UTC 2023
This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3245ec5687 IOS7: Use MacText tables in help section
737c1dfb17 DOC: Update iOS portal documentation
fff52cbda1 IOS7: Add more buttons to the Virtual Controller
b16faf1187 IOS7: Add options backend checkbox to use minimal gamepad layout
81401a1f2e IOS7: Add minimal gamepad layout
e37ab61eca IOS7: Enable/disable gesturers on virtual controller connect
Commit: 3245ec56877404ddb8462cce8dcea850376c2ca9
https://github.com/scummvm/scummvm/commit/3245ec56877404ddb8462cce8dcea850376c2ca9
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-12-03T21:00:32+01:00
Commit Message:
IOS7: Use MacText tables in help section
Describe the touch actions using a table in the help section. This
will make the help documentation more readable.
Changed paths:
backends/platform/ios7/ios7_osys_misc.mm
diff --git a/backends/platform/ios7/ios7_osys_misc.mm b/backends/platform/ios7/ios7_osys_misc.mm
index 9fe5f870a1a..6855c79acc4 100644
--- a/backends/platform/ios7/ios7_osys_misc.mm
+++ b/backends/platform/ios7/ios7_osys_misc.mm
@@ -250,7 +250,7 @@ _s("Touch Controls"),
"ios-help.zip",
_s(
"## Touch control modes\n"
-"The touch control mode can be changed by tapping or clicking on the controller icon in the upper right corner or by swiping two fingers from left to right.\n"
+"The touch control mode can be changed by tapping or clicking on the controller icon in the upper right corner, by swiping two fingers from left to right or in the global settings From the Launcher, go to **Global Options > BackenChoose the preferred touch mode. Itâs possible to configure the touch mode for three situations (ScummVM menus, 2D games and 3D games).\n"
"\n"
"### Direct mouse \n"
"\n"
@@ -268,21 +268,17 @@ _s(
"\n"
"## Touch actions \n"
"\n"
-"### One finger tap \n"
-"\n"
-"Tap one finger to perform a left mouse click"
-"\n"
-"### Two fingers tap\n"
-"\n"
-"Tap two fingers to perform a right mouse click\n"
-"\n"
-"### One finger long press\n"
-"\n"
-"Touch and hold one finger for at least 0.5 seconds to perform a left mouse button hold and drag, such as for selection from action wheel in Curse of Monkey Island.\n"
-"\n"
-"### Two fingers long press\n"
-"\n"
-"Touch and hold two fingers for at least 0.5 seconds to perform a right mouse button hold and drag, such as for selection from action wheel in Tony Tough.\n"
+"| Gesture | Action \n"
+"| ------------------|-------------------\n"
+"| `One finger tap` | Left mouse click \n"
+"| `Two fingers tap` | Right mouse click \n"
+"| `Two fingers double tap` | ESC \n"
+"| `One finger press & hold for >0.5s` | Left mouse button hold and drag, such as for selection from action wheel in Curse of Monkey Island \n"
+"| `Two fingers press & hold for >0.5s` | Right mouse button hold and drag, such as for selection from action wheel in Tony Tough \n"
+"| `Two fingers swipe (left to right)` | Toggles between the touch modes \n"
+"| `Two fingers swipe (right to left)` | Toggles virtual controller (>iOS 15) \n"
+"| `Two fingers swipe (top to bottom)` | Access Global Main Menu in games \n"
+"| `Pinch (zoom in/out)` | Enables/disables keyboard \n"
"\n"
"### Virtual Gamepad \n"
"\n"
Commit: 737c1dfb1781794b012c6d64926efb21df61af27
https://github.com/scummvm/scummvm/commit/737c1dfb1781794b012c6d64926efb21df61af27
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-12-03T21:00:32+01:00
Commit Message:
DOC: Update iOS portal documentation
Update the portal documentation for the iOS port. The touch actions
have been updated and the "Click-and-drag" mode has been removed.
Add a "Known issues" section describing the currently known issues
in the iOS port. These have been encountered by users using the
TestFlight version.
Changed paths:
doc/docportal/other_platforms/ios.rst
diff --git a/doc/docportal/other_platforms/ios.rst b/doc/docportal/other_platforms/ios.rst
index 497e22785ad..7e46b69c6a6 100644
--- a/doc/docportal/other_platforms/ios.rst
+++ b/doc/docportal/other_platforms/ios.rst
@@ -39,7 +39,8 @@ Controls
One finger tap, Left mouse click
:ref:`twofinger`, Right mouse click
:ref:`twofingerdouble`,ESC
- Two finger swipe (bottom to top), Toggles `Click and drag mode`_
+ One finger press & hold for >0.5s, Left mouse button hold and drag, such as for selection from action wheel in Curse of Monkey Island.
+ Two fingers press & hold for >0.5s, Right mouse button hold and drag, such as for selection from action wheel in Tony Tough.
Two finger swipe (left to right), Toggles between touch direct mode and touchpad mode.
Two finger swipe (right to left), Show/hide on-screen control (iOS 15 and later)
Two finger swipe (top to bottom), Global Main Menu
@@ -51,12 +52,16 @@ Controls
Touch controls
*******************
-The touch control scheme can be switched in the global settings. From the Launcher, go to **Options > Control > Touchpad mouse mode**.
+The touch control scheme can be switched in the global settings. From the Launcher, go to **Options > Control > Touchpad mouse mode**. It's possible to configure the touch mode for three situations (ScummVM menus, 2D games and 3D games) and choose one of the two possible modes:
- - When touchpad mouse mode is off, the touch controls are direct. The pointer jumps to where the finger touches the screen.
- - When touchpad mouse mode is on, the touch controls are indirect. The finger can be far away from the pointer and still move it, like on a laptop touchpad.
+ - Direct mouse, the touch controls are direct. The pointer jumps to where the finger touches the screen (default for menus).
+ - Touchpad emulation, the touch controls are indirect. The finger can be far away from the pointer and still move it, like on a laptop touchpad.
- The pointer speed setting in the :doc:`Controls tab <../settings/control>` affects how far the pointer moves in response to a finger movement.
+The touch mode can be switched at anytime by tapping on the controller icon, next to the menu icon at the top right of the screen.
+
+To display or hide the small controller icon, from the Launcher select **Options** and then the **Backend** tab. Tick the **Show on-screen control** box to enable the controller icon.
+
.. _twofinger:
Two finger tap
@@ -71,22 +76,17 @@ Two finger double tap
For a two finger double tap, hold one finger down and then double tap with a second finger.
-
-Click and drag mode
-^^^^^^^^^^^^^^^^^^^^^^^
-
-Simulates a left mouse click when you touch the screen. The mouse pointer drags to wherever you slide your finger, and releases where you lift your finger.
-
-If you press down a second finger in this mode, it releases the simulated left mouse button, and presses down the simulated right mouse button. The right mouse button is released when you lift your finger again.
-
Keyboard
^^^^^^^^^^^^^^^^^^^^
-If no external keyboard is connected, the pinch gesture shows and hides the onscreen keyboard. When an external keyboard is connected, the pinch gesture enables/disables inputs from the external keyboard.
+
+If no external keyboard is connected, the pinch gesture shows and hides the onscreen keyboard. When an external keyboard is connected the inputs from the external keyboard is enaled by default.
Game controllers
^^^^^^^^^^^^^^^^^^^^
+
If running iOS 14 and later there is support for connected mouses and gamepad controllers using the Apple Game Controller framework. Only "Extended Gamepad Controllers" are supported at the moment. For more information visit https://developer.apple.com/documentation/gamecontroller/gcextendedgamepad
+
Paths
=======
@@ -99,3 +99,12 @@ Configuration file
*********************
``/var/mobile/Library/ScummVM/Preferences`` if the device is jailbroken, or ``Preferences`` in the ScummVM folder for a non-jailbroken device. Access this folder through the Finder or iTunes.
+
+
+Known issues
+===============
+
+- If ScummVM is uninstalled or downgraded, its internal and external app spaces are fully deleted. If you want to keep saved games use ScummVM's :doc:`cloud <../use_scummvm/connect_cloud>` or LAN functionality to keep those files. Alternatively, change the saved game path to a shared location such as an SD card.
+- If closing the ScummVM application (background mode) and then killing the application (by swiping the application upwards) there is a risk that the ScummVM configuration file becomes corrupted. Make sure not to kill the application to soon after ptting it to background.
+- In rare cases the ScummVM folder is not created in the "Files" application after installing ScummVM. Make sure the ScummVM folder shows up after installation. If not, uninstall the ScummVM, restart the iOS device and reinstall ScummVM.
+- In rare cases the system mouse pointer on iPadOS is not hidden so both the ScummVM arrow mouse pointer and the iPadOS system pointer are seen in parallell. It's usually fixed when restartarting the iPad.
Commit: fff52cbda124db571b65f13fb08d54422ed3607d
https://github.com/scummvm/scummvm/commit/fff52cbda124db571b65f13fb08d54422ed3607d
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-12-03T21:00:32+01:00
Commit Message:
IOS7: Add more buttons to the Virtual Controller
There are games using more buttons than are currently configured for
the virtual controller. Add a right thumbstick and left and right
shoulder buttons. The shoulder buttons are e.g. used in Escape from
Monkey Island to browse the items in the action list.
Changed paths:
backends/platform/ios7/ios7_gamepad_controller.mm
diff --git a/backends/platform/ios7/ios7_gamepad_controller.mm b/backends/platform/ios7/ios7_gamepad_controller.mm
index b18439faa42..d9489acdcc8 100644
--- a/backends/platform/ios7/ios7_gamepad_controller.mm
+++ b/backends/platform/ios7/ios7_gamepad_controller.mm
@@ -65,9 +65,9 @@
if (@available(iOS 15.0, *)) {
// Configure a simple game controller with dPad and A and B buttons
_configDpad = [[GCVirtualControllerConfiguration alloc] init];
- _configDpad.elements = [[NSSet alloc] initWithObjects:GCInputDirectionPad, GCInputButtonA, GCInputButtonB, GCInputButtonX, GCInputButtonY, nil];
+ _configDpad.elements = [[NSSet alloc] initWithObjects:GCInputDirectionPad, GCInputRightThumbstick, GCInputButtonA, GCInputButtonB, GCInputButtonX, GCInputButtonY, GCInputLeftShoulder, GCInputRightShoulder, nil];
_configThumbstick = [[GCVirtualControllerConfiguration alloc] init];
- _configThumbstick.elements = [[NSSet alloc] initWithObjects:GCInputLeftThumbstick, GCInputButtonA, GCInputButtonB, GCInputButtonX, GCInputButtonY, nil];
+ _configThumbstick.elements = [[NSSet alloc] initWithObjects:GCInputLeftThumbstick, GCInputRightThumbstick, GCInputButtonA, GCInputButtonB, GCInputButtonX, GCInputButtonY, GCInputLeftShoulder, GCInputRightShoulder, nil];
_virtualControllerThumbstick = [[GCVirtualController alloc] initWithConfiguration:_configThumbstick];
_virtualControllerDpad = [[GCVirtualController alloc] initWithConfiguration:_configDpad];
_currentController = _virtualControllerThumbstick;
Commit: b16faf11878bde1dcf87be9fe5ad639b44752f04
https://github.com/scummvm/scummvm/commit/b16faf11878bde1dcf87be9fe5ad639b44752f04
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-12-03T21:00:32+01:00
Commit Message:
IOS7: Add options backend checkbox to use minimal gamepad layout
Add a checkbox to allow users to have a minimal gamepad layout.
The minimal layout will be implemented in next commit. The layout
will consist of less buttons. This allows users to select which
controller layout to use, a full layout with many buttons for
games requiring it or a minimal with less buttons.
Changed paths:
backends/platform/ios7/ios7_options.mm
diff --git a/backends/platform/ios7/ios7_options.mm b/backends/platform/ios7/ios7_options.mm
index 1b311425a96..93d95fa5fd9 100644
--- a/backends/platform/ios7/ios7_options.mm
+++ b/backends/platform/ios7/ios7_options.mm
@@ -68,6 +68,7 @@ private:
GUI::StaticTextWidget *_gamepadControllerOpacityLabel;
GUI::StaticTextWidget *_gamepadControllerDirectionalInputDesc;
GUI::PopUpWidget *_gamepadControllerDirectionalInputPopUp;
+ GUI::CheckboxWidget *_gamepadControllerMinimalLayoutCheckbox;
GUI::CheckboxWidget *_keyboardFnBarCheckbox;
#if TARGET_OS_IOS
@@ -103,6 +104,7 @@ IOS7OptionsWidget::IOS7OptionsWidget(GuiObject *boss, const Common::String &name
_gamepadControllerDirectionalInputPopUp = new GUI::PopUpWidget(widgetsBoss(), "IOS7OptionsDialog.GamepadControllerLeftButtonPopUp");
_gamepadControllerDirectionalInputPopUp->appendEntry(_("Thumbstick"), kDirectionalInputThumbstick);
_gamepadControllerDirectionalInputPopUp->appendEntry(_("Dpad"), kDirectionalInputDpad);
+ _gamepadControllerMinimalLayoutCheckbox = new GUI::CheckboxWidget(widgetsBoss(), "IOS7OptionsDialog.GamepadControllerMinimalLayout", _("Use minimal gamepad layout"));
_keyboardFnBarCheckbox = new GUI::CheckboxWidget(widgetsBoss(), "IOS7OptionsDialog.KeyboardFunctionBar", _("Show keyboard function bar"));
@@ -191,6 +193,7 @@ void IOS7OptionsWidget::defineLayout(GUI::ThemeEval &layouts, const Common::Stri
.addWidget("GamepadControllerOpacitySlider", "Slider")
.addWidget("GamepadControllerOpacityLabel", "OptionsLabel")
.closeLayout()
+ .addWidget("GamepadControllerMinimalLayout", "Checkbox")
.addWidget("KeyboardFunctionBar", "Checkbox");
#if TARGET_OS_IOS
@@ -352,6 +355,7 @@ void IOS7OptionsWidget::load() {
_gamepadControllerOpacitySlider->setValue(ConfMan.getInt("gamepad_controller_opacity", _domain));
_gamepadControllerOpacityLabel->setValue(_gamepadControllerOpacitySlider->getValue());
_gamepadControllerDirectionalInputPopUp->setSelectedTag(loadDirectionalInput("gamepad_controller_directional_input", !inAppDomain, kDirectionalInputThumbstick));
+ _gamepadControllerMinimalLayoutCheckbox->setState(ConfMan.getBool("gamepad_controller_minimal_layout", _domain));
_keyboardFnBarCheckbox->setState(ConfMan.getBool("keyboard_fn_bar", _domain));
@@ -380,6 +384,7 @@ bool IOS7OptionsWidget::save() {
ConfMan.setBool("gamepad_controller", _gamepadControllerCheckbox->getState(), _domain);
ConfMan.setInt("gamepad_controller_opacity", _gamepadControllerOpacitySlider->getValue(), _domain);
ConfMan.setInt("gamepad_controller_directional_input", _gamepadControllerDirectionalInputPopUp->getSelectedTag(), _domain);
+ ConfMan.setBool("gamepad_controller_minimal_layout", _gamepadControllerMinimalLayoutCheckbox->getState(), _domain);
ConfMan.setBool("keyboard_fn_bar", _keyboardFnBarCheckbox->getState(), _domain);
@@ -401,6 +406,7 @@ bool IOS7OptionsWidget::save() {
ConfMan.removeKey("gamepad_controller", _domain);
ConfMan.removeKey("gamepad_controller_opacity", _domain);
ConfMan.removeKey("gamepad_controller_directional_input", _domain);
+ ConfMan.removeKey("gamepad_controller_minimal_layout", _domain);
#if TARGET_OS_IOS
if (inAppDomain) {
@@ -427,7 +433,7 @@ bool IOS7OptionsWidget::hasKeys() {
bool hasKeys = ConfMan.hasKey("gamepad_controller", _domain) ||
ConfMan.hasKey("gamepad_controller_opacity", _domain) ||
ConfMan.hasKey("gamepad_controller_directional_input", _domain) ||
-
+ ConfMan.hasKey("gamepad_controller_minimal_layout", _domain) ||
ConfMan.hasKey("touch_mode_menus", _domain) ||
ConfMan.hasKey("touch_mode_2d_games", _domain) ||
ConfMan.hasKey("touch_mode_3d_games", _domain);
@@ -455,12 +461,14 @@ void IOS7OptionsWidget::setEnabled(bool e) {
_gamepadControllerOpacityDesc->setEnabled(e);
_gamepadControllerOpacitySlider->setEnabled(e);
_gamepadControllerOpacityLabel->setEnabled(e);
+ _gamepadControllerMinimalLayoutCheckbox->setEnabled(e);
} else {
_gamepadControllerCheckbox->setEnabled(false);
_gamepadControllerDirectionalInputPopUp->setEnabled(false);
_gamepadControllerOpacityDesc->setEnabled(false);
_gamepadControllerOpacitySlider->setEnabled(false);
_gamepadControllerOpacityLabel->setEnabled(false);
+ _gamepadControllerMinimalLayoutCheckbox->setEnabled(false);
}
#endif /* __IPHONE_15_0 */
#else /* TARGET_OS_IOS */
@@ -470,6 +478,7 @@ void IOS7OptionsWidget::setEnabled(bool e) {
_gamepadControllerOpacityDesc->setEnabled(false);
_gamepadControllerOpacitySlider->setEnabled(false);
_gamepadControllerOpacityLabel->setEnabled(false);
+ _gamepadControllerMinimalLayoutCheckbox->setEnabled(false);
#endif /* TARGET_OS_IOS */
_keyboardFnBarCheckbox->setEnabled(e);
@@ -503,6 +512,7 @@ void OSystem_iOS7::registerDefaultSettings(const Common::String &target) const {
ConfMan.registerDefault("gamepad_controller", false);
ConfMan.registerDefault("gamepad_controller_opacity", 6);
ConfMan.registerDefault("gamepad_controller_directional_input", kDirectionalInputThumbstick);
+ ConfMan.registerDefault("gamepad_controller_minimal_layout", false);
ConfMan.registerDefault("touch_mode_menus", "direct");
ConfMan.registerDefault("touch_mode_2d_games", "touchpad");
Commit: 81401a1f2e19436926b1de3439df41bf16cd15c1
https://github.com/scummvm/scummvm/commit/81401a1f2e19436926b1de3439df41bf16cd15c1
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-12-03T21:00:32+01:00
Commit Message:
IOS7: Add minimal gamepad layout
This will only consist of a left directional input and the buttons
A, B, X and Y.
Changed paths:
backends/platform/ios7/ios7_gamepad_controller.mm
diff --git a/backends/platform/ios7/ios7_gamepad_controller.mm b/backends/platform/ios7/ios7_gamepad_controller.mm
index d9489acdcc8..468c26e4cc5 100644
--- a/backends/platform/ios7/ios7_gamepad_controller.mm
+++ b/backends/platform/ios7/ios7_gamepad_controller.mm
@@ -36,13 +36,21 @@
API_AVAILABLE(ios(15.0))
GCVirtualController *_virtualControllerThumbstick;
API_AVAILABLE(ios(15.0))
+ GCVirtualController *_virtualControllerMiniThumbstick;
+ API_AVAILABLE(ios(15.0))
GCVirtualController *_virtualControllerDpad;
API_AVAILABLE(ios(15.0))
+ GCVirtualController *_virtualControllerMiniDpad;
+ API_AVAILABLE(ios(15.0))
GCVirtualController *_currentController;
API_AVAILABLE(ios(15.0))
GCVirtualControllerConfiguration *_configDpad;
API_AVAILABLE(ios(15.0))
+ GCVirtualControllerConfiguration *_configMiniDpad;
+ API_AVAILABLE(ios(15.0))
GCVirtualControllerConfiguration *_configThumbstick;
+ API_AVAILABLE(ios(15.0))
+ GCVirtualControllerConfiguration *_configMiniThumbstick;
#endif
#endif
int _currentDpadXValue;
@@ -65,11 +73,36 @@
if (@available(iOS 15.0, *)) {
// Configure a simple game controller with dPad and A and B buttons
_configDpad = [[GCVirtualControllerConfiguration alloc] init];
- _configDpad.elements = [[NSSet alloc] initWithObjects:GCInputDirectionPad, GCInputRightThumbstick, GCInputButtonA, GCInputButtonB, GCInputButtonX, GCInputButtonY, GCInputLeftShoulder, GCInputRightShoulder, nil];
+ _configMiniDpad = [[GCVirtualControllerConfiguration alloc] init];
_configThumbstick = [[GCVirtualControllerConfiguration alloc] init];
- _configThumbstick.elements = [[NSSet alloc] initWithObjects:GCInputLeftThumbstick, GCInputRightThumbstick, GCInputButtonA, GCInputButtonB, GCInputButtonX, GCInputButtonY, GCInputLeftShoulder, GCInputRightShoulder, nil];
+ _configMiniThumbstick = [[GCVirtualControllerConfiguration alloc] init];
+
+ NSArray<NSString *> *_commonElements = [[NSArray alloc] initWithObjects: GCInputButtonA, GCInputButtonB, GCInputButtonX, GCInputButtonY, nil];
+ NSArray<NSString *> *_additionalElements = [[NSArray alloc] initWithObjects: GCInputRightThumbstick, GCInputLeftShoulder, GCInputRightShoulder, nil];
+
+ NSMutableSet<NSString *> *_fullSetElementsThumbstick = [[NSMutableSet alloc] initWithObjects: GCInputLeftThumbstick, nil];
+ [_fullSetElementsThumbstick addObjectsFromArray:_commonElements];
+ [_fullSetElementsThumbstick addObjectsFromArray:_additionalElements];
+
+ NSMutableSet<NSString *> *_miniSetElementsThumbstick = [[NSMutableSet alloc] initWithObjects:GCInputLeftThumbstick, nil];
+ [_miniSetElementsThumbstick addObjectsFromArray:_commonElements];
+
+ NSMutableSet<NSString *> *_fullSetElementsDpad = [[NSMutableSet alloc] initWithObjects: GCInputDirectionalDpad, nil];
+ [_fullSetElementsDpad addObjectsFromArray:_commonElements];
+ [_fullSetElementsDpad addObjectsFromArray:_additionalElements];
+
+ NSMutableSet<NSString *> *_miniSetElementsDpad = [[NSMutableSet alloc] initWithObjects:GCInputDirectionalDpad, nil];
+ [_miniSetElementsDpad addObjectsFromArray:_commonElements];
+
+ _configThumbstick.elements = _fullSetElementsThumbstick;
+ _configMiniThumbstick.elements = _miniSetElementsThumbstick;
+ _configDpad.elements = _fullSetElementsDpad;
+ _configMiniDpad.elements = _miniSetElementsDpad;
+
_virtualControllerThumbstick = [[GCVirtualController alloc] initWithConfiguration:_configThumbstick];
+ _virtualControllerMiniThumbstick = [[GCVirtualController alloc] initWithConfiguration:_configMiniThumbstick];
_virtualControllerDpad = [[GCVirtualController alloc] initWithConfiguration:_configDpad];
+ _virtualControllerMiniDpad = [[GCVirtualController alloc] initWithConfiguration:_configMiniDpad];
_currentController = _virtualControllerThumbstick;
}
#endif
@@ -135,7 +168,17 @@
#if TARGET_OS_IOS
#ifdef __IPHONE_15_0
if (@available(iOS 15.0, *)) {
- GCVirtualController *controller = ConfMan.getInt("gamepad_controller_directional_input") == kDirectionalInputThumbstick ? _virtualControllerThumbstick : _virtualControllerDpad;
+ GCVirtualController *controller;
+ switch (ConfMan.getInt("gamepad_controller_directional_input")) {
+ case kDirectionalInputThumbstick:
+ controller = ConfMan.getBool("gamepad_controller_minimal_layout") ? _virtualControllerMiniThumbstick : _virtualControllerThumbstick;
+ break;
+ case kDirectionalInputDpad:
+ default:
+ controller = ConfMan.getBool("gamepad_controller_minimal_layout") ? _virtualControllerMiniDpad : _virtualControllerDpad;
+ break;
+ }
+
if (_currentController != controller) {
[_currentController disconnect];
}
Commit: e37ab61eca1288e99a88184da910d4467af4c073
https://github.com/scummvm/scummvm/commit/e37ab61eca1288e99a88184da910d4467af4c073
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-12-03T21:00:32+01:00
Commit Message:
IOS7: Enable/disable gesturers on virtual controller connect
Dont trigger mouse down events in case virtual controller is
connected. When pressing buttons this also trigger tap gestures
and when holding down buttons this triggers long press gestures.
Disable these gestures when virtual controller connects and enable
them again when controller disconnects.
Changed paths:
backends/platform/ios7/ios7_video.mm
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index 207f3e65842..d0522b130c7 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -88,6 +88,8 @@ bool iOS7_fetchEvent(InternalEvent *event) {
UIButton *_toggleTouchModeButton;
UITapGestureRecognizer *oneFingerTapGesture;
UITapGestureRecognizer *twoFingerTapGesture;
+ UILongPressGestureRecognizer *oneFingerLongPressGesture;
+ UILongPressGestureRecognizer *twoFingerLongPressGesture;
#endif
}
@@ -210,7 +212,7 @@ bool iOS7_fetchEvent(InternalEvent *event) {
[twoFingerTapGesture setDelaysTouchesEnded:NO];
// Default long press duration is 0.5 seconds which suits us well
- UILongPressGestureRecognizer *oneFingerLongPressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(oneFingerLongPress:)];
+ oneFingerLongPressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(oneFingerLongPress:)];
[oneFingerLongPressGesture setNumberOfTouchesRequired:1];
[oneFingerLongPressGesture setAllowedTouchTypes:@[@(UITouchTypeDirect)]];
[oneFingerLongPressGesture setDelaysTouchesBegan:NO];
@@ -218,7 +220,7 @@ bool iOS7_fetchEvent(InternalEvent *event) {
[oneFingerLongPressGesture setCancelsTouchesInView:NO];
[oneFingerLongPressGesture canPreventGestureRecognizer:oneFingerTapGesture];
- UILongPressGestureRecognizer *twoFingerLongPressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(twoFingerLongPress:)];
+ twoFingerLongPressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(twoFingerLongPress:)];
[twoFingerLongPressGesture setNumberOfTouchesRequired:2];
[twoFingerLongPressGesture setAllowedTouchTypes:@[@(UITouchTypeDirect)]];
[twoFingerLongPressGesture setDelaysTouchesBegan:NO];
@@ -539,11 +541,27 @@ bool iOS7_fetchEvent(InternalEvent *event) {
}
}
+#if TARGET_OS_IOS
+- (void)enableGestures:(BOOL)enabled {
+ [oneFingerTapGesture setEnabled:enabled];
+ [twoFingerTapGesture setEnabled:enabled];
+ [oneFingerLongPressGesture setEnabled:enabled];
+ [twoFingerLongPressGesture setEnabled:enabled];
+}
+#endif
+
- (void)virtualController:(bool)connect {
if (@available(iOS 15.0, *)) {
for (GameController *c : _controllers) {
if ([c isKindOfClass:GamepadController.class]) {
[(GamepadController*)c virtualController:connect];
+#if TARGET_OS_IOS
+ if (connect) {
+ [self enableGestures:NO];
+ } else {
+ [self enableGestures:YES];
+ }
+#endif
}
}
}
More information about the Scummvm-git-logs
mailing list