Lynput is an input library for LÖVE that makes input handling very easy and intuitive 💙. It will make you able to do things like this:
function love.load()
Lynput = require("Lynput") -- Load Lynput
Lynput.load_key_callbacks() -- Load keyboard callbacks
control = Lynput() -- Create a Lynput object
control:bind(
"moveLeft",
{
"hold left",
"hold a",
}
)
control:bind(
"moveRight",
{
"hold right",
"hold d",
}
)
control:bind("action", "press f")
control:bind("obey", "release any")
end
function love.update(dt)
if control.moveLeft then x = x - speed * dt end
if control.moveRight then x = x + speed * dt end
if control.action then triggerAction() end
if control.obey then obey() end
Lynput.update_(dt) -- Update Lynput
end
Just download the latest release version of Lynput.lua
and extract the contents from the zip file. Place the Lynput.lua
file anywhere you want inside your game folder, just be careful with the path when requiring the library. Also remember that this file name starts with a capital letter.
See MANUAL
for more information.
lynput:bind("superPunch", "press G_RB+G_X")
if not creativity then
name = Lydzje + input
print(name)
end -- if not creativity
Output:
Lynput
If you want to report a bug (please do!), open a new issue. As another option just contact me.
If you need to contact me don't hesitate to send me an email. If you preffer other way, please visit the contact section in my website lydzje.com.
This software is licensed under the MIT license. Check the details by clicking here.