From AGI Wiki
Jump to: navigation, search

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


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


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.


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