RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    How to disable VT/TTY switching via Alt+Fn keys

    Scheduled Pinned Locked Moved Help and Support
    tty retropie
    3 Posts 2 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      MansomeLamb
      last edited by

      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"
      EndSection

      That didn't work, unfortunately. I'm wondering where the functionality for these key combinations is stored and if I can disable them. Thanks.

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        Modify /etc/default/console-setup and set ACTIVE_CONSOLES="/dev/tty1 so only the 1st TTY is active.

        1 Reply Last reply Reply Quote 0
        • M
          MansomeLamb
          last edited by MansomeLamb

          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!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          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.