Set.key

From AGI Wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The set.key command assigns a keyboard shortcut to a controller.

Syntax

set.key(byt ASCII, byt SCAN, ctl cCTRL);

Remarks

The key combination derived from ASCII and SCAN codes are assigned to controller cCTRL. To assign an ASCII key press to a controller, the SCAN value should be zero. To assign a SCAN code key press, the ASCII value should be zero.

For a list of usable ASCII and SCAN code values that can be assigned, see the Setting Up Keyboard Shortcuts topic.

Possible Errors

If an invalid combination of ASCII and SCAN is used, AGI will assign the controller, but it will just take up space in the controller assignment table and not do anything.

Similarly, if you use an invalid controller value, you will waste a space in the controller assignment table.

Example

Code:
set.key(0, 59, c1);  [ F1 to controller 1 
set.key(9, 0, c2);   [ Tab key to controller 2

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 121 (0x79 hex)

See Also

Player Input Commands