File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
22 * DISTRHO Cardinal Plugin
3- * Copyright (C) 2021-2024 Filipe Coelho <falktx@falktx.com>
3+ * Copyright (C) 2021-2025 Filipe Coelho <falktx@falktx.com>
44 *
55 * This program is free software; you can redistribute it and/or
66 * modify it under the terms of the GNU General Public License as
1717
1818#include " Application.hpp"
1919#include " CardinalPluginContext.hpp"
20+ #include " widget/event.hpp"
2021
2122#include < GLFW/glfw3.h>
2223
@@ -207,3 +208,12 @@ GLFWAPI const char* glfwGetKeyName(const int key, int)
207208 default : return nullptr ;
208209 }
209210}
211+
212+ int glfwGetKey (GLFWwindow*, const int key)
213+ {
214+ CardinalPluginContext* const context = static_cast <CardinalPluginContext*>(APP );
215+ DISTRHO_SAFE_ASSERT_RETURN (context != nullptr , GLFW_RELEASE );
216+ DISTRHO_SAFE_ASSERT_RETURN (context->event != nullptr , GLFW_RELEASE );
217+
218+ return context->event ->heldKeys .find (key) != context->event ->heldKeys .end () ? GLFW_PRESS : GLFW_RELEASE ;
219+ }
You can’t perform that action at this time.
0 commit comments