[Scummvm-git-logs] scummvm master -> b34b5ba2f16ba815e5b88cd5c2bd1cadf6386c01
sev-
noreply at scummvm.org
Fri Mar 15 13:26:56 UTC 2024
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
dde3fa0ec3 IOS7: Fix left mouse clicks with tap gesture on some devices
975ac38f72 IOS7: Make project build in Xcode 10.1
69554e0e52 IOS7: Fix memory leak when switching 3D framebuffers
05aaa3195d DOC: Update iOS documentation regarding keyboard input
b34b5ba2f1 IOS7: Add backend help information about external keyboards
Commit: dde3fa0ec3208442fbe2b6e8146eaa3a008bd7f7
https://github.com/scummvm/scummvm/commit/dde3fa0ec3208442fbe2b6e8146eaa3a008bd7f7
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-15T14:26:51+01:00
Commit Message:
IOS7: Fix left mouse clicks with tap gesture on some devices
Left mouse clicks are generated by tap gestures. To protect against
false mouse clicks the tap gesture is cancelled if the finger is
moved. Normally a tap gesture is generating a touchesBegan event
but doesn't generate any touchesMoved events. But for some devices,
not sure if it's the device or if the screen is broken, a false
touchesMoved event can be triggered even though the coordinates
aren't changed at all.
Add a check to see if the coordinate has changed from when the touch
began to see if the tap gesture should be cancelled or not.
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 5bfe3287540..71620901454 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -90,6 +90,7 @@ bool iOS7_fetchEvent(InternalEvent *event) {
UITapGestureRecognizer *twoFingerTapGesture;
UILongPressGestureRecognizer *oneFingerLongPressGesture;
UILongPressGestureRecognizer *twoFingerLongPressGesture;
+ CGPoint touchesBegan;
#endif
}
@@ -628,6 +629,8 @@ bool iOS7_fetchEvent(InternalEvent *event) {
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ UITouch *touch = [touches anyObject];
+ touchesBegan = [touch locationInView:self];
for (GameController *c : _controllers) {
if ([c isKindOfClass:TouchController.class]) {
[(TouchController *)c touchesBegan:touches withEvent:event];
@@ -637,8 +640,13 @@ bool iOS7_fetchEvent(InternalEvent *event) {
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
#if TARGET_OS_IOS
- [oneFingerTapGesture setState:UIGestureRecognizerStateCancelled];
- [twoFingerTapGesture setState:UIGestureRecognizerStateCancelled];
+ UITouch *touch = [touches anyObject];
+ CGPoint touchesMoved = [touch locationInView:self];
+ if (touchesBegan.x != touchesMoved.x ||
+ touchesBegan.y != touchesMoved.y) {
+ [oneFingerTapGesture setState:UIGestureRecognizerStateCancelled];
+ [twoFingerTapGesture setState:UIGestureRecognizerStateCancelled];
+ }
#endif
for (GameController *c : _controllers) {
if ([c isKindOfClass:TouchController.class]) {
Commit: 975ac38f726f9b7acf0258d49da63ca8322f5525
https://github.com/scummvm/scummvm/commit/975ac38f726f9b7acf0258d49da63ca8322f5525
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-15T14:26:51+01:00
Commit Message:
IOS7: Make project build in Xcode 10.1
Builtin checks are not present in older Xcode versions. Add macros
to check the target iOS version.
Changed paths:
backends/platform/ios7/ios7_keyboard.mm
backends/platform/ios7/ios7_mouse_controller.mm
backends/platform/ios7/ios7_video.mm
diff --git a/backends/platform/ios7/ios7_keyboard.mm b/backends/platform/ios7/ios7_keyboard.mm
index 9a7f316646e..1f8d3df746d 100644
--- a/backends/platform/ios7/ios7_keyboard.mm
+++ b/backends/platform/ios7/ios7_keyboard.mm
@@ -321,14 +321,17 @@
}
- (NSArray *)overloadFnKeys {
+#ifdef __IPHONE_13_4
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:)];
}
+#endif
return nil;
}
- (NSArray *)overloadSpecialKeys {
+#ifdef __IPHONE_13_4
NSMutableArray<NSString *> *specialKeys = [[NSMutableArray alloc] initWithObjects:UIKeyInputEscape, UIKeyInputPageUp, UIKeyInputPageDown, nil];
if (@available(iOS 13.4, *)) {
@@ -336,6 +339,9 @@
[specialKeys addObject: UIKeyInputEnd];
}
return [self overloadKeys:specialKeys withSelector:@selector(handleSpecialKey:)];
+#else
+ return nil;
+#endif
}
- (int)convertModifierFlags:(UIKeyModifierFlags)flags {
@@ -422,6 +428,7 @@
}
- (void)handleFnKey:(UIKeyCommand *)keyCommand {
+#ifdef __IPHONE_13_4
if (@available(iOS 13.4, *)) {
if (keyCommand.input == UIKeyInputF1) {
[self fn1Key];
@@ -449,9 +456,11 @@
[self fn12Key];
}
}
+#endif
}
- (void)handleSpecialKey:(UIKeyCommand *)keyCommand {
+#ifdef __IPHONE_13_4
if (keyCommand.input == UIKeyInputEscape) {
[self escapeKey:keyCommand];
} else if (keyCommand.input == UIKeyInputPageUp) {
@@ -466,6 +475,7 @@
[softKeyboard handleKeyPress:Common::KEYCODE_END withModifierFlags:[self convertModifierFlags:keyCommand.modifierFlags]];
}
}
+#endif
}
- (NSArray *)keyCommands {
@@ -628,6 +638,7 @@
// Base the new frame size on the current parent frame size
CGRect newFrame = self.superview.frame;
+#ifdef __IPHONE_14_0
if (@available(iOS 14.0, tvOS 14.0, *)) {
if (GCKeyboard.coalescedKeyboard != nil) {
if (didShow) {
@@ -644,7 +655,7 @@
} else {
newFrame.size.height += (keyboardFrame.size.height) * (didShow ? -1 : 1);
}
-
+#endif
// Resize with a fancy animation
NSNumber *rate = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey];
[UIView animateWithDuration:rate.floatValue animations:^{
@@ -681,11 +692,13 @@
- (void)keyboardDidDisconnect:(NSNotification*)notification
{
+#ifdef __IPHONE_14_0
if (@available(iOS 14.0, tvOS 14.0, *)) {
if (GCKeyboard.coalescedKeyboard == nil) {
[inputView endEditing:YES];
}
}
+#endif
}
#endif
@@ -703,6 +716,7 @@
name:UIKeyboardDidHideNotification
object:nil];
#endif
+#ifdef __IPHONE_14_0
if (@available(iOS 14.0, tvOS 14.0, *)) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardDidConnect:)
@@ -714,6 +728,7 @@
name:GCKeyboardDidDisconnectNotification
object:nil];
}
+#endif
inputDelegate = nil;
inputView = [[TextInputHandler alloc] initWithKeyboard:self];
@@ -724,6 +739,7 @@
_keyboardVisible = NO;
_inputAccessoryHeight = 0.0f;
+#ifdef __IPHONE_14_0
if (@available(iOS 14.0, tvOS 14.0, *)) {
// If already connected to a HW keyboard, start
// monitoring key presses
@@ -731,6 +747,7 @@
[inputView becomeFirstResponder];
}
}
+#endif
return self;
}
@@ -771,6 +788,7 @@
}
- (void)showKeyboard {
+#ifdef __IPHONE_14_0
if (@available(iOS 14.0, tvOS 14.0, *)) {
if ([inputView isFirstResponder] &&
GCKeyboard.coalescedKeyboard != nil) {
@@ -780,10 +798,12 @@
return;
}
}
+#endif
[inputView becomeFirstResponder];
}
- (void)hideKeyboard {
+#ifdef __IPHONE_14_0
if (@available(iOS 14.0, tvOS 14.0, *)) {
if ([inputView isFirstResponder] &&
GCKeyboard.coalescedKeyboard != nil) {
@@ -793,6 +813,7 @@
return;
}
}
+#endif
[inputView endEditing:YES];
}
diff --git a/backends/platform/ios7/ios7_mouse_controller.mm b/backends/platform/ios7/ios7_mouse_controller.mm
index 6772d6db932..cf35a2e6375 100644
--- a/backends/platform/ios7/ios7_mouse_controller.mm
+++ b/backends/platform/ios7/ios7_mouse_controller.mm
@@ -46,9 +46,10 @@
object:nil];
}
+#ifdef __IPHONE_14_0
_dxReminder = 0.0;
_dyReminder = 0.0;
-
+#endif
return self;
}
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index 71620901454..0e56821e8bd 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -391,12 +391,13 @@ bool iOS7_fetchEvent(InternalEvent *event) {
#if TARGET_OS_IOS
- (void)triggerTouchModeChanged {
BOOL hwKeyboardConnected = NO;
+#ifdef __IPHONE_14_0
if (@available(iOS 14.0, *)) {
if (GCKeyboard.coalescedKeyboard != nil) {
hwKeyboardConnected = YES;
}
}
-
+#endif
if ([self isKeyboardShown] && !hwKeyboardConnected) {
[self hideKeyboard];
} else {
@@ -426,9 +427,11 @@ bool iOS7_fetchEvent(InternalEvent *event) {
}
- (BOOL)isiOSAppOnMac {
+#ifdef __IPHONE_14_0
if (@available(iOS 14.0, *)) {
return [NSProcessInfo processInfo].isiOSAppOnMac;
}
+#endif
return NO;
}
#endif
Commit: 69554e0e52005be335aba0693e8d36a601ec1d8e
https://github.com/scummvm/scummvm/commit/69554e0e52005be335aba0693e8d36a601ec1d8e
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-15T14:26:51+01:00
Commit Message:
IOS7: Fix memory leak when switching 3D framebuffers
When a 3D game does not support arbitrary resolutions a framebuffer
has to be created. The initSize method can be called multiple times
with different resolutions. Make sure to delete any existing
framebuffer before creating a new.
Changed paths:
backends/graphics3d/ios/ios-graphics3d.cpp
diff --git a/backends/graphics3d/ios/ios-graphics3d.cpp b/backends/graphics3d/ios/ios-graphics3d.cpp
index d35219a18e0..05e30e4804c 100644
--- a/backends/graphics3d/ios/ios-graphics3d.cpp
+++ b/backends/graphics3d/ios/ios-graphics3d.cpp
@@ -226,6 +226,9 @@ void iOSGraphics3dManager::initSize(uint w, uint h, const Graphics::PixelFormat
bool engineSupportsArbitraryResolutions = !g_engine ||
g_engine->hasFeature(Engine::kSupportsArbitraryResolutions);
if (!engineSupportsArbitraryResolutions) {
+ if (_frameBuffer) {
+ delete _frameBuffer;
+ }
// If the game can't adapt to any resolution, render it to a framebuffer
// so it can be scaled to fill the available space.
_frameBuffer = new OpenGL::FrameBuffer(w, h);
Commit: 05aaa3195dc511910a1866f7531ca34539059227
https://github.com/scummvm/scummvm/commit/05aaa3195dc511910a1866f7531ca34539059227
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-15T14:26:51+01:00
Commit Message:
DOC: Update iOS documentation regarding keyboard input
Add description about special keys.
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 f9eebbab4cd..23ee3e944bd 100644
--- a/doc/docportal/other_platforms/ios.rst
+++ b/doc/docportal/other_platforms/ios.rst
@@ -80,6 +80,26 @@ 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.
+External keyboards are supported and from iOS 13.4 most of the special keys, e.g. function keys, Home and End, are mapped.
+For external keyboards missing the special keys, e.g. the Apple Magic Keyboard for iPads, the special keys can be triggered using the following key combinations:
+
+.. csv-table::
+ :widths: 40 60
+ :header-rows: 1
+ :class: keyboard
+
+ Key combination, Action
+ CMD + 1, F1
+ CMD + 2, F2
+ "..." , "..."
+ CMD + 0, F10
+ CMD + SHIFT 1, F11
+ CMD + SHIFT 2, F12
+ CMD + UP, PAGE UP
+ CMD + DOWN, PAGE DOWN
+ CMD + LEFT, HOME
+ CMD + RIGHT, END
+
Game controllers
^^^^^^^^^^^^^^^^^^^^
Commit: b34b5ba2f16ba815e5b88cd5c2bd1cadf6386c01
https://github.com/scummvm/scummvm/commit/b34b5ba2f16ba815e5b88cd5c2bd1cadf6386c01
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-03-15T14:26:51+01:00
Commit Message:
IOS7: Add backend help information about external keyboards
Add tab describing the external keyboard support.
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 3cf57583964..02cf68b28fb 100644
--- a/backends/platform/ios7/ios7_osys_misc.mm
+++ b/backends/platform/ios7/ios7_osys_misc.mm
@@ -311,7 +311,28 @@ _s(
" {w=10em}\n"
"\n"
),
-
+_s("External keyboard"),
+"",
+_s(
+"## Use of keyboard\n"
+"External keyboards are supported and from iOS 13.4 most of the special keys, e.g. function keys, Home and End, are mapped. \n"
+"For external keyboards missing the special keys, e.g. the Apple Magic Keyboard for iPads, the special keys can be triggered using the following key combinations: \n"
+"\n"
+"\n"
+"| Key combination | Action \n"
+"| ------------------|-------------------\n"
+"| `CMD + 1` | F1 \n"
+"| `CMD + 2` | F2 \n"
+"| `...` | ... \n"
+"| `CMD + 0` | F10 \n"
+"| `CMD + SHIFT + 1` | F11 \n"
+"| `CMD + SHIFT + 2` | F12 \n"
+"| `CMD + UP` | PAGE UP \n"
+"| `CMD + DOWN` | PAGE DOWN \n"
+"| `CMD + LEFT` | HOME \n"
+"| `CMD + RIGHT` | END \n"
+"\n"
+),
_s("Adding Games"),
"ios-help.zip",
_s(
More information about the Scummvm-git-logs
mailing list