From 9fe548e995a14c01584891717fc897a08462fe50 Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Thu, 3 Jul 2025 16:12:05 +1200 Subject: Fix debug console issue --- assets/scripts/local2P.lua | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'assets/scripts') 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 -- cgit v1.2.3