Results 1 to 3 of 3

Thread: DontVTSwitch doesn't pass through Ctrl-Alt-(Shift)-Fn to applications

  1. #1
    Join Date
    Jun 2011

    DontVTSwitch doesn't pass through Ctrl-Alt-(Shift)-Fn to applications

    I recently upgraded to the latest version of Ubuntu (11.04) on my PC. I'm using the default Confity interface.

    I have an application (Emacs) which uses many keyboard shortcuts of the form Ctrl-Alt-Fn or Ctrl-Alt-Shift-Fn.

    I have managed to insert this
    Section "ServerFlags"
    Option "DontVTSwitch" "true"

    into my /etc/X11/xorg.conf

    It partly works: Ctrl-Alt-Fn (with or without shift) no longer invokes virtual terminal n.

    But, the Ctrl-Alt-Fn keystrokes don't get fed through to the applications.

    An easy way to see this is to go to System Settings => Keyboard Shortcuts and try and define a new shortcut. For example, I can define any one of F5, Shift-F5, Alt-F5, Ctrl-F5, Shift-F5, Ctrl-Shift-F5, Alt-Shift-F5, but not Ctrl-Alt-F5 or Ctrl-Alt-Shift-F5. When I type one of the last two, it just sits there as if I did nothing at all.

    I've seen many discussions on the web about disabling Ctrl-Alt-Fn keys, and explanations about DontVTSwitch, but I haven't seen anyone confirm that DontVTSwitch actually passes the desired keystrokes through to their application. Is this a known bug?

    Relevant quote from :
    Option "DontVTSwitch" "boolean" This disallows the use of the Ctrl+Alt+Fn sequence (where Fn refers to one of the numbered function keys). That sequence is normally used to switch to another "virtual terminal" on operating systems that have this feature. When this option is enabled, that key sequence has no special meaning and is passed to clients. Default: off

    Side note: if I really really want to invoke a non-X terminal (for some reason), I can use Alt-SysReq-r etc. I don't want to disable the virtual terminals. I just want to disable how X handles those key combinations, so I can have them in my application.

  2. #2
    Join Date
    Jun 2011

    Post Re: DontVTSwitch doesn't pass through Ctrl-Alt-(Shift)-Fn to applications

    I think I have found the answer to my own question, which is to also add this to xorg.conf:

    Section "InputClass"
        Identifier "keyboard defaults"
        MatchIsKeyboard "on"
        Option "XKbOptions" "srvrkeys:none"
    The srvrkeys:none option points to a rule +srvr_ctrl(no_srvr_keys) in /usr/share/X11/xkb/rules/evdev which points to a rule in /usr/share/X11/xkb/symbols/srvr_ctrl which suppresses the standard interpretation of the Ctrl-Alt-Fn key strokes.

    And you can still do Alt-Sysrq-r and then Ctrl-Alt-Fn to access a console.

    It follows that the documentation for the DontVTSwitch option in xorg.conf(5x) is wrong, i.e. that option by itself does not cause events to be "passed to clients". (Maybe some of the other "Dont" options are also incorrectly documented.)

  3. #3
    Join Date
    Dec 2010
    Ubuntu Development Release

    Re: DontVTSwitch doesn't pass through Ctrl-Alt-(Shift)-Fn to applications

    Cool. I was looking for a way to disable breaking out of X, and your srvrkeys:none trick worked like a charm

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts