[Scummvm-git-logs] scummvm branch-2-8 -> f921c6acd980747fef5f9a3b71ce73824af1ef14

larsamannen noreply at scummvm.org
Sat Mar 2 11:06:35 UTC 2024


This automated email contains information about 13 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2fb03e4a51 IOS7: Fix toggling of mouse mode when HW keyboard connected
bef7933e25 IOS7: Make "Designed for iPad" on Mac silicon great again
6684dea683 IOS7: Update the window size correctly
326833c0e3 IOS7: Make specific options if running in macOS
b87b03ef16 IOS7: Pass key modifier flags to key events
9d6150fc84 IOS7: Add helper functions to overload keys
8c9608b928 IOS7: Add functions creating UIKeyCommands for arrow keys
b423d3a327 IOS7: Add functions creating UIKeyCommands for roman letter keys
7fed8f4fe0 IOS7: Add functions creating UIKeyCommands for number keys
80dcfe0ff9 IOS7: Add functions creating UIKeyCommands for Fn keys
28c5aaa40b IOS7: Add functions creating UIKeyCommands for special keys
823a060601 IOS7: Use new key overload functions
f921c6acd9 AUDIO: Fix problem where fluidsynth soundfont could not be loaded


Commit: 2fb03e4a51da3db5a260f984e585d480553684ba
    https://github.com/scummvm/scummvm/commit/2fb03e4a51da3db5a260f984e585d480553684ba
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
IOS7: Fix toggling of mouse mode when HW keyboard connected

It was not possible to change the mouse mode between "Direct mouse"
and "Touchpad emulation" if a hardware keyboard was connected when
using the on-screen control button.

Fix this by checking if a hardware keyboard is connected.

