mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 18:42:24 +00:00
Added API stub to allow for keystroke overrides when performing autotype
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
- (instancetype)init NS_UNAVAILABLE;
|
- (instancetype)init NS_UNAVAILABLE;
|
||||||
|
|
||||||
- (void)performAutotypeForEntry:(KPKEntry *)entry;
|
- (void)performAutotypeForEntry:(KPKEntry *)entry;
|
||||||
|
- (void)performAutotypeForEntry:(KPKEntry *)entry overrideSequence:(NSString *)sequence;
|
||||||
- (void)selectAutotypeCandiate:(MPAutotypeContext *)context;
|
- (void)selectAutotypeCandiate:(MPAutotypeContext *)context;
|
||||||
- (void)cancelAutotypeCandidateSelection;
|
- (void)cancelAutotypeCandidateSelection;
|
||||||
|
|
||||||
|
|||||||
@@ -125,6 +125,9 @@ static MPAutotypeDaemon *_sharedInstance;
|
|||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark Autotype Invocation
|
#pragma mark Autotype Invocation
|
||||||
- (void)performAutotypeForEntry:(KPKEntry *)entry {
|
- (void)performAutotypeForEntry:(KPKEntry *)entry {
|
||||||
|
[self performAutotypeForEntry:entry overrideSequence:nil];
|
||||||
|
}
|
||||||
|
- (void)performAutotypeForEntry:(KPKEntry *)entry overrideSequence:(NSString *)sequence {
|
||||||
if(entry) {
|
if(entry) {
|
||||||
[self _updateTargeInformationForApplication:self.previousApplication];
|
[self _updateTargeInformationForApplication:self.previousApplication];
|
||||||
[self _performAutotypeForEntry:entry];
|
[self _performAutotypeForEntry:entry];
|
||||||
@@ -132,7 +135,7 @@ static MPAutotypeDaemon *_sharedInstance;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)_didPressHotKey {
|
- (void)_didPressHotKey {
|
||||||
[self _updateTargetInfoForFrontMostApplication];
|
[self _updateTargetInformationForFrontMostApplication];
|
||||||
[self _performAutotypeForEntry:nil];
|
[self _performAutotypeForEntry:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,15 +333,15 @@ static MPAutotypeDaemon *_sharedInstance;
|
|||||||
#pragma mark Application information
|
#pragma mark Application information
|
||||||
- (BOOL)_orderApplicationToFront:(pid_t)processIdentifier {
|
- (BOOL)_orderApplicationToFront:(pid_t)processIdentifier {
|
||||||
NSRunningApplication *runingApplication = [NSRunningApplication runningApplicationWithProcessIdentifier:processIdentifier];
|
NSRunningApplication *runingApplication = [NSRunningApplication runningApplicationWithProcessIdentifier:processIdentifier];
|
||||||
NSRunningApplication *frontApplication = [NSWorkspace sharedWorkspace].frontmostApplication;
|
NSRunningApplication *frontApplication = NSWorkspace.sharedWorkspace.frontmostApplication;
|
||||||
if(frontApplication.processIdentifier == processIdentifier) {
|
if(frontApplication.processIdentifier == processIdentifier) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
[runingApplication activateWithOptions:NSApplicationActivateIgnoringOtherApps];
|
[runingApplication activateWithOptions:NSApplicationActivateIgnoringOtherApps];
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
- (void)_updateTargetInfoForFrontMostApplication {
|
- (void)_updateTargetInformationForFrontMostApplication {
|
||||||
[self _updateTargeInformationForApplication:[NSWorkspace sharedWorkspace].frontmostApplication];
|
[self _updateTargeInformationForApplication:NSWorkspace.sharedWorkspace.frontmostApplication];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_updateTargeInformationForApplication:(NSRunningApplication *)application {
|
- (void)_updateTargeInformationForApplication:(NSRunningApplication *)application {
|
||||||
|
|||||||
Reference in New Issue
Block a user