[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] How to prevent mouse initialization in Pygame



> I attached keyboard (and mouse) and logged in using this keyboard. 
> This was very surprising to me but running my application from this 
> real console doesn’t require sudo to use pygame! Why do I need sudo 
> when running from SSH console?!

I think I can answer this. When your keyboard and mouse are plugged directly into a Linux box and you're sitting in front of the box using it regularly, the system has already started the X Window server, which is a root-level process, for you. 

When you log into the Linux box using ssh, you are given a text-only container/shell to play in. The X Window server is attached to a different login instance, not to you. So if you want to have access to the video sub-system from an ssh shell, you need to get root permission.

Alternatively, you could set up a VNC daemon server on the Pi to run when your desktop loads, and then from a remote computer, you could log into the Pi and control the desktop. I think that is more what you're looking for.


Michael