Skip to content
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

DolphinQt: Add option to always show Mouse Cursor #10121

Merged
merged 2 commits into from Oct 13, 2021

Conversation

malleoz
Copy link
Contributor

@malleoz malleoz commented Sep 23, 2021

Adds a toggle in Config->Interface to always keep the mouse cursor visible. It seemed unusual that this wasn't possible before in DolphinQt.

Additionally, a bug meant that the default behavior of the mouse re-appearing on movement did not work... The mouse would only re-appear on clicking. Thus, I've also included a bug fix for this.

Left is current Dolphin dev. Right is the changes made in this pull request.

@Rumi-Larry
Copy link

Wouldn't it be better if this was a radio button menu?
"Cursor hiding:
Default
Always
Never"

@malleoz
Copy link
Contributor Author

malleoz commented Sep 23, 2021

Wouldn't it be better if this was a radio button menu?
"Cursor hiding:
Default
Always
Never"

This seems like a much cleaner approach and will make end-user experience less confusing. I will apply this change later. Thanks for your suggestion!

@malleoz
Copy link
Contributor Author

malleoz commented Sep 23, 2021

Radio buttons have been added. I don't know if this was the cleanest way to implement the functionality (particularly my use of the enum).

@mbc07
Copy link
Contributor

mbc07 commented Sep 23, 2021

Small nitpick but I think it's important to have "cursor" in the Group Box title, the current "Hide Mouse" title can be a bit ambiguous. I would probably go with "Mouse Cursor Hiding"...

@malleoz malleoz force-pushed the game-window-cursor-always-on branch 3 times, most recently from ff4403d to e87c633 Compare September 23, 2021 23:31
@Rumi-Larry
Copy link

Rumi-Larry commented Sep 23, 2021

I think the header could read "Mouse Cursor Visibility" but the options "Always" and "Never" should be swapped.
Instead of "Delay" that option could be called "On Movement" with the description reading "Mouse cursor hides after a certain time of inactivity and reappears when it moves again"

@malleoz
Copy link
Contributor Author

malleoz commented Sep 24, 2021

I think the header could read "Mouse Cursor Visibility" but the options "Always" and "Never" should be swapped.
Instead of "Delay" that option could be called "On Movement" with the description reading "Mouse cursor hides after a certain time of inactivity and reappears when it moves again"

I agree again. I do think Delay was a bit ambiguous and switching the header and the radio button label gives a better explanation.

Although, the mouse cursor, when hidden after the timer expires, does NOT reappear on movement. It actually reappears on the next click...

That being said, should the behavior instead by changed to make the cursor visible on movement, or keep it on click?

EDIT: Turns out that's a bug. Looks like the implementation assumes that the timer resets on mouse movement, but it's written within a case statement checking for MouseButtonPress... Gonna fix that and update the commit

@malleoz malleoz force-pushed the game-window-cursor-always-on branch 4 times, most recently from a079bc6 to 011b1be Compare September 24, 2021 02:32
@malleoz malleoz changed the title DolphinQt: Add option for Never Hide Mouse Cursor DolphinQt: Add option to always show Mouse Cursor Sep 24, 2021
@MayImilae
Copy link
Contributor

UI looks good to me. However I have a small question - with the On Movement setting, how long after movement is stopped until the mouse cursor disappears?

@malleoz
Copy link
Contributor Author

malleoz commented Sep 30, 2021

UI looks good to me. However I have a small question - with the On Movement setting, how long after movement is stopped until the mouse cursor disappears?

It is currently set to disappear after 3 seconds of inactivity which is the default behavior prior to this PR.

@Rumi-Larry
Copy link

UI looks good to me. However I have a small question - with the On Movement setting, how long after movement is stopped until the mouse cursor disappears?

It is currently set to disappear after 3 seconds of inactivity which is the default behavior prior to this PR.

I think one and a half seconds can be the default time.

@JosJuice
Copy link
Member

JosJuice commented Oct 6, 2021

I think 3 seconds is fine. If we want to change it, let's do it in a separate PR so this one doesn't get bikeshedded to hell.

Copy link
Member

@leoetlino leoetlino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Filoppi and @malleoz)


Source/Core/Core/ConfigManager.h, line 150 at r1 (raw file):

  bool bConfirmStop = false;

  enum ShowCursor

enum class


Source/Core/Core/ConfigManager.h, line 154 at r1 (raw file):

    Never,
    Constantly,
    Movement

"OnMovement" for consistency with the other options? Also please add a trailing comma here.

Previously the unhide of movement mouse_timer reset occurred within case MouseButtonPress.

Additionally, there was a redundant expression in the if statement for cursor locking.
Instead of having a single GUI checkbox for "Always Hide Mouse Cursor",
I have instead opted to use radio buttons so the user can swap between
different states of mouse visibility. "Movement" is the default
behavior, "Never" will hide the mouse cursor the entire time the game is
running, and "Always" will keep the mouse cursor always visible.
@malleoz malleoz force-pushed the game-window-cursor-always-on branch from 45848b3 to 2aa400e Compare October 13, 2021 01:05
Copy link
Member

@leoetlino leoetlino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Filoppi)

@leoetlino leoetlino merged commit 4541abd into dolphin-emu:master Oct 13, 2021
10 checks passed
@malleoz malleoz deleted the game-window-cursor-always-on branch October 13, 2021 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants