Skip to content
Permalink
Browse files

Bump up MASShortcut version

  • Loading branch information...
youknowone committed Jul 28, 2019
1 parent 1b255f6 commit 2a92cf8e5347a20b5ee967e5ceda10e1177f146f
Showing with 17 additions and 17 deletions.
  1. +1 −1 GureumTests/GureumTests.swift
  2. +2 −2 OSXCore/Configuration.swift
  3. +1 −1 OSXCore/GureumComposer.swift
  4. +7 −7 Podfile.lock
  5. +6 −6 Preferences/Preferences.swift
@@ -75,7 +75,7 @@ class GureumTests: XCTestCase {
}

func testLayoutChange() {
Configuration.shared.inputModeExchangeKey = Configuration.Shortcut(UInt(kVK_Space), .shift)
Configuration.shared.inputModeExchangeKey = Configuration.Shortcut(kVK_Space, .shift)
for app in apps {
app.client.string = ""
app.controller.setValue("org.youknowone.inputmethod.Gureum.qwerty", forTag: kTextServiceInputModePropertyTag, client: app.client)
@@ -35,7 +35,7 @@ public class Configuration: UserDefaults {

var enableCapslockToToggleInputMode: Bool = false

typealias Shortcut = (UInt, NSEvent.ModifierFlags)
typealias Shortcut = (Int, NSEvent.ModifierFlags)

class func convertShortcutToConfiguration(_ shortcut: Shortcut?) -> [String: Any] {
guard let shortcut = shortcut else {
@@ -45,7 +45,7 @@ public class Configuration: UserDefaults {
}

class func convertConfigurationToShortcut(_ configuration: [String: Any]) -> Shortcut? {
guard let modifier = configuration["modifier"] as? UInt, let keyCode = configuration["keyCode"] as? UInt else {
guard let modifier = configuration["modifier"] as? UInt, let keyCode = configuration["keyCode"] as? Int else {
return nil
}
return (keyCode, NSEvent.ModifierFlags(rawValue: modifier))
@@ -230,7 +230,7 @@ class GureumComposer: DelegatedComposer {
// {
// Handle SpecialKeyCode first
let inputKey = (UInt(keyCode), inputModifier)
let inputKey = (keyCode, inputModifier)
if let shortcutKey = configuration.inputModeExchangeKey, shortcutKey == inputKey {
return .changeLayout(.toggle, true)
}
@@ -1,8 +1,8 @@
PODS:
- cdebug (1.2)
- Crashlytics (3.13.1):
- Fabric (~> 1.10.1)
- Fabric (1.10.1)
- Crashlytics (3.13.4):
- Fabric (~> 1.10.2)
- Fabric (1.10.2)
- FoundationExtension (2.0.0):
- cdebug (~> 1.1)
- FoundationExtension/FoundationExtension (= 2.0.0)
@@ -12,7 +12,7 @@ PODS:
- FoundationExtension/FoundationExtensionRC
- FoundationExtension/FoundationExtensionRC (2.0.0):
- cdebug (~> 1.1)
- MASShortcut (2.3.6)
- MASShortcut (2.4.0)
- SwiftCarbon (0.1.0):
- SwiftCarbon/HIToolbox (= 0.1.0)
- SwiftCarbon/SwiftCarbon (= 0.1.0)
@@ -45,10 +45,10 @@ SPEC REPOS:

SPEC CHECKSUMS:
cdebug: 55a96da647360590f0d292baebb34c4066cbca02
Crashlytics: 5aa8e90dcbf2f34898b4f5a0037787531246cca0
Fabric: f6f21452846788bb44595d73e9909d79d328e617
Crashlytics: 2dfd686bcb918dc10ee0e76f7f853fe42c7bd552
Fabric: 706c8b8098fff96c33c0db69cbf81f9c551d0d74
FoundationExtension: 0c3615327b9d7844ca5f65bfb4dd7563baab197a
MASShortcut: 9c215e8a8a78f3d01ce56da48e2730ab66b538fa
MASShortcut: d9e4909e878661cc42877cc9d6efbe638273ab57
SwiftCarbon: c48bbbff6c451022e89c46b85d0e9b44c64ef61b
SwiftCoreServices: e4aebffc7143ff3e06920ecb89654f7c81f9768a
SwiftIOKit: 9dce3dec67e00dc74b95fde86f257aca78239853
@@ -67,25 +67,25 @@ import PreferencePanes

func loadShortcutValues() {
if let key = configuration.inputModeExchangeKey {
inputModeExchangeShortcutView.shortcutValue = MASShortcut(keyCode: key.0, modifierFlags: key.1.rawValue)
inputModeExchangeShortcutView.shortcutValue = MASShortcut(keyCode: key.0, modifierFlags: key.1)
} else {
inputModeExchangeShortcutView.shortcutValue = nil
}

if let key = configuration.inputModeHanjaKey {
inputModeHanjaShortcutView.shortcutValue = MASShortcut(keyCode: key.0, modifierFlags: key.1.rawValue)
inputModeHanjaShortcutView.shortcutValue = MASShortcut(keyCode: key.0, modifierFlags: key.1)
} else {
inputModeHanjaShortcutView.shortcutValue = nil
}

if let key = configuration.inputModeEnglishKey {
inputModeEnglishShortcutView.shortcutValue = MASShortcut(keyCode: key.0, modifierFlags: key.1.rawValue)
inputModeEnglishShortcutView.shortcutValue = MASShortcut(keyCode: key.0, modifierFlags: key.1)
} else {
inputModeEnglishShortcutView.shortcutValue = nil
}

if let key = configuration.inputModeKoreanKey {
inputModeKoreanShortcutView.shortcutValue = MASShortcut(keyCode: key.0, modifierFlags: key.1.rawValue)
inputModeKoreanShortcutView.shortcutValue = MASShortcut(keyCode: key.0, modifierFlags: key.1)
} else {
inputModeKoreanShortcutView.shortcutValue = nil
}
@@ -96,7 +96,7 @@ import PreferencePanes
guard let mas = mas else {
return nil
}
return (mas.keyCode, NSEvent.ModifierFlags(rawValue: mas.modifierFlags))
return (mas.keyCode, mas.modifierFlags)
}
inputModeExchangeShortcutView.shortcutValueChange = { sender in
guard let sender = sender else {
@@ -263,7 +263,7 @@ class GureumShortcutValidator: MASShortcutValidator {
}
let modifiers = shortcut.modifierFlags
let keyCode = shortcut.keyCode
guard (modifiers & NSEvent.ModifierFlags.shift.rawValue) > 0 else {
guard (modifiers.rawValue & NSEvent.ModifierFlags.shift.rawValue) > 0 else {
return false
}
return keyCode >= 0x33 || [kVK_Return, kVK_Tab, kVK_Space].contains(Int(keyCode))

0 comments on commit 2a92cf8

Please sign in to comment.
You can’t perform that action at this time.