inputs_keyboard_parameters
Keyboard state (inputs.keyboard) with is_pressed(key) and the shift, ctrl and arrow flags.
Fields and methods
Members of the struct inputs_keyboard_parameters. Most of what you do with a CGP type goes through the free functions listed below.
Fields
bool shift | True while one of the two Shift keys is held down. |
bool ctrl | True while one of the two Control keys is held down. |
bool up | True while the Up arrow key is held down. |
bool down | True while the Down arrow key is held down. |
bool right | True while the Right arrow key is held down. |
bool left | True while the Left arrow key is held down. |
inputs_keyboard_last_action_parameter last_action | Key and action (press, release, repeat) of the last keyboard event, to react once to a key press in keyboard_event(). |
std::set<int> pressed_keys_storage | Set of the GLFW key codes currently held down, read by is_pressed (internal storage, not meant to be modified). |
Methods
bool is_pressed(int glfw_key) const | Returns true while the key with this GLFW code (GLFW_KEY_A, GLFW_KEY_SPACE...) is held down; the code is a key position, the QWERTY name of the key.3 overloads src |
bool is_pressed(char keyname) const | Returns true while the key whose character is keyname on the keyboard in use (layout-aware, e.g. 'z' on AZERTY) is held down; printable keys only. src |
bool is_pressed(std::string const& keyname) const | Returns true while a held key has this name for the keyboard layout in use (glfwGetKeyName, e.g. "k"); printable keys only, use the GLFW code for Space or the arrows. src |
| Builds a keyboard state with no key held (shift, ctrl and the arrow flags false). src | |
| Updates the held keys, the shift, ctrl and arrow flags and last_action from a GLFW key event (called by the application, not by the scene). src |
Functions taking a inputs_keyboard_parameters
None.
Functions returning a inputs_keyboard_parameters
None.
Operators
None.