Commit graph

9 commits

Author SHA1 Message Date
Yifan Zhu
1240ac1dfe plugins/buttonrebinds: correctly handle level 1 keys
Level 1 keys (e.g., !=Shift+1) need to have shift added.

BUG: 484367
2024-08-05 16:37:32 +00:00
Joshua Goins
34c2a36000 ButtonRebindsFilter: Support keyboard modifiers with mouse buttons
This is needed to better support emitting mouse button events when
pressing tablet buttons. It's common in many art programs that an action
is tied to a mouse button + a modifier, such as panning the canvas. So
being able to send keyboard modifiers in tandem with mouse buttons is
very useful when rebinding.

Tests are added for this new feature.

CCBUG: 469232
2024-07-29 15:46:44 +00:00
Joshua Goins
59699402ad ButtonRebindsFilter: Set cursor position when rebinding tablet events
Since the tablet cursor and the mouse cursor is tracked separately,
rebinding a tablet button to a mouse click is sort of wonky. For
example, if you assign it to Right Click and attempt to open a context
menu it will appear to open in the wrong place.

So before we send the mouse button event, set the mouse position to
the tablet cursor position. A test is added to ensure this functionality
works as intended and doesn't regress.
2024-07-23 01:36:33 +00:00
Joshua Goins
fd670453e5 ButtonRebindsFilter: Modify testBindingTabletTool to use proximity
This is to not destroy the tablet state for the next test (which is
added in the next commit.) We could also explicitly do a tablet tool
up/down dance here, but all we need is the tablet tool to be in
proximity for the tablet button event to fire.
2024-07-23 01:36:33 +00:00
Joshua Goins
abc6dae6df ButtonsRebindFilter: Add tests for the tablet binding types
This adds autotests for binding to tablet pad and tool buttons, which
was previously untested. Of note is that we don't explicitly test mouse
buttons, which is already tested in the other functions.
2024-07-22 20:39:19 -04:00
Joshua Goins
0ea1bcfe89 ButtonRebindsFilter: Add test for disabled bindings
This was missed when it was first implemented, but now there's tests for
checking if bindings can be disabled in the buttons rebind plugin.
2024-07-23 00:38:36 +00:00
Joshua Goins
47a538e61c ButtonRebindsFilter: Add test for mouse button binding
This was missed when it was first implemented, but now there's tests for
checking the mouse binding functionality in the buttons rebind plugin.
2024-07-23 00:38:36 +00:00
Yifan Zhu
09d4f3fda3 xkb: support converting Qt keys to keysyms
QXkbCommon::toKeysym doesn't correctly handle the case where a single Qt
key map to multiple keysyms.

BUG: 482847
2024-05-27 18:27:33 +00:00
Aleix Pol
ac9b9a6772 buttonrebinds: Introduce tests
Should help make sure the rebind feature stays working.
2024-03-14 14:39:00 -07:00