0

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?

2

1 Answer 1

1

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 loadkeys.

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.

1
  • Thanks! I need just one application, so, probably running it without any window manager is the best solution for me. Recompiling kernel sounds to be much more complex than I planned to do... Maybe, I can just disable SysRq button? Also, do you know is there any list of such magic key combinations? Oct 30, 2018 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.