IMSK

From Creatures Wikia

Jump to: navigation, search

IMSK is a CAOS command to catch input events.

Usage

Syntax: IMSK mask (int)

This sets the input event mask of TARG. The mask is made by adding together the bits of the events you are interested in, from the following list:

BitEventScript numberScript details
1Key down73_P1_ contains keycode.
2Key up74_P1_ contains keycode.
4Mouse move75_P1_ and _P2_ contain new x and y positions, respectively.
8Mouse down76_P1_ contains mouse button: 1 left, 2 right, 4 middle.
16Mouse up77_P1_ contains mouse button, as above.
32Mouse wheel78_P1_ contains scroll amount: 120 per wheel-click.
64Translated character79On some systems (where ideographic languages are used, for instance) keypresses do not correspond to characters. In this case the translated character is sent in _P1_ to this script.

If, once IMSK is set, any events the agent is interested in actually occur, the agent's script 73 to 79 is called (with parameters), depending on the exact event.

Syntax: IMSK

Returns, as an integer, the current input event mask of TARG.

Examples

All of the keyboard-triggered events in Creatures 3 and Docking Station, including the CAOS command line and wolfling control, use IMSK to detect keypresses.

It is usually easier not to use IMSK for text input. See PAT: TEXT.

See also

Personal tools