PURE

From Creatures Wikia

Jump to: navigation, search

PURE is a CAOS command used to control mouse behaviour.

Usage

Syntax: PURE X (boolean integer)

When X is 0, enables default pointer behaviour, which means the mouse can be used to activate/deactivate (CLAC and CLIK are implemented), operate ports, and pick objects up. When X is 1, disables default pointer behaviour, in which case the agent setting it should catch and handle mouse events using IMSK.

Syntax: PURE

Returns current PURE value, as above.

(The above is based on observation of CEE and contradicts the CAOS documentation produced by MANN.)

Example

PURE is used by the Creatures agent help system to disable normal mouse behaviour while in help mode. An outline of the code is as follows:

*install script
pure 0
imsk 1

*... 'F1' keypress detected:
doif pure eq 0
  *...change pointer appearance...
  pure 1
  imsk 9
else
  *...change back to normal pointer...
  pure 0
  imsk 1
endi

*... handle mouse clicks to produce agent help

The above waits for 'F1' to be pressed, and when it is disables normal mouse behaviour and hooks mouse presses so the user can get help by clicking on agents. If 'F1' is pressed again it enables normal behaviour and just listens to keypresses.

See also

  • IMSK to hook events.
Personal tools