PrusaSlicer
PrusaSlicer copied to clipboard
Custom mouse bindings
Version
2.2.0
Feature request:
I would like to be able to set my custom mouse buttons bindings to match my other 3D software.
Pan/Zoom/Orbit should be cutomizable.
I just had a look at the function where this is handled and it's 400 lines of nested if-else clauses with hard-coded mouse buttons, so I think it would take quite some effort to implement this.
I could make a try if I knew the devs didn't mind a major refactoring of GLCanvas3D::on_mouse
I may be off base here, but in looking through that function it looks as if the panning and orbiting is done in the following else if chain: (slic3r\GUI\GLCanvas3D.cpp Ln 3344)
else if (evt.LeftIsDown()) {
// if dragging over blank area with left button, rotate
[...]
}
else if (evt.MiddleIsDown() || evt.RightIsDown()) {
// If dragging over blank area with right button, pan.
[...]
}
Which, if that's the case and there's no Gotcha (maybe a big If), then perhaps something like this would work:
//Define some styles of pan/orbit, presumably from other programs
typedef enum mouse_pan_orbit_setting_e
{
pan_orbit_default,
pan_orbit_cura
pan_orbit_fusion360,
} mouse_pan_orbit_setting_e;
mouse_pan_orbit_setting_e mouse_pan_orbit_type = pan_orbit_default;
// get a setting based on, presumably based on something in the preference menus
mouse_pan_orbit_type = mouse_pan_orbit_preference_setting;
//Some placeholders for what the else ifs are checking for.
//(Not sure if evt.LeftIsDown() etc actually returns a bool)
bool mouse_orbit_is_down = false;
bool mouse_pan_is_down = false;
//Change up the trigger flags based on desired settings
switch(mouse_pan_orbit_type)
{
case pan_orbit_default:
mouse_orbit_is_down = evt.LeftDown();
mouse_pan_is_down = (evt.RightDown() || evt.MiddleDown());
break;
case pan_orbit_cura:
mouse_orbit_is_down = evt.RightDown();
mouse_pan_is_down = evt.MiddleDown();
break;
case pan_orbit_cura:
//this one may not work b/c of the Shift+Click that might be handled elsewhere
mouse_orbit_is_down = evt.MiddleDown() && wxGetKeyState(WXK_SHIFT);
if(!mouse_orbit_is_down) { mouse_pan_is_down = evt.MiddleDown(); }
break;
default:
break;
}
with the relevant else if flags replaced like so:
else if (mouse_orbit_is_down) {
// if dragging over blank area with left button, rotate
[...]
}
else if (mouse_pan_is_down) {
// If dragging over blank area with right button, pan.
[...]
}
Might be worth a compile and check... (which i am conveniently not setup to do...)
@slipjigpoppys I was thinking some similar logic, but probably broken out into a separate control scheme class so that it would be easier to further extend it. There are some things that complicate it a little, for example gizmos and mouse buttons having different functions depending on if the mouse is over the plate or an object, but I think it should definitely be doable. Been quite busy with other projects, but I actually just started looking at this again yesterday evening, though as a patch for SuperSlicer after having had a chat with Merill. But it should also be portable to PrusaSlicer when it's done. If you're interested in joining the effort, come visit the SuperSlicer discord
No where near as clever as the guys above but perhaps a usage case might prompt, I use a CAD package (DesginSpark which is a free version of a commercial product, the dev's are unavailable) that does not have configurable Pan and Rotate. It would be great if both slicer and CAD package used the same keys!
What about this issue?
I did not continue working on this. Haven't checked the code if any Prusa3D devs have done any changes to the input handling that would make customisable mouse buttons easier to implement, or if it still looks the same (or even worse :))
+1 to this request
IMO, all software that manipulates 3D objects should have this customizable option.
Also upvoting. It's been a pain for years.
This would also potentially solve this issue https://github.com/prusa3d/PrusaSlicer/issues/5679 , which has a similar problem when painting custom support, as it paints instead of orbits when zoomed in.
+1
Why is this still even an open issue years later?
+1 to this request
Plus 10 here too. This would be a super nice to have in the preferences. Just switched to Orca (from Cura) and felt right at home and then some. This is and absolutely awesome slicer and I won't look back for a second. This is about the only gripe I have so far! :-) :-) :-) I design a lot and coming from CAD into the slicer always throws me off a little.
I design a lot and coming from CAD into the slicer always throws me off a little.
That's why I got myself a 3Dx SpacePilot. :-) I don't understand why every developer has to invent new controls...
Yes please. Prusa slicer seems to be doing everything reversed from what i would expect. Why is rotate on LMB, when it is also used to manipulate objects? Why are MMB and RMB doing the same thing (panning)? Also the speed of orbit is super fast, while panning is very slow. Would be nice to have those 2 speeds more balanced (or also adjustable). In short, a program like this should have customizable mouse controls.
(dont get me started on the lack of mouse-zoom-to-cursor, the weird center point of rotation when orbiting, or the fact that orbit also does a camera roll function)
I just had a look at the function where this is handled and it's 400 lines of nested if-else clauses with hard-coded mouse buttons, so I think it would take quite some effort to implement this.
I could make a try if I knew the devs didn't mind a major refactoring of GLCanvas3D::on_mouse
That doesn't sound to me like it's necessarily difficult. The hard coded references should be refactoring anyway.
Is there any progress on this? I'm looking forward for this feature
May 2020 -> March 2024, and this is still open?
There is no need to beat a dead horse here, but.... As so many have mentioned if you use almost any CAD software, its a complete pain to have to remember to flip your workflow around each time you switch between Prusa Slicer and CAD windows.
I'll throw my hat in here and say that I'd really like this. I use FreeCAD for design work, which shares its default mouse controls with Blender. In that state the middle-mouse button is Orbit, and L+R buttons are Pan. So it's inverted.
I just changed the navigation settings to "Blender based" for everything except Prusaslicer. I hope you'll update this soon.
+1 to this request
Add me to the +1
waiting on this as well
Me 2! All the other 3d programs are working with right mouse button. Please fix this soon!