禁用或更改控制台切换键

gio*_*gio 6 keyboard x11 tty console

由于某些原因,我的 Ubuntu 11.04 Natty 运行 Linux 2.6.38-13,键盘采用意大利语布局,按键 AltFx在虚拟控制台(而不是普通CtrlAltFx键)之间切换。

我可以改变什么来避免这种情况?

我尝试添加

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

Section "InputClass"
     Identifier "keyboard defaults"
     MatchIsKeyboard "on"
     Option "XKbOptions" "srvrkeys:none"
EndSection
Run Code Online (Sandbox Code Playgroud)

/etc/X11/xorg.conf文件,但无济于事。有xmodmap我可以使用的设置吗?

Яро*_*лин 2

男人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.
Run Code Online (Sandbox Code Playgroud)

根据arch wiki,字段的使用方式如下:

  1. 钥匙
  2. Shift+键
  3. 模式开关+按键
  4. 模式切换+Shift+按键
  5. AltGr+键
  6. AltGr+Shift+键

但是,当我运行xmodmap -pke时,我发现第七个字段被分配用于在 VT 之间切换:

键码 67 = F1 F1 F1 F1 F1 F1 XF86Switch_VT_1

这将根据当前布局配置的类型而有所不同。获取默认值,尝试运行:

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)
Run Code Online (Sandbox Code Playgroud)


也可能是您的窗口管理器或桌面环境(kde、gnome)窃取这些密钥并像您所说的那样在 VT 之间切换。