From b63c6a0fc2bd5be0c142a6f5e2c64d56a7a8eb81 Mon Sep 17 00:00:00 2001 From: Jens Peters Date: Sun, 16 Jun 2024 08:47:48 +0200 Subject: [PATCH] action: add ToggleTabletMouseEmulation Useful for switching between application-defined and mapped tablet pad buttons. Also for quickly troubleshooting tablet behavior. --- docs/labwc-actions.5.scd | 3 +++ docs/labwc-config.5.scd | 3 +++ src/action.c | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/docs/labwc-actions.5.scd b/docs/labwc-actions.5.scd index a8d8bba5..50f6ad33 100644 --- a/docs/labwc-actions.5.scd +++ b/docs/labwc-actions.5.scd @@ -286,6 +286,9 @@ 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. + ** Toggle the screen magnifier on or off at the last magnification level used. diff --git a/docs/labwc-config.5.scd b/docs/labwc-config.5.scd index f2088771..85a8d437 100644 --- a/docs/labwc-config.5.scd +++ b/docs/labwc-config.5.scd @@ -684,6 +684,9 @@ extending outward from the snapped edge. tablet specific restrictions, e.g. no support for drag-and-drop, but also omits tablet specific features like reporting pen pressure. + Use the *ToggleTabletMouseEmulation* action for toggling between + mouse emulation on and off. + ** Pen and pad buttons behave like regular mouse buttons.With mouse emulation set to "no", which is the default, and if not specified diff --git a/src/action.c b/src/action.c index 135af253..80231b95 100644 --- a/src/action.c +++ b/src/action.c @@ -114,6 +114,7 @@ enum action_type { ACTION_TYPE_SHADE, ACTION_TYPE_UNSHADE, ACTION_TYPE_TOGGLE_SHADE, + ACTION_TYPE_TOGGLE_TABLET_MOUSE_EMULATION, ACTION_TYPE_TOGGLE_MAGNIFY, ACTION_TYPE_ZOOM_IN, ACTION_TYPE_ZOOM_OUT @@ -172,6 +173,7 @@ const char *action_names[] = { "Shade", "Unshade", "ToggleShade", + "ToggleTabletMouseEmulation", "ToggleMagnify", "ZoomIn", "ZoomOut", @@ -1111,6 +1113,9 @@ actions_run(struct view *activator, struct server *server, view_set_shade(view, false); } break; + case ACTION_TYPE_TOGGLE_TABLET_MOUSE_EMULATION: + rc.tablet.force_mouse_emulation = !rc.tablet.force_mouse_emulation; + break; case ACTION_TYPE_TOGGLE_MAGNIFY: magnify_toggle(server); break;