Bug 14045

Summary: Option "VTSysReq" doesn't work
Product: xorg Reporter: Matthias B. <haferfrost>
Component: Server/DDX/XorgAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: daniel, peter.hutterer
Version: 7.3 (2007.09)   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Matthias B. 2008-01-12 14:25:42 UTC
It seems that Option "VTSysReq" is broken. When I set it, I get the log message

(**) VTSysReq enabled

but it has no effect. Neither ist Ctrl-Alt-FX VT switching deactivated as xorg.conf(5) says it should be, nor does Alt-SysReq,F1 do anything.

I've tried all combinations of XkbDisable and HandleSpecialKeys and tested several different keyboard configurations. No effect.
Comment 1 Alan Coopersmith 2011-03-01 16:13:08 UTC
http://patchwork.freedesktop.org/patch/1413/
Comment 2 mycosys 2011-03-01 16:36:58 UTC
Would very much appreciate this feature being re-implimented.
Am using a mythtv system and keys on the HID remote i am using give ctrl-alt-f[1-4]. this gives a couple of problems:

1) Accidental keypress requires getting the kb out to hit ctrl-alt-f7
2) i would dearly love to be able to bind these keys to jump points.

since ctrl-alt-fn is pretty commonly used for application launch in windows KBs i am sure i am not the only one with this issue.

In searching for a workaround for this i have also noted that a LOT of VM users come across issues with this too - the host xserver will grab the ctrl-alt-fn and there is no way to pass it to the guest os, allowing this remap (or any other method of remapping these keys) would be invaluable for them too.

Am loathe to opt for "DontVTSwitch" as VT switching is invaluable in case of an issue with the system.
Alt-SysRq-Fn seems perfect - it is so rarely bound as to be perfect
Comment 3 Peter Hutterer 2011-03-01 16:42:42 UTC
On Tue, Mar 01, 2011 at 04:36:59PM -0800, bugzilla-daemon@freedesktop.org wrote:
> In searching for a workaround for this i have also noted that a LOT of VM users
> come across issues with this too - the host xserver will grab the ctrl-alt-fn
> and there is no way to pass it to the guest os, allowing this remap (or any
> other method of remapping these keys) would be invaluable for them too.

vt switching these days is implemented as XKB action (see XF86_Switch_VT_1).
the easiest way would be to add a xkeyboard-config option to disable these.

Or move them into a separate section and only include VT switching if
requested (similar to the Terminate_Server) but I worry that will generate
more hate-mail than I can handle.
Comment 4 Peter Hutterer 2011-03-01 16:49:28 UTC
> vt switching these days is implemented as XKB action (see XF86_Switch_VT_1).
> the easiest way would be to add a xkeyboard-config option to disable these.

setxkbmap -option srvkeys:none does exactly that I just found
Comment 5 mycosys 2011-03-01 16:58:02 UTC
Seems actually that modifying the symbols for /usr/share/X11/xkb/symbols/pc such that 
    key <FK01> {
        type="CTRL+ALT",
        symbols[Group1]= [ F1,  XF86_Switch_VT_1 ]
    };

becomes

    key <FK01> {
        type="PC_SYSRQ",
        symbols[Group1]= [ F1,  XF86_Switch_VT_1 ]
    };

for ea of FK[01-12] would emulate the old 'Option "VTSysReq"'
no idea how hard it would be to implement automatically for that option (for future people trying to use it)
Is this correct?


Suggest xorg.conf manpage be updated to reflect this change?
Comment 6 mycosys 2011-03-01 18:57:17 UTC
(In reply to comment #4)
> > vt switching these days is implemented as XKB action (see XF86_Switch_VT_1).
> > the easiest way would be to add a xkeyboard-config option to disable these.
> 
> setxkbmap -option srvkeys:none does exactly that I just found

Sorry Peter - i should have said before - this bug isnt about 'DisableVTSwitch' (would seem to be the behaviour you have described) but 'VTSysReq'.
Your answer tho pointed me in a direction though:

edit /usr/share/X11/xkb/symbols/srvr_ctrl and duplicate the section 
xkb_symbols "fkey2vt" 
change fkey2vt to VTSysReq and change CTRL+ALT in the new section to PC_SYSRQ

add   
srvrkeys:VTSysReq       Use Alt+SysRq+Fn for VTswitching rather than Ctrl+Alt+Fn
to /usr/share/X11/xkb/rules/evdev.lst

but how do i add   
srvrkeys:VTSysReq         =       +srvr_ctrl(VTSysReq)
to /usr/share/X11/xkb/rules since it says not to edit it directly but instead use rules/*.part, which i dont appear to have?

am i correct in thinking that would allow "setxkbmap -option srvkeys:VTSysReq" to give the same function as the old server flag VTSysReq or have i missed something?
Comment 7 Peter Hutterer 2011-03-01 19:09:16 UTC
> but how do i add   
> srvrkeys:VTSysReq         =       +srvr_ctrl(VTSysReq)
> to /usr/share/X11/xkb/rules since it says not to edit it directly but instead
> use rules/*.part, which i dont appear to have?

rules/base.o_s.part is the right file but you need xkeyboard-config from git
and build it yourself. for just testing on your box, ediging the rules file
directly will work.

> am i correct in thinking that would allow "setxkbmap -option srvkeys:VTSysReq"
> to give the same function as the old server flag VTSysReq or have i missed
> something?

I think you're correct, yes
Comment 8 Adam Jackson 2018-05-15 18:40:42 UTC
commit ac5881d6d0bcf4bcc66a5d6ddde4eca950db1a5b
Author: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Date:   Thu Sep 15 23:05:24 2011 +0600

    Remove unused vtSysreq
    
    Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
    Reviewed-by: Jamey Sharp <jamey@minilop.net>
    Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.