2016년 1월 19일 화요일

리눅스 키보드 xmodmap 설정

1. xev 사용하여 Key Code 알아내기

※ Key Code 는 시스템에 따라 다를 수 있다.

(1) 우측 Alt Key

KeyPress event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23413094, (666,16), root:(2590,849),
    state 0x0, keycode 108 (keysym 0xff31, Hangul), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23413166, (666,16), root:(2590,849),
    state 0x8, keycode 108 (keysym 0xff31, Hangul), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


(2) 우측 Ctrl Key

KeyPress event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23414782, (666,16), root:(2590,849),
    state 0x0, keycode 105 (keysym 0xff34, Hangul_Hanja), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23414870, (666,16), root:(2590,849),
    state 0x4, keycode 105 (keysym 0xff34, Hangul_Hanja), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


(3) CapsLock Key

KeyPress event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23418342, (666,16), root:(2590,849),
    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 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23418438, (666,16), root:(2590,849),
    state 0x4, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


(4) Window Key

KeyPress event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23422646, (666,16), root:(2590,849),
    state 0x0, keycode 133 (keysym 0xff67, Menu), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23422734, (666,16), root:(2590,849),
    state 0x40, keycode 133 (keysym 0xff67, Menu), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


2. 우측 Alt Key 를 한글 Key 로 설정

xmodmap -e "remove mod1 = Alt_R"
xmodmap -e "keycode 108 = Hangul"


3. 우측 Ctrl Key 를 한자 Key로 설정

xmodmap -e "remove control = Control_R"
xmodmap -e "keycode 105 = Hangul_Hanja"


4. CapsLock Key 를 Ctrl Key 로 설정

xmodmap -e "keycode 66 = Control_L"
xmodmap -e "clear Lock"
xmodmap -e "add Control = Control_L"


5. Window Key 를 Menu Key 로 설정

xmodmap -e "keycode 133 = Menu"


6. 설정 (Key Mapping) 영구 저장

xmodmap -pke > ~/.Xmodmap


7. 부팅시 실행: 다음을 자동으로 시작되도록 지정

xmodmap ~/.Xmodmap

0 개의 댓글:

댓글 쓰기