mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-24 02:49:45 +00:00
Added {CLEARFIELD} to autotype commands. Stubbs for {DELAY X}
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
|
||||
#import "MPAutotypePaste.h"
|
||||
#import "MPAutotypeKeyPress.h"
|
||||
#import "MPAutotypeClear.h"
|
||||
#import "MPAutotypeDelay.h"
|
||||
|
||||
#import "MPAutotypeContext.h"
|
||||
#import "MPKeyMapper.h"
|
||||
@@ -163,19 +165,26 @@
|
||||
}
|
||||
|
||||
+ (void)appendCommandForString:(NSString *)commandString toCommands:(NSMutableArray *)commands activeModifer:(CGEventFlags)flags {
|
||||
if(!commandString) {
|
||||
if(nil == commandString) {
|
||||
return;
|
||||
}
|
||||
/* TODO: Test for special Commands */
|
||||
/* TODO: fall back to paste if nothing matches */
|
||||
|
||||
|
||||
NSString *delayPrefix = [[NSString alloc] initWithFormat:@"{%@", kKPKAutotypeDelay];
|
||||
NSNumber *keyCodeNumber = [self keypressCommands][commandString];
|
||||
|
||||
if(keyCodeNumber) {
|
||||
if(nil != keyCodeNumber) {
|
||||
CGKeyCode keyCode = [keyCodeNumber keyCodeValue];
|
||||
[commands addObject:[[MPAutotypeKeyPress alloc] initWithModifierMask:flags keyCode:keyCode]];
|
||||
}
|
||||
else if([kKPKAutotypeClearField isEqualToString:commandString]) {
|
||||
[commands addObject:[[MPAutotypeClear alloc] init]];
|
||||
}
|
||||
else if([commandString hasPrefix:delayPrefix]){
|
||||
[commands addObject:[[MPAutotypeDelay alloc] initWithDelay:5]];
|
||||
/* TODO: find the delay */
|
||||
}
|
||||
else {
|
||||
[self appendPasteCommandForContent:commandString toCommands:commands];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user