keyboard

v0.0.6
keyIsDown(k);

Check if a keyboard key is pressed, returns true if key is down and returns false if it's not

Arguments

kThe keyboard key to check as a key global, or a string

Returns

booleanWhether or not the key is down

 -- Use a string 
 if (keyIsDown('a')) then
   -- key 'a' is down
 end

 -- use a global
 if (keyIsDown(LEFT_ARROW)) then
   -- left arrow is down
 end

keyPressed(key, keyCode);Event

Called whenever a key is pressed.

Arguments

keyThe pressed key as a string, is nil if glfw cannot find a name for the key
keyCodeThe pressed key as a key code

 function setup()
    createWindow(600, 600);
 end
 
 function draw()
    background(51);
 end
 
 function keyPressed(key, keyCode)
    print(key, keyCode)
 end

keyReleased(key, keyCode);Event

Called whenever a key is released.

Arguments

keyThe released key as a string, is nil if glfw cannot find a name for the key
keyCodeThe released key as a key code


keyHeld(key, keyCode);Event

Called whenever a key is held down.

Arguments

keyThe held key as a string, is nil if glfw cannot find a name for the key
keyCodeThe held key as a key code


UP_ARROWGlobal

No description


DOWN_ARROWGlobal

No description


LEFT_ARROWGlobal

No description


RIGHT_ARROWGlobal

No description


KEY_ENTERGlobal

No description


KEY_BACKSPACEGlobal

No description


KEY_AGlobal

No description


KEY_BGlobal

No description


KEY_CGlobal

No description


KEY_DGlobal

No description


KEY_EGlobal

No description


KEY_FGlobal

No description


KEY_GGlobal

No description


KEY_HGlobal

No description


KEY_IGlobal

No description


KEY_JGlobal

No description


KEY_KGlobal

No description


KEY_LGlobal

No description


KEY_MGlobal

No description


KEY_NGlobal

No description


KEY_OGlobal

No description


KEY_PGlobal

No description


KEY_QGlobal

No description


KEY_RGlobal

No description


KEY_SGlobal

No description


KEY_TGlobal

No description


KEY_UGlobal

No description


KEY_VGlobal

No description


KEY_WGlobal

No description


KEY_XGlobal

No description


KEY_YGlobal

No description


KEY_ZGlobal

No description