I am creating a kiosk-mode program for Raspberry Pi, using Raspbian +Python/Tkinter. I need to have keyboard attached, so the user is able to enter a password, but I need to prevent the user from getting out of the program using any means (basically, disable any special key combinations including CTRL-ESC, ALT-TAB etc.) What is the best way to do it? If it is easier to do using some other technology stack (not Python? not Tkinter?), what would you recommend?
If you need to run a single application, you can lock the user in it by not starting any window manager at all: you'll get a single window occupying the entire screen with no "desktop" controls whatsoever. This can be achieved by editing
.xinitrc file. Additionally, you can disable switching to virtual consoles using
If you need the user to access multiple applications, start a simple window manager like
twm which can be configured not to have any menus.
In both cases, you will want to write a script which checks that the programs you intend to show to the user are still running, because if the user closes them, they will be stuck with an empty desktop with no obvious ways of starting any app or rebooting.
Note that users will still be able to e.g. reboot by pressing Alt+SysRq+b, unless you recompile the kernel with disabled magic keys.