Jump to content


Photo

Check If Any Key Is Pressed


  • Please log in to reply
6 replies to this topic

#1 kake_fisk

kake_fisk

    GMC Member

  • GMC Member
  • 2392 posts
  • Version:GM7

Posted 11 March 2009 - 05:39 PM

Is it possible to check if any key is pressed, like the <any key> event just in gml?

Edit: Sorry i posted in wrong forum, could this please be moved to novice questions and answers?

Edited by kake_fisk, 11 March 2009 - 05:44 PM.

  • 0

#2 Darthvender

Darthvender

    Fat Red Guy

  • New Member
  • 186 posts
  • Version:GM5

Posted 11 March 2009 - 05:45 PM

keyboard_check_pressed(vk_anykey)
Your welcome...
  • 0

#3 kake_fisk

kake_fisk

    GMC Member

  • GMC Member
  • 2392 posts
  • Version:GM7

Posted 11 March 2009 - 05:52 PM

Thanks! I didn't think about that because anykey isn't really a key. :)
  • 0

#4 lucb1e

lucb1e

    GMC Member

  • GMC Member
  • 13 posts
  • Version:GM8

Posted 11 March 2009 - 07:16 PM

Thanks! I didn't think about that because anykey isn't really a key.

Posted Image
:)
  • 0

#5 that_dude_over_there>

that_dude_over_there>

    Codezilla

  • New Member
  • 1338 posts

Posted 11 March 2009 - 07:39 PM

Thanks! I didn't think about that because anykey isn't really a key.

Posted Image
:)

XD
One heck of a first post :D
  • 0

#6 darky

darky

    GMC Member

  • New Member
  • 284 posts

Posted 11 March 2009 - 07:48 PM

haha, makes me think of homer simpsons when he's at some machine and he's supposed to press the "anykey" and he's like "huh? where's the anykey".
  • 0

#7 Katuko

Katuko

    GMC Member

  • GMC Member
  • 5687 posts

Posted 11 March 2009 - 08:25 PM

Sadly, many people have asked that in real life.

Maybe I should mention that keyboard_check_pressed() only checks to see if the key has been pressed since the last step (gone from 0 to 1). To check if it's being held, use only keyboard_check() instead.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users