내 RF 무선 키보드는 키를 누르거나 놓을 때마다 XF86Forward KeyPress 및 KeyRelease 이벤트를 시스템에 계속 보냅니다.

내 RF 무선 키보드는 키를 누르거나 놓을 때마다 XF86Forward KeyPress 및 KeyRelease 이벤트를 시스템에 계속 보냅니다.

넘어진 후 RF 무선 키보드는 키를 누르거나 놓을 때마다 XF86Forward KeyPress 및 KeyRelease 이벤트를 시스템에 계속 보냅니다.

$ xev -event keyboard | egrep -w "KeyPress|KeyRelease|keycode"
KeyRelease event, serial 34, synthetic NO, window 0x3c00001,
    state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,
KeyPress event, serial 37, synthetic NO, window 0x3c00001,
    state 0x10, keycode 24 (keysym 0x61, a), same_screen YES,
KeyPress event, serial 37, synthetic NO, window 0x3c00001,
    state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,
KeyRelease event, serial 38, synthetic NO, window 0x3c00001,
    state 0x10, keycode 24 (keysym 0x61, a), same_screen YES,
KeyRelease event, serial 39, synthetic NO, window 0x3c00001,
    state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,
KeyPress event, serial 311, synthetic NO, window 0x3c00001,
    state 0x10, keycode 56 (keysym 0x62, b), same_screen YES,
KeyPress event, serial 312, synthetic NO, window 0x3c00001,
    state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,
KeyRelease event, serial 312, synthetic NO, window 0x3c00001,
    state 0x10, keycode 56 (keysym 0x62, b), same_screen YES,
KeyRelease event, serial 313, synthetic NO, window 0x3c00001,
    state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,
KeyPress event, serial 313, synthetic NO, window 0x3c00001,
    state 0x10, keycode 54 (keysym 0x63, c), same_screen YES,
KeyPress event, serial 313, synthetic NO, window 0x3c00001,
    state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,
KeyRelease event, serial 314, synthetic NO, window 0x3c00001,
    state 0x10, keycode 54 (keysym 0x63, c), same_screen YES,
KeyRelease event, serial 315, synthetic NO, window 0x3c00001,
    state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,
KeyPress event, serial 315, synthetic NO, window 0x3c00001,
    state 0x10, keycode 40 (keysym 0x64, d), same_screen YES,
KeyPress event, serial 315, synthetic NO, window 0x3c00001,
    state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,
KeyRelease event, serial 316, synthetic NO, window 0x3c00001,
    state 0x10, keycode 40 (keysym 0x64, d), same_screen YES,
KeyRelease event, serial 317, synthetic NO, window 0x3c00001,
    state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,

^@따라서 입력한 모든 문자 에 다음이 추가되므로 tty[1-6] 콘솔에 로그인할 수 없습니다 .

$ showkey -k
 kb mode was UNICODE
 [ if you are trying this under X, it might not work
 since the X server is also reading /dev/console ]

 press any key (program terminates 10s after last keypress)...
 keycode  28 release
 keycode  16 press
 keycode 159 press
 keycode  16 release
 keycode 159 release
 keycode  48 press
 keycode 159 press
 keycode  48 release
 keycode 159 release
 keycode  46 press
 keycode 159 press
 keycode  46 release
 keycode 159 release
 keycode  32 press
 keycode 159 press
 keycode  32 release
 keycode 159 release

편집0: 나에 따르면 내 RAPOO 무선 키보드 + 마우스 콤보 /proc/bus/input/devices에는 2개의 항목이 있습니다./dev/input/eventX

$ cat /proc/bus/input/devices  | grep -P '^[NH]: ' | paste - - | grep RAPOO
N: Name="RAPOO RAPOO 5G Wireless Device"    H: Handlers=sysrq kbd event2 leds 
N: Name="RAPOO RAPOO 5G Wireless Device"    H: Handlers=kbd mouse0 event3 

마우스는 키보드와 동일한 RF 채널을 사용하여 USB 마이크로 수신기와 통신하므로 논리적으로 보입니다.

EDIT1: 위의 핸들러 값에 따르면 /dev/input/event2이벤트는 키보드에서만 수신되는 것 같습니다. evtest출력 은 다음 과 같습니다 /dev/input/event2.

$ sudo evtest /dev/input/event2
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x24ae product 0x2003 version 0x110
Input device name: "RAPOO RAPOO 5G Wireless Device"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
...
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
  Event type 17 (EV_LED)
    Event code 0 (LED_NUML) state 0
    Event code 1 (LED_CAPSL) state 0
    Event code 2 (LED_SCROLLL) state 0
    Event code 3 (LED_COMPOSE) state 0
    Event code 4 (LED_KANA) state 0
