From 9bc002577eca71006a810d7ced8276b0f9715cb8 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 16 Oct 2021 20:41:13 +0100 Subject: [PATCH] Ignore keyboard MIDI driver --- plugins/Cardinal/CardinalPlugin.cpp | 1 - plugins/Cardinal/Makefile | 2 +- plugins/Cardinal/Window.cpp | 19 ++----------------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/plugins/Cardinal/CardinalPlugin.cpp b/plugins/Cardinal/CardinalPlugin.cpp index f436247..8bf5294 100644 --- a/plugins/Cardinal/CardinalPlugin.cpp +++ b/plugins/Cardinal/CardinalPlugin.cpp @@ -109,7 +109,6 @@ struct Initializer { INFO("Initializing environment"); audio::init(); midi::init(); - keyboard::init(); plugin::init(); library::init(); ui::init(); diff --git a/plugins/Cardinal/Makefile b/plugins/Cardinal/Makefile index 5be1fec..491a716 100644 --- a/plugins/Cardinal/Makefile +++ b/plugins/Cardinal/Makefile @@ -47,7 +47,7 @@ endif FILES_DSP += $(wildcard Rack/src/*.c) FILES_DSP += $(wildcard Rack/src/*/*.c) -FILES_DSP += $(filter-out Rack/src/dep.cpp Rack/src/discord.cpp Rack/src/gamepad.cpp Rack/src/network.cpp Rack/src/rtaudio.cpp Rack/src/rtmidi.cpp, $(wildcard Rack/src/*.cpp)) +FILES_DSP += $(filter-out Rack/src/dep.cpp Rack/src/discord.cpp Rack/src/gamepad.cpp Rack/src/keyboard.cpp Rack/src/network.cpp Rack/src/rtaudio.cpp Rack/src/rtmidi.cpp, $(wildcard Rack/src/*.cpp)) FILES_DSP += $(filter-out Rack/src/window/Window.cpp, $(wildcard Rack/src/*/*.cpp)) EXTRA_DEPENDENCIES += Rack/dep/lib/libjansson.a diff --git a/plugins/Cardinal/Window.cpp b/plugins/Cardinal/Window.cpp index 4f18637..8b96b11 100644 --- a/plugins/Cardinal/Window.cpp +++ b/plugins/Cardinal/Window.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -395,10 +394,6 @@ void cursorPosCallback(Context* ctx, double xpos, double ypos) { ctx->window->internal->lastMousePos = mousePos; ctx->event->handleHover(mousePos, mouseDelta); - - // Keyboard/mouse MIDI driver - math::Vec scaledPos(xpos / ctx->window->internal->ui->getWidth(), ypos / ctx->window->internal->ui->getHeight()); - keyboard::mouseMove(scaledPos); } void cursorEnterCallback(Context* ctx, int entered) { @@ -419,21 +414,11 @@ void scrollCallback(Context* ctx, double x, double y) { } void charCallback(Context* ctx, unsigned int codepoint) { - if (ctx->event->handleText(ctx->window->internal->lastMousePos, codepoint)) - return; + ctx->event->handleText(ctx->window->internal->lastMousePos, codepoint); } void keyCallback(Context* ctx, int key, int scancode, int action, int mods) { - if (ctx->event->handleKey(ctx->window->internal->lastMousePos, key, scancode, action, mods)) - return; - - // Keyboard/mouse MIDI driver - if (action == GLFW_PRESS && (mods & RACK_MOD_MASK) == 0) { - keyboard::press(key); - } - if (action == GLFW_RELEASE) { - keyboard::release(key); - } + ctx->event->handleKey(ctx->window->internal->lastMousePos, key, scancode, action, mods); }