I am trying to make a input terminal(not really)
i want it to listen for 9 letters, which it would wrote down the terminal as they come…
But… i cant figure out how to use the Backspace to delete the last letter that was typed…
Spoiler
tP(25,7)
tB(colors.blue)
tT(colors.white)
print(" ") -- password place...
tx,ty = 25,7
for i = 1, 9 do
local event, arg = os.pullEvent("char")
if event == "char" then
if arg == 14 or arg == keys.backspace then -- if i press backspace it SHOULD do the following, ( but it seems like it does not go into this if statement.. )
tP(tx-1,ty)
write(" ")
i = i - 1
else -- if not a backspace pressed, then input the letter...
tP(tx,ty)
write(arg)
table.insert(eTPassword, arg)
end
end
tx = tx + 1
end
for j = 1, #eTPassword do -- this is to input the whole password ( when done ) to 1 variable.. ( please help me with this too ) ( it is inputting every letters that i've typed in, into a table ( eTPassword ) but i dont --
-- know how to insert all the letters from the table to 1 single variable.
end
Thanks in advance