Key repeat handling:
  Repeat type 20 (EV_REP)
    Repeat code 0 (REP_DELAY)
      Value    250
    Repeat code 1 (REP_PERIOD)
      Value     33
Properties:
Testing ... (interrupt to exit)
Event: time 1625417787.379951, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70058
Event: time 1625417787.379951, type 1 (EV_KEY), code 96 (KEY_KPENTER), value 0
Event: time 1625417787.379951, -------------- SYN_REPORT ------------
Event: time 1625417794.923958, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70004
Event: time 1625417794.923958, type 1 (EV_KEY), code 30 (KEY_A), value 1
Event: time 1625417794.923958, -------------- SYN_REPORT ------------
qEvent: time 1625417795.051954, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70004
Event: time 1625417795.051954, type 1 (EV_KEY), code 30 (KEY_A), value 0
Event: time 1625417795.051954, -------------- SYN_REPORT ------------
Event: time 1625417797.083970, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70005
Event: time 1625417797.083970, type 1 (EV_KEY), code 48 (KEY_B), value 1
Event: time 1625417797.083970, -------------- SYN_REPORT ------------
bEvent: time 1625417797.187973, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70005
Event: time 1625417797.187973, type 1 (EV_KEY), code 48 (KEY_B), value 0
Event: time 1625417797.187973, -------------- SYN_REPORT ------------
Event: time 1625417798.363970, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70006
Event: time 1625417798.363970, type 1 (EV_KEY), code 46 (KEY_C), value 1
Event: time 1625417798.363970, -------------- SYN_REPORT ------------
cEvent: time 1625417798.459960, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70006
Event: time 1625417798.459960, type 1 (EV_KEY), code 46 (KEY_C), value 0
Event: time 1625417798.459960, -------------- SYN_REPORT ------------
Event: time 1625417799.195958, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70007
Event: time 1625417799.195958, type 1 (EV_KEY), code 32 (KEY_D), value 1
Event: time 1625417799.195958, -------------- SYN_REPORT ------------
dEvent: time 1625417799.259976, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70007
Event: time 1625417799.259976, type 1 (EV_KEY), code 32 (KEY_D), value 0
Event: time 1625417799.259976, -------------- SYN_REPORT ------------
Event: time 1625417801.379970, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1625417801.379970, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1625417801.379970, -------------- SYN_REPORT ------------
Event: time 1625417801.587964, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70006
Event: time 1625417801.587964, type 1 (EV_KEY), code 46 (KEY_C), value 1
Event: time 1625417801.587964, -------------- SYN_REPORT ------------

EDIT2: /dev/input/event3키보드와 마우스로부터 이벤트를 받는 것 같습니다. 출력은 다음과 같습니다(각 키를 눌렀다 놓을 때의 이벤트에 유의하세요) evtest./dev/input/event3KEY_FORWARD

$ sudo evtest /dev/input/event3
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x24ae product 0x2003 version 0x110
Input device name: "RAPOO RAPOO 5G Wireless Device"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    ...
  Event type 3 (EV_ABS)
    Event code 32 (ABS_VOLUME)
      Value      0
      Min        0
      Max      896
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1625418203.492208, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225
Event: time 1625418203.492208, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 0
Event: time 1625418203.492208, -------------- SYN_REPORT ------------
Event: time 1625418205.620275, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225
Event: time 1625418205.620275, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 1
Event: time 1625418205.620275, -------------- SYN_REPORT ------------
aEvent: time 1625418205.908189, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225
Event: time 1625418205.908189, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 0
Event: time 1625418205.908189, -------------- SYN_REPORT ------------
Event: time 1625418207.076271, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225
Event: time 1625418207.076271, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 1
Event: time 1625418207.076271, -------------- SYN_REPORT ------------
bEvent: time 1625418207.348222, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225
Event: time 1625418207.348222, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 0
Event: time 1625418207.348222, -------------- SYN_REPORT ------------
Event: time 1625418208.356296, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225
Event: time 1625418208.356296, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 1
Event: time 1625418208.356296, -------------- SYN_REPORT ------------
cEvent: time 1625418208.660204, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225
Event: time 1625418208.660204, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 0
Event: time 1625418208.660204, -------------- SYN_REPORT ------------
Event: time 1625418209.636254, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225
Event: time 1625418209.636254, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 1
Event: time 1625418209.636254, -------------- SYN_REPORT ------------
dEvent: time 1625418209.924202, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225
Event: time 1625418209.924202, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 0
Event: time 1625418209.924202, -------------- SYN_REPORT ------------
Event: time 1625418211.564204, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1625418211.564204, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1625418211.564204, -------------- SYN_REPORT ------------
Event: time 1625418211.620212, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1625418211.620212, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1625418211.620212, -------------- SYN_REPORT ------------
Event: time 1625418216.572202, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1625418216.572202, type 1 (EV_KEY), code 273 (BTN_RIGHT), value 1
Event: time 1625418216.572202, -------------- SYN_REPORT ------------
Event: time 1625418216.644212, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1625418216.644212, type 1 (EV_KEY), code 273 (BTN_RIGHT), value 0
Event: time 1625418216.644212, -------------- SYN_REPORT ------------
Event: time 1625418218.780207, type 2 (EV_REL), code 0 (REL_X), value -1
Event: time 1625418218.780207, -------------- SYN_REPORT ------------
Event: time 1625418218.788214, type 2 (EV_REL), code 0 (REL_X), value -1
Event: time 1625418218.788214, -------------- SYN_REPORT ------------
^C

