How do you make buttons on the keyboard do things in game?

Started by Freydall, Fri 11/03/2005 23:00:24

Previous topic - Next topic

Freydall

How do you make buttons on the keyboard do things in game?
AEscplega is the best epic ever. Chapter I is finally finished and Chapter II is on it's way.

Barbarian

Quote from: Freydall on Fri 11/03/2005 23:00:24
How do you make buttons on the keyboard do things in game?

From the top menu bar on the AGS editor, click on "Script", then from the drop-down menu select "on_key_press". You will be taken to the part of the global script that handles key presses and should see a list of functions already programmed in as default. You can edit as you like, or add in for more keys if you like (each Key pressed would have a different number though of course according to the ASCII code).

Below is a typical list of ASCII code relating to common setup of most keyboards:

ASCII codes
1..26Ã,  Ã,  Ã, Ctrl+A .. Ctrl+Z
8Ã,  Ã,  Ã,  Ã,  Ã, Backspace
9Ã,  Ã,  Ã,  Ã,  Ã, Tab
13Ã,  Ã,  Ã,  Ã,  Enter
27Ã,  Ã,  Ã,  Ã,  Escape
32Ã,  Ã,  Ã,  Ã,  Space
48..57Ã,  Ã,  '0' key .. '9' key
65..90Ã,  Ã,  'A' .. 'Z'Ã,  (upcased)
359..368Ã,  F1 .. F10
371Ã,  Ã,  Ã,  Ã, Home (numeric pad)
372Ã,  Ã,  Ã,  Ã, Up arrow
373Ã,  Ã,  Ã,  Ã, PgUp (numeric pad)
375Ã,  Ã,  Ã,  Ã, Left arrow
376Ã,  Ã,  Ã,  Ã, '5' (numeric pad)
377Ã,  Ã,  Ã,  Ã, Right arrow
379Ã,  Ã,  Ã,  Ã, End (numeric pad)
380Ã,  Ã,  Ã,  Ã, Down arrow
381Ã,  Ã,  Ã,  Ã, PgDn (numeric pad)
433..434Ã,  F11 .. F12
IsKeyPressed only:
403Ã,  Ã,  Ã,  Ã, Left shift
404Ã,  Ã,  Ã,  Ã, Right shift
405Ã,  Ã,  Ã,  Ã, Left ctrl
406Ã,  Ã,  Ã,  Ã, Right ctrl
407Ã,  Ã,  Ã,  Ã, Alt
Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

SMF spam blocked by CleanTalk