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)];
return [NSString stringWithFormat:@"%@%@%@%@%@",
(aModifierFlags & NSCommandKeyMask ? SRLoc(@"Command-") : @""),
(aModifierFlags & NSAlternateKeyMask ? SRLoc(@"Option-") : @""),
(aModifierFlags & NSControlKeyMask ? SRLoc(@"Control-") : @""),
(aModifierFlags & NSShiftKeyMask ? SRLoc(@"Shift-") : @""),
(aModifierFlags & NSEventModifierFlagCommand ? SRLoc(@"Command-") : @""),
(aModifierFlags & NSEventModifierFlagOption ? SRLoc(@"Option-") : @""),
(aModifierFlags & NSEventModifierFlagControl ? SRLoc(@"Control-") : @""),
(aModifierFlags & NSEventModifierFlagShift ? SRLoc(@"Shift-") : @""),
c];
}
@ -95,10 +95,10 @@ NSString *SRReadableASCIIStringForCocoaModifierFlagsAndKeyCode(NSEventModifierFl
NSString *c = [t transformedValue:@(aKeyCode)];
return [NSString stringWithFormat:@"%@%@%@%@%@",
(aModifierFlags & NSCommandKeyMask ? SRLoc(@"Command-") : @""),
(aModifierFlags & NSAlternateKeyMask ? SRLoc(@"Option-") : @""),
(aModifierFlags & NSControlKeyMask ? SRLoc(@"Control-") : @""),
(aModifierFlags & NSShiftKeyMask ? SRLoc(@"Shift-") : @""),
(aModifierFlags & NSEventModifierFlagCommand ? SRLoc(@"Command-") : @""),
(aModifierFlags & NSEventModifierFlagOption ? SRLoc(@"Option-") : @""),
(aModifierFlags & NSEventModifierFlagControl ? SRLoc(@"Control-") : @""),
(aModifierFlags & NSEventModifierFlagShift ? SRLoc(@"Shift-") : @""),
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
{
if ([anExplicitModifierFlags unsignedIntegerValue] & NSShiftKeyMask && [aKeyCode unsignedShortValue] == kVK_Tab)
if ([anExplicitModifierFlags unsignedIntegerValue] & NSEventModifierFlagShift && [aKeyCode unsignedShortValue] == kVK_Tab)
{
if (self.usesPlainStrings)
return _SRUnicharToString(SRKeyCodeGlyphTabLeft);

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

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

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

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

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

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

Loading…
Cancel
Save