KeyPress
From OxeyeWiki
|
keyPress(key) | ||
|
This hook is called when-ever the user presses a key. You can also get current key states using daisy.isKeyPressed(). | ||
| Parameter | Type | Description |
| key | An integer | The key that was pressed. See KeyCodes for a list of keys. |
| Daisymoon Video Lib |
|---|
Example
local function onKeyPress(key)
if key == 37 then
-- LEFT
elseif key == 38 then
-- UP
elseif key == 39 then
-- RIGHT
elseif key == 40 then
-- DOWN
end
end
hook.add("keyPress", onKeyPress)