This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Sewbacca's profile picture

Convert key to the key number?

Started by Sewbacca, 08 January 2016 - 07:05 PM
Sewbacca #1
Posted 08 January 2016 - 08:05 PM
Is there any way to convert a key into his name in the table keys or the value or must I do it manual?
(example: ' into apostrophe or the value of keys.apostrophe)

I hope you understand what I mean!
Edited on 10 March 2016 - 03:17 PM
Exerro #2
Posted 08 January 2016 - 08:52 PM
keys.getName( nKey ) will return "enter" if nKey is 28, if that's what you need?
KingofGamesYami #3
Posted 08 January 2016 - 08:54 PM
string.byte( str )
string.char( num )
Sewbacca #4
Posted 08 January 2016 - 08:59 PM
Thanks!!!