Keyboard Controls

Started by , Sun 12/10/2003 23:01:08

Previous topic - Next topic

Nick

I'm sorry for asking all of these questions.. it's the last one, I promise. I was wondering if there was a way you could use some controls on the keyboard. I see all the keycodes in the global script but I don't know how to get them.

Wolfgang Abenteuer

Just do it like a normal "if" statement, like:

if (keycode == 32) {
Display("You just pressed the Spacebar.");
}

Then go into your game and press the spacebar and that message will show up.  To find the keycode that corresponds to the different keys, go to the AGS help file and search for "on_key_press".

~Wolfgang


SMF spam blocked by CleanTalk