Skip to content

Use Tab for Free-Cursor#595

Open
BoatFloater wants to merge 1 commit intoBasisVR:developerfrom
BoatFloater:tab_free_cursor
Open

Use Tab for Free-Cursor#595
BoatFloater wants to merge 1 commit intoBasisVR:developerfrom
BoatFloater:tab_free_cursor

Conversation

@BoatFloater
Copy link
Contributor

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:

  • Open Menu -> 1 unlock request; unlock the cursor
  • Press Tab -> 2 unlock requests
  • Release Tab -> 1 unlock request
  • Close Menu -> 0 unlock requests; lock the cursor

I also cleaned up the one situation I found where a UnlockCursor was called without a subsequent LockCursor, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant