We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4407 - Mouse position changes while in relative mouse mode SDL_SetRelativeMouseMode
Summary: Mouse position changes while in relative mouse mode SDL_SetRelativeMouseMode
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.9
Hardware: x86 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-01 16:40 UTC by ihcusk
Modified: 2018-12-01 17:22 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ihcusk 2018-12-01 16:40:22 UTC
From https://wiki.libsdl.org/SDL_SetRelativeMouseMode :
"Only relative motion events will be delivered, the mouse position will not change."

After disabling the relative mouse mode and moving the mouse, the cursor is in a different position than where it was before enabling the mode.

Example C program: https://pastebin.com/a2JNrMT8

Windows 7 32-bit, MinGW-w64 GCC 7.3.0, SDL 2.0.9
Comment 1 ihcusk 2018-12-01 16:55:59 UTC
(In reply to ihcusk from comment #0)
> From https://wiki.libsdl.org/SDL_SetRelativeMouseMode :
> "Only relative motion events will be delivered, the mouse position will not
> change."
> 
> After disabling the relative mouse mode and moving the mouse, the cursor is
> in a different position than where it was before enabling the mode.
> 
> Example C program: https://pastebin.com/a2JNrMT8
> 
> Windows 7 32-bit, MinGW-w64 GCC 7.3.0, SDL 2.0.9

Sorry, I meant:
After disabling the relative mouse mode, the cursor is in a different position than where it was before enabling the mode and moving the mouse.
Comment 2 ihcusk 2018-12-01 17:22:22 UTC
(In reply to ihcusk from comment #0)
> From https://wiki.libsdl.org/SDL_SetRelativeMouseMode :
> "Only relative motion events will be delivered, the mouse position will not
> change."
> 
> After disabling the relative mouse mode and moving the mouse, the cursor is
> in a different position than where it was before enabling the mode.
> 
> Example C program: https://pastebin.com/a2JNrMT8
> 
> Windows 7 32-bit, MinGW-w64 GCC 7.3.0, SDL 2.0.9

There is an error in the example program. Again, sorry.
Correct version: https://pastebin.com/hLQnkkRP