Difference between revisions of "Key (event)"
From ComputerCraft Wiki
(Added example code, and copied key scan codes from Raw_key_events) |
m (Codefix.) |
||
Line 10: | Line 10: | ||
|code= | |code= | ||
while true do | while true do | ||
− | event, scancode = os.pullEvent() | + | event, scancode = os.pullEvent("key") |
print(tostring(scancode).." was pressed.") | print(tostring(scancode).." was pressed.") | ||
end | end |
Revision as of 01:05, 8 January 2013
This page needs some serious TLC, stat! Please help us by cleaning it, fixing it up, or sparing it some love.
(Reason: A demonstration on the use and handling of this event would be beneficial. AfterLifeLochie 16:10, 30 November 2012 (MSK)) |
Event key | |
Fired when any key is pressed while the terminal is focused. | |
Returned Object 1 | The numerical key value of the key pressed. |