Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have been having muscle memory issues trying to hold Tab to interact with UI elements without moving my head in desktop mode, which is a much nicer user experience. It also applies to interactables.
As part of this implementation, I refactored the way cursor lock/unlock requests worked, so please let me know if you disagree or maybe give me more context on the way it was before.
In this PR, the default case is to assume the cursor should be locked. If there is at least one unlock request, the cursor is unlocked. Once there are no unlock requests, the cursor is locked again. For example:
I also cleaned up the one situation I found where a
UnlockCursorwas called without a subsequentLockCursor, so there shouldn't be any dangling unlock requests. It would be pertinent to make sure moving forward that all Unlock requests have a matching Lock though.I only tested this in desktop as VR uses different logic and an override method, but it might be good to confirm that it still works as expected.