Red Hat Bugzilla – Bug 213046
graphical console should allow vt switching
Last modified: 2008-06-23 15:25:18 EDT
It would be nice if there was a gui way to switch vt's, otherwise you always
have to log in to do a chvt, and if you end up on a vt where you cannot log in,
you are stuck...
We already do a full keyboard grab when the mouse enters the window. This
doesn't stop X processing the VT switch bindings. So even with the keygrab,
Ctrl+Alt+F* still switches the local VT, not the remote one. Any ideas for how
to stop X processing the Ctrl+Alt+F* sequences when keyboard grab is active are
welcome, but we can't find any thus far....
Thus to get around this we implemented 'sticky' modifier keys. eg, if you tap a
modifier key 3-times in a row, it sticks on until the next non-modifier key is
released. So you can do 'Ctrl Ctrl Ctrl Alt+F1' to simulate Ctrl+Alt+F1
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release. Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release. This request is not yet committed for
Have you investigated how vmware captures the Ctrl-Alt-Fn events ?
I think Ctrl Ctrl Ctrl is a bit too undiscoverable to be of much use.
I would expect to simply add a "Switch VT" menuitem, which could then
ask for the number of the vt to switch to.
A 'Switch VT' menu item is rather Linux specific. We need to find a more general
solution to the problem, since other OS will have different actions which can be
affected. Probably need to have some tool-bar buttons to let you graphically
press 'Ctrl' or 'Alt' or a number of other special modifier keys.
I've been unable to figure out how VMWare manages it since they're obviously
closed source. I was hoping the XKeyboardGrab would do the trick. The only way
to block it found thus far is to use xmodmap to explicitly unmap all the
VT_Switch keyboard symbol, but this is a rather permanent & global change - we
only want to block them when we have keyboard focus.
> A 'Switch VT' menu item is rather Linux specific. We need to find a more general
> solution to the problem, since other OS will have different actions which can be
> affected. Probably need to have some tool-bar buttons to let you graphically
> press 'Ctrl' or 'Alt' or a number of other special modifier keys.
I strongly disagree. Having "Ctrl" and "Alt" buttons in the toolbar is
ridiculous from a ui perspective. If you want a good interface, it will have to
be specific to the capabilities of the underlying system. If this is
linux-specific, fine. Just provide a configure switch to not build it on systems
where it does not make sense.
Actually, Ray just reminds me that XKB has means to reconfigure the action bound
to the Switch_VT keysym. Thats probably the best route to explore.
Also, Ray explained to me why a "Switch VT" button does not make much sense in
general, because it depends on the gues OS that is running inside whether it makes
sense or not. Ray proposed to have a "Grab Keyboard" menuitem instead. The way
it would work is that if "grab keyboard" is turned on, the console window would
on focus-in reconfigure xkb to not do the Switch_VT action, and grab those keys
itself, and undo the xkb reconfiguration on focus-out.
The trouble is that this isn't dependant on the capabilities of the host system
being used, so a compile/configure switch is useless. The set of key shortcuts
we need to pass to a guest is the dependant on what guest operating system we
are running in the console - which we have no way to find out.
Ahh, thanks for the XKB info - I'll investigate this approach...
I had some fun last night trying to figure out how to use XKB to unbind the
switch vt action. I'll attach a little test program that shows how it can be done.
If you run it, it will prevent Ctrl-Alt-Fn to switch vts whenever it has focus.
It also tries to do the same thing for TerminateServer (Ctrl-Alt-Backspace), but
that does not work due to X server bugs.
Created attachment 139992 [details]
Of course, the demo is in C and using XKB api, so it may not be trivial to
translate that into python code...
This request was previously evaluated by Red Hat Product Management
for inclusion in the current Red Hat Enterprise Linux release, but
Red Hat was unable to resolve it in time. This request will be
reviewed for a future Red Hat Enterprise Linux release.
In RHEL-5.2, virt-manager-0.5.3 has a menu which allows sending of the
Ctrl+Alt+Fn, and Ctrl+Aalt+Backspace, Delete sequences.
As mentioned in previous comment, this functionality is available in 5.2.
Closing as CURRENTRELEASE.