| GL Studio C++ Runtime API

Public Types | Public Member Functions | List of all members
InputHandler Class Referenceabstract

`#include <input_handler.h>`

## Public Types
typedef unsigned int | ID
| Type for unique identifiers.

## Public Member Functions
virtual DisplayObject * | HandleInput (DisplayEvent *ev)=0
virtual ID | RegisterGlobalKeyboardHandler (KeyboardCallbackBase *callback)=0
virtual ID | RegisterGlobalMouseHandler (MouseCallbackBase *callback)=0
virtual void | UnregisterGlobalKeyboardHandler (ID id)=0
virtual void | UnregisterGlobalMouseHandler (ID id)=0
virtual | ~InputHandler ()

## Detailed Description

Base class implemented by all input handlers

## Constructor & Destructor Documentation

## ◆ ~InputHandler()

virtual ~InputHandler | ( |  | ) |
| inline virtual

destructor

## Member Function Documentation

## ◆ HandleInput()

virtual DisplayObject * HandleInput | ( | DisplayEvent * | ev | ) |
| pure virtual

Handle the event

Parameters

  ev | the event to handle

Returns
  the object that handled the event, or NULL if no object handled the event

## ◆ RegisterGlobalKeyboardHandler()

virtual ID RegisterGlobalKeyboardHandler | ( | KeyboardCallbackBase * | callback | ) |
| pure virtual

Register a global keyboard handler.

Parameters

  callback | the callback to call when a keyboard event occurs. The input handler owns the callback and will delete it.

Returns
  unique ID. Used to unregister.

## ◆ RegisterGlobalMouseHandler()

virtual ID RegisterGlobalMouseHandler | ( | MouseCallbackBase * | callback | ) |
| pure virtual

Register a global mouse handler.

Parameters

  callback | the callback to call when a mouse event occurs. The input handler owns the callback and will delete it.

Returns
  unique ID. Used to unregister.

## ◆ UnregisterGlobalKeyboardHandler()

virtual void UnregisterGlobalKeyboardHandler | ( | ID | id | ) |
| pure virtual

Unregister a global keyboard handler.

Parameters

  id | the unique identifier returned from RegisterGlobalKeyboardHandler.

## ◆ UnregisterGlobalMouseHandler()

virtual void UnregisterGlobalMouseHandler | ( | ID | id | ) |
| pure virtual

Unregister a global mouse handler.

Parameters

  id | the unique identifier returned from RegisterGlobalMouseHandler.

The documentation for this class was generated from the following file:

- input_handler.h