Difference between revisions of "Keys.getName"
From ComputerCraft Wiki
(New page) |
m (Changed nonexistent type int to type number.) |
||
| (One intermediate revision by one other user not shown) | |||
| Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=keys.getName | |name=keys.getName | ||
| − | |args= | + | |args={{Type|number}} code |
|api=keys | |api=keys | ||
| − | |returns= | + | |returns={{type|string}} the name of the key, or [[nil]] if not a valid key code |
|addon=ComputerCraft | |addon=ComputerCraft | ||
| − | |desc= | + | |desc=Translates a numerical key code to a human-readable name. The human-readable name is one of the constants in the [[Keys (API)|keys API]]. |
|examples= | |examples= | ||
{{Example | {{Example | ||
Latest revision as of 01:59, 12 July 2013
| 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
| Look up the name of key code 42. | |
| Code |
print(keys.getName(42)) |
| Output | leftShift |