Fixed issue resutling in singel hotkey combination not being properly processed

This commit is contained in:
michael starke
2014-12-15 14:47:44 +01:00
parent 59aa5c0ced
commit aa340305ba
8 changed files with 118 additions and 42 deletions

View File

@@ -238,5 +238,21 @@
keyPress = commands[4];
XCTAssertEqual(keyPress.keyCode, kVK_Return);
XCTAssertEqual(keyPress.modifierMask, 0);
/* Command 3 */
context = [[MPAutotypeContext alloc] initWithEntry:self.entry andSequence:@"^T"];
commands = [MPAutotypeCommand commandsForContext:context];
XCTAssertTrue(commands.count == 1);
XCTAssertTrue([commands[0] isKindOfClass:[MPAutotypeKeyPress class]]);
/*^T*/
keyPress = commands[0];
XCTAssertEqualObjects(@"t", [MPKeyMapper stringForKey:keyPress.keyCode]);
/* TODO - Respect user settings? */
XCTAssertEqual(keyPress.modifierMask, kCGEventFlagMaskCommand);
/*XCTAssertEqual(keyPress.modifierMask, kCGEventFlagMaskControl);*/
}
@end

View File

@@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
#import <XCTest/XCTest.h>
#import "KPKXmlUtilities.h"
#import "NSString+XMLUtilities.h"
@interface KPKTextXMLUtilities : XCTestCase
@@ -26,8 +26,8 @@
}
- (void)testExample {
NSString *safe = stripUnsafeCharacterForXMLFromString(@"*EORDIE\x10\x16\x12\x10");
XCTAssertEqualObjects(@"*EORDIE", safe);
NSString *unsave = @"*EORDIE\x10\x16\x12\x10";
XCTAssertEqualObjects(@"*EORDIE", unsave.XMLCompatibleString);
}
@end