diff --git a/startup.lua b/startup.lua index 689082a..1f05879 100644 --- a/startup.lua +++ b/startup.lua @@ -77,6 +77,7 @@ local selx, sely = 0, 0 local y = 0 local lastReceivedMessage = nil local remoteHasComputer = false +local enteringPassword = false --------------------------------------------- -- EVENT HANDLERS @@ -98,6 +99,11 @@ local function ParaDisconnect() local dx, dy = 0, 0 _, _, dx, dy = os.pullEvent("monitor_touch") + -- Ignore clicks during password entry + if enteringPassword then + return nil + end + -- Only disconnect if clicking the disconnect button (bottom-right corner) if dy >= 17 and dy <= 19 and dx >= 20 and dx <= 28 then gate.disconnectStargate() @@ -144,9 +150,9 @@ local function HandlePasswordEntry() display.showPasswordPrompt() local password = "" - local entering = true + enteringPassword = true - while entering do + while enteringPassword do -- Use os.pullEvent directly to avoid conflicts with ParaDisconnect local _, _, x, y = os.pullEvent("monitor_touch") @@ -176,7 +182,7 @@ local function HandlePasswordEntry() display.updatePasswordDisplay(password) elseif x >= 18 and x <= 21 then -- OK button - submit password - entering = false + enteringPassword = false end end end