diff options
Diffstat (limited to 'backends/platform/ios7')
| -rw-r--r-- | backends/platform/ios7/ios7_video.mm | 25 | 
1 files changed, 25 insertions, 0 deletions
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm index 679dedffc4..b00ecf64f9 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)];  }  | 
