don't pass SHIFT to FlxKeyShortcutHandler

This commit is contained in:
2022-07-05 15:20:27 +00:00
parent 81ae02a58d
commit 36d17b9cef

View File

@@ -29,14 +29,18 @@
) )
// automatically pass the last pressed key to handle key // automatically pass the last pressed key to handle key
(method update [] (method :Void update []
(let [:FlxKey id (FlxG.keys.firstJustPressed)] (let [:FlxKey id (FlxG.keys.firstJustPressed)]
(unless (= id -1) (unless (= id -1)
(handleKey (let [key (id.toString)]
(case (id.toString) (case key
((when (KEY_MAP.exists key) key) ("SHIFT" (return))
(dictGet KEY_MAP key)) (otherwise
((when FlxG.keys.pressed.SHIFT key) (handleKey
(.toUpperCase key)) (case key
(key (.toLowerCase key)) ((when (KEY_MAP.exists key) key)
(otherwise (throw "FlxKey.toString returned null!"))))))) (dictGet KEY_MAP key))
((when FlxG.keys.pressed.SHIFT key)
(.toUpperCase key))
(key (.toLowerCase key))
(otherwise (throw "FlxKey.toString returned null!"))))))))))