Permalink
Browse files

[ios] - add 1 finger single long tap as alternative for double finger…

… single tap
  • Loading branch information...
1 parent 67247b1 commit b0760d04a1f1be3759a3381445d7ec48e0343559 @Memphiz committed Apr 8, 2012
Showing with 40 additions and 0 deletions.
  1. +20 −0 xbmc/osx/IOSExternalTouchController.mm
  2. +20 −0 xbmc/osx/ios/XBMCController.mm
@@ -204,6 +204,15 @@ - (void)createGestureRecognizers
[[self view] addGestureRecognizer:doubleFingerSingleTap];
[doubleFingerSingleTap release];
+ //1 finger single long tab - right mouse - alernative
+ UITapGestureRecognizer *singleFingerSingleLongTap = [[UILongPressGestureRecognizer alloc]
+ initWithTarget:self action:@selector(handleSingleFingerSingleLongTap:)];
+ singleFingerSingleLongTap.delaysTouchesBegan = YES;
+ singleFingerSingleLongTap.delaysTouchesEnded = YES;
+ singleFingerSingleLongTap.numberOfTouchesRequired = 1;
+ [self.view addGestureRecognizer:singleFingerSingleLongTap];
+ [singleFingerSingleLongTap release];
+
//1 finger single tab - left mouse
UITapGestureRecognizer *singleFingerSingleTap = [[UITapGestureRecognizer alloc]
initWithTarget:self action:@selector(handleSingleFingerSingleTap:)];
@@ -301,6 +310,17 @@ - (IBAction)handleDoubleFingerSingleTap:(UIGestureRecognizer *)sender
}
}
//--------------------------------------------------------------
+- (IBAction)handleSingleFingerSingleLongTap:(UIGestureRecognizer *)sender
+{
+ if([self wakeUpFromSleep])
+ {
+ if (sender.state == UIGestureRecognizerStateEnded)
+ {
+ [self handleDoubleFingerSingleTap:sender];
+ }
+ }
+}
+//--------------------------------------------------------------
- (IBAction)handleSingleFingerSingleTap:(UIGestureRecognizer *)sender
{
if([self wakeUpFromSleep])
@@ -157,6 +157,15 @@ - (void)createGestureRecognizers
doubleFingerSingleTap.numberOfTouchesRequired = 2;
[self.view addGestureRecognizer:doubleFingerSingleTap];
[doubleFingerSingleTap release];
+
+ //1 finger single long tab - right mouse - alernative
+ UITapGestureRecognizer *singleFingerSingleLongTap = [[UILongPressGestureRecognizer alloc]
+ initWithTarget:self action:@selector(handleSingleFingerSingleLongTap:)];
+ singleFingerSingleLongTap.delaysTouchesBegan = YES;
+ singleFingerSingleLongTap.delaysTouchesEnded = YES;
+ [self.view addGestureRecognizer:singleFingerSingleLongTap];
+ [singleFingerSingleLongTap release];
+
//double finger swipe left for backspace ... i like this fast backspace feature ;)
UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc]
@@ -297,6 +306,17 @@ - (IBAction)handleDoubleFingerSingleTap:(UIGestureRecognizer *)sender
}
//--------------------------------------------------------------
+- (IBAction)handleSingleFingerSingleLongTap:(UIGestureRecognizer *)sender
+{
+ if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING
+ {
+ if (sender.state == UIGestureRecognizerStateEnded)
+ {
+ [self handleDoubleFingerSingleTap:sender];
+ }
+ }
+}
+//--------------------------------------------------------------
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING

0 comments on commit b0760d0

Please sign in to comment.