mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 05:52:58 +00:00
30 lines
659 B
Objective-C
30 lines
659 B
Objective-C
//
|
|
// MPAutotypeClear.m
|
|
// MacPass
|
|
//
|
|
// Created by Michael Starke on 20/08/14.
|
|
// Copyright (c) 2014 HicknHack Software GmbH. All rights reserved.
|
|
//
|
|
|
|
#import "MPAutotypeClear.h"
|
|
#import "MPKeyMapper.h"
|
|
#import <Carbon/Carbon.h>
|
|
|
|
@implementation MPAutotypeClear
|
|
|
|
- (NSString *)description {
|
|
return [[self class] description];
|
|
}
|
|
|
|
- (void)execute {
|
|
MPModifiedKey key = [MPKeyMapper modifiedKeyForCharacter:@"a"];
|
|
if(key.keyCode == kMPUnknownKeyCode) {
|
|
NSLog(@"Unable to generate key code for 'A'");
|
|
return;
|
|
}
|
|
[self sendPressKey:key.keyCode modifierFlags:kCGEventFlagMaskCommand];
|
|
[self sendPressKey:kVK_Delete modifierFlags:0];
|
|
}
|
|
|
|
@end
|