Lynput - An easy and intuitive way to handle your inputs

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
lydzje
Prole
Posts: 5
Joined: Sun Jul 22, 2018 2:36 am
Contact:

Lynput - An easy and intuitive way to handle your inputs

Post by lydzje » Sun Feb 03, 2019 3:06 pm

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 [email protected] or by visiting the contact section in my website lydzje.com.

More details and download.
NIL

monolifed
Party member
Posts: 120
Joined: Sat Feb 06, 2016 9:42 pm

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

Post by monolifed » Sun Feb 03, 2019 6:20 pm

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

User avatar
lydzje
Prole
Posts: 5
Joined: Sun Jul 22, 2018 2:36 am
Contact:

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

Post by lydzje » Sun Feb 03, 2019 7:22 pm

You don't want to loop playerControl. A lynput object contains more stuff aside from actions that have been bind.
NIL

narf0708
Prole
Posts: 1
Joined: Fri Feb 15, 2019 6:46 pm

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

Post by narf0708 » Fri Feb 15, 2019 8:01 pm

Awesome, this is exactly what I was looking for.

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests