diff --git a/projects/kiss-tools/src/kiss_tools/FlxKeyShortcutHandler.kiss b/projects/kiss-tools/src/kiss_tools/FlxKeyShortcutHandler.kiss index 0ad322d8..bd393a28 100644 --- a/projects/kiss-tools/src/kiss_tools/FlxKeyShortcutHandler.kiss +++ b/projects/kiss-tools/src/kiss_tools/FlxKeyShortcutHandler.kiss @@ -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!"))))))) \ No newline at end of file diff --git a/projects/kiss-tools/src/kiss_tools/KeyShortcutHandler.kiss b/projects/kiss-tools/src/kiss_tools/KeyShortcutHandler.kiss index 034360d5..0dcd76f9 100644 --- a/projects/kiss-tools/src/kiss_tools/KeyShortcutHandler.kiss +++ b/projects/kiss-tools/src/kiss_tools/KeyShortcutHandler.kiss @@ -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) ""))) diff --git a/projects/kiss-vscode/config/KissConfig.kiss b/projects/kiss-vscode/config/KissConfig.kiss index 027433d2..419b9c07 100644 --- a/projects/kiss-vscode/config/KissConfig.kiss +++ b/projects/kiss-vscode/config/KissConfig.kiss @@ -106,15 +106,17 @@ vscode.ViewColumn.Two (object enableScripts true))) - (set keyListener (shortcutPanel.webview.onDidReceiveMessage ->:Void key (shortcutHandler.handleKey (the String key)))) + (set keyListener + (shortcutPanel.webview.onDidReceiveMessage + ->:Void key (shortcutHandler.handleKey (the String key)))) (set shortcutPanel.webview.html (shortcutPanelHtml prefixMap)) (shortcutPanel.webview.postMessage (object command "focus"))) (function shortcutPanelHtml [:PrefixMap prefixMap] - (let [&mut unusedKeys "abcdefghijklmnopqrstuvwxyz1234567890-/" + (let [&mut unusedKeys "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-/" shortcutParagraphs (for =>key shortcutKey prefixMap - (set unusedKeys (unusedKeys.replace (key.toLowerCase) "")) + (set unusedKeys (unusedKeys.replace key "")) "

${key} - $(case shortcutKey ((Prefix innerMap) "$(Lambda.count innerMap) shortcuts") @@ -143,7 +145,12 @@ } }); window.addEventListener('keydown', function (e) { - vscode.postMessage(e.key); + var key = e.key; + if (key == 'Shift') + return; + if (key.length == 1 && e.shiftKey) + key = key.toUpperCase(); + vscode.postMessage(key); });