[Genymobile/scrcpy]使用 --hid-keyboard 始终打开大写锁定

2024-02-22 727 views
9

环境

  • 操作系统:macOS 13.5.2
  • scrcpy版本:2.1.1
  • 安装方法:brew
  • 设备型号:谷歌 Pixel 6
  • 安卓版本:GrapheneOS 13

描述错误 当连接时,它的行为就像大写锁定已打开一样。如果我按住 Shift 键,它将输入小写字母,否则我只会输入大写字母。如果我按任何其他键,我会得到正确的输出,因此 1 键给我一个 1 而不是 !。如果我不使用 --hid-keyboard 它会按预期工作。这是间歇性的,但一旦出现这种情况,断开连接并重新连接并不能解决问题。

使用的 CLI 选项: --turn-screen-off \ --stay-awake \ --lock-video-orientation=0 \ --rotation=0 \ --window-x=1600 --window-y=25 --窗口高度=1024 \ --max-size=1024 \ --push-target="/sdcard/Download" \ --verbosity=warn \ --select-usb \ --audio-bit-rate=320K \ - -audio-codec=aac \ --audio-encoder=c2.android.aac.encoder \ --audio-source=输出 \ --video-bit-rate=8M \ --video-codec=h265 \ --hid -键盘

回答

0

实际上,我禁用了大写锁定,因为我从不使用它,只有当我错误地点击它时它才会出现。我尝试重新启用它,但 scrcpy 会话似乎每次都会选择错误的状态,因此如果大写锁定打开,我在其他地方都会得到大写,但在 scrcpy 窗口内我会得到小写。

7

您可以运行scrcpy -K -Vverbose,输入一些字符并关闭,然后复制粘贴整个终端输出吗?

6

我连接scrcpy -K -Vverbose,然后键入abc<shift>abc</shift>abc,然后 cmd-Q 关闭。

我的大写锁定已关闭并且按键已禁用。

这是输出:

