diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..aafd6f5 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,4 @@ +github: falkTX +liberapay: falkTX +patreon: falkTX +custom: "https://paypal.me/falkTX" diff --git a/carla b/carla index 9317df5..ade014c 160000 --- a/carla +++ b/carla @@ -1 +1 @@ -Subproject commit 9317df59709ae646f6e08a1e2c9834b4a0325101 +Subproject commit ade014c97194486692c260b7cc09b04a92e58305 diff --git a/dpf b/dpf index 018e45d..78f6f18 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 018e45db4a40d57761f12e797093e3699b1ca5e3 +Subproject commit 78f6f18216f032070e72cc583e326b88efd43ea7 diff --git a/jucewrapper/CMakeLists.txt b/jucewrapper/CMakeLists.txt index 913c2eb..adeacef 100644 --- a/jucewrapper/CMakeLists.txt +++ b/jucewrapper/CMakeLists.txt @@ -166,6 +166,7 @@ target_sources(Cardinal target_include_directories(Cardinal PRIVATE ../dpf/distrho + ../dpf/dgl/src/pugl-upstream/include ../src/Cardinal) target_compile_definitions(Cardinal @@ -267,6 +268,7 @@ target_sources(CardinalFX target_include_directories(CardinalFX PRIVATE ../dpf/distrho + ../dpf/dgl/src/pugl-upstream/include ../src/CardinalFX) target_compile_definitions(CardinalFX @@ -367,6 +369,7 @@ target_sources(CardinalMIDI target_include_directories(CardinalMIDI PRIVATE ../dpf/distrho + ../dpf/dgl/src/pugl-upstream/include ../src/CardinalFX) target_compile_definitions(CardinalMIDI @@ -467,6 +470,7 @@ target_sources(CardinalSynth target_include_directories(CardinalSynth PRIVATE ../dpf/distrho + ../dpf/dgl/src/pugl-upstream/include ../src/CardinalSynth) target_compile_definitions(CardinalSynth diff --git a/src/CardinalUI.cpp b/src/CardinalUI.cpp index fddbca6..cf2c710 100644 --- a/src/CardinalUI.cpp +++ b/src/CardinalUI.cpp @@ -1066,34 +1066,15 @@ protected: const int action = ev.press ? GLFW_PRESS : GLFW_RELEASE; const int mods = glfwMods(ev.mod); - /* These are unsupported in pugl right now - #define GLFW_KEY_KP_0 320 - #define GLFW_KEY_KP_1 321 - #define GLFW_KEY_KP_2 322 - #define GLFW_KEY_KP_3 323 - #define GLFW_KEY_KP_4 324 - #define GLFW_KEY_KP_5 325 - #define GLFW_KEY_KP_6 326 - #define GLFW_KEY_KP_7 327 - #define GLFW_KEY_KP_8 328 - #define GLFW_KEY_KP_9 329 - #define GLFW_KEY_KP_DECIMAL 330 - #define GLFW_KEY_KP_DIVIDE 331 - #define GLFW_KEY_KP_MULTIPLY 332 - #define GLFW_KEY_KP_SUBTRACT 333 - #define GLFW_KEY_KP_ADD 334 - #define GLFW_KEY_KP_ENTER 335 - #define GLFW_KEY_KP_EQUAL 336 - */ - int key; switch (ev.key) { - case '\r': key = GLFW_KEY_ENTER; break; case '\t': key = GLFW_KEY_TAB; break; case kKeyBackspace: key = GLFW_KEY_BACKSPACE; break; + case kKeyEnter: key = GLFW_KEY_ENTER; break; case kKeyEscape: key = GLFW_KEY_ESCAPE; break; case kKeyDelete: key = GLFW_KEY_DELETE; break; + case kKeySpace: key = GLFW_KEY_SPACE; break; case kKeyF1: key = GLFW_KEY_F1; break; case kKeyF2: key = GLFW_KEY_F2; break; case kKeyF3: key = GLFW_KEY_F3; break; @@ -1106,15 +1087,21 @@ protected: case kKeyF10: key = GLFW_KEY_F10; break; case kKeyF11: key = GLFW_KEY_F11; break; case kKeyF12: key = GLFW_KEY_F12; break; + case kKeyPageUp: key = GLFW_KEY_PAGE_UP; break; + case kKeyPageDown: key = GLFW_KEY_PAGE_DOWN; break; + case kKeyEnd: key = GLFW_KEY_END; break; + case kKeyHome: key = GLFW_KEY_HOME; break; case kKeyLeft: key = GLFW_KEY_LEFT; break; case kKeyUp: key = GLFW_KEY_UP; break; case kKeyRight: key = GLFW_KEY_RIGHT; break; case kKeyDown: key = GLFW_KEY_DOWN; break; - case kKeyPageUp: key = GLFW_KEY_PAGE_UP; break; - case kKeyPageDown: key = GLFW_KEY_PAGE_DOWN; break; - case kKeyHome: key = GLFW_KEY_HOME; break; - case kKeyEnd: key = GLFW_KEY_END; break; + case kKeyPrintScreen: key = GLFW_KEY_PRINT_SCREEN; break; case kKeyInsert: key = GLFW_KEY_INSERT; break; + case kKeyPause: key = GLFW_KEY_PAUSE; break; + case kKeyMenu: key = GLFW_KEY_MENU; break; + case kKeyNumLock: key = GLFW_KEY_NUM_LOCK; break; + case kKeyScrollLock: key = GLFW_KEY_SCROLL_LOCK; break; + case kKeyCapsLock: key = GLFW_KEY_CAPS_LOCK; break; case kKeyShiftL: key = GLFW_KEY_LEFT_SHIFT; break; case kKeyShiftR: key = GLFW_KEY_RIGHT_SHIFT; break; case kKeyControlL: key = GLFW_KEY_LEFT_CONTROL; break; @@ -1123,12 +1110,39 @@ protected: case kKeyAltR: key = GLFW_KEY_RIGHT_ALT; break; case kKeySuperL: key = GLFW_KEY_LEFT_SUPER; break; case kKeySuperR: key = GLFW_KEY_RIGHT_SUPER; break; - case kKeyMenu: key = GLFW_KEY_MENU; break; - case kKeyCapsLock: key = GLFW_KEY_CAPS_LOCK; break; - case kKeyScrollLock: key = GLFW_KEY_SCROLL_LOCK; break; - case kKeyNumLock: key = GLFW_KEY_NUM_LOCK; break; - case kKeyPrintScreen: key = GLFW_KEY_PRINT_SCREEN; break; - case kKeyPause: key = GLFW_KEY_PAUSE; break; + case kKeyPad0: key = GLFW_KEY_KP_0; break; + case kKeyPad1: key = GLFW_KEY_KP_1; break; + case kKeyPad2: key = GLFW_KEY_KP_2; break; + case kKeyPad3: key = GLFW_KEY_KP_3; break; + case kKeyPad4: key = GLFW_KEY_KP_4; break; + case kKeyPad5: key = GLFW_KEY_KP_5; break; + case kKeyPad6: key = GLFW_KEY_KP_6; break; + case kKeyPad7: key = GLFW_KEY_KP_7; break; + case kKeyPad8: key = GLFW_KEY_KP_8; break; + case kKeyPad9: key = GLFW_KEY_KP_9; break; + case kKeyPadEnter: key = GLFW_KEY_KP_ENTER; break; + /* undefined in glfw + case kKeyPadPageUp: + case kKeyPadPageDown: + case kKeyPadEnd: + case kKeyPadHome: + case kKeyPadLeft: + case kKeyPadUp: + case kKeyPadRight: + case kKeyPadDown: + case kKeyPadClear: + case kKeyPadInsert: + case kKeyPadDelete: + */ + case kKeyPadEqual: key = GLFW_KEY_KP_EQUAL; break; + case kKeyPadMultiply: key = GLFW_KEY_KP_MULTIPLY; break; + case kKeyPadAdd: key = GLFW_KEY_KP_ADD; break; + /* undefined in glfw + case kKeyPadSeparator: + */ + case kKeyPadSubtract: key = GLFW_KEY_KP_SUBTRACT; break; + case kKeyPadDecimal: key = GLFW_KEY_KP_DECIMAL; break; + case kKeyPadDivide: key = GLFW_KEY_KP_DIVIDE; break; default: // glfw expects uppercase if (ev.key >= 'a' && ev.key <= 'z') diff --git a/src/custom/glfw.cpp b/src/custom/glfw.cpp index b4fa62a..e3718d7 100644 --- a/src/custom/glfw.cpp +++ b/src/custom/glfw.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Cardinal Plugin - * Copyright (C) 2021-2022 Filipe Coelho + * Copyright (C) 2021-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -50,16 +50,16 @@ GLFWAPI void glfwSetClipboardString(GLFWwindow*, const char* const text) GLFWAPI GLFWcursor* glfwCreateStandardCursor(const int shape) { static GLFWcursor cursors[] = { - { kMouseCursorArrow }, // GLFW_ARROW_CURSOR - { kMouseCursorCaret }, // GLFW_IBEAM_CURSOR - { kMouseCursorCrosshair }, // GLFW_CROSSHAIR_CURSOR - { kMouseCursorHand }, // GLFW_POINTING_HAND_CURSOR - { kMouseCursorNotAllowed }, // GLFW_NOT_ALLOWED_CURSOR - { kMouseCursorLeftRight }, // GLFW_RESIZE_EW_CURSOR - { kMouseCursorUpDown }, // GLFW_RESIZE_NS_CURSOR - { kMouseCursorDiagonal }, // GLFW_RESIZE_NWSE_CURSOR - { kMouseCursorAntiDiagonal }, // GLFW_RESIZE_NESW_CURSOR - // NOTE GLFW_RESIZE_ALL_CURSOR is unsupported in pugl + { kMouseCursorArrow }, // GLFW_ARROW_CURSOR + { kMouseCursorCaret }, // GLFW_IBEAM_CURSOR + { kMouseCursorCrosshair }, // GLFW_CROSSHAIR_CURSOR + { kMouseCursorHand }, // GLFW_POINTING_HAND_CURSOR + { kMouseCursorNotAllowed }, // GLFW_NOT_ALLOWED_CURSOR + { kMouseCursorLeftRight }, // GLFW_RESIZE_EW_CURSOR + { kMouseCursorUpDown }, // GLFW_RESIZE_NS_CURSOR + { kMouseCursorUpLeftDownRight }, // GLFW_RESIZE_NWSE_CURSOR + { kMouseCursorUpRightDownLeft }, // GLFW_RESIZE_NESW_CURSOR + { kMouseCursorAllScroll }, // GLFW_RESIZE_ALL_CURSOR }; switch (shape) @@ -79,9 +79,11 @@ GLFWAPI GLFWcursor* glfwCreateStandardCursor(const int shape) case GLFW_RESIZE_NS_CURSOR: return &cursors[kMouseCursorUpDown]; case GLFW_RESIZE_NWSE_CURSOR: - return &cursors[kMouseCursorDiagonal]; + return &cursors[kMouseCursorUpLeftDownRight]; case GLFW_RESIZE_NESW_CURSOR: - return &cursors[kMouseCursorAntiDiagonal]; + return &cursors[kMouseCursorUpRightDownLeft]; + case GLFW_RESIZE_ALL_CURSOR: + return &cursors[kMouseCursorAllScroll]; default: return nullptr; }