Page 1 of 1

Lynput - An easy and intuitive way to handle your inputs

Posted: Sun Feb 03, 2019 3:06 pm
by lydzje
Image

Hello everyone, I've been working on a library to handle input from some time ago for my personal use. Now I feel it's good enough to be published so here I am. This library is Lynput, and it lets you code your controls in a natural/intuitive way. For example:

Code: Select all

playerControl = Lynput()
playerControl:bind("jump", "press space")
playerControl:bind("shoot", "hold LMB")
playerControl:bind(
  "moveLeft",
  {
    "hold left",
    "hold a"
  }
)
playerControl:bind(
  "moveRight",
  {
    "hold right",
    "hold d"
  }
)
...

if playerControl.jump then jump() end
if playerControl.shoot then shoot() end
if playerControl.moveRight then moveRight() end
if playerControl.moveLeft then moveLeft() end
Devices supported:
- Keyboard
- Mouse buttons
- Gamepad buttons
- Gamepad analog input


Please let me know what do you think in the comments below or contacting me through email to.lydzje@gmail.com or by visiting the contact section in my website lydzje.com.

More details and download.

Re: Lynput - An easy and intuitive way to handle your inputs

Posted: Sun Feb 03, 2019 6:20 pm
by monolifed
can't we do something like this

Code: Select all

for k,v in pairs(playerControl.keys) do
    if v then binds[k]() end
end

Re: Lynput - An easy and intuitive way to handle your inputs

Posted: Sun Feb 03, 2019 7:22 pm
by lydzje
You don't want to loop playerControl. A lynput object contains more stuff aside from actions that have been bind.

Re: Lynput - An easy and intuitive way to handle your inputs

Posted: Fri Feb 15, 2019 8:01 pm
by narf0708
Awesome, this is exactly what I was looking for.