-
-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pbtn clarification #2
Comments
pbtn returns true if button wasn't pressed last tick |
Could be possible to add a sign to the method to make it works as a single shot trigger? Something like pbtn(0,1)? |
Not sure if we need make api more complicated in this case, so you can use code like that local last=0
function btnp(index)
return btn(index) and (last&(1<<index)==0)
end
function TIC()
if btnp(4) then
trace("pressed A")
end
last=btn()
end PS. |
Thanks for the nice snippet. I wrote a similar workaround in Tic Tac Toe demo, but have this in the API would make the code looks cleaner. |
Ok, can do something like that |
That will fit really well in the API and will cover most of common needs. |
fixed in 0.0.14 |
Enable mouse input via gamepad + various mouse improvements
Not sure if pbtn is working as it should. If I keep pressed a key pbtn return true every odd frame.
I was expecting to only receive true again after releasing and pressing again the button.
Try in Win10 64Bit with 0.0.13 and 0.0.12
The text was updated successfully, but these errors were encountered: