mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 07:02:39 +00:00
Fixed delay/vkey pattern matching, fixed another time conversion error
This commit is contained in:
@@ -290,7 +290,7 @@ static CGKeyCode kMPFunctionKeyCodes[] = { kVK_F1, kVK_F2, kVK_F3, kVK_F4, kVK_F
|
|||||||
}
|
}
|
||||||
// TODO: add {APPLICATION <appname>}
|
// TODO: add {APPLICATION <appname>}
|
||||||
/* Delay */
|
/* Delay */
|
||||||
NSString *delayPattern = [[NSString alloc] initWithFormat:@"\\{(%@|%@|)[ |=]+([0-9])+\\}",
|
NSString *delayPattern = [[NSString alloc] initWithFormat:@"\\{(%@|%@)[ |=]+([0-9]+)\\}",
|
||||||
kKPKAutotypeDelay,
|
kKPKAutotypeDelay,
|
||||||
kKPKAutotypeVirtualKey/*,
|
kKPKAutotypeVirtualKey/*,
|
||||||
kKPKAutotypeVirtualExtendedKey,
|
kKPKAutotypeVirtualExtendedKey,
|
||||||
|
|||||||
@@ -9,7 +9,13 @@
|
|||||||
#import "MPAutotypeCommand.h"
|
#import "MPAutotypeCommand.h"
|
||||||
|
|
||||||
@interface MPAutotypeDelay : MPAutotypeCommand
|
@interface MPAutotypeDelay : MPAutotypeCommand
|
||||||
|
/**
|
||||||
|
* Creates an DelayCommand that delays the execution for n milliseconds
|
||||||
|
*
|
||||||
|
* @param delay Delay in milliseconds
|
||||||
|
*
|
||||||
|
* @return <#return value description#>
|
||||||
|
*/
|
||||||
- (instancetype)initWithDelay:(NSUInteger)delay;
|
- (instancetype)initWithDelay:(NSUInteger)delay;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)description {
|
- (NSString *)description {
|
||||||
return [[NSString alloc] initWithFormat:@"%@ delay: %ld ms", [self class], _delay];
|
return [[NSString alloc] initWithFormat:@"%@ delay: %ld ms", self.class, _delay];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithDelay:(NSUInteger)delay {
|
- (instancetype)initWithDelay:(NSUInteger)delay {
|
||||||
@@ -35,7 +35,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)execute {
|
- (void)execute {
|
||||||
usleep((useconds_t)(_delay*NSEC_PER_MSEC));
|
/* milliseconds * 10000 = microseconds */
|
||||||
|
usleep((useconds_t)(_delay*1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -233,4 +233,5 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Reference in New Issue
Block a user