Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Make mouse locking optional#518

Merged
cgutman merged 8 commits intomoonlight-stream:masterfrom
tomciaaa:master
Jul 4, 2022
Merged

Make mouse locking optional#518
cgutman merged 8 commits intomoonlight-stream:masterfrom
tomciaaa:master

Conversation

@tomciaaa
Copy link
Copy Markdown
Contributor

Make mouse locking optional

Mouse-locking breaks tap-to-click functionality on a chromebook's touchpad (see https://bugs.chromium.org/p/chromium/issues/detail?id=1335564). My primary use-case are point-and-click games which do not rely on infinite mouse movement but only on absolute mouse position on-screen. Hence I would like to make mouse-locking optional in moonlight.

Changes proposed in this pull request:

  • Add 'Mouse locking' checkbox in the main moonlight window
  • Pass the 'mouse locking' state to the NaCl moonlight component
  • This is then accessed in input processing code (input.cpp) to either use the old behaviour or not lock the mouse pointer anymore
  • In the new behaviour all input events that are received are processed irrespective of mouse-locking and instead of relative mouse movements, absolute mouse position is sent instead

@moonlight-stream

@tomciaaa tomciaaa marked this pull request as ready for review June 25, 2022 18:09
@tomciaaa
Copy link
Copy Markdown
Contributor Author

As the linked bug-report on Chrome OS tracker doesn't seem like it's going anywhere soon, I'd like to merge this PR if possible.

On the failed appveyor build, I believe that's an existing issue with bundled Google cert expiring, if I remove the lines forcing the use of the bundled cert the build works fine on my machine.

Thanks

index.html Outdated
<i class="mdl-icon-toggle__label material-icons">mouse</i>
</label>
<div id="mouseLockTooltip" class="mdl-tooltip" for="mouseLockBtn">
Enable mouseLocking (must disable to use tap-to-click on touchpads)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"mouseLocking" -> "mouse locking"

input.cpp Outdated
case PP_INPUTEVENT_TYPE_MOUSEDOWN: {
// Lock the mouse cursor when the user clicks on the stream
if (!m_MouseLocked) {
if (m_MouseLockingFeatureEnabled && !m_MouseLocked) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should still provide toggleable input capture behavior like what Moonlight Qt does when in remote desktop mouse mode, otherwise it is impossible to uncapture input to use the shortcut keys required to exit fullscreen.

When mouse locking is disabled and the user presses Ctrl+Alt+Shift, we should:

  • Toggle cursor visibility
  • Toggle ignoring keyboard and mouse input

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your feedback. I'm happy to implement the change, but personally I've not used the Ctrl+Alt+Shift shortcut as both of my chromebooks (and so I assumed all chromebooks) feature function keys to toggle the fullscreen and window-switching functionality, which I found a more obvious way to navigate.

tomciaaa added 3 commits July 2, 2022 17:16
Previously Ctrl+Alt+Shift+Q would leave the `m_WaitingForAllModifiersUp`
flag set, causing a reconnect to lose-focus on first key-up event.
@tomciaaa tomciaaa requested a review from cgutman July 2, 2022 20:20
@cgutman cgutman merged commit 765e104 into moonlight-stream:master Jul 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants