Browse Source

Fix non-mac mouse buttons

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.02
falkTX 3 years ago
parent
commit
afc4ee9238
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 19 additions and 1 deletions
  1. +19
    -1
      plugins/Cardinal/CardinalUI.cpp

+ 19
- 1
plugins/Cardinal/CardinalUI.cpp View File

@@ -156,21 +156,39 @@ protected:
if (ev.mod & kModifierAlt)
mods |= GLFW_MOD_ALT;

#ifdef DISTRHO_OS_MAC
switch (ev.button)
{
case 0:
case 1:
button = GLFW_MOUSE_BUTTON_LEFT;
break;
case 2:
button = GLFW_MOUSE_BUTTON_RIGHT;
break;
case 3:
button = GLFW_MOUSE_BUTTON_MIDDLE;
break;
default:
button = 0;
break;
}
#else
switch (ev.button)
{
case 1:
button = GLFW_MOUSE_BUTTON_LEFT;
break;
case 2:
button = GLFW_MOUSE_BUTTON_MIDDLE;
break;
case 3:
button = GLFW_MOUSE_BUTTON_RIGHT;
break;
default:
button = 0;
break;
}
#endif

mouseButtonCallback(APP->window, button, action, mods);
return true;


Loading…
Cancel
Save