How to disable VT/TTY switching via Alt+Fn keys
-
Hello, I have a Retropie project using the updated 4.4 image, running on a Raspberry Pi 3 B.
I'm using Attract Mode as the front end to launch DosBox and Linapple emulated games, so the primary controller is a keyboard. In order to prevent users from exiting Attract Mode, I disabled the keyboard shortcuts to exit the front end, as well as the ctrl-alt-del.target (switched the symlink to /dev/null), but I am having problems disabling the tty switching via Alt+Fn keys. The end user can still press Alt-F4 (for example) during emulation, which switches to a different virtual terminal but does not close the emulator, and leaves the pi in a state that requires a reboot.
I've tried to follow other posts online pertaining to Debian, Raspbian, and Jessie. Editing /etc/X11/xorg.conf and adding
Section "ServerFlags"
Option "DontVTSwitch" "true"
EndSectionThat didn't work, unfortunately. I'm wondering where the functionality for these key combinations is stored and if I can disable them. Thanks.
-
Modify
/etc/default/console-setup
and setACTIVE_CONSOLES="/dev/tty1
so only the 1st TTY is active. -
Thanks for the reply. I tried editing /etc/default/console-setup and changed ACTIVE_CONSOLES="/dev/tty1" but I can still switch to tty2,3, and 6 by pressing the corresponding Fn keys while holding alt. Tty4 and tty5 seem to be disabled, so maybe I'm missing something and the other 3 are being activated at login?
I also edited NAutoVTs=1 in my systemd logind.conf, but this also hasn't stopped the additional TTYs from appearing.
[UPDATE]
Had a feeling the TTYs still active were being started somewhere at boot. Checked my /boot/cmdline.txt and changed console=tty3 to console=tty1 and now Alt+F3 is disabled!Still need to disable Alt+F2 and Alt+F6. Any suggestions are appreciated!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.