From 75231029821c58628480d45ed3b114176d9ac50f Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Fri, 1 Feb 2019 12:25:08 -0800 Subject: [PATCH] Adjusts keyboard input display priorities to favor special character keys --- Delta/Extensions/Input+Display.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Delta/Extensions/Input+Display.swift b/Delta/Extensions/Input+Display.swift index 6629abb..9d8c48f 100644 --- a/Delta/Extensions/Input+Display.swift +++ b/Delta/Extensions/Input+Display.swift @@ -35,6 +35,21 @@ extension Input case .rightTrigger: return 500 default: break } + + case .controller(.keyboard): + let input = KeyboardGameController.Input(input: self)! + + // We prefer to display keys with special characters (e.g. arrow keys, shift) over regular keys. + // If the input's localizedName == it's string value, we can assume it's a normal key, and return a lower priority. + // Otherwise, it has a special display character, and so we return a higher priority. + if input.localizedName == input.stringValue.uppercased() + { + return 500 + } + else + { + return 1000 + } default: break }