Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Documentation: when to call input:update() #21

Open
shousper opened this issue Mar 13, 2018 · 2 comments
Open

Documentation: when to call input:update() #21

shousper opened this issue Mar 13, 2018 · 2 comments

Comments

@shousper
Copy link

I just spent a bit of time figuring out that the reason :down(..) would work but :pressed(..), etc. wouldn't was because I was calling input:update() before checking the state of the inputs.

It might be worth highlighting this in the README.md with an example :)

For example:

function love.update(dt)
    if input:pressed('down') then print('down was pressed!') end
    -- your other input checks here..
    input:update()
end
@flamendless
Copy link

You can submit a Pull Request with the changes in the documentation so that the author could just merge it :)

@shousper
Copy link
Author

Thanks @flamendless. I'd be happy to but wanted to confirm this is intended behavior first :) For instance, I found that baton doesn't work this way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants