Browse Source

Fix deprecations.

pull/101/head
Abhishek 4 years ago
parent
commit
3136b748be
  1. 16
      Clocker/Clocker/ShortcutRecorder-master/Library/SRCommon.m
  2. 2
      Clocker/Clocker/ShortcutRecorder-master/Library/SRKeyCodeTransformer.m
  3. 16
      Clocker/Clocker/ShortcutRecorder-master/Library/SRModifierFlagsTransformer.m
  4. 2
      Clocker/Clocker/ShortcutRecorder-master/PTHotKey/PTHotKeyCenter.m
  5. 2
      Clocker/Clocker/ShortcutRecorder-master/PTHotKey/PTKeyCombo.m

16
Clocker/Clocker/ShortcutRecorder-master/Library/SRCommon.m

@ -81,10 +81,10 @@ NSString *SRReadableStringForCocoaModifierFlagsAndKeyCode(NSEventModifierFlags a
NSString *c = [t transformedValue:@(aKeyCode)]; NSString *c = [t transformedValue:@(aKeyCode)];
return [NSString stringWithFormat:@"%@%@%@%@%@", return [NSString stringWithFormat:@"%@%@%@%@%@",
(aModifierFlags & NSCommandKeyMask ? SRLoc(@"Command-") : @""), (aModifierFlags & NSEventModifierFlagCommand ? SRLoc(@"Command-") : @""),
(aModifierFlags & NSAlternateKeyMask ? SRLoc(@"Option-") : @""), (aModifierFlags & NSEventModifierFlagOption ? SRLoc(@"Option-") : @""),
(aModifierFlags & NSControlKeyMask ? SRLoc(@"Control-") : @""), (aModifierFlags & NSEventModifierFlagControl ? SRLoc(@"Control-") : @""),
(aModifierFlags & NSShiftKeyMask ? SRLoc(@"Shift-") : @""), (aModifierFlags & NSEventModifierFlagShift ? SRLoc(@"Shift-") : @""),
c]; c];
} }
@ -95,10 +95,10 @@ NSString *SRReadableASCIIStringForCocoaModifierFlagsAndKeyCode(NSEventModifierFl
NSString *c = [t transformedValue:@(aKeyCode)]; NSString *c = [t transformedValue:@(aKeyCode)];
return [NSString stringWithFormat:@"%@%@%@%@%@", return [NSString stringWithFormat:@"%@%@%@%@%@",
(aModifierFlags & NSCommandKeyMask ? SRLoc(@"Command-") : @""), (aModifierFlags & NSEventModifierFlagCommand ? SRLoc(@"Command-") : @""),
(aModifierFlags & NSAlternateKeyMask ? SRLoc(@"Option-") : @""), (aModifierFlags & NSEventModifierFlagOption ? SRLoc(@"Option-") : @""),
(aModifierFlags & NSControlKeyMask ? SRLoc(@"Control-") : @""), (aModifierFlags & NSEventModifierFlagControl ? SRLoc(@"Control-") : @""),
(aModifierFlags & NSShiftKeyMask ? SRLoc(@"Shift-") : @""), (aModifierFlags & NSEventModifierFlagShift ? SRLoc(@"Shift-") : @""),
c]; c];
} }

2
Clocker/Clocker/ShortcutRecorder-master/Library/SRKeyCodeTransformer.m

@ -340,7 +340,7 @@ FOUNDATION_STATIC_INLINE NSString* _SRUnicharToString(unichar aChar)
- (NSString *)transformedSpecialKeyCode:(NSNumber *)aKeyCode withExplicitModifierFlags:(NSNumber *)anExplicitModifierFlags - (NSString *)transformedSpecialKeyCode:(NSNumber *)aKeyCode withExplicitModifierFlags:(NSNumber *)anExplicitModifierFlags
{ {
if ([anExplicitModifierFlags unsignedIntegerValue] & NSShiftKeyMask && [aKeyCode unsignedShortValue] == kVK_Tab) if ([anExplicitModifierFlags unsignedIntegerValue] & NSEventModifierFlagShift && [aKeyCode unsignedShortValue] == kVK_Tab)
{ {
if (self.usesPlainStrings) if (self.usesPlainStrings)
return _SRUnicharToString(SRKeyCodeGlyphTabLeft); return _SRUnicharToString(SRKeyCodeGlyphTabLeft);

16
Clocker/Clocker/ShortcutRecorder-master/Library/SRModifierFlagsTransformer.m

@ -77,16 +77,16 @@
NSEventModifierFlags modifierFlags = [aValue unsignedIntegerValue]; NSEventModifierFlags modifierFlags = [aValue unsignedIntegerValue];
NSMutableString *s = [NSMutableString string]; NSMutableString *s = [NSMutableString string];
if (modifierFlags & NSControlKeyMask) if (modifierFlags & NSEventModifierFlagControl)
[s appendString:SRLoc(@"Control-")]; [s appendString:SRLoc(@"Control-")];
if (modifierFlags & NSAlternateKeyMask) if (modifierFlags & NSEventModifierFlagOption)
[s appendString:SRLoc(@"Option-")]; [s appendString:SRLoc(@"Option-")];
if (modifierFlags & NSShiftKeyMask) if (modifierFlags & NSEventModifierFlagShift)
[s appendString:SRLoc(@"Shift-")]; [s appendString:SRLoc(@"Shift-")];
if (modifierFlags & NSCommandKeyMask) if (modifierFlags & NSEventModifierFlagCommand)
[s appendString:SRLoc(@"Command-")]; [s appendString:SRLoc(@"Command-")];
if (s.length > 0) if (s.length > 0)
@ -98,10 +98,10 @@
{ {
NSEventModifierFlags f = [aValue unsignedIntegerValue]; NSEventModifierFlags f = [aValue unsignedIntegerValue];
return [NSString stringWithFormat:@"%@%@%@%@", return [NSString stringWithFormat:@"%@%@%@%@",
(f & NSControlKeyMask ? @"⌃" : @""), (f & NSEventModifierFlagControl ? @"⌃" : @""),
(f & NSAlternateKeyMask ? @"⌥" : @""), (f & NSEventModifierFlagOption ? @"⌥" : @""),
(f & NSShiftKeyMask ? @"⇧" : @""), (f & NSEventModifierFlagShift ? @"⇧" : @""),
(f & NSCommandKeyMask ? @"⌘" : @"")]; (f & NSEventModifierFlagCommand ? @"⌘" : @"")];
} }
} }

2
Clocker/Clocker/ShortcutRecorder-master/PTHotKey/PTHotKeyCenter.m

@ -207,7 +207,7 @@ static PTHotKeyCenter *_sharedHotKeyCenter = nil;
short subType; short subType;
EventHotKeyRef carbonHotKey; EventHotKeyRef carbonHotKey;
if( [event type] == NSSystemDefined ) if( [event type] == NSEventTypeSystemDefined )
{ {
subType = [event subtype]; subType = [event subtype];

2
Clocker/Clocker/ShortcutRecorder-master/PTHotKey/PTKeyCombo.m

@ -49,7 +49,7 @@
case kVK_F18: case kVK_F18:
case kVK_F19: case kVK_F19:
case kVK_F20: case kVK_F20:
mModifiers = modifiers | NSFunctionKeyMask; mModifiers = modifiers | NSEventModifierFlagFunction;
break; break;
default: default:
mModifiers = modifiers; mModifiers = modifiers;

Loading…
Cancel
Save