718 posts
Location
Hawaii
Posted 06 April 2012 - 05:59 AM
How can I convert any keycode but 28 into the letter/number that has been pressed?
while true do
local e,key = os.pullEvent( "key" )
oldkey = key
end
So if I press "i", it will change 23 (keycode for "i") into i
(without changing "key")
496 posts
Location
Harlem, NY
Posted 06 April 2012 - 06:24 AM
Use print("i")? :)/>/>
718 posts
Location
Hawaii
Posted 06 April 2012 - 06:29 AM
Use print("i")? :)/>/>
Nevermind, I added;
local a,char = os.pullEvent("char")
161 posts
Posted 06 April 2012 - 10:03 AM
Sure, use the char event instead of the key event if that's an option. Otherwise (e.g. if you want to use special keys),
http://minecraftwiki.net/wiki/Key_Codes has a list of all the numeric key codes.
718 posts
Location
Hawaii
Posted 06 April 2012 - 06:25 PM
Sure, use the char event instead of the key event if that's an option. Otherwise (e.g. if you want to use special keys),
http://minecraftwiki.net/wiki/Key_Codes has a list of all the numeric key codes.
I'm using char and key now, key for enter, char for printing