NOTE: I have made these variables shortened from term
c = term.setTextColor
b = term.setBackgroundColor
cp = term.setCursorPos
z = colors
while true do
local event, key = os.pullEvent("key")
if key == 28 then break elseif key == 14 then
local xpos1, ypos1 = term.getCursorPos()
if xpos1 > x then
cp(xpos1 - 1, ypos1)
b(z.black)
write(" ")
cp(xpos1 - 1, ypos1)
end
else
write(tostring(key)) --- I want this to output the character that belongs to the keycode entered, this do only output the keycode
end
end
TechnicalCoding, on 22 June 2016 - 04:50 PM, said:
By adding this line after local e,key = os.pullEvent("key")
local k = keys.getName(key)then use "k" instead of key
which now means i can do
if k=="character" THEN
That is how i fixed the problem! Hope everyone can get a use of it!
Edited by TechnicalCoding, 22 June 2016 - 08:59 PM.











