[Scummvm-git-logs] scummvm master -> a9a6ce7e811a2a3fe14399a868341031b54517a0
criezy
criezy at scummvm.org
Sat Feb 16 18:35:12 CET 2019
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
63a6a3c3de GUI: show/hide virtual keyboard when the EditTextWidget gains/loses the focus
4795f2b68a IOS: Implement kFeatureVirtualKeyboard to show/hide the keyboard
a9a6ce7e81 IOS: Add support for three finger swipes up/down for showing/hiding software keyboard
Commit: 63a6a3c3debce1bc843906bf8fa277a1fb75b2d4
https://github.com/scummvm/scummvm/commit/63a6a3c3debce1bc843906bf8fa277a1fb75b2d4
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2019-02-16T17:20:57Z
Commit Message:
GUI: show/hide virtual keyboard when the EditTextWidget gains/loses the focus
Changed paths:
gui/widgets/edittext.cpp
diff --git a/gui/widgets/edittext.cpp b/gui/widgets/edittext.cpp
index 8dabb0d..ba9ef61 100644
--- a/gui/widgets/edittext.cpp
+++ b/gui/widgets/edittext.cpp
@@ -87,12 +87,6 @@ void EditTextWidget::handleMouseDown(int x, int y, int button, int clickCount) {
}
if (setCaretPos(i))
markAsDirty();
-
-#ifdef TIZEN
- // Display the virtual keypad to allow text entry. Samsung app-store testers expected
- // the keypad to be displayed when clicking the filter edit control in the laucher gui.
- g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
-#endif
}
void EditTextWidget::drawWidget() {
@@ -118,12 +112,15 @@ Common::Rect EditTextWidget::getEditRect() const {
}
void EditTextWidget::receivedFocusWidget() {
+ g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
}
void EditTextWidget::lostFocusWidget() {
// If we loose focus, 'commit' the user changes
_backupString = _editString;
drawCaret(true);
+
+ g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
}
void EditTextWidget::startEditMode() {
Commit: 4795f2b68a4fd7023c2f85a79c1b7686b9226747
https://github.com/scummvm/scummvm/commit/4795f2b68a4fd7023c2f85a79c1b7686b9226747
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2019-02-16T17:20:57Z
Commit Message:
IOS: Implement kFeatureVirtualKeyboard to show/hide the keyboard
Changed paths:
backends/platform/ios7/ios7_osys_main.cpp
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_osys_main.cpp b/backends/platform/ios7/ios7_osys_main.cpp
index 318838d..9b740ca 100644
--- a/backends/platform/ios7/ios7_osys_main.cpp
+++ b/backends/platform/ios7/ios7_osys_main.cpp
@@ -171,6 +171,7 @@ bool OSystem_iOS7::hasFeature(Feature f) {
switch (f) {
case kFeatureCursorPalette:
case kFeatureFilteringMode:
+ case kFeatureVirtualKeyboard:
return true;
default:
@@ -193,6 +194,9 @@ void OSystem_iOS7::setFeatureState(Feature f, bool enable) {
case kFeatureAspectRatioCorrection:
_videoContext->asprectRatioCorrection = enable;
break;
+ case kFeatureVirtualKeyboard:
+ setShowKeyboard(enable);
+ break;
default:
break;
@@ -207,6 +211,8 @@ bool OSystem_iOS7::getFeatureState(Feature f) {
return _videoContext->filtering;
case kFeatureAspectRatioCorrection:
return _videoContext->asprectRatioCorrection;
+ case kFeatureVirtualKeyboard:
+ return isKeyboardShown();
default:
return false;
diff --git a/backends/platform/ios7/ios7_osys_main.h b/backends/platform/ios7/ios7_osys_main.h
index c57d95b..ca98991 100644
--- a/backends/platform/ios7/ios7_osys_main.h
+++ b/backends/platform/ios7/ios7_osys_main.h
@@ -209,6 +209,8 @@ public:
protected:
void initVideoContext();
void updateOutputSurface();
+ void setShowKeyboard(bool);
+ bool isKeyboardShown() const;
void internUpdateScreen();
void dirtyFullScreen();
diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm
index 3196f88..20cf687 100644
--- a/backends/platform/ios7/ios7_osys_video.mm
+++ b/backends/platform/ios7/ios7_osys_video.mm
@@ -583,3 +583,23 @@ void OSystem_iOS7::updateMouseTexture() {
[[iOS7AppDelegate iPhoneView] updateMouseCursor];
});
}
+
+void OSystem_iOS7::setShowKeyboard(bool show) {
+ if (show) {
+ execute_on_main_thread(^ {
+ [[iOS7AppDelegate iPhoneView] showKeyboard];
+ });
+ } else {
+ // Do not hide the keyboard in portrait mode as it is shown automatically and not
+ // just when asked with the kFeatureVirtualKeyboard.
+ if (_screenOrientation == kScreenOrientationLandscape || _screenOrientation == kScreenOrientationFlippedLandscape) {
+ execute_on_main_thread(^ {
+ [[iOS7AppDelegate iPhoneView] hideKeyboard];
+ });
+ }
+ }
+}
+
+bool OSystem_iOS7::isKeyboardShown() const {
+ return [[iOS7AppDelegate iPhoneView] isKeyboardShown];
+}
diff --git a/backends/platform/ios7/ios7_video.h b/backends/platform/ios7/ios7_video.h
index 9c5d92a..a26213f 100644
--- a/backends/platform/ios7/ios7_video.h
+++ b/backends/platform/ios7/ios7_video.h
@@ -48,6 +48,7 @@ typedef struct {
Common::List<InternalEvent> _events;
NSLock *_eventLock;
SoftKeyboard *_keyboardView;
+ BOOL _keyboardVisible;
EAGLContext *_context;
GLuint _viewRenderbuffer;
@@ -120,6 +121,10 @@ typedef struct {
- (void)deviceOrientationChanged:(UIDeviceOrientation)orientation;
+- (void)showKeyboard;
+- (void)hideKeyboard;
+- (BOOL)isKeyboardShown;
+
- (void)applicationSuspend;
- (void)applicationResume;
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index 8e3edb3..679dedf 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -413,6 +413,7 @@ uint getSizeNextPOT(uint size) {
#endif
_keyboardView = nil;
+ _keyboardVisible = NO;
_screenTexture = 0;
_overlayTexture = 0;
_mouseCursorTexture = 0;
@@ -725,7 +726,7 @@ uint getSizeNextPOT(uint size) {
[_keyboardView setInputDelegate:self];
[self addSubview:[_keyboardView inputView]];
[self addSubview: _keyboardView];
- [_keyboardView showKeyboard];
+ [self showKeyboard];
}
glBindRenderbuffer(GL_RENDERBUFFER, _viewRenderbuffer); printOpenGLError();
@@ -907,12 +908,26 @@ uint getSizeNextPOT(uint size) {
BOOL isLandscape = (self.bounds.size.width > self.bounds.size.height);
if (isLandscape) {
- [_keyboardView hideKeyboard];
+ [self hideKeyboard];
} else {
- [_keyboardView showKeyboard];
+ [self showKeyboard];
}
}
+- (void)showKeyboard {
+ [_keyboardView showKeyboard];
+ _keyboardVisible = YES;
+}
+
+- (void)hideKeyboard {
+ [_keyboardView hideKeyboard];
+ _keyboardVisible = NO;
+}
+
+- (BOOL)isKeyboardShown {
+ return _keyboardVisible;
+}
+
- (UITouch *)secondTouchOtherTouchThan:(UITouch *)touch in:(NSSet *)set {
NSArray *all = [set allObjects];
for (UITouch *t in all) {
Commit: a9a6ce7e811a2a3fe14399a868341031b54517a0
https://github.com/scummvm/scummvm/commit/a9a6ce7e811a2a3fe14399a868341031b54517a0
Author: Jonny Bergström (jonnybergstrom at gmail.com)
Date: 2019-02-16T17:28:16Z
Commit Message:
IOS: Add support for three finger swipes up/down for showing/hiding software keyboard
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 679dedf..b00ecf6 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -349,6 +349,19 @@ uint getSizeNextPOT(uint size) {
}
- (void)setupGestureRecognizers {
+ const NSUInteger KEYBOARDSWIPETOUCHCOUNT = 3;
+ UISwipeGestureRecognizer *swipeUpKeyboard = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(keyboardSwipeUp:)];
+ swipeUpKeyboard.direction = UISwipeGestureRecognizerDirectionUp;
+ swipeUpKeyboard.numberOfTouchesRequired = KEYBOARDSWIPETOUCHCOUNT;
+ swipeUpKeyboard.delaysTouchesBegan = NO;
+ swipeUpKeyboard.delaysTouchesEnded = NO;
+
+ UISwipeGestureRecognizer *swipeDownKeyboard = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(keyboardSwipeDown:)];
+ swipeDownKeyboard.direction = UISwipeGestureRecognizerDirectionDown;
+ swipeDownKeyboard.numberOfTouchesRequired = KEYBOARDSWIPETOUCHCOUNT;
+ swipeDownKeyboard.delaysTouchesBegan = NO;
+ swipeDownKeyboard.delaysTouchesEnded = NO;
+
UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(twoFingersSwipeRight:)];
swipeRight.direction = UISwipeGestureRecognizerDirectionRight;
swipeRight.numberOfTouchesRequired = 2;
@@ -379,12 +392,16 @@ uint getSizeNextPOT(uint size) {
doubleTapTwoFingers.delaysTouchesBegan = NO;
doubleTapTwoFingers.delaysTouchesEnded = NO;
+ [self addGestureRecognizer:swipeUpKeyboard];
+ [self addGestureRecognizer:swipeDownKeyboard];
[self addGestureRecognizer:swipeRight];
[self addGestureRecognizer:swipeLeft];
[self addGestureRecognizer:swipeUp];
[self addGestureRecognizer:swipeDown];
[self addGestureRecognizer:doubleTapTwoFingers];
+ [swipeUpKeyboard release];
+ [swipeDownKeyboard release];
[swipeRight release];
[swipeLeft release];
[swipeUp release];
@@ -1013,6 +1030,14 @@ uint getSizeNextPOT(uint size) {
_secondTouch = nil;
}
+- (void)keyboardSwipeUp:(UISwipeGestureRecognizer *)recognizer {
+ [self showKeyboard];
+}
+
+- (void)keyboardSwipeDown:(UISwipeGestureRecognizer *)recognizer {
+ [self hideKeyboard];
+}
+
- (void)twoFingersSwipeRight:(UISwipeGestureRecognizer *)recognizer {
[self addEvent:InternalEvent(kInputSwipe, kUIViewSwipeRight, 2)];
}
More information about the Scummvm-git-logs
mailing list