34 std::vector<bool> keysPressed;
35 keysPressed.reserve(256);
38 if (arr ==
nullptr)
return keysPressed;
40 for (
int i = 0; i < 256; i++) {
41 keysPressed.push_back(arr[i]);
58 std::vector<bool> buttonsPressed;
59 buttonsPressed.reserve(3);
62 if (arr ==
nullptr)
return buttonsPressed;
64 for (
int i = 0; i < 3; i++) {
65 buttonsPressed.push_back(arr[i]);
68 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:23
std::vector< bool > getMouseButtonsPressed()
Gets a vector of mouse buttons that are currently pressed.
Definition device.hpp:57
std::vector< bool > getKeyboardKeysPressed()
Gets a vector of booleans representing the state of the keyboard keys.
Definition device.hpp:33
Primary namespace for CmdFX.
Definition cmdfx.hpp:22