36 std::vector<bool> keysPressed;
37 keysPressed.reserve(256);
40 if (arr ==
nullptr)
return keysPressed;
42 for (
int i = 0; i < 256; i++) {
43 keysPressed.push_back(arr[i]);
48char fromKeyCode(
int keyCode) {
63 std::vector<bool> buttonsPressed;
64 buttonsPressed.reserve(3);
67 if (arr ==
nullptr)
return buttonsPressed;
69 for (
int i = 0; i < 3; i++) {
70 buttonsPressed.push_back(arr[i]);
73 return buttonsPressed;
Device command functions.
char Device_fromKeyCode(int keyCode)
Converts a key code to a character.
bool * Device_getMouseButtonsPressed()
Gets the current mouse button being pressed.
bool * Device_getKeyboardKeysPressed()
Gets the current keys being pressed.
C++ wrapper for the CmdFX Device API.
Definition device.hpp:25
std::vector< bool > getMouseButtonsPressed()
Gets a vector of mouse buttons that are currently pressed.
Definition device.hpp:62
std::vector< bool > getKeyboardKeysPressed()
Gets a vector of booleans representing the state of the keyboard keys.
Definition device.hpp:35
Primary namespace for CmdFX.
Definition cmdfx.hpp:26