내 Xorg 프로그램은 ++ 사용 을 전환 하는 데 tty1
. 이때 또는 상태(키보드의 해당 LED 조명 포함)가 정상적으로 동기화될 수 있습니다.CtrlAltF[2~6]ttY[2~6]
NumLockCapsLock
tty1
와 tty[2~6]
, NumLock또는 사이를 전환하는 경우 CapsLock상태는 정상이지만 키보드 표시등이 정상적으로 전환되지 않습니다. NumLock키보드의 상태(키보드의 해당 LED 조명 포함)를 저장하고 전환하는 책임은 누구에게 있는지 알고 싶습니다 .CapsLocktty
키보드 이벤트를 모니터링 하는 데 사용되며 evtest
예는 다음과 같습니다.
장면 1:
tty1: Num led is on, you can input numbers;
tty2: Num Led is off, you cannot enter numbers;
tty1-->tty2: Num led is on, no number can be input
ctrl+alt+f2, tty1-->tty2, evtest print as follows:
Event: time 1631671173.524324, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1631671173.524324, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1631671173.524324, -------------- SYN_REPORT ------------
Event: time 1631671173.612530, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2
Event: time 1631671173.612530, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 1
Event: time 1631671173.612530, -------------- SYN_REPORT ------------
Event: time 1631671173.684525, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7003b
Event: time 1631671173.684525, type 1 (EV_KEY), code 60 (KEY_F2), value 1
Event: time 1631671173.684525, -------------- SYN_REPORT ------------
Event: time 1631671173.804507, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1631671173.804507, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
Event: time 1631671173.804507, -------------- SYN_REPORT ------------
Event: time 1631671173.812235, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2
Event: time 1631671173.812235, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 0
Event: time 1631671173.812235, -------------- SYN_REPORT ------------
Event: time 1631671173.824310, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7003b
Event: time 1631671173.824310, type 1 (EV_KEY), code 60 (KEY_F2), value 0
Event: time 1631671173.824310, -------------- SYN_REPORT ------------
시나리오 2:
tty2: Num led is on, you can input numbers;
tty3: Num Led is off, you cannot enter numbers;
tty2-->tty3: Num led is off, no number can be input
ctrl+alt+f3, tty2-->tty3, evtest print as follows:
Event: time 1631671357.985873, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1631671357.985873, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1631671357.985873, -------------- SYN_REPORT ------------
Event: time 1631671358.097893, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2
Event: time 1631671358.097893, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 1
Event: time 1631671358.097893, -------------- SYN_REPORT ------------
Event: time 1631671358.181861, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7003c
Event: time 1631671358.181861, type 1 (EV_KEY), code 61 (KEY_F3), value 1
Event: time 1631671358.181861, -------------- SYN_REPORT ------------
Event: time 1631671358.313866, type 17 (EV_LED), code 0 (LED_NUML), value 0
Event: time 1631671358.313866, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7003c
Event: time 1631671358.313866, type 1 (EV_KEY), code 61 (KEY_F3), value 0
Event: time 1631671358.313866, -------------- SYN_REPORT ------------
Event: time 1631671358.321862, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1631671358.321862, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
Event: time 1631671358.321862, -------------- SYN_REPORT ------------
Event: time 1631671358.337870, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2
Event: time 1631671358.337870, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 0
Event: time 1631671358.337870, -------------- SYN_REPORT ------------