|
Hymn to Beauty
C++ 3D Engine
|
#include <InputManager.hpp>
Public Types | |
| enum | Button { PLAYTEST = 0 , PROFILE , WINDOWMODE , CONTROL , NEW , OPEN , SAVE , CAMERA , FORWARD , BACKWARD , LEFT , RIGHT , ZOOM , SELECT , FOCUS , W , E , R , BUTTONS } |
| Button codes. More... | |
| enum | Device { KEYBOARD = 0 , MOUSE , INPUT_DEVICES } |
| Input device codes. More... | |
Public Member Functions | |
| void | Update () |
| Update input state. More... | |
| double | GetCursorX () const |
| Get cursor's horizontal position. More... | |
| double | GetCursorY () const |
| Get cursor's vertical position. More... | |
| glm::vec2 | GetCursorXY () const |
| Get cursor's coordinates. More... | |
| bool | GetScrollUp () const |
| Get whether user has moved scroll wheel up. More... | |
| bool | GetScrollDown () const |
| Get whether user has moved scroll wheel down. More... | |
| void | AssignButton (Button button, Device device, int index) |
| Assign a button binding. More... | |
| bool | Pressed (Button button) const |
| Gets whether a button is currently down. More... | |
| bool | Triggered (Button button) const |
| Gets whether a button was just pressed. More... | |
| void | CharacterCallback (unsigned int codePoint) |
| GLFW character callback. More... | |
| void | ScrollCallback (double yOffset) |
| GLFW scrolling callback. More... | |
Friends | |
| class | Hub |
Handles input devices.
| enum InputManager::Button |
Button codes.
| enum InputManager::Device |
Input device codes.
| Enumerator | |
|---|---|
| KEYBOARD | Keyboard input. |
| MOUSE | Mouse buttons. |
| INPUT_DEVICES | Number of input devices. |
Assign a button binding.
See GLFW keyboard documentation for indices for keys. For mouse buttons, either GLFW_MOUSE_BUTTON_LEFT, GLFW_MOUSE_BUTTON_RIGHT or GLFW_MOUSE_BUTTON_MIDDLE.
| button | Which button to bind. |
| device | Which device (KEYBOARD or MOUSE). |
| index | Index of the key. |
| void InputManager::CharacterCallback | ( | unsigned int | codePoint | ) |
GLFW character callback.
| codePoint | Unicode code point. |
| double InputManager::GetCursorX | ( | ) | const |
Get cursor's horizontal position.
| glm::vec2 InputManager::GetCursorXY | ( | ) | const |
Get cursor's coordinates.
| double InputManager::GetCursorY | ( | ) | const |
Get cursor's vertical position.
| bool InputManager::GetScrollDown | ( | ) | const |
Get whether user has moved scroll wheel down.
| bool InputManager::GetScrollUp | ( | ) | const |
Get whether user has moved scroll wheel up.
| bool InputManager::Pressed | ( | Button | button | ) | const |
Gets whether a button is currently down.
| button | The button to check. |
| void InputManager::ScrollCallback | ( | double | yOffset | ) |
GLFW scrolling callback.
| yOffset | Offset along the Y-axis. |
| bool InputManager::Triggered | ( | Button | button | ) | const |
Gets whether a button was just pressed.
Checks whether a button was pressed between the last two calls to update().
| button | The button to check. |
| void InputManager::Update | ( | ) |
Update input state.
|
friend |