In my Python application running on Raspberry Pi under Raspbian I use Pygame to display some software-generated images via framebuffer. I don’t need any input from mouse, keyboard or any other devices, all I need is a convenient way of using framebuffer.
I initialize Pygame in the following way:
Problem #1: I have mouse pointer at the top left corner of Pygame-drawn images. I want mouse pointer to be hidden.
I know that I can disable mouse pointer using pygame.mouse.set_visible, but here comes
Problem #2: I have to run my application with sudo in order for pygame to not raise “
unable to open a console terminal” exception. But I want to run my application without root rights, because this increases my application’s security.There are some posts on forums that recommend setting SDL_NOMOUSE=1 environment variable before initializing pygame which should skip mouse initialization and maybe make it possible to get rid of sudo, but this doesn’t work for me: I still need to use sudo and mouse pointer is still there.
If this makes any difference, I have no mouse or keyboard attached to the Raspberry Pi, I connect to it using SSH.
I use
Pygame version 1.9.2~pre~r3348-2~bpo8+rpi1
libsdl-image1.2 version 1.2.12-5+b1
libsdl1.2debian version 1.2.15-10+rpi1
Does SDL_NOMOUSE work for anyone using recent Pygame versions?
Is it possible to skip mouse initialization in Pygame?
P.S. This question was originally posted on StackExchange, but it seems I chose the wrong section. For this reason or another, I haven’t got any straight answer yet, so I write here and hope for the best :)