             }
     }
     
-    static func tweak() {
-        selectPrevious()
-        Timer.scheduledTimer(timeInterval: 0.3, target: self, selector: #selector(selectPrevious), userInfo: nil, repeats: false)
+    static func nonCJKSource() -> InputSource? {
+        return inputSources.first(where: { !$0.isCJK })
     }
 
-    @objc
     static func selectPrevious() {
         let src = CGEventSource(stateID: CGEventSourceStateID.hidSystemState)!
 
         let down = CGEvent(keyboardEventSource: src, virtualKey: CGKeyCode(kVK_Space), keyDown: true)!
         let up = CGEvent(keyboardEventSource: src, virtualKey: CGKeyCode(kVK_Space), keyDown: false)!
 
-        let flag = CGEventFlags(rawValue: CGEventFlags.maskShift.rawValue | CGEventFlags.maskCommand.rawValue)
+        let flag = CGEventFlags(rawValue: CGEventFlags.maskAlternate.rawValue | CGEventFlags.maskCommand.rawValue)
         down.flags = flag;
         up.flags = flag;
 

    let tisInputSource: TISInputSource
    let id: String
    let name: String

    var icon: NSImage? = nil


    }

    func select() {
        TISSelectInputSource(tisInputSource)

        if isCJK {
            // Workaround for TIS CJK layout bug:
            // when it's CJK, select nonCJK input first and then return
            if let nonCJK = InputSourceManager.nonCJKSource() {
                nonCJK.select()
                Thread.sleep(forTimeInterval: 0.05)
                InputSourceManager.selectPrevious()
            }
        }
    }

