I've run into a strange issue where I want to hide the mouse in fullscreen 
mode, but if the mouse is initially centered in the screen then it will at 
first be visible until the mouse is moved. Here is some code that 
reproduces the issue:

import win32api

import pyglet
from pyglet.gl import *


class PrimaryWindow(pyglet.window.Window):

    screenWidth = 
pyglet.window.get_platform().get_default_display().get_default_screen().width
    screenHeight = 
pyglet.window.get_platform().get_default_display().get_default_screen().height

    def __init__(self):
        super(PrimaryWindow, self).__init__()
        self.set_caption('Test')
        self.set_fullscreen(True)
        self.set_mouse_visible(False)
        
        pyglet.clock.schedule_interval(self.update, 1/60)
        pyglet.app.run()


    def update(self, dt):
        win32api.SetCursorPos((int(self.screenWidth / 2) + 0, 
int(self.screenHeight / 2)))


if __name__ == '__main__':
    PrimaryWindow()





When I run this code the cursor is at first visible in the middle of the 
screen. However if the code is changed in the update() method so that the 
cursor is not in the center then it is invisible from the start.




def update(self, dt):
    win32api.SetCursorPos((int(self.screenWidth / 2) + 1, int(self.screenHeight 
/ 2)))



I'm using Windows 10 and pyglet 1.3.0.

-- 
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