## onFocusChange

### Syntax:

    onFocusChange (handlerFunction);

    onFocusChange ();

### Purpose:

Tells the computer which function to call when the mouse cursor moves from one area of the screen to another (screen regions, characters and nothing). The value of handlerFunction must be a pointer to a function which takes one parameters. The function will be called every time the area at which the mouse is pointing changes until another call to onFocusChange. The object type at which the mouse is pointing - or NULL if the mouse is pointing at nothing - will be passed into the handlerFunction when it is called. This parameter will be the same as the return value from the getOverObject function.

If no parameter is given, the program stops calling the current focus change function. No function will be called when the mouse moves from one area of the screen to another until another call to onFocusChange tells it otherwise.

Note that only one handler for focus changes can be used at any one time. A subsequent call to onFocusChange will replace the current handler function.

### Return value:

No return value.

### See also:

Passing Functions as Variables

onKeyboard

onLeftMouse

onLeftMouseUp

onMoveMouse

onRightMouse

onRightMouseUp

SLUDGE and this SLUDGE documentation are copyright Hungry Software and contributors 2000-2012