lynput icon indicating copy to clipboard operation
lynput copied to clipboard

Lynput is an input library for LÖVE that makes input handling very easy and intuitive :blue_heart:

Lynput

LÖVE VERSION MIT LICENSE

lynput logo

Index

  • What is Lynput?
  • Installation
  • Usage
  • Devices supported
  • Features
  • What does Lynput mean?
  • I've found a bug, what do I do?
  • Contact
  • License

What is Lynput?

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

Installation

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.

Usage

See MANUAL for more information.

Devices supported

  • [x] Keyboard
  • [x] Mouse buttons
  • [x] Gamepad buttons
  • [x] Gamepad analog input
  • [ ] Touch screen
  • [ ] ...

Features

  • [x] Multiple independent input objects
  • [x] Easy and intuitive input binding and unbindig
  • [ ] Saving and loading input configuration files
  • [ ] Things like this: lynput:bind("superPunch", "press G_RB+G_X")
  • [ ] ...

What does Lynput mean?

if not creativity then
    name = Lydzje + input
    print(name)
end -- if not creativity

Output:

Lynput

I've found a bug, what do I do?

If you want to report a bug (please do!), open a new issue. As another option just contact me.

Contact

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.

License

This software is licensed under the MIT license. Check the details by clicking here.