在 gnome2 中,Shift 键无法与 F1、F2 等键一起使用。可能是什么原因?

在 gnome2 中,Shift 键无法与 F1、F2 等键一起使用。可能是什么原因?

我有一个与 gnome2 桌面的 vnc 会话。

下面是几个示例,其中多个按键按预期工作,最后两个示例产生了意外结果(带有F1& F2)。

请帮忙。

Shift+ Enter

KeyPress event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513198614, (95,-14), root:(97,63),
state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513198717, (95,-14), root:(97,63),
state 0x1, keycode 36 (keysym 0xff0d, Return), same_screen YES,
"   XLookupString gives 1 bytes: (0d) "
"   XmbLookupString gives 1 bytes: (0d) "
XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513198790, (95,-14), root:(97,63),
state 0x1, keycode 36 (keysym 0xff0d, Return), same_screen YES,
"   XLookupString gives 1 bytes: (0d) "
XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513198810, (95,-14), root:(97,63),
state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

Shift+ \

KeyPress event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513201404, (95,-14), root:(97,63),
state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513201476, (95,-14), root:(97,63),
state 0x1, keycode 51 (keysym 0x7c, bar), same_screen YES,
XLookupString gives 1 bytes: (7c) "|"
XmbLookupString gives 1 bytes: (7c) "|"
XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513201547, (95,-14), root:(97,63),
state 0x1, keycode 51 (keysym 0x7c, bar), same_screen YES,
XLookupString gives 1 bytes: (7c) "|"
XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513201577, (95,-14), root:(97,63),
state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

Shift+ Backspace

KeyPress event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513204915, (95,-14), root:(97,63),
state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513205006, (95,-14), root:(97,63),
state 0x1, keycode 22 (keysym 0xff08, BackSpace), same_screen YES,
XLookupString gives 1 bytes: (08) "
XmbLookupString gives 1 bytes: (08) "
XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513205075, (95,-14), root:(97,63),
state 0x1, keycode 22 (keysym 0xff08, BackSpace), same_screen YES,
XLookupString gives 1 bytes: (08) "
XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513205107, (95,-14), root:(97,63),
state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

在上述所有例子中:

  • 按下 Shift 键
  • 按下并释放其他键
  • 释放 Shift 键。

Shift+ F1

KeyPress event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513207893, (95,-14), root:(97,63),
state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513208137, (95,-14), root:(97,63),
state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513208137, (95,-14), root:(97,63),
state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513208137, (95,-14), root:(97,63),
state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513208208, (95,-14), root:(97,63),
state 0x1, keycode 67 (keysym 0xffbe, F1), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513208273, (95,-14), root:(97,63),
state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

Shift+ F2

KeyPress event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513219709, (79,-12), root:(81,65),
state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513219812, (79,-12), root:(81,65),
state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513219812, (79,-12), root:(81,65),
state 0x0, keycode 68 (keysym 0xffbf, F2), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513219812, (79,-12), root:(81,65),
state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513219885, (79,-12), root:(81,65),
state 0x1, keycode 68 (keysym 0xffbf, F2), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x6600001,
root 0x3f, subw 0x0, time 3513219925, (79,-12), root:(81,65),
state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

因此,按住Shift并按下F1键会产生以下结果:

  • Shift按下并(Shift释放键)
  • F1键已按下(且Shift键已按下)
  • F1键被释放,Shift键被释放

这意味着,shift按下 F 键时会释放该键。

如何预防?

Alt 键与 F 键配合良好。

以下是该服务器的 xmodmap:

xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x6d)
mod1        Alt_L (0x40),  Alt_R (0x71),  Meta_L (0x9c)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x73),  Super_R (0x74),  Super_L (0x7f),  Hyper_L (0x80)
mod5        Mode_switch (0x8),  ISO_Level3_Shift (0x7c)

以下是另一个服务器的 xmodmap,其中Shift+ Fkeys 起作用:

xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock      
control     Control_L (0x25),  Control_R (0x6d)
mod1        Alt_L (0x40),  Alt_R (0x71)
mod2        Num_Lock (0x4d)
mod3      
mod4      
mod5      

我尝试删除最后 3 个修饰符。但仍然不起作用。是否需要重新启动任何服务才能生效。如果是,我还没有这样做。但是重新启动 VNC 会完全重置为默认值。

我也尝试过禁用 F 键。但不知道怎么做。而且即使我禁用这些 F 键绑定,Alt+F key命令也无法正常工作。所以我不应该完全禁用 F 键绑定。

请帮忙。

相关内容