boipushy icon indicating copy to clipboard operation
boipushy copied to clipboard

Documentation: when to call `input:update()`

Open shousper opened this issue 6 years ago • 2 comments

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

shousper avatar Mar 13 '18 10:03 shousper

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

flamendless avatar Mar 13 '18 12:03 flamendless

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.

shousper avatar Mar 13 '18 23:03 shousper