BlankMat 0.1.0
Free open-source 3D texture creation application
|
Public Member Functions | |
void | SetMouseInputMode (GLFWwindow *window, MouseInputMode newMode) |
Sets the mouse input mode to the given mode. | |
void | SetMouseRotFunction (std::function< void(const glm::vec3 &delta)> func) |
Sets the callback function that runs whenever the mouse moves in rotation mode. | |
void | SetMouseZoomFunction (std::function< void(const glm::vec3 &delta)> func) |
Sets the callback function that runs whenever the mouse moves in zoom mode. | |
void | SetMouseMoveFunction (std::function< void(const glm::vec3 &delta)> func) |
Sets the callback function that runs whenever the mouse moves in move mode. | |
bool | PressKey (const std::string &keyCode, int mods) |
Presses the given key with the given mod bits. | |
bool | UnPressKey (const std::string &keyCode) |
Unpresses the given key. | |
bool | IsKeyPressed (const std::string &keyCode) const |
Returns whether the given key is pressed or not. | |
void | RunCommand (const std::string &command) |
Runs the command with the given name if it exists. | |
void | AddCommand (const std::string &name, ICommand *command) |
Adds the given command to the command list. | |
int | GeyKeyMods (const std::string &keyCode) const |
Returns the modifier keys of the pressed key. | |
void | KeyCallback (GLFWwindow *window, int key, int scancode, int action, int mods) |
Handles keyboard key interactions. | |
void | MouseButtonCallback (GLFWwindow *window, int button, int action, int mods) |
Handles mouse button interactions. | |
void | CursorPositionCallback (GLFWwindow *window, double xPos, double yPos) |
Handles mouse movement interactions. | |
void | ScrollCallback (GLFWwindow *window, double xOffset, double yOffset) |
Handles mouse scroll interactions. | |
Input (ImGuiIO *io, State *state, Config *config) | |
Initializes the input module with the current hotkeys. | |
Static Public Member Functions | |
static bool | IsModKey (int key) |
Returns whether the key is a modifier key. | |
static std::string | GetModCode (int mod) |
Returns the mod code as a string. | |
static std::string | GetKeyCode (int key) |
Returns the key code as a string. | |
static std::string | GetMouseCode (int button) |
Returns the mouse button code as a string. | |
static std::string | GetActionCode (int action) |
Returns the action code as a string. | |
static bool | AltPress (int mod) |
Returns whether alt is being pressed. | |
static bool | ShiftPress (int mod) |
Returns whether shift is being pressed. | |
static bool | CtrlPress (int mod) |
Returns whether ctrl is being pressed. | |
static void | FramebufferSizeCallback (GLFWwindow *window, int width, int height) |
Handles changing the viewport size to match the window size. | |
static void | DisableMouseCursor (GLFWwindow *window) |
Disables the mouse cursor, making it not move even if the user moves their mouse. | |
static void | HideMouseCursor (GLFWwindow *window) |
Hides the mouse cursor, allowing the user to continue moving it in the background. | |
static void | ShowMouseCursor (GLFWwindow *window) |
Shows the mouse cursor, resetting it to the default mode. | |
Initializes the input module with the current hotkeys.
io | ImGui Input/Output module |
state | Global state |
config | Top level config |
|
inline |
Adds the given command to the command list.
name | Name of the command |
command | The command |
|
inlinestatic |
Returns whether alt is being pressed.
mod | Alt/Ctrl/Shift modifiers |
|
inlinestatic |
Returns whether ctrl is being pressed.
mod | Alt/Ctrl/Shift modifiers |
void Input::CursorPositionCallback | ( | GLFWwindow * | window, |
double | xPos, | ||
double | yPos | ||
) |
Handles mouse movement interactions.
window | Current window |
xPos | x position of cursor |
yPos | y position of cursor |
|
inlinestatic |
Disables the mouse cursor, making it not move even if the user moves their mouse.
window | Current window |
|
inlinestatic |
Handles changing the viewport size to match the window size.
window | Current window |
width | Width of new window |
height | Height of new window |
|
inlinestatic |
Returns the action code as a string.
action | Action |
|
inlinestatic |
Returns the key code as a string.
key | Key code |
|
inlinestatic |
Returns the mod code as a string.
mod | Alt/Ctrl/Shift modifiers |
|
inlinestatic |
Returns the mouse button code as a string.
button | Mouse button |
|
inline |
Returns the modifier keys of the pressed key.
keyCode | Key code of the key pressed |
|
inlinestatic |
Hides the mouse cursor, allowing the user to continue moving it in the background.
window | Current window |
|
inline |
Returns whether the given key is pressed or not.
keyCode | Key code to check |
|
inlinestatic |
Returns whether the key is a modifier key.
key | Key code to check |
void Input::KeyCallback | ( | GLFWwindow * | window, |
int | key, | ||
int | scancode, | ||
int | action, | ||
int | mods | ||
) |
Handles keyboard key interactions.
window | Current window |
key | The key that was pressed or unpressed |
scancode | Scancode of key |
action | Whether the key was pressed or unpressed |
mods | Alt/Ctrl/Shift modifiers |
void Input::MouseButtonCallback | ( | GLFWwindow * | window, |
int | button, | ||
int | action, | ||
int | mods | ||
) |
Handles mouse button interactions.
window | Current window |
button | The mouse button that was pressed or unpressed |
action | Whether the mouse button was pressed or unpressed |
mods | Alt/Ctrl/Shift modifiers |
|
inline |
Presses the given key with the given mod bits.
keyCode | Key code to press |
mods | Modifier bits |
|
inline |
Runs the command with the given name if it exists.
command | Command to run |
void Input::ScrollCallback | ( | GLFWwindow * | window, |
double | xOffset, | ||
double | yOffset | ||
) |
Handles mouse scroll interactions.
window | Current window |
xOffset | Change in x |
yOffset | Change in y |
|
inline |
Sets the mouse input mode to the given mode.
window | |
newMode | Mode to set input to |
|
inline |
Sets the callback function that runs whenever the mouse moves in move mode.
func | Callback function to run |
|
inline |
Sets the callback function that runs whenever the mouse moves in rotation mode.
func | Callback function to run |
|
inline |
Sets the callback function that runs whenever the mouse moves in zoom mode.
func | Callback function to run |
|
inlinestatic |
Returns whether shift is being pressed.
mod | Alt/Ctrl/Shift modifiers |
|
inlinestatic |
Shows the mouse cursor, resetting it to the default mode.
window | Current window |
|
inline |
Unpresses the given key.
keyCode | Key code to unpress |