Browse Source

Merge branch 'main' into venom_2.13.2

Bringing over falkTX experimental fix for glfwGetKey.
pull/862/head
Don Cross 3 months ago
parent
commit
0346f48caa
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      src/custom/glfw.cpp

+ 11
- 1
src/custom/glfw.cpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2024 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2025 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -17,6 +17,7 @@

#include "Application.hpp"
#include "CardinalPluginContext.hpp"
#include "widget/event.hpp"

#include <GLFW/glfw3.h>

@@ -207,3 +208,12 @@ GLFWAPI const char* glfwGetKeyName(const int key, int)
default: return nullptr;
}
}

int glfwGetKey(GLFWwindow*, const int key)
{
CardinalPluginContext* const context = static_cast<CardinalPluginContext*>(APP);
DISTRHO_SAFE_ASSERT_RETURN(context != nullptr, GLFW_RELEASE);
DISTRHO_SAFE_ASSERT_RETURN(context->event != nullptr, GLFW_RELEASE);

return context->event->heldKeys.find(key) != context->event->heldKeys.end() ? GLFW_PRESS : GLFW_RELEASE;
}

Loading…
Cancel
Save