]> git.mdlowis.com Git - proto/labwc.git/commitdiff
action: add ToggleTabletMouseEmulation
authorJens Peters <jp7677@gmail.com>
Sun, 16 Jun 2024 06:47:48 +0000 (08:47 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 18 Jun 2024 21:13:28 +0000 (22:13 +0100)
Useful for switching between application-defined and
mapped tablet  pad buttons. Also for quickly troubleshooting
tablet behavior.

docs/labwc-actions.5.scd
docs/labwc-config.5.scd
src/action.c

index a8d8bba57e4e36dc331814bc0921bcfcde9532e5..50f6ad33ad095236ef8f3135730296473f094246 100644 (file)
@@ -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.
 
+*<action name="ToggleTabletMouseEmulation">*
+       Toggle mouse emulation for drawing tablets on or off.
+
 *<action name="ToggleMagnify">*
        Toggle the screen magnifier on or off at the last magnification level
        used.
index f2088771b7610d7515e15cb4b095ed02500cf24b..85a8d4376f16656b21133018598c8ebead0faf93 100644 (file)
@@ -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.
+
 *<tablet><map button="" to="" />*
        Pen and pad buttons behave like regular mouse buttons.With mouse
        emulation set to "no", which is the default, and if not specified
index 135af253777076d5510372859256789b7d5f02ca..80231b954cbac0190a9427caf154103f587fb8bd 100644 (file)
@@ -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;