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

[WIP] Feature pointerlock #573

Closed
wants to merge 4 commits into from

Conversation

Yanrishatum
Copy link
Contributor

@Yanrishatum Yanrishatum commented Mar 21, 2019

Resolves #568
Implements API allowing for locking mouse for relative free movement and locking mouse inside game boundaries.

There are currently unresolved questions regarding implementation pending. See here #568 (comment)

Todo:

  • JS: lock/unlockPointer.
    • Should pass movement when mouse was unlocked by user?
    • Should ignore click that relocks mouse?
  • JS: windowLock. Should be implemented at all?
  • SDL: lock/unlockPointer. Automatic unlocking when game loose focus is handled by SDL.
  • SDL: windowLock. Need to expose SDL api.
  • DirectX: lock/unlockPointer.
  • DirectX: windowLock.
  • Flash: Reimplmenet lock/unlockPointer. Should be implemented?
  • Flash: windowLock. Should be implemented?
  • General: windowLock naming convention?

Edit 26/05/20: Dropping flash/DX in favor of having it at least for JS/SDL. Also dropping windowLock.

@Yanrishatum
Copy link
Contributor Author

I'm closing this PR, as I'm working on a slightly different re-implementation of it, which will require changes to hlsdl/hldx (HLSDL is already fully functioning, but HLDX still needs some work with cursor capture). When ready, new PR will introduce:

  • SDL, DirectX and JS pointer lock (i.e. hide cursor, suppress EMouseMove and delegate relative mouse movement to the callback.
  • SDL and DirectX window lock (i.e. trapping the cursor within window client area. Not possible on JS. For SDL and DX, pointer lock also implies window lock.
  • Not in Heaps API, but accessible via SDL/DX: Moving the cursor on the screen. Both relative to the window and in screen-space.

@ncannasse
Copy link
Member

Nice :)

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.

pointer/mouse lock support
2 participants