frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

Can I have something triggered if any key is pressed?

The keyboard trigger is very useful, however, I'm trying to have something activate if any key on the keyboard is pressed not just a specific one. Is there an easy way to do this or do I have to manually enter every key?

Comments

  • Probably have to enter every key? Some more detail would be useful - what are you trying to do that an (always) or (timer) wouldn't achieve?

    Hypothetically maybe youd want this to trigger popping up an instruction panel whenever a key is pressed that isn't part of the games controls. In that instance I wouldnt trigger on ANY keypress, just the obvious ones. Space, shift, I or M for example.
  • Yes, I could do that. I was just wondering if anyone knew something that I wasn't considering. I am attempting to make a start screen where if you press any key the game would boot up, but I could just do something like space or shift. Thank you @Kollamma!
  • Yeah to do that you can easily cover 99% of people's first key choice with maybe 10 keys:

    W
    A
    S
    D
    UP
    DOWN
    LEFT
    RIGHT
    SPACE
    ENTER
    SHIFT

    I'd setup keypresses for those 11 and have a message on the start screen saying "press any key to start". 99% of people will be covered, and theres no way that for the other 1% those 11 aren't their second key choice.
Sign In or Register to comment.

flowlab.io

| make games in your browser
@ 2017 Flowlab.io, All rights reserved.

Contact us

Get In Touch