keys.getName

From ComputerCraft Wiki
Revision as of 01:59, 12 July 2013 by Watcher7 (Talk | contribs) (Changed nonexistent type int to type number.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Grid Redstone.png  Function keys.getName
Translates a numerical key code to a human-readable name. The human-readable name is one of the constants in the keys API.
Syntax keys.getName(number code)
Returns string the name of the key, or nil if not a valid key code
Part of ComputerCraft
API keys

Examples

Grid paper.png  Example
Look up the name of key code 42.
Code
print(keys.getName(42))
Output leftShift