diff options
author | Campbell Barton <campbell@blender.org> | 2022-10-25 12:42:46 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-10-25 12:42:46 +0300 |
commit | c4f9e4afab8c51e271fc6a313ccd2dd0b8d3186c (patch) | |
tree | c90045991427e641d2d17e1ab7094871dad70528 | |
parent | 7e3e4751b544bce290288de4af8651847d230655 (diff) |
GHOST/Wayland: swap tablet middle/right mouse buttons
There looks to be an inconsistency between Gnome/KDE here,
match KDE and Gnome applications under X11 (even XWayland)
by making the button closest to the nib MMB, and the other button RMB.
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWayland.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp index 60247660a9c..f09678374fa 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cpp +++ b/intern/ghost/intern/GHOST_SystemWayland.cpp @@ -174,9 +174,14 @@ static bool use_gnome_confine_hack = false; /** * Tablet events. + * + * \note Gnome/GTK swap middle/right, where the same application in X11 will swap the middle/right + * mouse button when running under WAYLAND. KDE doesn't do this, and according to artists + * at the Blender studio, having the button closest to the nib be MMB is preferable, + * so use this as a default. If needs be - swapping these could be a preference. */ -#define BTN_STYLUS 0x14b /* Use as right-mouse. */ -#define BTN_STYLUS2 0x14c /* Use as middle-mouse. */ +#define BTN_STYLUS 0x14b /* Use as middle-mouse. */ +#define BTN_STYLUS2 0x14c /* Use as right-mouse. */ /* NOTE(@campbellbarton): Map to an additional button (not sure which hardware uses this). */ #define BTN_STYLUS3 0x149 @@ -2969,10 +2974,10 @@ static void tablet_tool_handle_button(void *data, GHOST_TButton ebutton = GHOST_kButtonMaskLeft; switch (button) { case BTN_STYLUS: - ebutton = GHOST_kButtonMaskRight; + ebutton = GHOST_kButtonMaskMiddle; break; case BTN_STYLUS2: - ebutton = GHOST_kButtonMaskMiddle; + ebutton = GHOST_kButtonMaskRight; break; case BTN_STYLUS3: ebutton = GHOST_kButtonMaskButton4; |