Cherry-pick of: 19d173ea1bd8d90c30c6e955650cd98f19ce352a

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 d0522b130c7..42877eda7a5 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -389,7 +389,14 @@ bool iOS7_fetchEvent(InternalEvent *event) {
 
 #if TARGET_OS_IOS
 - (void)triggerTouchModeChanged {
-	if ([self isKeyboardShown]) {
+	BOOL hwKeyboardConnected = NO;
+	if (@available(iOS 14.0, *)) {
+		if (GCKeyboard.coalescedKeyboard != nil) {
+			hwKeyboardConnected = YES;
+		}
+	}
+
+	if ([self isKeyboardShown] && !hwKeyboardConnected) {
 		[self hideKeyboard];
 	} else {
 		[self addEvent:InternalEvent(kInputTouchModeChanged, 0, 0)];


Commit: bef7933e25c0536a5ac3da65890e722788608282
    https://github.com/scummvm/scummvm/commit/bef7933e25c0536a5ac3da65890e722788608282
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
IOS7: Make "Designed for iPad" on Mac silicon great again

It is possible to run iOS applications on macOS on Mac computers
running on Apple Silicon. This was possible before moving to the
ModularGraphicsBackend implementation in the iOS7 port with just
a little tweaking.

After the move to ModularGraphicsBackend, the ScummVM application
crashed on launch. There were two reasons for crashing;

1. dlsym() was called with the special handle RTLD_SELF to search
for the address binding of the GLES2 load symbol. Using RTLD_SELF
the search for the symbol is limited to the shared object issuing
the call to dlsym() and those shared objjects which were loaded
after it. When running an iOS app in macOS it seems that the app
is running inside a wrapper, which means that the objects resides
in a different level. Changing the search level to RTLD_DEFAULT
changes the search to also include all objects loaded at program
start-up.

2. As for the native macOS application, XCode also adds the
argument -NSDocumentRevisionsDebugMode YES if XCode option
"Allow debugging when using document Versions Browser" is on.
Make sure not to parse that argument also when building the
IPHONE target.

Cherry-pick of: 9d63f3901c2b57ba79f14cab8e462e8c096021c5

Changed paths:
    backends/platform/ios7/ios7_osys_main.cpp
    base/commandLine.cpp


diff --git a/backends/platform/ios7/ios7_osys_main.cpp b/backends/platform/ios7/ios7_osys_main.cpp
index 33911a90fc3..3c8ce68601d 100644
--- a/backends/platform/ios7/ios7_osys_main.cpp
+++ b/backends/platform/ios7/ios7_osys_main.cpp
@@ -114,7 +114,7 @@ OSystem_iOS7::~OSystem_iOS7() {
 
 #if defined(USE_OPENGL) && defined(USE_GLAD)
 void *OSystem_iOS7::getOpenGLProcAddress(const char *name) const {
-	return dlsym(RTLD_SELF, name);
+	return dlsym(RTLD_DEFAULT, name);
 }
 #endif
 
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 1e82b438539..eb841e7988d 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -586,7 +586,7 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
 			// to pass the process serial number. We need to ignore it to avoid an error.
 			// When using XCode it also adds -NSDocumentRevisionsDebugMode YES argument if XCode option
 			// "Allow debugging when using document Versions Browser" is on (which is the default).
-#ifdef MACOSX
+#if defined(MACOSX) || defined(IPHONE)
 			if (strncmp(s, "-psn_", 5) == 0)
 				continue;
 			if (strcmp(s, "-NSDocumentRevisionsDebugMode") == 0) {


Commit: 6684dea6834b0e189fb0827df8d0f6efe444f68a
    https://github.com/scummvm/scummvm/commit/6684dea6834b0e189fb0827df8d0f6efe444f68a
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
IOS7: Update the window size correctly

Applications running on iOS are usually full screen. On newer iPads
and when running iOS applications on macOS the application window
size can be changed.

When running the iOS application on macOS using "Designed for iPad"
option, the window can be changed, also to full screen. The function
"safeAreaInsetsDidChange" is then called. Update the screen size
using the view window property instead of checking the UIScreen
window bounds since these never changes.

If forcing the application to run in full screen setting the option
UIRequiresFullScreen to TRUE, it seems to trigger ScummVM to run
in portrait mode instead of landscape mode when running the app in
macOS using "Designed for iPad" on Apple silicon macs.

The UI doesn't require full screen since the application handles
resolution changes nice.

Cherry-pick of: 2eb03dbc042cea394ff6afe0b1e1535458cef725

Changed paths:
    backends/platform/ios7/ios7_video.mm
    dists/ios7/Info.plist
    dists/ios7/Info.plist.in


diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index 42877eda7a5..7089a33d563 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -471,7 +471,7 @@ bool iOS7_fetchEvent(InternalEvent *event) {
 	if ( @available(iOS 11, tvOS 11, *) ) {
 		CGRect newFrame = self.frame;
 #if TARGET_OS_IOS
-		CGRect screenSize = [[UIScreen mainScreen] bounds];
+		CGRect screenSize = self.window.bounds;
 		UIEdgeInsets inset = [[[UIApplication sharedApplication] keyWindow] safeAreaInsets];
 		UIInterfaceOrientation orientation = [iOS7AppDelegate currentOrientation];
 
diff --git a/dists/ios7/Info.plist b/dists/ios7/Info.plist
index 87b728e0da6..c43794d71f8 100644
--- a/dists/ios7/Info.plist
+++ b/dists/ios7/Info.plist
@@ -53,7 +53,7 @@
 	<key>UIPrerenderedIcon</key>
 	<true/>
 	<key>UIRequiresFullScreen</key>
-	<true/>
+	<false/>
 	<key>UIStatusBarHidden</key>
 	<true/>
 	<key>UISupportedInterfaceOrientations</key>
diff --git a/dists/ios7/Info.plist.in b/dists/ios7/Info.plist.in
index 03fd5c2799d..247e7f0d568 100644
--- a/dists/ios7/Info.plist.in
+++ b/dists/ios7/Info.plist.in
@@ -53,7 +53,7 @@
 	<key>UIPrerenderedIcon</key>
 	<true/>
 	<key>UIRequiresFullScreen</key>
-	<true/>
+	<false/>
 	<key>UIStatusBarHidden</key>
 	<true/>
 	<key>UISupportedInterfaceOrientations</key>


Commit: 326833c0e31e3f1c814332071b07a18b1c117400
    https://github.com/scummvm/scummvm/commit/326833c0e31e3f1c814332071b07a18b1c117400
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
IOS7: Make specific options if running in macOS

Add a convenience function to check if the application is running
in macOS. Use this method to change the default visibility of on-
screen control buttons and function bar.
Neither of these are needed when running on macOS since both mouse
and keyboard are available. Also the mouse pointer in ScummVM does
not access the on-screen control buttons.

However this requires function keys and key combinations like e.g.
Alt+X to work to be able to save and quit games.
These will be added in future commits.

Cherry-pick of: 3d1fa1c1dd72289625fff0e9e0985110b6dbb67b

Changed paths:
    backends/platform/ios7/ios7_options.mm
    backends/platform/ios7/ios7_osys_main.h
    backends/platform/ios7/ios7_osys_video.mm
    backends/platform/ios7/ios7_video.h
    backends/platform/ios7/ios7_video.mm


diff --git a/backends/platform/ios7/ios7_options.mm b/backends/platform/ios7/ios7_options.mm
index 2cd9c265a54..42c48a86381 100644
--- a/backends/platform/ios7/ios7_options.mm
+++ b/backends/platform/ios7/ios7_options.mm
@@ -521,13 +521,13 @@ void OSystem_iOS7::registerDefaultSettings(const Common::String &target) const {
 	ConfMan.registerDefault("touch_mode_2d_games", "touchpad");
 	ConfMan.registerDefault("touch_mode_3d_games", "gamepad");
 
-	ConfMan.registerDefault("keyboard_fn_bar", true);
+	ConfMan.registerDefault("keyboard_fn_bar", isiOSAppOnMac() ? false : true);
 
 #if TARGET_OS_IOS
 	ConfMan.registerDefault("orientation_menus", "auto");
 	ConfMan.registerDefault("orientation_games", "auto");
 
-	ConfMan.registerDefault("onscreen_control", true);
+	ConfMan.registerDefault("onscreen_control", isiOSAppOnMac() ? false : true);
 #endif
 }
 
diff --git a/backends/platform/ios7/ios7_osys_main.h b/backends/platform/ios7/ios7_osys_main.h
index b9e19702368..040f1c49f0c 100644
--- a/backends/platform/ios7/ios7_osys_main.h
+++ b/backends/platform/ios7/ios7_osys_main.h
@@ -157,6 +157,7 @@ public:
 
 	bool isConnectionLimited() override;
 	void virtualController(bool connect);
+	bool isiOSAppOnMac() const;
 
 	virtual Common::String getDefaultLogFileName() override { return Common::String("/scummvm.log"); }
 
diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm
index 46282bc6793..9b58074b11e 100644
--- a/backends/platform/ios7/ios7_osys_video.mm
+++ b/backends/platform/ios7/ios7_osys_video.mm
@@ -165,6 +165,14 @@ void OSystem_iOS7::virtualController(bool connect) {
 	});
 }
 
+bool OSystem_iOS7::isiOSAppOnMac() const {
+	__block bool isiOSAppOnMac = false;
+	execute_on_main_thread(^ {
+		isiOSAppOnMac = [[iOS7AppDelegate iPhoneView] isiOSAppOnMac];
+	});
+	return isiOSAppOnMac;
+}
+
 void OSystem_iOS7::setShowKeyboard(bool show) {
 	if (show) {
 #if TARGET_OS_IOS
diff --git a/backends/platform/ios7/ios7_video.h b/backends/platform/ios7/ios7_video.h
index 8b222786b9e..011c75ae0e0 100644
--- a/backends/platform/ios7/ios7_video.h
+++ b/backends/platform/ios7/ios7_video.h
@@ -77,6 +77,7 @@ uint getSizeNextPOT(uint size);
 #if TARGET_OS_IOS
 - (void)interfaceOrientationChanged:(UIInterfaceOrientation)orientation;
 - (void)updateTouchMode;
+- (BOOL)isiOSAppOnMac;
 #endif
 
 - (void)showKeyboard;
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index 7089a33d563..9b8ece3b782 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -423,6 +423,13 @@ bool iOS7_fetchEvent(InternalEvent *event) {
 	[_menuButton setEnabled:isEnabled];
 	[_menuButton setHidden:!isEnabled];
 }
+
+- (BOOL)isiOSAppOnMac {
+	if (@available(iOS 14.0, *)) {
+		return [NSProcessInfo processInfo].isiOSAppOnMac;
+	}
+	return NO;
+}
 #endif
 
 - (void)dealloc {


Commit: b87b03ef161c23190c7b0d3a085b47d049ad9f7b
    https://github.com/scummvm/scummvm/commit/b87b03ef161c23190c7b0d3a085b47d049ad9f7b
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
IOS7: Pass key modifier flags to key events

Prepare the backend to send key modifier flags in the key events.
No modifier flags are sent at this point but will be added in
upcoming commits.

Cherry-pick of: b66dca78aeb64addbc34ed9ae8e250c8147c72cb

Changed paths:
    backends/platform/ios7/ios7_keyboard.h
    backends/platform/ios7/ios7_keyboard.mm
    backends/platform/ios7/ios7_osys_events.cpp
    backends/platform/ios7/ios7_osys_main.h
    backends/platform/ios7/ios7_video.mm


diff --git a/backends/platform/ios7/ios7_keyboard.h b/backends/platform/ios7/ios7_keyboard.h
index 3e6f7c7930c..34ef0b40ae8 100644
--- a/backends/platform/ios7/ios7_keyboard.h
+++ b/backends/platform/ios7/ios7_keyboard.h
@@ -36,7 +36,7 @@
 - (void)dealloc;
 - (UITextField *)inputView;
 - (void)setInputDelegate:(id)delegate;
-- (void)handleKeyPress:(unichar)c;
+- (void)handleKeyPress:(unichar)c withModifierFlags:(int)f;
 - (void)handleMainMenuKey;
 
 - (void)showKeyboard;
diff --git a/backends/platform/ios7/ios7_keyboard.mm b/backends/platform/ios7/ios7_keyboard.mm
index 308fe56fa9b..13f6b9d109f 100644
--- a/backends/platform/ios7/ios7_keyboard.mm
+++ b/backends/platform/ios7/ios7_keyboard.mm
@@ -166,7 +166,7 @@
  * Propagate all delete callbacks to the backend.
  */
 -(void)deleteBackward {
-	[softKeyboard handleKeyPress:'\b'];
+	[softKeyboard handleKeyPress:'\b' withModifierFlags:0];
 	[super deleteBackward];
 }
 
@@ -288,23 +288,23 @@
 }
 
 - (void) upArrow: (UIKeyCommand *) keyCommand {
-	[softKeyboard handleKeyPress:Common::KEYCODE_UP];
+	[softKeyboard handleKeyPress:Common::KEYCODE_UP withModifierFlags:0];
 }
 
 - (void) downArrow: (UIKeyCommand *) keyCommand {
-	[softKeyboard handleKeyPress:Common::KEYCODE_DOWN];
+	[softKeyboard handleKeyPress:Common::KEYCODE_DOWN withModifierFlags:0];
 }
 
 - (void) leftArrow: (UIKeyCommand *) keyCommand {
-	[softKeyboard handleKeyPress:Common::KEYCODE_LEFT];
+	[softKeyboard handleKeyPress:Common::KEYCODE_LEFT withModifierFlags:0];
 }
 
 - (void) rightArrow: (UIKeyCommand *) keyCommand {
-	[softKeyboard handleKeyPress:Common::KEYCODE_RIGHT];
+	[softKeyboard handleKeyPress:Common::KEYCODE_RIGHT withModifierFlags:0];
 }
 
 - (void) escapeKey: (UIKeyCommand *) keyCommand {
-	[softKeyboard handleKeyPress:Common::KEYCODE_ESCAPE];
+	[softKeyboard handleKeyPress:Common::KEYCODE_ESCAPE withModifierFlags:0];
 }
 
 - (void) mainMenuKey {
@@ -312,79 +312,79 @@
 }
 
 - (void) escapeKey {
-	[softKeyboard handleKeyPress:Common::KEYCODE_ESCAPE];
+	[softKeyboard handleKeyPress:Common::KEYCODE_ESCAPE withModifierFlags:0];
 }
 
 - (void) tabKey {
-	[softKeyboard handleKeyPress:Common::KEYCODE_TAB];
+	[softKeyboard handleKeyPress:Common::KEYCODE_TAB withModifierFlags:0];
 }
 
 - (void) fn1Key {
-	[softKeyboard handleKeyPress:Common::KEYCODE_F1];
+	[softKeyboard handleKeyPress:Common::KEYCODE_F1 withModifierFlags:0];
 }
 
 - (void) fn2Key {
-	[softKeyboard handleKeyPress:Common::KEYCODE_F2];
+	[softKeyboard handleKeyPress:Common::KEYCODE_F2 withModifierFlags:0];
 }
 
 - (void) fn3Key {
-	[softKeyboard handleKeyPress:Common::KEYCODE_F3];
+	[softKeyboard handleKeyPress:Common::KEYCODE_F3 withModifierFlags:0];
 }
 
 - (void) fn4Key {
-	[softKeyboard handleKeyPress:Common::KEYCODE_F4];
+	[softKeyboard handleKeyPress:Common::KEYCODE_F4 withModifierFlags:0];
 }
 
 - (void) fn5Key {
-	[softKeyboard handleKeyPress:Common::KEYCODE_F5];
+	[softKeyboard handleKeyPress:Common::KEYCODE_F5 withModifierFlags:0];
 }
 
 - (void) fn6Key {
-	[softKeyboard handleKeyPress:Common::KEYCODE_F6];
+	[softKeyboard handleKeyPress:Common::KEYCODE_F6 withModifierFlags:0];
 }
 
 - (void) fn7Key {
-	[softKeyboard handleKeyPress:Common::KEYCODE_F7];
+	[softKeyboard handleKeyPress:Common::KEYCODE_F7 withModifierFlags:0];
 }
 
 - (void) fn8Key {
-	[softKeyboard handleKeyPress:Common::KEYCODE_F8];
+	[softKeyboard handleKeyPress:Common::KEYCODE_F8 withModifierFlags:0];
 }
 
 - (void) fn9Key {
-	[softKeyboard handleKeyPress:Common::KEYCODE_F9];
+	[softKeyboard handleKeyPress:Common::KEYCODE_F9 withModifierFlags:0];
 }
 
 - (void) fn10Key {
-	[softKeyboard handleKeyPress:Common::KEYCODE_F10];
+	[softKeyboard handleKeyPress:Common::KEYCODE_F10 withModifierFlags:0];
 }
 
 - (void) fn11Key {
-	[softKeyboard handleKeyPress:Common::KEYCODE_F11];
+	[softKeyboard handleKeyPress:Common::KEYCODE_F11 withModifierFlags:0];
 }
 
 - (void) fn12Key {
-	[softKeyboard handleKeyPress:Common::KEYCODE_F12];
+	[softKeyboard handleKeyPress:Common::KEYCODE_F12 withModifierFlags:0];
 }
 
 - (void) leftArrowKey {
-	[softKeyboard handleKeyPress:Common::KEYCODE_LEFT];
+	[softKeyboard handleKeyPress:Common::KEYCODE_LEFT withModifierFlags:0];
 }
 
 - (void) upArrowKey {
-	[softKeyboard handleKeyPress:Common::KEYCODE_UP];
+	[softKeyboard handleKeyPress:Common::KEYCODE_UP withModifierFlags:0];
 }
 
 - (void) rightArrowKey {
-	[softKeyboard handleKeyPress:Common::KEYCODE_RIGHT];
+	[softKeyboard handleKeyPress:Common::KEYCODE_RIGHT withModifierFlags:0];
 }
 
 - (void) downArrowKey {
-	[softKeyboard handleKeyPress:Common::KEYCODE_DOWN];
+	[softKeyboard handleKeyPress:Common::KEYCODE_DOWN withModifierFlags:0];
 }
 
 - (void) returnKey {
-	[softKeyboard handleKeyPress:Common::KEYCODE_RETURN];
+	[softKeyboard handleKeyPress:Common::KEYCODE_RETURN withModifierFlags:0];
 }
 
 - (void) switchKeyboardLayout {
@@ -528,7 +528,7 @@
 
 - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)text {
 	if (text.length) {
-		[inputDelegate handleKeyPress:[text characterAtIndex:0]];
+		[inputDelegate handleKeyPress:[text characterAtIndex:0] withModifierFlags:0];
 	}
 	return YES;
 }
@@ -549,8 +549,8 @@
 	inputDelegate = delegate;
 }
 
-- (void)handleKeyPress:(unichar)c {
-	[inputDelegate handleKeyPress:c];
+- (void)handleKeyPress:(unichar)c withModifierFlags:(int)f {
+	[inputDelegate handleKeyPress:c withModifierFlags:f];
 }
 
 - (void)handleMainMenuKey {
diff --git a/backends/platform/ios7/ios7_osys_events.cpp b/backends/platform/ios7/ios7_osys_events.cpp
index 682d2e7ad00..3d455a511d6 100644
--- a/backends/platform/ios7/ios7_osys_events.cpp
+++ b/backends/platform/ios7/ios7_osys_events.cpp
@@ -100,7 +100,7 @@ bool OSystem_iOS7::pollEvent(Common::Event &event) {
 			return false;
 
 		case kInputKeyPressed:
-			handleEvent_keyPressed(event, internalEvent.value1);
+			handleEvent_keyPressed(event, internalEvent.value1, internalEvent.value2);
 			break;
 
 		case kInputSwipe:
@@ -268,7 +268,7 @@ void OSystem_iOS7::handleEvent_applicationResumed() {
 	rebuildSurface();
 }
 
-void  OSystem_iOS7::handleEvent_keyPressed(Common::Event &event, int keyPressed) {
+void  OSystem_iOS7::handleEvent_keyPressed(Common::Event &event, int keyPressed, int modifierFlags) {
 	int ascii = keyPressed;
 	//printf("key: %i\n", keyPressed);
 
@@ -281,7 +281,7 @@ void  OSystem_iOS7::handleEvent_keyPressed(Common::Event &event, int keyPressed)
 	event.type = Common::EVENT_KEYDOWN;
 	_queuedInputEvent.type = Common::EVENT_KEYUP;
 
-	event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
+	event.kbd.flags = _queuedInputEvent.kbd.flags = modifierFlags;
 	event.kbd.keycode = _queuedInputEvent.kbd.keycode = (Common::KeyCode)keyPressed;
 	event.kbd.ascii = _queuedInputEvent.kbd.ascii = ascii;
 	_queuedEventTime = getMillis() + kQueuedInputEventDelay;
diff --git a/backends/platform/ios7/ios7_osys_main.h b/backends/platform/ios7/ios7_osys_main.h
index 040f1c49f0c..7e6b0511041 100644
--- a/backends/platform/ios7/ios7_osys_main.h
+++ b/backends/platform/ios7/ios7_osys_main.h
@@ -181,7 +181,7 @@ protected:
 	bool handleEvent_swipe(Common::Event &event, int direction, int touches);
 	bool handleEvent_tap(Common::Event &event, UIViewTapDescription type, int touches);
 	bool handleEvent_longPress(Common::Event &event, UIViewLongPressDescription type, int touches);
-	void handleEvent_keyPressed(Common::Event &event, int keyPressed);
+	void handleEvent_keyPressed(Common::Event &event, int keyPressed, int modifierFlags);
 	void handleEvent_orientationChanged(int orientation);
 	void handleEvent_touchModeChanged();
 	void handleEvent_applicationSuspended();
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index 9b8ece3b782..5bfe3287540 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -796,11 +796,11 @@ bool iOS7_fetchEvent(InternalEvent *event) {
 	[self addEvent:InternalEvent(kInputTap, kUIViewTapDouble, 2)];
 }
 
-- (void)handleKeyPress:(unichar)c {
+- (void)handleKeyPress:(unichar)c withModifierFlags:(int)f {
 	if (c == '`') {
-		[self addEvent:InternalEvent(kInputKeyPressed, '\033', 0)];
+		[self addEvent:InternalEvent(kInputKeyPressed, '\033', f)];
 	} else {
-		[self addEvent:InternalEvent(kInputKeyPressed, c, 0)];
+		[self addEvent:InternalEvent(kInputKeyPressed, c, f)];
 	}
 }
 


Commit: 9d6150fc847644cfcde282f10fab321636f843fe
    https://github.com/scummvm/scummvm/commit/9d6150fc847644cfcde282f10fab321636f843fe
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
IOS7: Add helper functions to overload keys

Currently the key inputs are sent to the IOS7 event handler on calls
to the delegate function:
"textField:shouldChangeCharactersInRange:replacementString:"
So when typing on either the software keyboard or a connected HW
keyboard the input is handled by the hidden textfield that is in
focus. The delegate is called on each key input and the character
typed is passed to the IOS7 event handler.

Doing as above has the drawback that if they user holds down a key,
common in games when shooting or moving, the key event is only sent
once. The delegate function is only called once per distinct key
press.

By implementing the keyCommands function and create UIKeyCommands
for a set of keys, the system will call a defined callback function.
This also enables repeatedly calls as long as the key is held down.

Modifier keys can also be configured to create UIKeyCommands to
trigger custom actions. This way we can overload the key functions
when they are pressed at the same time as a modifier key.

Add helper funtions that can be used to create UIKeyCommands for
a set of keys. Keys are represented by their input, e.g. the key
for the character 'c' is defined as a string with only one char,
the 'c', while special keys are represeented by strings defined
by the OS.

Register UIKeyCommands for all types of modifier keys and add a
function that can convert system modifier flags to flags used by
ScummVM.

Cherry-pick of: 7a1ebc05c9e4bfb06a8d5f56b41e3ba5fba415e1

Changed paths:
    backends/platform/ios7/ios7_keyboard.mm


diff --git a/backends/platform/ios7/ios7_keyboard.mm b/backends/platform/ios7/ios7_keyboard.mm
index 13f6b9d109f..1be14359477 100644
--- a/backends/platform/ios7/ios7_keyboard.mm
+++ b/backends/platform/ios7/ios7_keyboard.mm
@@ -274,6 +274,36 @@
 	}
 }
 
+- (UIKeyCommand *)createKeyCommandForKey:(NSString *)key withModifierFlags:(UIKeyModifierFlags)flags andSelector:(SEL)selector {
+	UIKeyCommand *k = [UIKeyCommand keyCommandWithInput:key modifierFlags:flags action:selector];
+	[self setWantsPriority:k];
+	return k;
+}
+
+- (NSArray *)overloadKeys:(NSArray<NSString *> *)keys withSelector:(SEL)selector {
+	NSMutableArray<UIKeyCommand *> *overloadedKeys = [[NSMutableArray alloc] init];
+	for (NSString *key in keys) {
+		[overloadedKeys addObject:[self createKeyCommandForKey:key withModifierFlags:0 andSelector:selector]];
+		[overloadedKeys addObject:[self createKeyCommandForKey:key withModifierFlags:UIKeyModifierShift andSelector:selector]];
+		[overloadedKeys addObject:[self createKeyCommandForKey:key withModifierFlags:UIKeyModifierControl andSelector:selector]];
+		[overloadedKeys addObject:[self createKeyCommandForKey:key withModifierFlags:UIKeyModifierAlternate andSelector:selector]];
+		[overloadedKeys addObject:[self createKeyCommandForKey:key withModifierFlags:UIKeyModifierCommand andSelector:selector]];
+		// Sticky
+		[overloadedKeys addObject:[self createKeyCommandForKey:key withModifierFlags:UIKeyModifierAlphaShift andSelector:selector]];
+		[overloadedKeys addObject:[self createKeyCommandForKey:key withModifierFlags:UIKeyModifierNumericPad andSelector:selector]];
+	}
+	return overloadedKeys;
+}
+
+- (int)convertModifierFlags:(UIKeyModifierFlags)flags {
+	return (((flags & UIKeyModifierShift) ? Common::KBD_SHIFT : 0) |
+		((flags & UIKeyModifierControl) ? Common::KBD_CTRL : 0) |
+		((flags & UIKeyModifierAlternate) ? Common::KBD_ALT : 0) |
+		((flags & UIKeyModifierCommand) ? Common::KBD_META : 0) |
+		((flags & UIKeyModifierAlphaShift) ? Common::KBD_CAPS : 0) |
+		((flags & UIKeyModifierNumericPad) ? Common::KBD_NUM : 0));
+}
+
 - (NSArray *)keyCommands {
 	UIKeyCommand *upArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputUpArrow modifierFlags: 0 action: @selector(upArrow:)];
 	[self setWantsPriority: upArrow];


Commit: 8c9608b928cf37d232eed4ab0be7b03df3fd3123
    https://github.com/scummvm/scummvm/commit/8c9608b928cf37d232eed4ab0be7b03df3fd3123
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
IOS7: Add functions creating UIKeyCommands for arrow keys

Use the helper function to create an array of UIKeyCommands for the
arrow keys. Add a generic handler function that decides which action
for which key.

Since not all keyboards have the PAGE UP/DOWN nor HOME/END keys,
e.g. the Apple Magic Keyboard for iPads, map these keys to the arrow
keys when pressed together with the CMD modifier key.

Cherry-pick of: 77ecc595a366fb87f7c93af9ef7844970439cf09

Changed paths:
    backends/platform/ios7/ios7_keyboard.mm


diff --git a/backends/platform/ios7/ios7_keyboard.mm b/backends/platform/ios7/ios7_keyboard.mm
index 1be14359477..aeb06464c29 100644
--- a/backends/platform/ios7/ios7_keyboard.mm
+++ b/backends/platform/ios7/ios7_keyboard.mm
@@ -288,13 +288,18 @@
 		[overloadedKeys addObject:[self createKeyCommandForKey:key withModifierFlags:UIKeyModifierControl andSelector:selector]];
 		[overloadedKeys addObject:[self createKeyCommandForKey:key withModifierFlags:UIKeyModifierAlternate andSelector:selector]];
 		[overloadedKeys addObject:[self createKeyCommandForKey:key withModifierFlags:UIKeyModifierCommand andSelector:selector]];
-		// Sticky
+		// UIKeyModifierAlphaShift seems broken since iOS 13
 		[overloadedKeys addObject:[self createKeyCommandForKey:key withModifierFlags:UIKeyModifierAlphaShift andSelector:selector]];
 		[overloadedKeys addObject:[self createKeyCommandForKey:key withModifierFlags:UIKeyModifierNumericPad andSelector:selector]];
 	}
 	return overloadedKeys;
 }
 
+- (NSArray *)overloadArrowKeys {
+	NSArray<NSString *> *arrowKeys = [[NSArray alloc] initWithObjects:UIKeyInputUpArrow, UIKeyInputDownArrow, UIKeyInputLeftArrow, UIKeyInputRightArrow, nil];
+	return [self overloadKeys:arrowKeys withSelector:@selector(handleArrowKey:)];
+}
+
 - (int)convertModifierFlags:(UIKeyModifierFlags)flags {
 	return (((flags & UIKeyModifierShift) ? Common::KBD_SHIFT : 0) |
 		((flags & UIKeyModifierControl) ? Common::KBD_CTRL : 0) |
@@ -304,6 +309,18 @@
 		((flags & UIKeyModifierNumericPad) ? Common::KBD_NUM : 0));
 }
 
+- (void)handleArrowKey:(UIKeyCommand *)keyCommand {
+	if (keyCommand.input == UIKeyInputUpArrow) {
+		[self upArrow:keyCommand];
+	} else if (keyCommand.input == UIKeyInputDownArrow) {
+		[self downArrow:keyCommand];
+	} else if (keyCommand.input == UIKeyInputLeftArrow) {
+		[self leftArrow:keyCommand];
+	} else {
+		[self rightArrow:keyCommand];
+	}
+}
+
 - (NSArray *)keyCommands {
 	UIKeyCommand *upArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputUpArrow modifierFlags: 0 action: @selector(upArrow:)];
 	[self setWantsPriority: upArrow];
@@ -318,19 +335,35 @@
 }
 
 - (void) upArrow: (UIKeyCommand *) keyCommand {
-	[softKeyboard handleKeyPress:Common::KEYCODE_UP withModifierFlags:0];
+	if (keyCommand.modifierFlags == UIKeyModifierCommand) {
+		[softKeyboard handleKeyPress:Common::KEYCODE_PAGEUP withModifierFlags:0];
+	} else {
+		[softKeyboard handleKeyPress:Common::KEYCODE_UP withModifierFlags:[self convertModifierFlags:keyCommand.modifierFlags]];
+	}
 }
 
 - (void) downArrow: (UIKeyCommand *) keyCommand {
-	[softKeyboard handleKeyPress:Common::KEYCODE_DOWN withModifierFlags:0];
+	if (keyCommand.modifierFlags == UIKeyModifierCommand) {
+		[softKeyboard handleKeyPress:Common::KEYCODE_PAGEDOWN withModifierFlags:0];
+	} else {
+		[softKeyboard handleKeyPress:Common::KEYCODE_DOWN withModifierFlags:[self convertModifierFlags:keyCommand.modifierFlags]];
+	}
 }
 
 - (void) leftArrow: (UIKeyCommand *) keyCommand {
-	[softKeyboard handleKeyPress:Common::KEYCODE_LEFT withModifierFlags:0];
+	if (keyCommand.modifierFlags == UIKeyModifierCommand) {
+		[softKeyboard handleKeyPress:Common::KEYCODE_HOME withModifierFlags:0];
+	} else {
+		[softKeyboard handleKeyPress:Common::KEYCODE_LEFT withModifierFlags:[self convertModifierFlags:keyCommand.modifierFlags]];
+	}
 }
 
 - (void) rightArrow: (UIKeyCommand *) keyCommand {
-	[softKeyboard handleKeyPress:Common::KEYCODE_RIGHT withModifierFlags:0];
+	if (keyCommand.modifierFlags == UIKeyModifierCommand) {
+		[softKeyboard handleKeyPress:Common::KEYCODE_END withModifierFlags:0];
+	} else {
+		[softKeyboard handleKeyPress:Common::KEYCODE_RIGHT withModifierFlags:[self convertModifierFlags:keyCommand.modifierFlags]];
+	}
 }
 
 - (void) escapeKey: (UIKeyCommand *) keyCommand {


Commit: b423d3a3279fa9413c5c83e508ebfb39e3153734
    https://github.com/scummvm/scummvm/commit/b423d3a3279fa9413c5c83e508ebfb39e3153734
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
IOS7: Add functions creating UIKeyCommands for roman letter keys

Use the helper function to create an array of UIKeyCommands for the
roman letter keys. Since most of the games supports input of roman
letters, overload these keys. Keys with other characters than these
are not overloaded and will therefore trigger the call to the
delegate function:
"textField:shouldChangeCharactersInRange:replacementString:"
and will therefore still be passed to the IOS7 event handler.
However no modifier flags will be passed for those and they will not
support repeated presses.

Add a generic handler function that decides which action
for which key.

Cherry-pick of: 1a5d247070096542ccbde48e7b90c940ed560b94

Changed paths:
    backends/platform/ios7/ios7_keyboard.mm


diff --git a/backends/platform/ios7/ios7_keyboard.mm b/backends/platform/ios7/ios7_keyboard.mm
index aeb06464c29..a1777339814 100644
--- a/backends/platform/ios7/ios7_keyboard.mm
+++ b/backends/platform/ios7/ios7_keyboard.mm
@@ -300,6 +300,16 @@
 	return [self overloadKeys:arrowKeys withSelector:@selector(handleArrowKey:)];
 }
 
+- (NSArray *)overloadRomanLetters {
+	NSString *romanLetters = @"abcdefghijklmnopqrstuvwxyz";
+	NSMutableArray<NSString *> *letters = [[NSMutableArray alloc] init];
+	for (NSUInteger x = 0; x < romanLetters.length; x++) {
+		unichar c = [romanLetters characterAtIndex:x];
+		[letters addObject:[NSString stringWithCharacters:&c length:1]];
+	}
+	return [self overloadKeys:letters withSelector:@selector(handleLetterKey:)];;
+}
+
 - (int)convertModifierFlags:(UIKeyModifierFlags)flags {
 	return (((flags & UIKeyModifierShift) ? Common::KBD_SHIFT : 0) |
 		((flags & UIKeyModifierControl) ? Common::KBD_CTRL : 0) |
@@ -321,6 +331,16 @@
 	}
 }
 
+- (void)handleLetterKey:(UIKeyCommand *)keyCommand {
+	UniChar c = [[keyCommand input] characterAtIndex:0];
+	if ((keyCommand.modifierFlags & UIKeyModifierShift) ||
+		(keyCommand.modifierFlags & UIKeyModifierAlphaShift)) {
+		// Convert to capital letter
+		c -= 32;
+	}
+	[softKeyboard handleKeyPress: c withModifierFlags:[self convertModifierFlags:keyCommand.modifierFlags]];
+}
+
 - (NSArray *)keyCommands {
 	UIKeyCommand *upArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputUpArrow modifierFlags: 0 action: @selector(upArrow:)];
 	[self setWantsPriority: upArrow];


Commit: 7fed8f4fe0014ef0da163cf39d553b2f6ef59ae0
    https://github.com/scummvm/scummvm/commit/7fed8f4fe0014ef0da163cf39d553b2f6ef59ae0
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
IOS7: Add functions creating UIKeyCommands for number keys

Use the helper function to create an array of UIKeyCommands for the
number keys. Add a generic handler function that decides which action
for which key.

Since not all keyboards have the function keys, Fn1-Fn12, e.g. the
Apple Magic Keyboard for iPads, map these keys to the number keys
when pressed together with the CMD modifier key. Fn11 and Fn12
requires CMD + Shift as modifier keys.

Cherry-pick of: 5c8315abbd4f1802e5e59c6264767bcaa941b84d

Changed paths:
    backends/platform/ios7/ios7_keyboard.mm


diff --git a/backends/platform/ios7/ios7_keyboard.mm b/backends/platform/ios7/ios7_keyboard.mm
index a1777339814..4e2b45d7b14 100644
--- a/backends/platform/ios7/ios7_keyboard.mm
+++ b/backends/platform/ios7/ios7_keyboard.mm
@@ -310,6 +310,16 @@
 	return [self overloadKeys:letters withSelector:@selector(handleLetterKey:)];;
 }
 
+- (NSArray *)overloadNumbers {
+	NSString *numbers = @"0123456789";
+	NSMutableArray<NSString *> *numArray = [[NSMutableArray alloc] init];
+	for (NSUInteger x = 0; x < numbers.length; x++) {
+		unichar c = [numbers characterAtIndex:x];
+		[numArray addObject:[NSString stringWithCharacters:&c length:1]];
+	}
+	return [self overloadKeys:numArray withSelector:@selector(handleNumberKey:)];
+}
+
 - (int)convertModifierFlags:(UIKeyModifierFlags)flags {
 	return (((flags & UIKeyModifierShift) ? Common::KBD_SHIFT : 0) |
 		((flags & UIKeyModifierControl) ? Common::KBD_CTRL : 0) |
@@ -341,6 +351,59 @@
 	[softKeyboard handleKeyPress: c withModifierFlags:[self convertModifierFlags:keyCommand.modifierFlags]];
 }
 
+- (void)handleNumberKey:(UIKeyCommand *)keyCommand {
+	if (keyCommand.modifierFlags == UIKeyModifierCommand) {
+		switch ([[keyCommand input] characterAtIndex:0]) {
+		case '1':
+			[self fn1Key];
+			break;
+		case '2':
+			[self fn2Key];
+			break;
+		case '3':
+			[self fn3Key];
+			break;
+		case '4':
+			[self fn4Key];
+			break;
+		case '5':
+			[self fn5Key];
+			break;
+		case '6':
+			[self fn6Key];
+			break;
+		case '7':
+			[self fn7Key];
+			break;
+		case '8':
+			[self fn8Key];
+			break;
+		case '9':
+			[self fn9Key];
+			break;
+		case '0':
+			[self fn10Key];
+			break;
+		default:
+			break;
+		}
+	} else if (keyCommand.modifierFlags == (UIKeyModifierCommand | UIKeyModifierShift)) {
+		switch ([[keyCommand input] characterAtIndex:0]) {
+		case '1':
+			[self fn11Key];
+			break;
+		case '2':
+			[self fn12Key];
+			break;
+		default:
+			break;
+		}
+	} else {
+		[softKeyboard handleKeyPress: [[keyCommand input] characterAtIndex:0] withModifierFlags:[self convertModifierFlags:keyCommand.modifierFlags]];
+	}
+}
+
+
 - (NSArray *)keyCommands {
 	UIKeyCommand *upArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputUpArrow modifierFlags: 0 action: @selector(upArrow:)];
 	[self setWantsPriority: upArrow];


Commit: 80dcfe0ff9f8ddc6ba5e77744a55e094f9a3ade9
    https://github.com/scummvm/scummvm/commit/80dcfe0ff9f8ddc6ba5e77744a55e094f9a3ade9
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
IOS7: Add functions creating UIKeyCommands for Fn keys

Use the helper function to create an array of UIKeyCommands for the
Fn keys. Add a generic handler function that decides which action
for which key.

This allows the application to register key presses of the Fn keys,
however only supoorted in iOS 13.4 and later.

Cherry-pick of: 7a251f010f77caf8d808492d10bf9d462442ba80

Changed paths:
    backends/platform/ios7/ios7_keyboard.mm


diff --git a/backends/platform/ios7/ios7_keyboard.mm b/backends/platform/ios7/ios7_keyboard.mm
index 4e2b45d7b14..f39cfa9f4f3 100644
--- a/backends/platform/ios7/ios7_keyboard.mm
+++ b/backends/platform/ios7/ios7_keyboard.mm
@@ -320,6 +320,14 @@
 	return [self overloadKeys:numArray withSelector:@selector(handleNumberKey:)];
 }
 
+- (NSArray *)overloadFnKeys {
+	if (@available(iOS 13.4, *)) {
+		NSArray<NSString *> *fnKeys = [[NSArray alloc] initWithObjects:UIKeyInputF1, UIKeyInputF2, UIKeyInputF3, UIKeyInputF4, UIKeyInputF5, UIKeyInputF6, UIKeyInputF7, UIKeyInputF8, UIKeyInputF9, UIKeyInputF10, UIKeyInputF11, UIKeyInputF12, nil];
+		return [self overloadKeys:fnKeys withSelector:@selector(handleFnKey:)];
+	}
+	return nil;
+}
+
 - (int)convertModifierFlags:(UIKeyModifierFlags)flags {
 	return (((flags & UIKeyModifierShift) ? Common::KBD_SHIFT : 0) |
 		((flags & UIKeyModifierControl) ? Common::KBD_CTRL : 0) |
@@ -403,6 +411,35 @@
 	}
 }
 
+- (void)handleFnKey:(UIKeyCommand *)keyCommand {
+	if (@available(iOS 13.4, *)) {
+		if (keyCommand.input == UIKeyInputF1) {
+			[self fn1Key];
+		} else if (keyCommand.input == UIKeyInputF2) {
+			[self fn2Key];
+		} else if (keyCommand.input == UIKeyInputF3) {
+			[self fn3Key];
+		} else if (keyCommand.input == UIKeyInputF4) {
+			[self fn4Key];
+		} else if (keyCommand.input == UIKeyInputF5) {
+			[self fn5Key];
+		} else if (keyCommand.input == UIKeyInputF6) {
+			[self fn6Key];
+		} else if (keyCommand.input == UIKeyInputF7) {
+			[self fn7Key];
+		} else if (keyCommand.input == UIKeyInputF8) {
+			[self fn8Key];
+		} else if (keyCommand.input == UIKeyInputF9) {
+			[self fn9Key];
+		} else if (keyCommand.input == UIKeyInputF10) {
+			[self fn10Key];
+		} else if (keyCommand.input == UIKeyInputF11) {
+			[self fn11Key];
+		} else if (keyCommand.input == UIKeyInputF12) {
+			[self fn12Key];
+		}
+	}
+}
 
 - (NSArray *)keyCommands {
 	UIKeyCommand *upArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputUpArrow modifierFlags: 0 action: @selector(upArrow:)];


Commit: 28c5aaa40b27e395ed3d91ed6861b151c94f5364
    https://github.com/scummvm/scummvm/commit/28c5aaa40b27e395ed3d91ed6861b151c94f5364
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
IOS7: Add functions creating UIKeyCommands for special keys

Use the helper function to create an array of UIKeyCommands for the
END, HOME, PAGE UP, PAGE DOWN and the ESC keys. Add a generic handler
function that decides which action for which key.

This allows the application to register key presses of these keys,
however some of them requires iOS 13.4 or later.

Cherry-pick of: 633b7ea2018d273e4b86dff2078946b63052cba2

Changed paths:
    backends/platform/ios7/ios7_keyboard.mm


diff --git a/backends/platform/ios7/ios7_keyboard.mm b/backends/platform/ios7/ios7_keyboard.mm
index f39cfa9f4f3..ab095968df5 100644
--- a/backends/platform/ios7/ios7_keyboard.mm
+++ b/backends/platform/ios7/ios7_keyboard.mm
@@ -328,6 +328,16 @@
 	return nil;
 }
 
+- (NSArray *)overloadSpecialKeys {
+	NSMutableArray<NSString *> *specialKeys = [[NSMutableArray alloc] initWithObjects:UIKeyInputEscape, UIKeyInputPageUp, UIKeyInputPageDown, nil];
+
+	if (@available(iOS 13.4, *)) {
+		[specialKeys addObject: UIKeyInputHome];
+		[specialKeys addObject: UIKeyInputEnd];
+	}
+	return [self overloadKeys:specialKeys withSelector:@selector(handleSpecialKey:)];
+}
+
 - (int)convertModifierFlags:(UIKeyModifierFlags)flags {
 	return (((flags & UIKeyModifierShift) ? Common::KBD_SHIFT : 0) |
 		((flags & UIKeyModifierControl) ? Common::KBD_CTRL : 0) |
@@ -441,6 +451,23 @@
 	}
 }
 
+- (void)handleSpecialKey:(UIKeyCommand *)keyCommand {
+	if (keyCommand.input == UIKeyInputEscape) {
+		[self escapeKey:keyCommand];
+	} else if (keyCommand.input == UIKeyInputPageUp) {
+		[softKeyboard handleKeyPress:Common::KEYCODE_PAGEUP withModifierFlags:[self convertModifierFlags:keyCommand.modifierFlags]];
+	} else if (keyCommand.input == UIKeyInputPageDown) {
+		[softKeyboard handleKeyPress:Common::KEYCODE_PAGEDOWN withModifierFlags:[self convertModifierFlags:keyCommand.modifierFlags]];
+	}
+	if (@available(iOS 13.4, *)) {
+		if (keyCommand.input == UIKeyInputHome) {
+			[softKeyboard handleKeyPress:Common::KEYCODE_HOME withModifierFlags:[self convertModifierFlags:keyCommand.modifierFlags]];
+		} else if (keyCommand.input == UIKeyInputEnd) {
+			[softKeyboard handleKeyPress:Common::KEYCODE_END withModifierFlags:[self convertModifierFlags:keyCommand.modifierFlags]];
+		}
+	}
+}
+
 - (NSArray *)keyCommands {
 	UIKeyCommand *upArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputUpArrow modifierFlags: 0 action: @selector(upArrow:)];
 	[self setWantsPriority: upArrow];


Commit: 823a0606017457d060819a78cdd62ae3878eedcd
    https://github.com/scummvm/scummvm/commit/823a0606017457d060819a78cdd62ae3878eedcd
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
IOS7: Use new key overload functions

Call the overload functions for key inputs and return the results
as an array of UIKeyCommands.

Cherry-pick of: 498b9e9e31febaec2ff056072a04e406a67e19ec

Changed paths:
    backends/platform/ios7/ios7_keyboard.mm


diff --git a/backends/platform/ios7/ios7_keyboard.mm b/backends/platform/ios7/ios7_keyboard.mm
index ab095968df5..9a7f316646e 100644
--- a/backends/platform/ios7/ios7_keyboard.mm
+++ b/backends/platform/ios7/ios7_keyboard.mm
@@ -469,16 +469,19 @@
 }
 
 - (NSArray *)keyCommands {
-	UIKeyCommand *upArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputUpArrow modifierFlags: 0 action: @selector(upArrow:)];
-	[self setWantsPriority: upArrow];
-	UIKeyCommand *downArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputDownArrow modifierFlags: 0 action: @selector(downArrow:)];
-	[self setWantsPriority: downArrow];
-	UIKeyCommand *leftArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputLeftArrow modifierFlags: 0 action: @selector(leftArrow:)];
-	[self setWantsPriority: leftArrow];
-	UIKeyCommand *rightArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputRightArrow modifierFlags: 0 action: @selector(rightArrow:)];
-	[self setWantsPriority: rightArrow];
-	UIKeyCommand *escapeKey = [UIKeyCommand keyCommandWithInput: UIKeyInputEscape modifierFlags: 0 action: @selector(escapeKey:)];
-	return [[NSArray alloc] initWithObjects: upArrow, downArrow, leftArrow, rightArrow, escapeKey, nil];
+	NSMutableArray<UIKeyCommand *> *overloadedKeys = [[NSMutableArray alloc] init];
+	// Arrows
+	[overloadedKeys addObjectsFromArray:[self overloadArrowKeys]];
+	// Roman letters
+	[overloadedKeys addObjectsFromArray:[self overloadRomanLetters]];
+	// Numbers
+	[overloadedKeys addObjectsFromArray:[self overloadNumbers]];
+	// FN keys
+	[overloadedKeys addObjectsFromArray:[self overloadFnKeys]];
+	// ESC, PAGE_UP, PAGE_DOWN, HOME, END
+	[overloadedKeys addObjectsFromArray:[self overloadSpecialKeys]];
+
+	return overloadedKeys;
 }
 
 - (void) upArrow: (UIKeyCommand *) keyCommand {


Commit: f921c6acd980747fef5f9a3b71ce73824af1ef14
    https://github.com/scummvm/scummvm/commit/f921c6acd980747fef5f9a3b71ce73824af1ef14
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-02T12:06:27+01:00

Commit Message:
AUDIO: Fix problem where fluidsynth soundfont could not be loaded

The user can specify a custom soundfont to be used with fluidsynth.
There was previously a hack for the iOS7 backend to get the path to
the document folder where the user can put files in a sandboxed
environment. This hack was removed in commit:
cac06647571a3352cb108faad48af9271a69ce36

The problem however occurred when creating a FSNode from the full
system path because FSNode uses makeFileNodePath, which already
prepends the root. So the full path is added twice which causes the
fileNode.exists() to fail.

Create the FSNode from the path to the soundfont and check if the
file exist. If so then return the full path.

Cherry-pick of: addbdc13c5d624ec5349251b8f6d6c580db3108b
Git conflict manually fixed

Changed paths:
    audio/softsynth/fluidsynth.cpp


diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp
index 38036b0a54e..0647c0b4fc3 100644
--- a/audio/softsynth/fluidsynth.cpp
+++ b/audio/softsynth/fluidsynth.cpp
@@ -285,11 +285,11 @@ Common::String MidiDriver_FluidSynth::getSoundFontPath() const {
 	if (path.empty())
 		return path;
 
-	// First check if this is a full path
-	Common::String fullPath = g_system->getFilesystemFactory()->getSystemFullPath(path);
-	Common::FSNode fileNode(fullPath);
-	if (fileNode.exists())
-		return fullPath;
+	Common::FSNode fileNode(path);
+	if (fileNode.exists()) {
+		// Return the full system path to the soundfont
+		return g_system->getFilesystemFactory()->getSystemFullPath(path) ;
+	}
 
 	// Then check with soundfontpath
 	if (ConfMan.hasKey("soundfontpath")) {




More information about the Scummvm-git-logs mailing list