Raylib C++  1.0.0
Encapsulates the raylib library
Static Public Member Functions | List of all members
raylib::helper::input::KeyboardHelper Class Reference

Helper class for Input-related functions: keyboard. More...

#include <KeyboardHelper.hpp>

Collaboration diagram for raylib::helper::input::KeyboardHelper:
Collaboration graph

Static Public Member Functions

static bool isKeyPressed (const KeyboardKey &key)
 Check if a key has been pressed once. More...
 
static bool isKeyDown (const KeyboardKey &key)
 Check if a key is being pressed. More...
 
static bool isKeyReleased (const KeyboardKey &key)
 Check if a key has been released once. More...
 
static bool isKeyUp (const KeyboardKey &key)
 Check if a key is NOT being pressed. More...
 
static void setExitKey (const KeyboardKey &key)
 Set a custom key to exit program (default is ESC) More...
 
static int getKeyPressed ()
 Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty. More...
 
static int getCharPressed ()
 Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty. More...
 
static std::vector< KeyboardKey > getPressedKeys ()
 Get all the queued pressed keys. More...
 
static std::vector< int > getPressedChars ()
 Get all the queued keys char (unicode) More...
 
static std::string getKeyName (const int &key, const int &scancode)
 Get key name. More...
 

Detailed Description

Helper class for Input-related functions: keyboard.

Member Function Documentation

◆ getCharPressed()

int raylib::helper::input::KeyboardHelper::getCharPressed ( )
static

Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty.

Returns
the char pressed

◆ getKeyName()

std::string raylib::helper::input::KeyboardHelper::getKeyName ( const int &  key,
const int &  scancode 
)
static

Get key name.

Parameters
keythe key to get the name
scancodethe scancode to get the name
Returns
the key name

◆ getKeyPressed()

int raylib::helper::input::KeyboardHelper::getKeyPressed ( )
static

Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty.

Returns
the key pressed

◆ getPressedChars()

std::vector< int > raylib::helper::input::KeyboardHelper::getPressedChars ( )
static

Get all the queued keys char (unicode)

Returns
the keys char

◆ getPressedKeys()

std::vector< KeyboardKey > raylib::helper::input::KeyboardHelper::getPressedKeys ( )
static

Get all the queued pressed keys.

Returns
the keys pressed

◆ isKeyDown()

bool raylib::helper::input::KeyboardHelper::isKeyDown ( const KeyboardKey &  key)
static

Check if a key is being pressed.

Parameters
keythe key to check
Returns
true if the key is being pressed

◆ isKeyPressed()

bool raylib::helper::input::KeyboardHelper::isKeyPressed ( const KeyboardKey &  key)
static

Check if a key has been pressed once.

Parameters
keythe key to check
Returns
true if the key is pressed
Here is the caller graph for this function:

◆ isKeyReleased()

bool raylib::helper::input::KeyboardHelper::isKeyReleased ( const KeyboardKey &  key)
static

Check if a key has been released once.

Parameters
keythe key to check
Returns
true if the key is released

◆ isKeyUp()

bool raylib::helper::input::KeyboardHelper::isKeyUp ( const KeyboardKey &  key)
static

Check if a key is NOT being pressed.

Parameters
keythe key to check
Returns
true if the key is NOT being pressed

◆ setExitKey()

void raylib::helper::input::KeyboardHelper::setExitKey ( const KeyboardKey &  key)
static

Set a custom key to exit program (default is ESC)

Parameters
keythe key to set

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