keyHeld

v0.1.7
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

function setup()
   createWindow(200, 200);

   background('purple');
   text('Hold any key', 10, 40);
end

-- no draw
function draw() return end 

function keyHeld(key, keyCode)
   print(key, keyCode);

   background('purple');

   if key ~= nil then 
       text('Held key: ' .. key, 10, 40);
   end
end

Output

See keyHeld in keyboard.h