Hi

I was trying to play this game: https://pyweek.org/e/wasabi24/
Instructions for dependencies installation to run from source: https://pyweek.org/d/6353/#13456

Besides of getting it working on windows because of the dependencies, I found that I could not rotate. The rotation is calculated depending on the x position of the mouse.

The effect that I'm seeing is that the coordinates snap back to a certain value. But is seems inaccurate [1]. Strangely enough others had not problems on windows (bit I don't know which version of win, python and libs where used).

Looking at the code for exclusive mouse I see that setCursosPosition is called. But this does trigger a WM_MOUSEMOVE event again.

Others seem to have same issues too:
https://stackoverflow.com/questions/20809958/how-to-track-mouse-movements-without-limiting-it-to-screen-size
https://stackoverflow.com/questions/10575377/move-mouse-cursor-without-triggering-a-wm-mousemove


I have tried the one quick fix suggestion without success:

In set_mouse_position(), line 446 in ...\pyglet\window\win32\__init__.py:

    def set_mouse_position(self, x, y, absolute=False):
        if not absolute:
            rect = RECT()
            _user32.GetClientRect(self._view_hwnd, byref(rect))
            _user32.MapWindowPoints(self._view_hwnd, HWND_DESKTOP, byref(rect), 2)

            x = x + rect.left
            y = rect.top + (rect.bottom - rect.top) - y

        _user32.SetCursorPos(x, y)
*        msg = MSG()**
**        while _user32.PeekMessageW(msg, NULL, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE):**
**            pass*

The other solution to use raw input seems to be a bit more complicated (this would need a change of the entire exclusive mode) and I'm not enough knowledged with ctypes and win libs to do it myself.


Does anyone else have this problem too? Maybe its only noticeable with the 64bit version of python? (I have not tried the 32bit version).


Here the version information:

 * Win 10  Home 1709, 64bit
 * python 3.6 *64bit*
 * pyglet 1.2.4  (pip installed)


[1]
here the printout moving my mouse *only to the right*:
!!! x, y <- print in _event_mousemove in pyglet
??? x, y, dx, dy <- print in on_mouse_motion in main.py of the game

