简体   繁体   中英

kivy application cursor don't show when over the window

While I was testing an uix example of Kivy (modalview.py), the cursor suddenly disappeared while over the application window. When I move out of the window, the cursor reappears. The cursor disappears only when it is inside the Kivy window, but I can still interact with the widgets (ie buttons, ...). Since then, I have this behaviour with any Kivy application and only these applications.

I have reinstalled Python and Kivy, I have restarted my computer, updated my touchpad and GPU drivers (even though there should be absolutely no reason, but I'm desperate...), nothing changes.

Any suggestion? Thanks!

I'm working with: Windows 10 Python 3.7.2 Kivy 1.10.1

The solution (thanks to inclement) is to simply check the Kivy settings.

The best way to access them (to me) is launching the "Settings.py" in "Lib\\site-packages\\kivy\\uix\u0026quot;.

From there, the "show/hide cursor" can be toggled on.

Even I had the exact same issue. The reason was that I ran a code and changed a setting unknowingly. I fixed the issue by running the program again and changed the settings. If you have this issue, you would find "Mouse Cursor" off. On the mouse cursor and the problem is fixed. What this does is, it directly changes the kivy settings. Thus, the change is permanent.

from kivy.app import App
from kivy.lang import Builder

from kivy.uix.boxlayout import BoxLayout

Builder.load_string('''
<Interface>:
    orientation: 'vertical'
    Button:
        text: 'Settings'
        font_size: 100
        on_release: app.open_settings()
''')


class Interface(BoxLayout):
    pass


class SettingsApp(App):
    def build(self):
        return Interface()


SettingsApp().run()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM