Adds complete support for external keyboards

Fixes misc. other controller skin issues
This commit is contained in:
Riley Testut 2019-01-29 16:08:29 -08:00
parent 2f4171b9e2
commit 17e20a6a7c
3 changed files with 25 additions and 1 deletions

@ -1 +1 @@
Subproject commit 911d36bd01964ad7aeb0b4a37610402fd9845310
Subproject commit a721967855c44b52557eb9c8799518115ed76483

View File

@ -104,6 +104,26 @@ extension Input
case .rightTrigger: return NSLocalizedString("R2", comment: "")
}
case .controller(.keyboard):
let input = KeyboardGameController.Input(input: self)!
switch input
{
case .up: return NSLocalizedString("", comment: "")
case .down: return NSLocalizedString("", comment: "")
case .left: return NSLocalizedString("", comment: "")
case .right: return NSLocalizedString("", comment: "")
case .escape: return NSLocalizedString("", comment: "")
case .shift: return NSLocalizedString("", comment: "")
case .command: return NSLocalizedString("", comment: "")
case .option: return NSLocalizedString("", comment: "")
case .control: return NSLocalizedString("Ctrl", comment: "")
case .capsLock: return NSLocalizedString("", comment: "")
case .space: return NSLocalizedString("Space", comment: "")
case .return: return NSLocalizedString("\u{FE0E}", comment: "")
case .tab: return NSLocalizedString("", comment: "")
default: return input.stringValue.uppercased()
}
default: break
}

View File

@ -42,6 +42,10 @@ class ControllerInputsViewController: UIViewController
@IBOutlet private var actionsMenuViewControllerHeightConstraint: NSLayoutConstraint!
@IBOutlet private var cancelTapGestureRecognizer: UITapGestureRecognizer!
public override var next: UIResponder? {
return KeyboardResponder(nextResponder: super.next)
}
override func viewDidLoad()
{