!!! 300 400
!!! 300 400
!!! 300 400
!!! 299 400
??? 299 400 -1 0 ? 1.5707963267948966
!!! 300 400
!!! 303 400
??? 303 400 3 0 ? 1.5728907218972898
!!! 303 400
!!! 306 400
??? 306 400 3 0 ? 1.5666075365901102
!!! 308 400
??? 308 400 2 0 ? 1.5603243512829306
!!! 307 400
??? 307 400 -1 0 ? 1.5561355610781442
!!! 310 400
??? 310 400 3 0 ? 1.5582299561805375
!!! 309 400
??? 309 400 -1 0 ? 1.5519467708733579
!!! 309 400
!!! 312 400
??? 312 400 3 0 ? 1.5540411659757511
!!! 311 400
??? 311 400 -1 0 ? 1.5477579806685715
!!! 313 400
??? 313 400 2 0 ? 1.5498523757709648
!!! 313 400
!!! 315 400
??? 315 400 2 0 ? 1.5456635855661784
!!! 314 401
??? 314 399 -1 -1 ? 1.541474795361392
!!! 310 401
??? 310 399 -4 0 ? 1.5435691904637854
!!! 311 401
??? 311 399 1 0 ? 1.551946770873358
!!! 310 402
??? 310 398 -1 -1 ? 1.5498523757709648
!!! 309 400
??? 309 400 -1 2 ? 1.551946770873358
!!! 310 402
??? 310 398 1 -2 ? 1.5540411659757514
!!! 311 401
??? 311 399 1 1 ? 1.551946770873358
!!! 314 401
??? 314 399 3 0 ? 1.5498523757709648
!!! 312 400
??? 312 400 -2 1 ? 1.5435691904637852
!!! 312 400
!!! 314 400
??? 314 400 2 0 ? 1.5477579806685715
!!! 316 400
??? 316 400 2 0 ? 1.5435691904637852
!!! 317 400
??? 317 400 1 0 ? 1.5393804002589988
!!! 319 400
??? 319 400 2 0 ? 1.5372860051566055
!!! 309 400
??? 309 400 -10 0 ? 1.5330972149518192
!!! 322 400
??? 322 400 13 0 ? 1.5540411659757511
!!! 318 400
??? 318 400 -4 0 ? 1.5268140296446395
!!! 324 400
??? 324 400 6 0 ? 1.5351916100542122
!!! 324 400
!!! 320 400
??? 320 400 -4 0 ? 1.522625239439853
!!! 323 400
??? 323 400 3 0 ? 1.5310028198494257
!!! 321 400
??? 321 400 -2 0 ? 1.524719634542246
!!! 321 400
!!! 320 400
??? 320 400 -1 0 ? 1.5289084247470324
!!! 316 400
??? 316 400 -4 0 ? 1.5310028198494257
!!! 307 400
??? 307 400 -9 0 ? 1.5393804002589984
!!! 309 400
??? 309 400 2 0 ? 1.558229956180537
!!! 307 400
??? 307 400 -2 0 ? 1.5540411659757507
!!! 307 400
!!! 312 400
??? 312 400 5 0 ? 1.558229956180537
!!! 309 400
??? 309 400 -3 0 ? 1.547757980668571
!!! 306 400
??? 306 400 -3 0 ? 1.5540411659757507
!!! 305 400
??? 305 400 -1 0 ? 1.5603243512829303
!!! 307 400
??? 307 400 2 0 ? 1.5624187463853236
!!! 309 400
??? 309 400 2 0 ? 1.5582299561805373
!!! 310 400
??? 310 400 1 0 ? 1.554041165975751
!!! 311 400
??? 311 400 1 0 ? 1.5519467708733576
!!! 308 400
??? 308 400 -3 0 ? 1.5498523757709644
!!! 311 400
??? 311 400 3 0 ? 1.556135561078144
!!! 312 400
??? 312 400 1 0 ? 1.5498523757709644
!!! 306 400
??? 306 400 -6 0 ? 1.547757980668571
!!! 302 400
??? 302 400 -4 0 ? 1.5603243512829303
!!! 303 400
??? 303 400 1 0 ? 1.568701931692503
!!! 308 400
??? 308 400 5 0 ? 1.5666075365901098
!!! 309 400
??? 309 400 1 0 ? 1.5561355610781438
!!! 307 400
??? 307 400 -2 0 ? 1.5540411659757505
!!! 306 400
??? 306 400 -1 0 ? 1.5582299561805368
!!! 305 400
??? 305 400 -1 0 ? 1.5603243512829301
!!! 307 400
??? 307 400 2 0 ? 1.5624187463853234
!!! 307 400
!!! 309 400
??? 309 400 2 0 ? 1.558229956180537
!!! 309 400
!!! 306 400
??? 306 400 -3 0 ? 1.5540411659757507
!!! 303 400
??? 303 400 -3 0 ? 1.5603243512829303
!!! 301 400
??? 301 400 -2 0 ? 1.56660753659011
!!! 301 400
!!! 309 400
??? 309 400 8 0 ? 1.5707963267948963
!!! 303 400
??? 303 400 -6 0 ? 1.5540411659757507
!!! 309 400
??? 309 400 6 0 ? 1.56660753659011
!!! 308 400
??? 308 400 -1 0 ? 1.5540411659757507
!!! 305 400
??? 305 400 -3 0 ? 1.556135561078144
!!! 306 400
??? 306 400 1 0 ? 1.5624187463853236
!!! 305 400
??? 305 400 -1 0 ? 1.5603243512829303
!!! 308 400
??? 308 400 3 0 ? 1.5624187463853236
!!! 303 400
??? 303 400 -5 0 ? 1.556135561078144
!!! 302 400
??? 302 400 -1 0 ? 1.56660753659011
!!! 301 400
??? 301 400 -1 0 ? 1.5687019316925033
!!! 301 400
!!! 300 400
!!! 301 400
??? 301 400 1 0 ? 1.5707963267948966
!!! 300 400
!!! 301 400
??? 301 400 1 0 ? 1.5687019316925033
!!! 301 400
!!! 300 400
!!! 300 400

--
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to