setxkbmap -option ctrl:nocapsは、macOSのOracle VirtualBoxで実行されているDebian VM内でCaps LockをEscapeにマップしません。

setxkbmap -option ctrl:nocapsは、macOSのOracle VirtualBoxで実行されているDebian VM内でCaps LockをEscapeにマップしません。

私はmacOS CatalinaのOracle VirtualBox 6.1で実行されているDebian 10でXfce 4.12を使用しています。

私のすべてのキーマップはmacOSでデフォルトに設定されています。 (システム環境設定>キーボード>修飾キー>デフォルトの復元>確認。)

脱出キャップがうまく機能します

Debian VM では、以下を実行します。

$ setxkbmap -option
$ setxkbmap -query
rules:      evdev
model:      pc105
layout:     us

$ setxkbmap -option caps:escape
$ setxkbmap -query
rules:      evdev
model:      pc105
layout:     us
options:    caps:escape

Caps Lock は Debian VM でエスケープのように動作し、Caps Lock は macOS システムで Caps Lock のように動作します。これは期待どおりに機能します。

xevCaps Lockキーを押した後の出力は次のとおりですsetxkbmap -option

KeyPress event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 128721870, (-31,207), root:(560,530),
    state 0x0, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 128721874, (-31,207), root:(560,530),
    state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

xevCaps Lockキーを押した後の出力は次のとおりですsetxkbmap -option caps:escape

KeyPress event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 128844487, (163,5), root:(754,328),
    state 0x0, keycode 66 (keysym 0xff1b, Escape), same_screen YES,
    XKeysymToKeycode returns keycode: 9
    XLookupString gives 1 bytes: (1b) "
mbLookupString gives 1 bytes: (1b) "
FilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 128844489, (163,5), root:(754,328),
    state 0x0, keycode 66 (keysym 0xff1b, Escape), same_screen YES,
    XKeysymToKeycode returns keycode: 9
    XLookupString gives 1 bytes: (1b) "
FilterEvent returns: False

制御上限が機能しない

Debian VM では、以下を実行します。

$ setxkbmap -option
$ setxkbmap -query
rules:      evdev
model:      pc105
layout:     us

$ setxkbmap -option ctrl:nocaps
$ setxkbmap -query
rules:      evdev
model:      pc105
layout:     us
options:    ctrl:nocaps

Caps LockはDebian VMのCtrl修飾子とは異なる動作をします。

xevCaps Lockキーを押した後の出力は次のとおりですsetxkbmap -option

KeyPress event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 129089370, (163,1), root:(754,324),
    state 0x0, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 129089373, (163,1), root:(754,324),
    state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

xevCaps Lockキーを押した後の出力は次のとおりですsetxkbmap -option ctrl:nocaps

KeyPress event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 129117033, (163,5), root:(754,328),
    state 0x2, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 129117037, (163,5), root:(754,328),
    state 0x6, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

何が間違っていますか?

この問題に対する追加のxev出力。

以下のコメントセクションに従うと、これまでsetxkbmap -option ctrl:nocaps+を実行して letter を入力した後、+が正しく動作することがわかります(例:bashで現在のコマンドをキャンセル)。caps lockccctrlc

ctrlこれは+のxev出力ですc

KeyPress event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 176921083, (165,3), root:(756,326),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 176921220, (165,3), root:(756,326),
    state 0x4, keycode 54 (keysym 0x63, c), same_screen YES,
    XLookupString gives 1 bytes: (03) ""
    XmbLookupString gives 1 bytes: (03) ""
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 176921334, (165,3), root:(756,326),
    state 0x4, keycode 54 (keysym 0x63, c), same_screen YES,
    XLookupString gives 1 bytes: (03) ""
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 176921336, (165,3), root:(756,326),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

caps lockこれは+の出力ですc

KeyPress event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 176819139, (165,5), root:(756,328),
    state 0x0, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 176819141, (165,5), root:(756,328),
    state 0x4, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 176819251, (165,5), root:(756,328),
    state 0x0, keycode 54 (keysym 0x63, c), same_screen YES,
    XLookupString gives 1 bytes: (63) "c"
    XmbLookupString gives 1 bytes: (63) "c"
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x3c00001,
    root 0x3ac, subw 0x0, time 176819371, (165,5), root:(756,328),
    state 0x0, keycode 54 (keysym 0x63, c), same_screen YES,
    XLookupString gives 1 bytes: (63) "c"
    XFilterEvent returns: False

ctrlここで問題はプリミティブであり、c正しい順序で正しいキーイベントを送信しているようです。

  • ctrl~によると
  • c~によると
  • c解放する
  • ctrl解く)

ただし、caps lock+cの組み合わせは主要なイベントを間違った順序で送信します。

  • ctrl~によると
  • ctrl解放する
  • c~によると
  • c解放する

この問題をどのように解決できますか?

ベストアンサー1

おすすめ記事