Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sun 12/10/2003 23:01:08

Title: Keyboard Controls
Post by: on Sun 12/10/2003 23:01:08
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.
Title: Re:Keyboard Controls
Post by: Wolfgang Abenteuer on Mon 13/10/2003 07:16:42
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
Title: Re:Keyboard Controls
Post by: Timosity on Mon 13/10/2003 08:03:53
Also check out this thread in the new Technical Archive forum

http://www.agsforums.com/yabb/index.php?board=10;action=display;threadid=8303