My Project
Public Member Functions | List of all members
Keyboard Class Reference

Keyboard class that handles inputs from computer keyboards. More...

#include <Keyboard.hpp>

Public Member Functions

 Keyboard ()
 Construct a new Keyboard object. More...
 
 ~Keyboard ()
 Destroy the Keyboard object. More...
 
int getKey () const
 Get the Key value. More...
 
bool hasBeenPressed (int key) const
 Check if a key has been pressed. More...
 
bool isBeingPressed (int key) const
 Check if a key is being pressed. More...
 
bool hasBeenReleased (int key) const
 Check if a key has been released. More...
 
bool isNotBeingPressed (int key) const
 Check if a key is not being pressed. More...
 
void setExitKey (int key)
 Set the Exit Key object. More...
 
int getPressedKeycode () const
 Get the Pressed Keycode object. More...
 
int getPressedCharcode () const
 Get the Pressed Charcode object. More...
 
int getKeyUpCharCode () const
 Get the Key Up Char Code object. More...
 
int getKeyDownCharCode () const
 Get the Key Down Key Code object. More...
 
int getKeyRightCharCode () const
 Get the Key Down Char Code object. More...
 
int getKeyLeftCharCode () const
 Get the Key Left Key Code object. More...
 
int getKeySpaceCharCode () const
 Get the Key Space Char Code object. More...
 
int getKeyEnterCharCode () const
 Get the Key Enter Char Code object. More...
 
int getKeySCharCode () const
 Get the Key S Char Code object. More...
 
int getKeyDCharCode () const
 Get the Key D Char Code object. More...
 
template<typename ENUM >
std::map< ENUM, bool > getKeysPressed (std::map< ENUM, int > map) const
 Get the Keys Pressed object. More...
 
template<typename ENUM >
std::map< ENUM, bool > getKeysHasBeenPressed (std::map< ENUM, int > map) const
 Get the Keys Has Been Pressed object. More...
 

Detailed Description

Keyboard class that handles inputs from computer keyboards.

Constructor & Destructor Documentation

◆ Keyboard()

Keyboard::Keyboard ( )

Construct a new Keyboard object.

◆ ~Keyboard()

Keyboard::~Keyboard ( )

Destroy the Keyboard object.

Member Function Documentation

◆ getKey()

int Keyboard::getKey ( ) const

Get the Key value.

Returns
int key value

◆ getKeyDCharCode()

int Keyboard::getKeyDCharCode ( ) const

Get the Key D Char Code object.

Returns
int charcode

◆ getKeyDownCharCode()

int Keyboard::getKeyDownCharCode ( ) const

Get the Key Down Key Code object.

Returns
int charcode

◆ getKeyEnterCharCode()

int Keyboard::getKeyEnterCharCode ( ) const

Get the Key Enter Char Code object.

Returns
int charcode

◆ getKeyLeftCharCode()

int Keyboard::getKeyLeftCharCode ( ) const

Get the Key Left Key Code object.

Returns
int charcode

◆ getKeyRightCharCode()

int Keyboard::getKeyRightCharCode ( ) const

Get the Key Down Char Code object.

Returns
int charcode

◆ getKeySCharCode()

int Keyboard::getKeySCharCode ( ) const

Get the Key S Char Code object.

Returns
int charcode

◆ getKeysHasBeenPressed()

template<typename ENUM >
std::map<ENUM, bool> Keyboard::getKeysHasBeenPressed ( std::map< ENUM, int >  map) const
inline

Get the Keys Has Been Pressed object.

Template Parameters
ENUMkey
Parameters
mapmap of the keys
Returns
std::map<ENUM, bool> map of the keys that have been pressed

◆ getKeySpaceCharCode()

int Keyboard::getKeySpaceCharCode ( ) const

Get the Key Space Char Code object.

Returns
int charcode

◆ getKeysPressed()

template<typename ENUM >
std::map<ENUM, bool> Keyboard::getKeysPressed ( std::map< ENUM, int >  map) const
inline

Get the Keys Pressed object.

Template Parameters
ENUM
Parameters
map
Returns
std::map<ENUM, bool>

◆ getKeyUpCharCode()

int Keyboard::getKeyUpCharCode ( ) const

Get the Key Up Char Code object.

Returns
int charcode

◆ getPressedCharcode()

int Keyboard::getPressedCharcode ( ) const

Get the Pressed Charcode object.

Returns
int charcode

◆ getPressedKeycode()

int Keyboard::getPressedKeycode ( ) const

Get the Pressed Keycode object.

Returns
int keycode

◆ hasBeenPressed()

bool Keyboard::hasBeenPressed ( int  key) const

Check if a key has been pressed.

Parameters
keykey to check
Returns
true
false

◆ hasBeenReleased()

bool Keyboard::hasBeenReleased ( int  key) const

Check if a key has been released.

Parameters
keykey to check
Returns
true
false

◆ isBeingPressed()

bool Keyboard::isBeingPressed ( int  key) const

Check if a key is being pressed.

Parameters
keykey to check
Returns
true
false

◆ isNotBeingPressed()

bool Keyboard::isNotBeingPressed ( int  key) const

Check if a key is not being pressed.

Parameters
keykey to check
Returns
true
false

◆ setExitKey()

void Keyboard::setExitKey ( int  key)

Set the Exit Key object.

Parameters
keykey to set

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