 //
 
 import AppKit
-import Carbon
 
 protocol SingleCharTextFieldDelegate: class {
     func didRecieveChar(textField: SingleCharTextField, char: Character)
     func didLoseFocus(textField: SingleCharTextField)
 }
-
-private let englishInputSource = TISCopyInputSourceForLanguage("en").takeRetainedValue()
 
 final class SingleCharTextField: NSTextField, NSTextFieldDelegate {
     

    weak var charInputDelegate: SingleCharTextFieldDelegate?
    
    var forceEnglishKeyboard = false
    
    // MARK:- Private properties
    
    private var previousInputSource: TISInputSource?
    
    // MARK:- Instantiation
    

    
    // MARK:- Overriden methods
    
    override func becomeFirstResponder() -> Bool {
        let result = super.becomeFirstResponder()
        if forceEnglishKeyboard {
            NSTextInputContext.currentInputContext()?.selectedKeyboardInputSource = "com.apple.keylayout.US"
        }
        return result
    }
    
    override func controlTextDidEndEditing(obj: NSNotification) {
        charInputDelegate?.didLoseFocus(self)
        stringValue = ""
    }
    
    override func textDidChange(_: NSNotification) {
