Welcome to the Creatures Wiki! Log in and join the community.
IMSK
Jump to navigation
Jump to search
IMSK is a CAOS command to catch input events.
Usage[edit]
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:
Bit | Event | Script number | Script details |
1 | Key down | 73 | _P1_ contains keycode. |
2 | Key up | 74 | _P1_ contains keycode. |
4 | Mouse move | 75 | _P1_ and _P2_ contain new x and y positions, respectively. |
8 | Mouse down | 76 | _P1_ contains mouse button: 1 left, 2 right, 4 middle. |
16 | Mouse up | 77 | _P1_ contains mouse button, as above. |
32 | Mouse wheel | 78 | _P1_ contains scroll amount: 120 per wheel-click. |
64 | Translated character | 79 | On 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[edit]
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.