-
-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModelSpinner - use middle mouse button to spin model #5594
base: master
Are you sure you want to change the base?
ModelSpinner - use middle mouse button to spin model #5594
Conversation
Also, in my opinion there is a problem with this patch - what to do for people like me - without the middle button (touchpad only) - in other places there is either the ability to twist it with the numpad, or there is a button on the panel for this. |
Would an option in the settings work? 'No middle button present' |
Tried it out and it seem to work well. There is now a setting option that will set the mousebutton to '0', the old value, instead. I've been wrestling with the compiler for a couple of hours which is reflected in the variable names. I'll clean that up should this function be wanted. |
@zonkmachine I like the option idea, but I think the option is very global, and it seems that it should somehow affect other places as well - Sector Map, System Map, World View. For example, a person who has a middle button activates this checkbox, but his middle button will still work, which seems odd? |
The other MMB rotation screens have a "left click and hold"-button [to rotate], no? |
@impaktor WorldView no. |
Yes, I just picked the ones mentioned in the issue to try it out. I think I got a better grip of the issue now and I've pushed similar changes for the places you mention here. I don't know if there is an instance of rotation that I've missed. |
I tested the last commit and it seems to work well, I would definitely enable this option for myself. What do you think about it, @impaktor? |
So if no middle mouse button (option is selected), you rotate with some other mouse button? Or how does this work? What's the trade off? Also, are there no tooltip for the other control options in the settings menu? (If there are, then this should also have, explaining it changes how to rotate ships and maps) |
No trade off. If you don't have a middle mouse button you go back to the old way with the left mouse button. Now also implemented so all spin actions work the same, with either middle mouse button or left mouse button.
I haven't seen any for the other options. |
But left mouse button does other things in some of the screens, right? Like in the maps? (Pardon me being too lazy to read the source, or start the game or test the PR) |
Yes but we already test for hover on. Pioneer knows if you, for instance in the Sector View where you can grab the scene and spin it, or use the button on the right side and grab that and spin it. Left mouse button both times.
I think that's the way to go. Grabbing something and manipulating it with a mouse is a complex thing to do. It's easy to see what the PR does when you test it and compare to how it is today. |
dc9de9c
to
4a194a4
Compare
Fixed up variable names and strings. Squashed and ready for review. Tested and works like a charm... :P |
@@ -245,6 +248,7 @@ class Input::Manager { | |||
|
|||
bool joystickEnabled; | |||
bool mouseYInvert; | |||
bool noMiddleMouseButton; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adopted to surrounding code here but shouldn't they be member variables, m_mouseYInvert, m_noMiddleMouseButton... etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically yes, they're this way for legacy reasons. Let me review the PR further before I make a decision as to whether it's worth converting them.
The "best" way to handle this IMO is to have this checkbox toggle on an additional code-path which looks for e.g. alt-LMB / ctrl-LMB and handles that as a middle-mouse press in all screens. The choice of key should most likely be configurable by the user as a binding, and all callsites which use MMB pan/rotate should be updated for this option. I believe this is how Mac software usually handles pan/rotate when both left+right mouse button have semantic actions already (though without the configurable modifier key). The advantage to this approach is it allows screens with already-heavily overloaded mouse actions (e.g. WorldView) to support interaction without MMB while not sacrificing the ability of the user to quickly perform important actions in combat or flight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several regressions with this option enabled:
- You can no longer left-click on systems in the Sector map to select them.
- Every time you pan in the System map you deselect the current selected object (changes tree visibility in the outliner and hides the info window).
- Same with the System atlas map, panning deselects the currently selected object.
- As mentioned in a separate comment, it becomes impossible to aim while firing in combat.
src/ship/ShipViewController.cpp
Outdated
const int mouseButton = (Pi::input->IsMiddleMouseButton() ? SDL_BUTTON_LEFT : SDL_BUTTON_MIDDLE); | ||
bool mouse_down = Pi::input->MouseButtonState(mouseButton); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unwilling to accept this as-is, given that the left-mouse button is overloaded to fire weapons while rotating the ship (in PlayerShipController IIRC). This means that as soon as the player starts firing in combat, their view is going to rotate wildly with every correction of the mouse while aiming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can probably be a problem if you have a mouse without a middle button or wheel, but in the case of a touchpad, it is pretty convenient to shoot with a spacebar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly, but the expectation for most people playing on desktop is they fire with a mouse button click. Spacebar for most people is mentally associated with "go up" rather than "shoot", especially in 6-DOF style games.
EDIT: either way, the feedback here would not affect the ability to fire with spacebar, but rather mentioning that the current version of the PR accidentally removes the ability to shoot with a mouse.
I think the aim of this PR is great: to unify MMB for spinning, and an checkbox option for those without MMB, to then use modifier-key + LMB, for instance. But as noted in the three last posts above, there's more to do before this PR is ready for review. Hope @zonkmachine finds time for this again at some point & rebase to prevent bitrot. |
Sorry for the late reply. I'm busy with real world stuff and won't have time to look into this anytime soon. I unfortunately failed to rebase it on current master. If someone want's to pick up this PR they are most welcome. |
* Make grab/spin action consistent and default to middle mouse button. * Option to use left mouse button in cases where no middle mouse button is available such as on a laptop.
4a194a4
to
fe53e62
Compare
Done. I'm looking into the feedback from the review. |
Maybe activate this only when landed/docked? |
Use middle mouse button in model spinner.
Fixes #5544