Terminus
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
terminus::EventHandler Class Reference

The EventHandler class receives events (touch, key, mouse, gyroscope, etc.) and triggers actions, taking object states and context into account. More...

#include <eventhandler.h>

Public Member Functions

 EventHandler (Game *game=nullptr)
 
void buttonInput (int type)
 Handles a click on a QML UI button. More...
 
void keyInput (Qt::Key key)
 Handles a key event. More...
 
void moveInput (int type, qreal x, qreal y)
 Handles mouse and gyroscope movements. More...
 
void touchInput (qreal oldx, qreal oldy, qreal x, qreal y)
 Handles touch input. More...
 

Protected Member Functions

void keyPressEvent (Qt::Key key)
 
void mouseMoveEvent (qreal x, qreal y)
 
void gyroMoveEvent (qreal x, qreal y)
 
void switchToNextWagon ()
 
void switchToPreviousWagon ()
 
void touchChargeFire ()
 
void touchFire ()
 

Protected Attributes

Gamem_game
 

Detailed Description

The EventHandler class receives events (touch, key, mouse, gyroscope, etc.) and triggers actions, taking object states and context into account.

Constructor & Destructor Documentation

terminus::EventHandler::EventHandler ( Game game = nullptr)

Member Function Documentation

void terminus::EventHandler::buttonInput ( int  type)

Handles a click on a QML UI button.

void terminus::EventHandler::gyroMoveEvent ( qreal  x,
qreal  y 
)
protected
void terminus::EventHandler::keyInput ( Qt::Key  key)

Handles a key event.

void terminus::EventHandler::keyPressEvent ( Qt::Key  key)
protected
void terminus::EventHandler::mouseMoveEvent ( qreal  x,
qreal  y 
)
protected
void terminus::EventHandler::moveInput ( int  type,
qreal  x,
qreal  y 
)

Handles mouse and gyroscope movements.

void terminus::EventHandler::switchToNextWagon ( )
protected
void terminus::EventHandler::switchToPreviousWagon ( )
protected
void terminus::EventHandler::touchChargeFire ( )
protected
void terminus::EventHandler::touchFire ( )
protected
void terminus::EventHandler::touchInput ( qreal  oldx,
qreal  oldy,
qreal  x,
qreal  y 
)

Handles touch input.

Member Data Documentation

Game* terminus::EventHandler::m_game
protected

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