From: Jens Peters Date: Sun, 18 Aug 2024 14:09:39 +0000 (+0200) Subject: action: add Enable/DisableTabletMouseEmulation X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=cd961b1ac103d553b949acd2578d599a5b230b51;p=proto%2Flabwc.git action: add Enable/DisableTabletMouseEmulation Useful for window rules. --- diff --git a/docs/labwc-actions.5.scd b/docs/labwc-actions.5.scd index cb6fac63..1c9e2ec1 100644 --- a/docs/labwc-actions.5.scd +++ b/docs/labwc-actions.5.scd @@ -294,8 +294,10 @@ Actions are used in menus and keyboard/mouse bindings. decorations (including those for which the server-side titlebar has been hidden) are not eligible for shading. +**++ +**++ ** - Toggle mouse emulation for drawing tablets on or off. + Enable, disable or toggle mouse emulation for drawing tablets respectively. ** Toggle the screen magnifier on or off at the last magnification level diff --git a/src/action.c b/src/action.c index 69a317bb..c38cba70 100644 --- a/src/action.c +++ b/src/action.c @@ -114,6 +114,8 @@ enum action_type { ACTION_TYPE_SHADE, ACTION_TYPE_UNSHADE, ACTION_TYPE_TOGGLE_SHADE, + ACTION_TYPE_ENABLE_TABLET_MOUSE_EMULATION, + ACTION_TYPE_DISABLE_TABLET_MOUSE_EMULATION, ACTION_TYPE_TOGGLE_TABLET_MOUSE_EMULATION, ACTION_TYPE_TOGGLE_MAGNIFY, ACTION_TYPE_ZOOM_IN, @@ -173,6 +175,8 @@ const char *action_names[] = { "Shade", "Unshade", "ToggleShade", + "EnableTabletMouseEmulation", + "DisableTabletMouseEmulation", "ToggleTabletMouseEmulation", "ToggleMagnify", "ZoomIn", @@ -1142,6 +1146,12 @@ actions_run(struct view *activator, struct server *server, view_set_shade(view, false); } break; + case ACTION_TYPE_ENABLE_TABLET_MOUSE_EMULATION: + rc.tablet.force_mouse_emulation = true; + break; + case ACTION_TYPE_DISABLE_TABLET_MOUSE_EMULATION: + rc.tablet.force_mouse_emulation = false; + break; case ACTION_TYPE_TOGGLE_TABLET_MOUSE_EMULATION: rc.tablet.force_mouse_emulation = !rc.tablet.force_mouse_emulation; break;