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

Public Types

enum  EKey {
  UNKNOWN = -1, APOSTROPHE = 39, COMMA = 44, MINUS = 45,
  PERIOD = 46, SLASH = 47, NUM0 = 48, NUM1 = 49,
  NUM2 = 50, NUM3 = 51, NUM4 = 52, NUM5 = 53,
  NUM6 = 54, NUM7 = 55, NUM8 = 56, NUM9 = 57,
  SEMICOLON = 59, EQUAL = 61, A = 65, B = 66,
  C = 67, D = 68, E = 69, F = 70,
  G = 71, H = 72, I = 73, J = 74,
  K = 75, L = 76, M = 77, N = 78,
  O = 79, P = 80, Q = 81, R = 82,
  S = 83, T = 84, U = 85, V = 86,
  W = 87, X = 88, Y = 89, Z = 90,
  LEFT_BRACKET = 91, BACKSLASH = 92, RIGHT_BRACKET = 93, GRAVE = 96,
  SPACE = 32, ESCAPE = 256, ENTER = 257, TAB = 258,
  BACKSPACE = 259, INSERT = 260, DELETE = 261, RIGHT = 262,
  LEFT = 263, DOWN = 264, UP = 265, PAGE_UP = 266,
  PAGE_DOWN = 267, HOME = 268, END = 269, CAPS_LOCK = 280,
  SCROLL_LOCK = 281, NUM_LOCK = 282, PRINT_SCREEN = 283, PAUSE = 284,
  F1 = 290, F2 = 291, F3 = 292, F4 = 293,
  F5 = 294, F6 = 295, F7 = 296, F8 = 297,
  F9 = 298, F10 = 299, F11 = 300, F12 = 301,
  LEFT_SHIFT = 340, LEFT_CONTROL = 341, LEFT_ALT = 342, LEFT_SUPER = 343,
  RIGHT_SHIFT = 344, RIGHT_CONTROL = 345, RIGHT_ALT = 346, RIGHT_SUPER = 347,
  KB_MENU = 348, KP_0 = 320, KP_1 = 321, KP_2 = 322,
  KP_3 = 323, KP_4 = 324, KP_5 = 325, KP_6 = 326,
  KP_7 = 327, KP_8 = 328, KP_9 = 329, KP_DECIMAL = 330,
  KP_DIVIDE = 331, KP_MULTIPLY = 332, KP_SUBTRACT = 333, KP_ADD = 334,
  KP_ENTER = 335, KP_EQUAL = 336, BACK = 349, MENU,
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WN, GAMEPAD1_RIGHT_FACE_LEFT, GAMEPAD1_LEFT_TRIGGER_1,
  GAMEPAD1_LEFT_TRIGGER_2, GAMEPAD1_RIGHT_TRIGGER_1, GAMEPAD1_RIGHT_TRIGGER_2, GAMEPAD1_MIDDLE_LEFT,
  GAMEPAD1_MIDDLE, GAMEPAD1_MIDDLE_RIGHT, GAMEPAD1_LEFT_THUMB, GAMEPAD1_RIGHT_THUMB,
  TILDE, UNDERSCORE, F13, F14,
  F15, QUOTE = APOSTROPHE, SUBSTRACT = MINUS, DIVIDE = SLASH,
  POINT = PERIOD
}
 all keys More...
 

Public Member Functions

Keyoperator= (EKey const &_ek)
 
Keyoperator= (Key const &_k)
 
bool operator== (EKey const &_ek) const
 
bool operator== (Key const &_k) const
 
bool operator!= (EKey const &_ek) const
 
bool operator!= (Key const &_ek) const
 
bool isKeyboardKey () const
 Check is a keyboard key. More...
 
bool isMouseKey () const
 vérifie si la touche provient de la souris More...
 
bool isGamepadKey () const
 Check is a gamepad key. More...
 
Keyoperator= (int const &_k)
 
std::string toString () const
 Get key name. More...
 
std::string getTextValue () const
 Get displayable value of your key. More...
 
EKey get () const
 get current value Key More...
 

Static Public Member Functions

static EKey maxValue ()
 Max value EKey. More...
 
static EKey minValue ()
 Minimum value EKey. More...
 
static bool intInEnum (int const &id)
 Check id in enum. More...
 

Member Enumeration Documentation

◆ EKey

all keys

enumeration of all keys that engine can detect

Member Function Documentation

◆ get()

EKey KapEngine::Events::Key::get ( ) const
inline

get current value Key

Returns
KapEngine::Events::Key::EKey

◆ getTextValue()

std::string KapEngine::Events::Key::getTextValue ( ) const
inline

Get displayable value of your key.

Returns
std::string

◆ intInEnum()

static bool KapEngine::Events::Key::intInEnum ( int const &  id)
inlinestatic

Check id in enum.

Check if index "id" exists in the KapEngine::Events::Key::EKey enum

Parameters
idindex (int)
Return values
trueif index is in the KapEngine::Events::Key::EKey enum
falseif index is not in the KapEngine::Events::Key::EKey enum

◆ isGamepadKey()

bool KapEngine::Events::Key::isGamepadKey ( ) const
inline

Check is a gamepad key.

Check if _last is a gamepad key

Return values
trueif _last is a gamepad key
falseif _last is not a gamepad key

◆ isKeyboardKey()

bool KapEngine::Events::Key::isKeyboardKey ( ) const
inline

Check is a keyboard key.

Check if _last variable is a keyboard key

Return values
trueif _last is a keyboard key
falseif _last is not a keyboard key

◆ isMouseKey()

bool KapEngine::Events::Key::isMouseKey ( ) const
inline

vérifie si la touche provient de la souris

permet de savoir si la touche enregistrer dans la variable _last est une touche de souris

Return values
truesi la touche vient de la souris
falsesi la touche n'est pas de la souris

◆ maxValue()

static EKey KapEngine::Events::Key::maxValue ( )
inlinestatic

Max value EKey.

Get the max value of the EKey enum

Returns
KapEngine::Events::Key::EKey

◆ minValue()

static EKey KapEngine::Events::Key::minValue ( )
inlinestatic

Minimum value EKey.

Get the minimum value of the EKey enum

Returns
KapEngine::Events::Key::EKey

◆ toString()

std::string KapEngine::Events::Key::toString ( ) const
inline

Get key name.

Get name of key in string value

Returns
std::string

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