Bug 213046 - graphical console should allow vt switching
graphical console should allow vt switching
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: virt-manager (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Berrange
:
Depends On: 429052
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-30 12:46 EST by Matthias Clasen
Modified: 2008-06-23 15:25 EDT (History)
2 users (show)

See Also:
Fixed In Version: 5.2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-23 15:25:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
demo (5.00 KB, text/plain)
2006-11-01 10:16 EST, Matthias Clasen
no flags Details

  None (edit)
Description Matthias Clasen 2006-10-30 12:46:48 EST
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...
Comment 1 Daniel Berrange 2006-10-30 12:56:36 EST
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
Comment 2 RHEL Product and Program Management 2006-10-30 13:00:50 EST
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
inclusion.
Comment 3 Matthias Clasen 2006-10-31 08:41:55 EST
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.
Comment 4 Daniel Berrange 2006-10-31 08:59:11 EST
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.
Comment 5 Matthias Clasen 2006-10-31 11:18:05 EST
> 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.
Comment 6 Matthias Clasen 2006-10-31 11:25:22 EST
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.
Comment 7 Daniel Berrange 2006-10-31 11:27:12 EST
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.
Comment 8 Daniel Berrange 2006-10-31 11:27:59 EST
Ahh, thanks for the XKB info - I'll investigate this approach...
Comment 9 Matthias Clasen 2006-10-31 11:28:49 EST
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.
Comment 10 Matthias Clasen 2006-11-01 10:15:47 EST
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.
Comment 11 Matthias Clasen 2006-11-01 10:16:54 EST
Created attachment 139992 [details]
demo

Of course, the demo is in C and using XKB api, so it may not be trivial to
translate that into python code...
Comment 13 RHEL Product and Program Management 2007-09-07 16:02:36 EDT
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.
Comment 14 Daniel Berrange 2008-01-22 22:43:14 EST
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.
Comment 15 Cole Robinson 2008-06-23 15:25:18 EDT
As mentioned in previous comment, this functionality is available in 5.2.
Closing as CURRENTRELEASE.

Note You need to log in before you can comment on or make changes to this bug.