INFO: ADB device found:
INFO:     -->   (usb)  19111FDF600B15                  device  Pixel_6
DEBUG: Device serial: 19111FDF600B15
DEBUG: Using server: /opt/homebrew/Cellar/scrcpy/2.1.1/share/scrcpy/scrcpy-server
/opt/homebrew/Cellar/scrcpy/2.1.1/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 64.9 MB/s (56995 bytes in 0.001s)
[server] INFO: Device: [Google] google Pixel 6 (Android 14)
[server] DEBUG: Using video encoder: 'c2.exynos.h264.encoder'
[server] DEBUG: Using audio encoder: 'c2.android.opus.encoder'
DEBUG: Server connected
INFO: USB device found:
INFO:     --> 19111FDF600B15     (18d1:4eec)  Google Pixel 6
INFO:         NA7TZPEE           (0bc2:ab1e)  Seagate BUP BL
INFO: USB device: 19111FDF600B15 (18d1:4eec) Google Pixel 6
DEBUG: Starting AOA thread
DEBUG: Starting controller thread
DEBUG: Starting receiver thread
INFO: Renderer: metal
DEBUG: Trilinear filtering disabled (not an OpenGL renderer
DEBUG: Using icon: /opt/homebrew/Cellar/scrcpy/2.1.1/share/icons/hicolor/256x256/apps/scrcpy.png
DEBUG: Demuxer 'video': starting thread
DEBUG: Demuxer 'audio': starting thread
INFO: Texture: 1080x2400
VERBOSE: [Audio] Buffering: target=2400 avg=2731.847900 cur=2880 compensation=-331
VERBOSE: [Audio] Buffering: target=2400 avg=2669.759033 cur=2539 compensation=-269
VERBOSE: [Audio] Buffering: target=2400 avg=2590.740723 cur=2231 compensation=0
VERBOSE: [Audio] Buffering: target=2400 avg=2549.970215 cur=2231 compensation=0
VERBOSE: keys[04] = true
VERBOSE: hid keyboard: key down scancode=04 (4) mod=00
VERBOSE: HID Event: [1] 00 00 04 00 00 00 00 00
VERBOSE: keys[04] = false
VERBOSE: hid keyboard: key up   scancode=04 (4) mod=00
VERBOSE: HID Event: [1] 00 00 00 00 00 00 00 00
VERBOSE: [Audio] Buffering: target=2400 avg=2525.368164 cur=3191 compensation=-125
VERBOSE: keys[05] = true
VERBOSE: hid keyboard: key down scancode=05 (5) mod=00
VERBOSE: HID Event: [1] 00 00 05 00 00 00 00 00
VERBOSE: keys[05] = false
VERBOSE: hid keyboard: key up   scancode=05 (5) mod=00
VERBOSE: HID Event: [1] 00 00 00 00 00 00 00 00
VERBOSE: keys[06] = true
VERBOSE: hid keyboard: key down scancode=06 (6) mod=00
VERBOSE: HID Event: [1] 00 00 06 00 00 00 00 00
VERBOSE: keys[06] = false
VERBOSE: hid keyboard: key up   scancode=06 (6) mod=00
VERBOSE: HID Event: [1] 00 00 00 00 00 00 00 00
VERBOSE: [Audio] Buffering: target=2400 avg=2573.971191 cur=2919 compensation=-173
VERBOSE: hid keyboard: key down scancode=e1 (225) mod=02
VERBOSE: HID Event: [1] 02 00 00 00 00 00 00 00
VERBOSE: keys[04] = true
VERBOSE: hid keyboard: key down scancode=04 (4) mod=02
VERBOSE: HID Event: [1] 02 00 04 00 00 00 00 00
VERBOSE: keys[04] = false
VERBOSE: hid keyboard: key up   scancode=04 (4) mod=02
VERBOSE: HID Event: [1] 02 00 00 00 00 00 00 00
VERBOSE: keys[05] = true
VERBOSE: hid keyboard: key down scancode=05 (5) mod=02
VERBOSE: HID Event: [1] 02 00 05 00 00 00 00 00
VERBOSE: [Audio] Buffering: target=2400 avg=2536.629150 cur=2635 compensation=-136
VERBOSE: keys[05] = false
VERBOSE: hid keyboard: key up   scancode=05 (5) mod=02
VERBOSE: HID Event: [1] 02 00 00 00 00 00 00 00
VERBOSE: keys[06] = true
VERBOSE: hid keyboard: key down scancode=06 (6) mod=02
VERBOSE: HID Event: [1] 02 00 06 00 00 00 00 00
VERBOSE: keys[06] = false
VERBOSE: hid keyboard: key up   scancode=06 (6) mod=02
VERBOSE: HID Event: [1] 02 00 00 00 00 00 00 00
VERBOSE: hid keyboard: key up   scancode=e1 (225) mod=00
VERBOSE: HID Event: [1] 00 00 00 00 00 00 00 00
VERBOSE: [Audio] Buffering: target=2400 avg=2505.402832 cur=2360 compensation=0
VERBOSE: keys[04] = true
VERBOSE: hid keyboard: key down scancode=04 (4) mod=00
VERBOSE: HID Event: [1] 00 00 04 00 00 00 00 00
VERBOSE: keys[04] = false
VERBOSE: hid keyboard: key up   scancode=04 (4) mod=00
VERBOSE: HID Event: [1] 00 00 00 00 00 00 00 00
VERBOSE: keys[05] = true
VERBOSE: hid keyboard: key down scancode=05 (5) mod=00
VERBOSE: HID Event: [1] 00 00 05 00 00 00 00 00
VERBOSE: keys[05] = false
VERBOSE: hid keyboard: key up   scancode=05 (5) mod=00
VERBOSE: HID Event: [1] 00 00 00 00 00 00 00 00
VERBOSE: keys[06] = true
VERBOSE: hid keyboard: key down scancode=06 (6) mod=00
VERBOSE: HID Event: [1] 00 00 06 00 00 00 00 00
VERBOSE: keys[06] = false
VERBOSE: hid keyboard: key up   scancode=06 (6) mod=00
VERBOSE: HID Event: [1] 00 00 00 00 00 00 00 00
VERBOSE: [Audio] Buffering: target=2400 avg=2498.420654 cur=2360 compensation=0
DEBUG: User requested to quit
DEBUG: quit...
DEBUG: Demuxer 'video': end of frames
DEBUG: Demuxer 'audio': end of frames
DEBUG: Receiver stopped
[server] DEBUG: Controller stopped
[server] DEBUG: Device message sender stopped
[server] DEBUG: Audio encoder stopped
[server] DEBUG: Screen streaming stopped
DEBUG: Server disconnected
DEBUG: Server terminated
7

好的,所以它不会记录HID keyboard state synchronized(所以如果您的计算机上禁用了大写锁定键,这是预期的)。

因此,它一定是您设备上的东西。使用其他设备会发生这种情况吗?如果您在设备上连接真正的键盘(通过 OTG 电缆或蓝牙),会出现什么行为?