Difference between revisions of "Char (event)"
From ComputerCraft Wiki
(Added example.) |
m (NeedsWork resolved.) |
||
Line 1: | Line 1: | ||
− | |||
− | |||
{{Event | {{Event | ||
|name=char | |name=char |
Revision as of 14:36, 2 February 2013
Event char | |
Fired when a alphanumeric key is pressed on the keyboard. | |
Returned Object 1 | The String representing the character that was pressed. |
Example | |
Prints out the character that was pressed. | |
Code |
while true do event, character = os.pullEvent("char") print(character.." was pressed.") end |
Output | The key that was pressed. Note this doesn't trigger for Tab, Shift, the up arrow, etc. Use the key event if you wish to trap those keys. |