action: add ToggleTabletMouseEmulation

Useful for switching between application-defined and
mapped tablet  pad buttons. Also for quickly troubleshooting
tablet behavior.
This commit is contained in:
Jens Peters 2024-06-16 08:47:48 +02:00 committed by Johan Malm
parent 1dadb12807
commit b63c6a0fc2
3 changed files with 11 additions and 0 deletions

View 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 decorations (including those for which the server-side titlebar has been
hidden) are not eligible for shading. hidden) are not eligible for shading.
*<action name="ToggleTabletMouseEmulation">*
Toggle mouse emulation for drawing tablets on or off.
*<action name="ToggleMagnify">* *<action name="ToggleMagnify">*
Toggle the screen magnifier on or off at the last magnification level Toggle the screen magnifier on or off at the last magnification level
used. used.

View file

@ -684,6 +684,9 @@ extending outward from the snapped edge.
tablet specific restrictions, e.g. no support for drag-and-drop, but tablet specific restrictions, e.g. no support for drag-and-drop, but
also omits tablet specific features like reporting pen pressure. 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="" />* *<tablet><map button="" to="" />*
Pen and pad buttons behave like regular mouse buttons.With mouse Pen and pad buttons behave like regular mouse buttons.With mouse
emulation set to "no", which is the default, and if not specified emulation set to "no", which is the default, and if not specified

View file

@ -114,6 +114,7 @@ enum action_type {
ACTION_TYPE_SHADE, ACTION_TYPE_SHADE,
ACTION_TYPE_UNSHADE, ACTION_TYPE_UNSHADE,
ACTION_TYPE_TOGGLE_SHADE, ACTION_TYPE_TOGGLE_SHADE,
ACTION_TYPE_TOGGLE_TABLET_MOUSE_EMULATION,
ACTION_TYPE_TOGGLE_MAGNIFY, ACTION_TYPE_TOGGLE_MAGNIFY,
ACTION_TYPE_ZOOM_IN, ACTION_TYPE_ZOOM_IN,
ACTION_TYPE_ZOOM_OUT ACTION_TYPE_ZOOM_OUT
@ -172,6 +173,7 @@ const char *action_names[] = {
"Shade", "Shade",
"Unshade", "Unshade",
"ToggleShade", "ToggleShade",
"ToggleTabletMouseEmulation",
"ToggleMagnify", "ToggleMagnify",
"ZoomIn", "ZoomIn",
"ZoomOut", "ZoomOut",
@ -1111,6 +1113,9 @@ actions_run(struct view *activator, struct server *server,
view_set_shade(view, false); view_set_shade(view, false);
} }
break; break;
case ACTION_TYPE_TOGGLE_TABLET_MOUSE_EMULATION:
rc.tablet.force_mouse_emulation = !rc.tablet.force_mouse_emulation;
break;
case ACTION_TYPE_TOGGLE_MAGNIFY: case ACTION_TYPE_TOGGLE_MAGNIFY:
magnify_toggle(server); magnify_toggle(server);
break; break;