Add ability to assign None/Pan/Rotate to mouse buttons (#10736)

* Add logic to handle the left, middle and right buttons being assigned to do nothing, pan or rotate

* Add entries for setting the drag actions to preferences

* Allow the label text in preferences to wrap

* Show mouse mappings in Help -> Keyboard Shortcuts

* Re-add preferences in updated layout

* Add camera mouse options under camera

* Change mouse action strings to use L() for localization

* Display "None" when it is selected instead of blank in keyboard shortcuts

---------

Co-authored-by: Rob O <robertolabode@gmail.com>
Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
This commit is contained in:
r3dbaba
2026-05-17 20:54:21 -04:00
committed by GitHub
parent 6cf7db1ded
commit 1447602d43
5 changed files with 74 additions and 23 deletions

View File

@@ -1038,8 +1038,11 @@ public:
void on_set_focus(wxFocusEvent& evt);
void force_set_focus();
bool is_camera_rotate(const wxMouseEvent& evt, const bool buttonsSwapped) const;
bool is_camera_pan(const wxMouseEvent& evt, const bool buttonsSwapped) const;
enum class MouseButton { None, Left, Middle, Right };
enum class MouseAction { None, Pan, Rotation };
bool clicked_button_matches_action(const wxMouseEvent& evt, MouseAction action, const std::map<MouseButton, MouseAction>& mappings) const;
bool is_camera_rotate(const wxMouseEvent& evt, const std::map<MouseButton, MouseAction>& mappings) const;
bool is_camera_pan(const wxMouseEvent& evt, const std::map<MouseButton, MouseAction>& mappings) const;
Size get_canvas_size() const;
Vec2d get_local_mouse_position() const;