R-Type
R-Type project
KapEngine::Events::Input Class Reference

Input actions. More...

#include <Input.hpp>

Classes

struct  Axis
 

Public Types

enum  AxisDetectMode { UNKNOWN, GET, DOWN, UP }
 axis mode detection More...
 

Public Member Functions

 Input (EventManager &manager)
 
void __update ()
 update inputs More...
 
bool getKey (Key::EKey key)
 input action More...
 
bool getKeyDown (Key::EKey key)
 key pressed More...
 
bool getKeyUp (Key::EKey key)
 key released More...
 
bool getKey (Key key)
 input action More...
 
bool getKeyDown (Key key)
 key pressed More...
 
bool getKeyUp (Key key)
 key released More...
 
float getAxis (std::string name)
 get axis value More...
 
void addAxis (std::string name)
 add new axis More...
 
void addAxis (Axis const &axis)
 add new axis More...
 
AxisgetAxisSettings (std::string const &name)
 Get the Axis. More...
 

Detailed Description

Input actions.

Input is made to know action of input while game is running

Member Enumeration Documentation

◆ AxisDetectMode

axis mode detection

Member Function Documentation

◆ __update()

void KapEngine::Events::Input::__update ( )

update inputs

Warning
Do not call this function

◆ addAxis() [1/2]

void KapEngine::Events::Input::addAxis ( Axis const &  axis)
inline

add new axis

add axis you defined

Parameters
axisaxis

◆ addAxis() [2/2]

void KapEngine::Events::Input::addAxis ( std::string  name)
inline

add new axis

add empty axis

Parameters
nameaxis name

◆ getAxis()

float KapEngine::Events::Input::getAxis ( std::string  name)

get axis value

get axis value. If axis not found then value is 0

Parameters
nameaxis name
Returns
float (betwenn 1 and -1)

◆ getAxisSettings()

Axis& KapEngine::Events::Input::getAxisSettings ( std::string const &  name)
inline

Get the Axis.

Parameters
nameaxis name
Returns
KapEngine::Events::Input::Axis Axis&

◆ getKey() [1/2]

bool KapEngine::Events::Input::getKey ( Key  key)

input action

Knows if an action occured on a specifics input

Parameters
keyKapEngine::Events::Key
Return values
trueif an action occured
falseif no action occured

◆ getKey() [2/2]

bool KapEngine::Events::Input::getKey ( Key::EKey  key)

input action

Knows if an action occured on a specifics input

Parameters
keyKapEngine::Events::Key::Ekey (enum) key
Return values
trueif an action occured
falseif no action occured

◆ getKeyDown() [1/2]

bool KapEngine::Events::Input::getKeyDown ( Key  key)

key pressed

knows if key is just pressed

Parameters
keyKapEngine::Events::Key key
Return values
trueif action occured
falseif no action occured

◆ getKeyDown() [2/2]

bool KapEngine::Events::Input::getKeyDown ( Key::EKey  key)

key pressed

knows if key is just pressed

Parameters
keyKapEngine::Events::Key::Ekey (enum) key
Return values
trueif action occured
falseif no action occured

◆ getKeyUp() [1/2]

bool KapEngine::Events::Input::getKeyUp ( Key  key)

key released

knows if key is just released

Parameters
keyKapEngine::Events::Key
Return values
trueif an action occured
falseif no action occured

◆ getKeyUp() [2/2]

bool KapEngine::Events::Input::getKeyUp ( Key::EKey  key)

key released

knows if key is just released

Parameters
keyKapEngine::Events::Key::Ekey (enum) key
Return values
trueif an action occured
falseif no action occured

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