简体   繁体   English

当.py在RASPBIAN STRETCH LITE上启动时运行时,在kivy上的鼠标光标被隐藏

[英]Mouse cursor on kivy is hidden when .py runs as startup on RASPBIAN STRETCH LITE

I'm new in Kivy and this question might be silly, but I need to fix this issue. 我是Kivy的新手,这个问题可能很愚蠢,但我需要解决此问题。

I have a Kivy app running on raspberry pi stretch lite. 我有一个在树莓派Stretch Lite上运行的Kivy应用程序。 I set config.ini for Kivy mouse and it is working as long as it runs by: 我为Kivy鼠标设置了config.ini,并且只要它运行,它就可以正常工作:

python KivyTest.py

But if I set the file on startup mode doing this: 但是,如果我将文件设置为启动模式,请执行以下操作:

sudo nano /etc/rc.local

...then write: ...然后写:

sudo python //KivyTest.py &

...before the exit 0 ...在出口0之前

then after rebooting, py runs automatically but on this mode, the mouse is hidden and I can not see it. 然后重新启动后,py会自动运行,但是在此模式下,鼠标被隐藏了,我看不到它。 while it has an effect on buttons on Kivy app when I click it. 当我单击它时,它会对Kivy应用程序上的按钮产生影响。

Does anyone know what is the problem? 有谁知道这是什么问题?

side to side comparison 侧面比较

Since you are executing your application at startup in "/etc/rc.local" with "sudo" which means as a root-user, you need to make the same modifications to the "config.ini" file for showing the cursor in the following path: 由于您是在启动时使用“ sudo”在“ /etc/rc.local”中执行应用程序的,因此意味着“ root”用户,因此您需要对“ config.ini”文件进行相同的修改,以将光标显示在以下路径:

/root/.kivy/config.ini

as you did for "config.ini" in: 就像您在“ config.ini”中所做的那样:

~/.kivy/config.ini

PS The tilde (~) symbol stands for your home directory. PS代字号(〜)代表您的主目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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