KeyShortcutHandler allow capital letters. close #68

This commit is contained in:
2022-06-18 19:26:11 +00:00
parent 6700c27157
commit fc431b164d
3 changed files with 14 additions and 5 deletions

View File

@@ -36,5 +36,7 @@
(case (id.toString)
((when (KEY_MAP.exists key) key)
(dictGet KEY_MAP key))
((when FlxG.keys.pressed.SHIFT key)
(.toUpperCase key))
(key (.toLowerCase key))
(otherwise (throw "FlxKey.toString returned null!")))))))

View File

@@ -51,7 +51,7 @@
((Some _)
(case (stream.takeUntilAndDrop "]")
((Some newShortcuts)
(extractKeyboardShortcuts str stream (+ shortcuts (newShortcuts.toLowerCase))))
(extractKeyboardShortcuts str stream (+ shortcuts newShortcuts)))
(otherwise
(tryCallOrThrow onBadShortcut "unclosed [ in $str" str null)
"")))