Autotype now uses key presses instead of paste whenever possible.

This commit is contained in:
Michael Starke
2018-11-05 11:55:07 +01:00
parent 57e28e1417
commit afc69f69ae
18 changed files with 1008 additions and 521 deletions

View File

@@ -22,12 +22,14 @@
#import "MPAutotypeClear.h"
#import "MPKeyMapper.h"
#import "MPKeyTyper.h"
#import <Carbon/Carbon.h>
@implementation MPAutotypeClear
- (NSString *)description {
return [[self class] description];
return self.class.description;
}
- (void)execute {
@@ -36,8 +38,8 @@
NSLog(@"Unable to generate key code for 'A'");
return;
}
[self sendPressKey:key.keyCode modifierFlags:kCGEventFlagMaskCommand];
[self sendPressKey:kVK_Delete modifierFlags:0];
[MPKeyTyper sendKey:MPMakeModifiedKey(kCGEventFlagMaskCommand, key.keyCode)];
[MPKeyTyper sendKey:MPMakeModifiedKey(0, kVK_Delete)];
}
@end