Disabling or changing console switching keys

consolekeyboardttyx11

For some reasons on my Ubuntu 11.04 Natty running Linux 2.6.38-13, with an Italian layout for the keyboard, the keystrokes
AltFx switch between virtual consoles (instead of the normal CtrlAltFx keys).

What could I change to avoid that?

I tried adding

Section "Serverflags"
Option "DontVTSwitch" "on"
EndSection

Section "InputClass"
     Identifier "keyboard defaults"
     MatchIsKeyboard "on"
     Option "XKbOptions" "srvrkeys:none"
EndSection

to the /etc/X11/xorg.conf file but to no avail. Is there an xmodmap setting that I could use?

Best Answer

man xmodmap:

 EXPRESSION GRAMMAR
 keycode NUMBER = KEYSYMNAME ...<br>

 The list of keysyms is assigned to the indicated keycode (which may 
 be specified in decimal, hex or octal and can be determined by 
 running the xev program). Up to eight keysyms may be attached to a 
 key, however the last four are not used in any major X server 
 implementation. The first keysym is used when no modifier key 
 is pressed in conjunction with this key, the second with Shift, 
 the third when the Mode_switch key is used with this key and the 
 fourth when both the Mode_switch and Shift keys are used.

According to the arch wiki the fields are used like so:

  1. Key
  2. Shift+Key
  3. mode_switch+Key
  4. mode_switch+Shift+Key
  5. AltGr+Key
  6. AltGr+Shift+Key

However, when I run xmodmap -pke I get that the seventh field is assigned to switching the between VTs:

keycode 67 = F1 F1 F1 F1 F1 F1 XF86Switch_VT_1

This will vary depending on which types your current layout is configured with. Do get the default, try running:

setxkbmap -v -types complete it
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Warning! Multiple definitions of types
         Using command line, ignoring rules file
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+it+inet(evdev)
geometry:   pc(pc104)


It may also be the case that your window manager or desktop environment (kde, gnome) steals those keys and switches between VTs like you say.

Related Question