Skip to content

Add HID support for macOS - #3031

Merged
rom1v merged 4 commits into
devfrom
libusb-macos
Feb 20, 2022
Merged

rom1v merged 4 commits into
devfrom
libusb-macos

Conversation

@rom1v

@rom1v rom1v commented Feb 17, 2022

Copy link
Copy Markdown
Collaborator

Build with libusb on macOS to enable HID/OTG features.

Due to a bug in SDL (libsdl-org/SDL#5340) related to relative mouse mode, implement a workaround to capture the mouse correctly (and avoid double mouse cursors).

Fixes #2774

Tests welcome.


FYI, Windows support (for OTG only) will be provided by #3011.

@rom1v rom1v mentioned this pull request Feb 17, 2022
@r4dixx

r4dixx commented Feb 19, 2022 •

Copy link
Copy Markdown

Thank you for this. However, I'm encountering a particular issue in both --otg and -KM mode. I have to click to get my cursor back. In other words, option does not suffice. I have to do option, then left click and my cursor is back.

EDIT: For some reason this does not happen all the time. Although this seems to be a pretty consistent issue in --otg mode

HID/OTG features are not limited to Linux anymore.

PR #3031 <#3031>
Using the screen instance or not in these functions is an implementation
detail. Further changes will require the screen instance.

Refs 7848a38
PR #3031 <#3031>
On macOS, SDL relative mouse mode does not work correctly when the
cursor is outside the window.

As a workaround, move the cursor inside the window before setting the
relative mouse mode.

Refs SDL/#5340 <libsdl-org/SDL#5340>
PR #3031 <#3031>
@rom1v
rom1v merged commit 3ee3f8d into dev Feb 20, 2022
@rom1v

rom1v commented Feb 20, 2022 •

Copy link
Copy Markdown
Collaborator Author

Thank you for your tests 👍

Noted for the remaining bug. At least the "double cursor" issue has a workaround, this one looks minor.

I merge and hopefully everything will be fixed in libusb in the future.

Linux4 pushed a commit to Linux4/scrcpy that referenced this pull request Sep 5, 2025
scrcpy v1.23

Changes since v1.22:
 - Add HID/OTG support for Windows (--otg only) (Genymobile#2773, Genymobile#3011)
 - Add HID/OTG support for macOS (Genymobile#2774, Genymobile#3031)
 - Improve device selection (list devices, -d, -e) (Genymobile#3005)
 - Downscale and retry on MediaCodec error in more cases (Genymobile#2990, Genymobile#3043)
 - Add ZSH completion script (Genymobile#3012)
 - Add Bash completion script (Genymobile#2930, Genymobile#3048)
 - Add --no-cleanup option (Genymobile#1764, Genymobile#3020)
 - Add --printf-fps (Genymobile#468, Genymobile#3030)
 - Print both compiled and linked version of libs on --version
 - Fix FPS counter (broken in v1.22)
 - Various technical refactors and fixes
rom1v added a commit that referenced this pull request Jan 8, 2026
Jamilah-nabel pushed a commit to Jamilah-nabel/https-github.com-Genymobile-scrcpy that referenced this pull request Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants