Fixed issue with special keys being remapped again (resulting in mangeled key codes in release)

This commit is contained in:
michael starke
2014-12-03 17:30:13 +01:00
parent 7ce789790c
commit 559f7cd78f
3 changed files with 7 additions and 6 deletions

View File

@@ -323,11 +323,10 @@
Set the modifiers to the ones we want Set the modifiers to the ones we want
We use our private event source so no modifier reset should be needed We use our private event source so no modifier reset should be needed
*/ */
CGEventSetFlags(pressKey,flags); CGEventSetFlags(pressKey, flags);
CGEventSetFlags(releaseKey, flags); CGEventSetFlags(releaseKey, flags);
/* Send the event */ /* Send the event */
NSLog(@"Seding %@", self);
CGEventPost(kCGHIDEventTap, pressKey); CGEventPost(kCGHIDEventTap, pressKey);
usleep(0.05 * NSEC_PER_MSEC); usleep(0.05 * NSEC_PER_MSEC);
CGEventPost(kCGHIDEventTap, releaseKey); CGEventPost(kCGHIDEventTap, releaseKey);

View File

@@ -39,12 +39,14 @@
if(![self isValid]) { if(![self isValid]) {
return; // no valid command. Stop. return; // no valid command. Stop.
} }
CGKeyCode mappedKey = [self _transformKeyCode]; //CGKeyCode mappedKey = [self _transformKeyCode];
[self sendPressKey:mappedKey modifierFlags:self.modifierMask]; [self sendPressKey:self.keyCode modifierFlags:self.modifierMask];
} }
- (BOOL)isValid { - (BOOL)isValid {
return ([self _transformKeyCode] != kMPUnknownKeyCode); return YES;
/* TODO test for actual validity of the command */
//return ([self _transformKeyCode] != kMPUnknownKeyCode);
} }
- (CGKeyCode)_transformKeyCode { - (CGKeyCode)_transformKeyCode {

View File

@@ -62,7 +62,7 @@
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>2550</string> <string>2555</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string> <string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>