mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 17:32:17 +00:00
Collection of modifiers and subsequent key presses implemented
Extended tests for command creation
This commit is contained in:
@@ -20,6 +20,17 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithModifierMask:(CGEventFlags)modiferMask character:(NSString *)character {
|
||||
CGKeyCode mappedKey = [MPKeyMapper keyCodeForCharacter:character];
|
||||
if(mappedKey == kMPUnknownKeyCode) {
|
||||
self = nil;
|
||||
}
|
||||
else {
|
||||
self = [self initWithModifierMask:modiferMask keyCode:mappedKey];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)execute {
|
||||
if(![self isValid]) {
|
||||
return; // no valid command. Stop.
|
||||
|
||||
Reference in New Issue
Block a user