GL Studio C++ Runtime API
InputHandler Class Referenceabstract

#include <input_handler.h>

Public Types

typedef unsigned int ID
 Type for unique identifiers.
 

Public Member Functions

virtual DisplayObjectHandleInput (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 ( )
inlinevirtual

destructor

Member Function Documentation

◆ HandleInput()

virtual DisplayObject * HandleInput ( DisplayEvent ev)
pure virtual

Handle the event

Parameters
evthe 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
callbackthe 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
callbackthe 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
idthe unique identifier returned from RegisterGlobalKeyboardHandler.

◆ UnregisterGlobalMouseHandler()

virtual void UnregisterGlobalMouseHandler ( ID  id)
pure virtual

Unregister a global mouse handler.

Parameters
idthe unique identifier returned from RegisterGlobalMouseHandler.

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