diff options
| author | Arslaan Pathan <[email protected]> | 2025-07-03 16:12:05 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2025-07-03 16:12:05 +1200 |
| commit | 9fe548e995a14c01584891717fc897a08462fe50 (patch) | |
| tree | 709fb43ac423c706c97fff236082d57ab3952e11 /assets/scripts | |
| parent | 2bebf7f259b4655c3f63fdca955145c832530b08 (diff) | |
| download | showdownofthesticks-9fe548e995a14c01584891717fc897a08462fe50.tar.xz showdownofthesticks-9fe548e995a14c01584891717fc897a08462fe50.zip | |
Fix debug console issue
Diffstat (limited to 'assets/scripts')
| -rw-r--r-- | assets/scripts/local2P.lua | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/assets/scripts/local2P.lua b/assets/scripts/local2P.lua index 48bce2c..9bd6bb8 100644 --- a/assets/scripts/local2P.lua +++ b/assets/scripts/local2P.lua @@ -22,7 +22,7 @@ consoleKeycodes = {} for _, name in ipairs({"a","b","c","d","e","f","g","h","i","j","k","l","m", "n","o","p","q","r","s","t","u","v","w","x","y","z", "space","return","backspace","backquote","minus","0","1","2","3","4","5","6","7","8","9", - "(", ")", "%", "$", "."}) do + "(", ")", "%", "$", ".", "=", "\"", "'", "\\", "/", ",", ";"}) do consoleKeycodes[name] = getKeycodeByName(name) end @@ -64,6 +64,20 @@ function HandleDebugConsoleInput() if not debugConsoleActive then return end local shiftPressed = Input.isKeyDown("Left Shift") + local shiftedSymbols = { + ["9"] = "(", + ["0"] = ")", + ["-"] = "_", + ["="] = "+", + ["["] = "{", + ["]"] = "}", + ["\\"] = "|", + [";"] = ":", + ["'"] = "\"", + [","] = "<", + ["."] = ">", + ["/"] = "?" + } for keyName, keycode in pairs(consoleKeycodes) do if Input.isKeyPressedOnce(keyName) then @@ -74,7 +88,11 @@ function HandleDebugConsoleInput() debugInput = "" elseif #keyName == 1 then if shiftPressed then - debugInput = debugInput .. keyName:upper() + if shiftedSymbols[keyName] then + debugInput = debugInput .. shiftedSymbols[keyName] + else + debugInput = debugInput .. keyName:upper() + end else debugInput = debugInput .. keyName end |
