Provides an interface to the keyboard exposed by the libretro frontend.
Keyboard availability depends on the frontend and platform. Lutro polls libretro keyboard state once per frame and uses libretro key codes as scancodes.
Returns whether at least one of the requested keys is pressed.
pressed = love.keyboard.isDown("space")
pressed = love.keyboard.isDown("space", "a")
Key names follow Lutro's libretro key map. Common values include letters, digits, arrows, function keys and modifiers:
"a".."z", "0".."9"
"space", "return", "escape", "tab", "backspace"
"up", "down", "left", "right"
"f1".."f15"
"lshift", "rshift", "lctrl", "rctrl", "lalt", "ralt"
Returns the libretro key code for a key name.
scancode = love.keyboard.getScancodeFromKey("f")
In Lutro, scancodes are numeric libretro keyboard constants. They are useful when handling keyboard callbacks or when interoperating with libretro-specific code.
Returns the key name for a libretro key code.
key = love.keyboard.getKeyFromScancode(scancode)
This callback is called when a key is pressed.
function love.keypressed(key, scancode, isrepeat)
print("pressed", key, scancode)
end
false for now.This callback is called when a key is released.
function love.keyreleased(key, scancode, isrepeat)
print("released", key, scancode)
end