Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 finger tap is easier than blackslash for input esc #9

Closed
pinxue opened this issue Jan 25, 2012 · 1 comment
Closed

2 finger tap is easier than blackslash for input esc #9

pinxue opened this issue Jan 25, 2012 · 1 comment

Comments

@pinxue
Copy link

pinxue commented Jan 25, 2012

To input blackslash in iOS, we need switch to symbol keyboard by two click, not a good idea. Personally, I prefer to using two finger tap gesture as an alternative.

I have forked it as https://github.com/pinxue/Vim .

git diff is:

diff --git a/src/gui_ios.m b/src/gui_ios.m
index ecd1f11..10b5e7a 100644
--- a/src/gui_ios.m
+++ b/src/gui_ios.m
@@ -128,7 +128,13 @@ enum blink_state {

  • (void)viewDidLoad {
    [super viewDidLoad];
  • UITapGestureRecognizer * tap2fGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(click2f:)];
  • tap2fGestureRecognizer.numberOfTouchesRequired = 2;
  • [_textView addGestureRecognizer:tap2fGestureRecognizer];
  • [tap2fGestureRecognizer release];
  • UITapGestureRecognizer * tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(click:)];
  • tapGestureRecognizer.numberOfTouchesRequired = 1;
    [_textView addGestureRecognizer:tapGestureRecognizer];
    [tapGestureRecognizer release];

@@ -199,6 +205,13 @@ enum blink_state {
gui_send_mouse_event(MOUSE_LEFT, clickLocation.x, clickLocation.y, 1, 0);
}

+- (void)click2f:(UITapGestureRecognizer *)sender {

  • [self becomeFirstResponder];
  • // send ESC
  • char escapeString[] = {ESC, 0};
  • [self insertText:[NSString stringWithUTF8String:escapeString]];
    +}
  • (void)pan:(UIPanGestureRecognizer *)sender {
    CGPoint clickLocation = [sender locationInView:sender.view];
@Ecco
Copy link

Ecco commented Jan 28, 2012

Thanks for the patch @pinxue ! However I won't pull this in, as it isn't user-customizable. Sure backslash isn't the best solution. But at least it's something users can change without rebuilding Vim.

In that case, I think the proper fix would be to solve issue #3 by adding gestures as mappable objects.

Thanks a lot for your time though !

@Ecco Ecco closed this as completed Jan 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants