非修飾子を修飾子キーとして構成する

非修飾子を修飾子キーとして構成する

この質問は次のようになります。

https://askubuntu.com/questions/33751/making-any-key-into-a-modifier-key

CapsLockキーがHome、Endに置き換えられた非標準キーボードレイアウトを備えたコンピュータ(lenovo x1 Carbon)があります。私はCapsLockをコントロールにマッピングすることに慣れているので、xmodmapを使用してHomeとEndをコントロールにマップします。

xmodmap -e 'keycode 110 = Control_L' # Home
xmodmap -e 'keycode 115 = Control_L' # End

Home(またはEnd)キーのみを押すと、正しいキーボード記号が検出されます。

state 0x0, keycode 110 (keysym 0xffe3, Control_L), same_screen YES,

ただし、再マップされたHomeキーまたはEndキーを他のキーの修飾子として使用することはできません。 Ctrl+a を押すと a キーは変更されません。

KeyPress event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15157752, (829,406), root:(830,407),
    state 0x0, keycode 110 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15157761, (829,406), root:(830,407),
    state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (61) "a"
    XmbLookupString gives 1 bytes: (61) "a"
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15157912, (829,406), root:(830,407),
    state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (61) "a"
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15157949, (829,406), root:(830,407),
    state 0x0, keycode 110 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

また、「実際の」コントロールキーを使用している場合は、「a」キーを押すとコントロール修飾子の状態になります。

KeyPress event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15160488, (829,406), root:(830,407),
    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 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15161477, (829,406), root:(830,407),
    state 0x4, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (01) ""
    XmbLookupString gives 1 bytes: (01) ""
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15161588, (829,406), root:(830,407),
    state 0x4, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (01) ""
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15161842, (829,406), root:(830,407),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

私の場合、ホームキーをコントロール補助キーとして設定できますか?それともそれを防ぐハードウェア制限はありますか?

ベストアンサー1

2つのコマンドに加えて、次のことを行う必要があります。コントロールの追加:
xmodmap -e 'keycode 110 = Control_L' # Home
xmodmap -e 'keycode 115 = Control_L' # End
xmodmap -e 'add Control = Control_L'

おすすめ記事