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

tweak(input/five): release cursor capture for the game's cursor #2332

Merged

Conversation

blattersturm
Copy link
Contributor

@blattersturm blattersturm commented Jan 7, 2024

Custom bits of UI (NUI focus, as well as the F8 console/dear ImGui) do this already, which makes the game's mouse cursor (such as in the pause menu) behave differently.

This commit solves this by hooking up the QueryMayLockCursor event to a flag specifying if the cursor is visible.

Feature was requested in DMs by @summeryukata at some point:

is there a way to make fivem not confine the cursor
like, when i have f8 open i can drag it out no problem, but if I pause it keeps it locked to the window

Goal of this PR

Add a little feature for consistency.

How is this PR achieving the goal

Implements the feature.

This PR applies to the following area(s)

FiveM, rage:input:five

Successfully tested on

Game builds: 1604-3095

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

(force-pushed as commit signing did not work first try - used the wrong key for the committer identity, then forgot -S the second time)

@blattersturm blattersturm force-pushed the tweak/pause-menu-cursor-capture branch from 68c41ab to ce04dca Compare January 7, 2024 22:35
Custom bits of UI (NUI focus, as well as the F8 console/dear ImGui) do
this already, which makes the game's mouse cursor (such as in the pause
menu) behave differently.

This commit solves this by hooking up the QueryMayLockCursor event to a
flag specifying if the cursor is visible.
@blattersturm blattersturm force-pushed the tweak/pause-menu-cursor-capture branch from ce04dca to a4c7c06 Compare January 7, 2024 22:35
@nihonium-cfx nihonium-cfx added the needs manual verification PRs that need manual verification by testing the change locally label Jan 11, 2024
@nihonium-cfx nihonium-cfx self-assigned this Jan 16, 2024
@nihonium-cfx nihonium-cfx self-requested a review January 16, 2024 08:54
@nihonium-cfx nihonium-cfx added ready-to-merge This PR is enqueued for merging and removed needs manual verification PRs that need manual verification by testing the change locally labels Jan 16, 2024
@nihonium-cfx nihonium-cfx merged commit a57783c into citizenfx:master Jan 19, 2024
2 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR is enqueued for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants