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

Option to hide mouse on inactivity #5094

Merged
merged 5 commits into from Apr 7, 2020
Merged

Conversation

vitor-k
Copy link
Contributor

@vitor-k vitor-k commented Feb 13, 2020

Add the option to hide the mouse cursor when a defined amount of time (currently 3s 2.5s)
Adresses/closes #4687.

There are a few things that could be implemented with this, but I'm not sure if they're necessary or desirable.

  • Changing how long the mouse inactivity should be before hiding
  • Counting the mouse click as activity
  • Hotkey to show/hide the mouse
  • The ability to change the option while emulation is running

Mouse clicks now count as activity and the setting can be changed while emulation is running.

After reading the comments and some deliberation, I decided to not implement in this PR neither hotkeys nor changing the mouse timeout. Both are rather niche features and could be easily implemented by someone passionate about it, if they decide the current amount of control over the mouse hiding is not enough.

UI change:
hide-mouse


This change is Reviewable

@adityaruplaha
Copy link
Contributor

adityaruplaha commented Feb 15, 2020

Can you please attach a screenshot as this is a UI change?

I haven't gone through the code yet, but since general suggestions based on my experience with apps that hide the mouse upon inactivity:

  1. I think the inactivity time should be adjustable. Something like:
    [x] Hide mouse pointer after: ______

  2. Mouse clicks should be treated as activity. Most apps do this, so why not keep it intuitive for the user?

  3. I don't think this requires a hotkey, as simply moving the mouse would make the pointer visible.

  4. I wouldn't see that as a vital, but being able to change the setting during emulation would be a nice-to-have.

Copy link
Member

@zhaowenlan1779 zhaowenlan1779 left a comment

I believe it would be much nicer, while not very hard, to make this setting changable while the system is on.

@@ -98,6 +98,8 @@ __declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
}
#endif

const int default_mouse_timeout = 3000;
Copy link
Member

@zhaowenlan1779 zhaowenlan1779 Feb 15, 2020

Choose a reason for hiding this comment

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

Suggested change
const int default_mouse_timeout = 3000;
constexpr int default_mouse_timeout = 3000;

@@ -956,6 +964,12 @@ void GMainWindow::BootGame(const QString& filename) {
}
status_bar_update_timer.start(2000);

if (UISettings::values.hide_mouse) {
mouse_hide_timer.start(default_mouse_timeout);
Copy link
Member

@zhaowenlan1779 zhaowenlan1779 Feb 15, 2020

Choose a reason for hiding this comment

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

Suggested change
mouse_hide_timer.start(default_mouse_timeout);
mouse_hide_timer.start();

@BreadFish64
Copy link
Contributor

BreadFish64 commented Feb 19, 2020

Changing how long the mouse inactivity should be before hiding

If it doesn't add complexity, sure

Counting the mouse click as activity

Definitely

Hotkey to show/hide the mouse

Not necessary

The ability to change the option while emulation is running

That would be ideal

@jroweboy
Copy link
Contributor

jroweboy commented Feb 22, 2020

Changing how long the mouse inactivity should be before hiding

I oppose adding an option for this. Just pick a good amount of time and leave it be. Someone somewhere will complain but its such an obscure setting that no one will ever want to maintain.

@Dragios
Copy link
Contributor

Dragios commented Mar 27, 2020

A bit glitchy sometimes with this option enabled. Cursor disappear sometimes when clicking on menu despite with activity
image

@Dragios
Copy link
Contributor

Dragios commented Apr 6, 2020

Looks good now. Can safely merge this.

@BreadFish64 BreadFish64 merged commit 23921e3 into citra-emu:master Apr 7, 2020
3 checks passed
bunnei added a commit to yuzu-emu/yuzu that referenced this pull request May 4, 2020
Port citra-emu/citra#5094: "yuzu: Option to hide mouse on inactivity"
@vitor-k vitor-k deleted the hide-mouse2 branch Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Hide mouse cursor
6 participants