Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Darwin: enable non-exclusive device usage #178

Open
ilyalasy opened this issue Jun 9, 2024 · 4 comments
Open

Darwin: enable non-exclusive device usage #178

ilyalasy opened this issue Jun 9, 2024 · 4 comments

Comments

@ilyalasy
Copy link

ilyalasy commented Jun 9, 2024

When I use device.open(), device inputs are not accessible on any application other than my script code.
How can I fix that?
Platform: macOS (ARM)

@prusnak
Copy link
Member

prusnak commented Jun 9, 2024

Duplicate of libusb/hidapi#27

It seems that the underlying library does not allow it

@prusnak prusnak closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2024
@ilyalasy
Copy link
Author

ilyalasy commented Jun 9, 2024

This PR fixes it, isn't it?

@prusnak
Copy link
Member

prusnak commented Jun 9, 2024

So it seems that all we need to do is export the following functions and set them accordingly.

void HID_API_EXPORT_CALL hid_darwin_set_open_exclusive(int open_exclusive)
int HID_API_EXPORT_CALL hid_darwin_get_open_exclusive(void)
int HID_API_EXPORT_CALL hid_darwin_is_device_open_exclusive(hid_device *dev)

@ilyalasy would you like to create a PR for this?

@prusnak prusnak reopened this Jun 9, 2024
@prusnak prusnak changed the title Non-exclusive device usage Darwin: enable non-exclusive device usage Jun 9, 2024
@ilyalasy
Copy link
Author

ilyalasy commented Jun 9, 2024

So it seems that all we need to do is export the following functions and set them accordingly.

void HID_API_EXPORT_CALL hid_darwin_set_open_exclusive(int open_exclusive)
int HID_API_EXPORT_CALL hid_darwin_get_open_exclusive(void)
int HID_API_EXPORT_CALL hid_darwin_is_device_open_exclusive(hid_device *dev)

@ilyalasy would you like to create a PR for this?

Don't have experience with cython, but I can try

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

No branches or pull requests

2 participants