[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Since chvt works, the problem must be the keymap

On Wed, May 02, 2007 at 19:47:44 -0400, cga2000 wrote:
> On Wed, May 02, 2007 at 09:27:35AM EDT, Florian Kulzer wrote:
> > On Wed, May 02, 2007 at 00:49:38 +0100, David Claughton wrote:
> > > Florian Kulzer wrote:
> > >
> > >> I would experiment like this:
> > >> xmodmap -e 'keycode  67 = F1 F13 XF86_Switch_VT_1'
> > >> xmodmap -e 'keycode  67 = F1 F13 F1 XF86_Switch_VT_1'
> > >> xmodmap -e 'keycode  67 = F1 F1 F1 XF86_Switch_VT_1'
> > >> xmodmap -e 'keycode  67 = F1 F13 F13 XF86_Switch_VT_1'
> > >
> > > Nope, none of these commands seem to work - all possible shift/alt/control 
> > > F1 combinations I tried after running each of these commands just got me an 
> > > error beep + a letter or two on the terminal, or it launched Gnome Help!
> > 
> > So much for that brilliant theory...
> It's certainly the one that makes the better sense.
> At least it's something I can understand.

I think I understand now why it did not work: There is more to this
keysym business than what meets the eye in the output of the xmodmap
commands as we have used them in this thread. Besides their symbols the
keys also have a "type" assigned to them and this type determines how
the additional keysyms are interpreted. The function keys should
normally be of type "CTRL+ALT" which means what the name suggests: They
always produce "Fn" except when used with CTRL and ALT together, in
which case the second keysym is registered. This type is defined here:

$ awk '/CTRL\+ALT/,/};/' /usr/share/X11/xkb/types/pc
    type "CTRL+ALT" {
        modifiers = Control+Alt;
        map[Control+Alt] = Level2;
        level_name[Level1] = "Base";
        level_name[Level2] = "Ctrl+Alt";

In David's case it turned out that he had the obsolete "uk" layout in
his xorg.conf instead of "gb" and because of this his X obviously did
not load the correct type definitions. Therefore he could only activate
the VT switching for SHIFT + F1.

If you specify an existing layout from /usr/share/X11/xkb/symbols/ then
everything seems to be taken care of by the "pc" file in that directory:

$ awk '/<FK01>/,/};/' /usr/share/X11/xkb/symbols/pc
    key <FK01> {
        symbols[Group1]= [ F1,  XF86_Switch_VT_1 ]


> > > I should also mention that once I have switched VT using Shift-F1, I can 
> > > switch back using Ctrl-Alt-F7 as expected - which seems to suggest nothing 
> > > is wrong with the system keymap.
> > 
> > There are two different keymaps: The console keymap (which seems to be
> > OK) and the X keymap (which we cannot quite figure out, it seems). The
> > VT switching mechanism is different once you are outside of X. 
> To be a little more precise .. it looks as if there are two totally
> separate mechanisms...  One that's "system-wide" so to speak .. handled
> by the kernel .. (?) ..  manages VT's wherever you are .. including in
> an X session .. and whatever they are currently connected with including
> "nothing" .. lets you switch .. but also create & destroy VT's on the
> fly (man chvt).  And then there's another mechanism that works only when
> you are running an X session .. only lets you switch VT's .. and is
> presumably handled by the X server.
> No idea if the two are related or how..


> The other (vague I admit) reason I mentioned buggy video drivers as a
> possible cause is that though I was not able to verify this first-hand
> .. I did see in google instances of folks reporting they has fixed such
> a problem being fixed by upgrading their X driver to a more current
> version.  But since both those who experienced the problem and those who
> came up with the "solution" were just as clueless as myself as to what
> would be causing this .. it mostly ran along the lines of ..  ".. works
> here with the 3.99 version .. what're you running .. 3.72.3 .. hmm..
> you may want to try to upgrade" .. "you're my hero  .. thanks a ton ..
> upgraded the driver and it took care of the problem."

I think these are all good points. We definitely have to use the next
person with this problem as our guinea pig to experiment a bit more in
that direction ;)

P.S. David, I included the information about types and keysyms in this
     mail rather than in my last response to you because the quoted
     older messages here made it easier for me to have the complete
     story in one mail.

Regards,            | http://users.icfo.es/Florian.Kulzer
          Florian   |

Reply to: