Merge pull request #7782 from SaracenOne/windows_relative_cursor_fix
Fix relative cursor data in CAPTURED mouse mode on Windows.
This commit is contained in:
commit
3cab47adba
1 changed files with 3 additions and 2 deletions
|
@ -400,14 +400,15 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||||
if (mouse_mode==MOUSE_MODE_CAPTURED) {
|
if (mouse_mode==MOUSE_MODE_CAPTURED) {
|
||||||
|
|
||||||
Point2i c(video_mode.width/2,video_mode.height/2);
|
Point2i c(video_mode.width/2,video_mode.height/2);
|
||||||
|
old_x = c.x;
|
||||||
|
old_y = c.y;
|
||||||
|
|
||||||
if (Point2i(mm.x,mm.y)==c) {
|
if (Point2i(mm.x,mm.y)==c) {
|
||||||
center=c;
|
center=c;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Point2i ncenter(mm.x,mm.y);
|
Point2i ncenter(mm.x,mm.y);
|
||||||
mm.x = old_x + (mm.x-center.x);
|
|
||||||
mm.y = old_y + (mm.y-center.y);
|
|
||||||
center=ncenter;
|
center=ncenter;
|
||||||
POINT pos = { (int) c.x, (int) c.y };
|
POINT pos = { (int) c.x, (int) c.y };
|
||||||
ClientToScreen(hWnd, &pos);
|
ClientToScreen(hWnd, &pos);
|
||||||
|
|
Loading…
Reference in a new issue