Implement keyboard modifiers

Fixes #13

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2021-10-19 16:11:16 +01:00
parent 11cd37ea7a
commit c4ee1b06df
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
2 changed files with 44 additions and 32 deletions

View file

@ -113,6 +113,11 @@ void WindowInit(Window* const window, DISTRHO_NAMESPACE::UI* const ui)
}
}
void WindowMods(Window* const window, const int mods)
{
window->internal->mods = mods;
}
Window::~Window() {
if (APP->scene) {
widget::Widget::ContextDestroyEvent e;
@ -235,18 +240,7 @@ bool Window::isCursorLocked() {
int Window::getMods() {
int mods = 0;
/*
if (glfwGetKey(win, GLFW_KEY_LEFT_SHIFT) == GLFW_PRESS || glfwGetKey(win, GLFW_KEY_RIGHT_SHIFT) == GLFW_PRESS)
mods |= GLFW_MOD_SHIFT;
if (glfwGetKey(win, GLFW_KEY_LEFT_CONTROL) == GLFW_PRESS || glfwGetKey(win, GLFW_KEY_RIGHT_CONTROL) == GLFW_PRESS)
mods |= GLFW_MOD_CONTROL;
if (glfwGetKey(win, GLFW_KEY_LEFT_ALT) == GLFW_PRESS || glfwGetKey(win, GLFW_KEY_RIGHT_ALT) == GLFW_PRESS)
mods |= GLFW_MOD_ALT;
if (glfwGetKey(win, GLFW_KEY_LEFT_SUPER) == GLFW_PRESS || glfwGetKey(win, GLFW_KEY_RIGHT_SUPER) == GLFW_PRESS)
mods |= GLFW_MOD_SUPER;
*/
return mods;
return internal->mods;
}