Detect if spacebar is pushed?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
cybercircuit
Prole
Posts: 16
Joined: Mon May 20, 2013 7:39 pm

Detect if spacebar is pushed?

Post by cybercircuit »

in love.keypressed(key), how can I know if the key is spacebar? I have tried "space" and "spacebar" but neither seem to work, help?
User avatar
Larsii30
Party member
Posts: 267
Joined: Sun Sep 11, 2011 9:36 am
Location: Germany

Re: Detect if spacebar is pushed?

Post by Larsii30 »

there's one obvious way you don't tried yet.

Code: Select all

key == " "
Please try to read the tutorials in the wiki and learn some lua, because some day - if you ask such basic things over and over again - nobody will anwser because he know you don't really tried to learn and understand the matter.
Nobody really like to do the job for you.
https://www.love2d.org/wiki/KeyConstant
cybercircuit
Prole
Posts: 16
Joined: Mon May 20, 2013 7:39 pm

Re: Detect if spacebar is pushed?

Post by cybercircuit »

I looked on the wiki and I couldent find anything...
User avatar
Larsii30
Party member
Posts: 267
Joined: Sun Sep 11, 2011 9:36 am
Location: Germany

Re: Detect if spacebar is pushed?

Post by Larsii30 »

OT :
I really won't to be the bad guy but ...
viewtopic.php?f=4&t=33904
viewtopic.php?f=4&t=33903
viewtopic.php?f=4&t=33901
viewtopic.php?f=4&t=33898

Four topics since yesterday was pretty much over the average.
Don't get me wrong. Your're free to ask here,
that's a forum - that's what it is made for - but I think at least two of the topics
were unnecessary if you search a little more in the wiki or via google.
I don't want to be mean :p
User avatar
Eamonn
Party member
Posts: 550
Joined: Sat May 04, 2013 1:29 pm
Location: Ireland

Re: Detect if spacebar is pushed?

Post by Eamonn »

I agree with Larsii30. Do some research before asking questions. If you cant find the answer, ask. There might be a thread hidden deep within the internet, but just have a quick look through the first few pages of Google/Yahoo/Bing/Dogpile and see what you find. If no luck, check the wiki. If no luck there, come here or Yahoo! Answers or Wiki Answers or StackExchange. StackExchange are a bunch of idiots though. They know what they are talking about, but no matter what question you ask you'll get banned. Even for asking no question. I made 3 accounts and all 3 got banned. 2 of which I didn't even ask any questions on and it was only open like 2 hours. Hope this helps!
"In those quiet moments, you come into my mind" - Liam Reilly
Post Reply

Who is online

Users browsing this forum: sbr2729 and 54 guests