Giter VIP home page Giter VIP logo

lynput's People

Contributors

lydzje avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

srdgame undeadtwo

lynput's Issues

Implement delay modifiers

This might be a bit advanced and wouldn't work as intuitively as the other features (at least not the way I see it), but it'd be very interesting and useful if we could have control over how long an input has been pressed for.
Some examples would be of an input that only fires if you hold a key for N seconds (a powerup/boost attack, or a dash, or a heavy action). Syntax could be something like this:

control:bind(
    "longFire",
    {
      "hold z for 5"
    }
  )

This would fire if, and only if, the key had been held for at least 5 seconds, and would continue outputting until it's released.

Another example would be to only let a key be held for N seconds, then forcibly "release" it. This could be useful to control stuff like long-distance jumping, or lifting a heavy object.

control:bind(
    "heavyPickup",
    {
      "press x after 5"
    }
  )

Perhaps the two properties could be combined, though personally I don't see a use for that. One last suggestion, which I'm also not particularly fond of (but still useful for game developers), would be to allow rapid key-pressing within an interval. With this option, players would have to continuously press a key for an action to take place. You'd only need to set the "keypress interval" and it'd correct for when the player presses/releases it, resetting the timer. Could be used in quicktime events, or making a character turn a valve, or a hacking sequence.

control:bind(
    "rotateHandle",
    {
      "press x every 0.5"
    }
  )

I believe these could be combined, but doing so in an intuitive and elegant way might be a challenge. There are also other, more nuanced ways in which timing could be useful and these suggestions wouldn't attend. Regardless, this is a very neat library with or without this feature!

Better analog input

There should be a better way to obtain analog values rather than using getAxis(). Since Lua is dynamically typed I think that adding the value to the action is a good solution.

if controls.speed then car:speed(controls.speed) end

Also, not specifying an interval when binding an analog input to an action should be possible and it would mean the interval is min:max.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.