Kivy on Raspberry: Cursor is outside of window

Multi tool use


Kivy on Raspberry: Cursor is outside of window
I am developing a GUI on my RaspberryPi 3 using Python3 and Kivy 1.11.0dev. The GUI is working, it is running in fullscreen after start (as far a I know since Kivy 1.9.x it is not possible to run a Kivy app as a window) and the mouse cursor is visible. The only problem now is that the user can move the mouse out of the visible area if he goes too far to the left, right, up or down. If this happens, it is difficult to get the cursor back to the visible area.
I tried a lot to prevent that or to take the cursor back to window automatically but without success. From similar posts I tried things like this:
Window.bind(on_cursor_leave=self.on_leave)
def on_leave(self, *args):
if self.hold:
print('Cursor leaved Window')
# call api calls here
I also tried to grab the mouse
Window.bind(grab_mouse=self.on_leave)
Does anybody have a solution for putting the cursor back to the visible area after leaving or to set a border where the cursor can't leave?
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.