EDIT3: sudo timeout 5s evtest --grab /dev/input/eventX작동하지만 그게 다입니다.

/dev/input/event2모든 EV_KEY키보드 이벤트만 수신하며 추가 KEY_FORWARD EV_KEY이벤트 및 마우스 이벤트는 수신되지 않습니다. 그리고 마우스 이벤트와 키보드 이벤트 /dev/input/event3만 받는 것 같습니다 (다른 이벤트는 받지 않음).KEY_FORWARD EV_KEYEV_KEY

그래서 을 사용하면 /dev/input/event2마우스가 작동하지 않고, 을 사용하면 /dev/input/event3키보드가 작동하지 않습니다.

udevadm info/dev/input/event2키보드 이벤트 및 /dev/input/event3마우스 이벤트를 확인합니다 .

$ udevadm info /dev/input/event2 | grep event-
S: input/by-id/usb-RAPOO_RAPOO_5G_Wireless_Device-event-kbd
S: input/by-path/pci-0000:00:1d.3-usb-0:1:1.0-event-kbd
E: DEVLINKS=/dev/input/by-id/usb-RAPOO_RAPOO_5G_Wireless_Device-event-kbd /dev/input/by-path/pci-0000:00:1d.3-usb-0:1:1.0-event-kbd
$ udevadm info /dev/input/event3 | grep event-
S: input/by-id/usb-RAPOO_RAPOO_5G_Wireless_Device-if01-event-mouse
S: input/by-path/pci-0000:00:1d.3-usb-0:1:1.1-event-mouse
E: DEVLINKS=/dev/input/by-path/pci-0000:00:1d.3-usb-0:1:1.1-event-mouse /dev/input/by-id/usb-RAPOO_RAPOO_5G_Wireless_Device-if01-event-mouse

RF 키보드가 XF86Forward KeyPress 및 KeyRelease 이벤트를 보내는 것을 방지하는 방법은 무엇입니까?

답변1

자, 요약해보자:

첫 번째 단계는 evtest커널 입력 레이어에서도 이런 일이 발생하는지 확인하고 사용하는 것입니다. 또한 RF 키보드에는 연결된 여러 입력 장치가 있는 경우가 있으므로( evtest검증을 위해 모든 입력 장치에 사용) 실제 키가 아닌 다른 장치에서 나오는 경우 XF86Forward해당 장치를 무시하는 간단한 솔루션이 될 수 있습니다.

실제로 두 개의 장치가 있는 것으로 나타났습니다.

다음 단계는 evtest --grab키+마우스 장치를 사용하여 이벤트가 X 또는 VT에서 처리되지 않도록 evtest로만 전송되도록 하는 것입니다. VT를 사용하면 VT를 전환해도 크롤링이 계속되는지 모르기 때문에 약간 까다로울 수 있습니다. 또한 /dev/input/by-*부팅 시 장치를 올바르게 식별하는 방법도 살펴보세요. 이것이 작동하면 실행해 볼 수 있습니다

evtest --grab /dev/input/... > /dev/null

아니면 시작하는 동안 그런 것.

마우스는 분명히 키보드의 일부이고(또는 동일한 RF 채널을 사용합니까?) 필수이므로 이는 옵션이 아닙니다.

이것이 X에서만 작동한다면 "마우스" 입력 장치를 키보드 대신 마우스로 사용해 볼 수 있습니다. 그러나 VT도 사용하려는 경우 이는 옵션이 아닙니다.

따라서 남은 유일한 일은 XF86Forward마우스 이벤트를 통과시키면서 이벤트를 제거하는 사용자 정의 필터를 작성하는 것입니다. 얼마전에 잠깐 물어본 질문이 있었는데설명하다그것을하는 방법. 여전히 를 사용할 수 있어야 합니다 uinput.

관련 정보