Module
Public Member Functions | Protected Member Functions | List of all members
Module::InputCallback Class Reference

#include <InputCallback.hpp>

Public Member Functions

virtual void onMouseDown (uint8_t button, uint16_t x, uint16_t y)
 
virtual void onMouseUp (uint8_t button, uint16_t x, uint16_t y)
 
virtual void onMouseMove (uint16_t x, uint16_t y, int16_t dx, int16_t dy)
 
virtual void onKeyDown (KeyCode::Code code, char keyChar)
 
virtual void onKeyUp (KeyCode::Code code, char keyChar)
 

Protected Member Functions

 InputCallback ()
 

Detailed Description

An abstract class to hook into events triggered by user input, such as mouse and key presses. Extend this class if you need to process these events.

Constructor & Destructor Documentation

Module::InputCallback::InputCallback ( )
inlineprotected

Member Function Documentation

virtual void Module::InputCallback::onKeyDown ( KeyCode::Code  code,
char  keyChar 
)
inlinevirtual

Called when a key is pressed.

Parameters
keyThe key that was pressed.
virtual void Module::InputCallback::onKeyUp ( KeyCode::Code  code,
char  keyChar 
)
inlinevirtual

Called when a key is released.

Parameters
keyThe key that was released.
virtual void Module::InputCallback::onMouseDown ( uint8_t  button,
uint16_t  x,
uint16_t  y 
)
inlinevirtual

Called when a mouse button is pressed down.

Parameters
buttonThe mouse button that was pressed. 0 is left button, 1 is right, 2 is middle.
xThe x position of the mouse on screen.
yThe y position of the mouse on screen.
virtual void Module::InputCallback::onMouseMove ( uint16_t  x,
uint16_t  y,
int16_t  dx,
int16_t  dy 
)
inlinevirtual

Called when the mouse position changes.

Parameters
xThe final x position of the mouse on screen.
yThe final y position of the mouse on screen.
dxThe change in the x position of the mouse.
dyThe change in the y position of the mouse.
virtual void Module::InputCallback::onMouseUp ( uint8_t  button,
uint16_t  x,
uint16_t  y 
)
inlinevirtual

Called when a mouse button is released.

Parameters
buttonThe mouse button that was released. 0 is left button, 1 is right, 2 is middle.
xThe x position of the mouse on screen.
yThe y position of the mouse on screen.