Guys, simple and dirty:
I'm using the joystick.isDown to move an object, but the detection happens extremely fast - I need a condition for when a certain key is released after being pressed.
Thanks.
[RESOLVED] Detecting when key is not being pressed anymore
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
[RESOLVED] Detecting when key is not being pressed anymore
Last edited by Nife on Thu Jun 06, 2013 2:47 pm, edited 1 time in total.
Re: onRelease? Detecting when key is not being pressed anymo
See the love.joystickpressed and love.joystickreleased callbacks.
Shallow indentations.
Re: onRelease? Detecting when key is not being pressed anymo
Worked like a charm, thank you very much!Boolsheet wrote:See the love.joystickpressed and love.joystickreleased callbacks.
Last edited by Nife on Sun Jun 09, 2013 9:17 am, edited 1 time in total.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: onRelease? Detecting when key is not being pressed anymo
Um, I don't think that code does what you think it does.Nife wrote:Reminder to whoever happens to bump here looking for the solution:
Here, the global variable controllerName is shadowed by the first argument to love.joystickpressed, so you can't access it inside that callback.
Help us help you: attach a .love.
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: onRelease? Detecting when key is not being pressed anymo
Not to mention the first argument of love.joystickpressed is the joystick index, not its name.Robin wrote:Um, I don't think that code does what you think it does.Nife wrote:Reminder to whoever happens to bump here looking for the solution:
Here, the global variable controllerName is shadowed by the first argument to love.joystickpressed, so you can't access it inside that callback.
Re: onRelease? Detecting when key is not being pressed anymo
You are right, my apologies for that - removed that bit of stupidity from the post.Robin wrote:Um, I don't think that code does what you think it does.
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests