이 질문은 다음과 유사합니다.
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
두 가지 명령 외에도 다음을 수행해야 합니다.컨트롤 추가:
xmodmap -e 'keycode 110 = Control_L' # Home
xmodmap -e 'keycode 115 = Control_L' # End
xmodmap -e 'add Control = Control_L'