aboutsummaryrefslogtreecommitdiff
path: root/assets/scripts/local2P.lua
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2025-07-03 16:12:05 +1200
committerArslaan Pathan <[email protected]>2025-07-03 16:12:05 +1200
commit9fe548e995a14c01584891717fc897a08462fe50 (patch)
tree709fb43ac423c706c97fff236082d57ab3952e11 /assets/scripts/local2P.lua
parent2bebf7f259b4655c3f63fdca955145c832530b08 (diff)
downloadshowdownofthesticks-9fe548e995a14c01584891717fc897a08462fe50.tar.xz
showdownofthesticks-9fe548e995a14c01584891717fc897a08462fe50.zip
Fix debug console issue
Diffstat (limited to 'assets/scripts/local2P.lua')
-rw-r--r--assets/scripts/local2P.lua22
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