 //  EnigmaMachine
 //
 //  Created by Jeremy Pereira on 23/03/2015.
-//  Copyright (c) 2015 Jeremy Pereira. All rights reserved.
+//  Copyright (c) 2015, 2018 Jeremy Pereira. All rights reserved.
 //
 /*
 

protocol KeyboardDelegate: AnyObject
{
    func letterPressed(aLetter: Letter, keyboard: KeyboardView);
    func letterReleased(#keyboard: KeyboardView);
}

class KeyboardView: NSBox
{
    weak var keyboardDelegate: KeyboardDelegate?
    var timer: NSTimer?

    @IBOutlet var singleStep: AutoKeyButton!
    @IBOutlet var autoInput: NSSegmentedControl!

    @IBAction func keyPressed(sender: AnyObject)
    {
        if let keyboardButton = sender as? KeyboardButton, keyboardDelegate = keyboardDelegate
        {
            keyboardDelegate.letterReleased(keyboard: self)
        }


    func buttonPressed(keyboardButton : KeyboardButton)
    {
        if let keyboardDelegate = keyboardDelegate, let letter = keyboardButton.letter
        {
            keyboardDelegate.letterPressed(aLetter: letter, keyboard: self)
        }
    }

