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

[Mac] Upgrade Karabiner-DriverKit-VirtualHIDDevice to v2.1.0 #716

Merged
merged 4 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update dext related code
  • Loading branch information
vosaica authored and slotThe committed Oct 25, 2023
commit f409a4b83f85a2518f759532b1a7239a52947489
5 changes: 3 additions & 2 deletions c_src/mac/dext.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <filesystem> // Include this before virtual_hid_device_service.hpp to avoid compile error

#include "keyio_mac.hpp"

#include "virtual_hid_device_driver.hpp"
Expand All @@ -16,8 +18,7 @@ static pqrs::karabiner::driverkit::virtual_hid_device_driver::hid_report::consum

int init_sink() {
pqrs::dispatcher::extra::initialize_shared_dispatcher();
std::filesystem::path client_socket_file_path("/tmp/karabiner_driverkit_virtual_hid_device_service_client.sock");
client = new pqrs::karabiner::driverkit::virtual_hid_device_service::client(client_socket_file_path);
client = new pqrs::karabiner::driverkit::virtual_hid_device_service::client();
auto copy = client;
client->async_driver_loaded();
client->async_driver_version_matched();
Expand Down
4 changes: 2 additions & 2 deletions c_src/mac/keyio_mac.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void monitor_kb(char *product) {
CFRelease(cfValue);
io_iterator_t iter = IO_OBJECT_NULL;
CFRetain(matching_dictionary);
kr = IOServiceGetMatchingServices(kIOMasterPortDefault,
kr = IOServiceGetMatchingServices(kIOMainPortDefault,
matching_dictionary,
&iter);
if(kr != KERN_SUCCESS) {
Expand All @@ -166,7 +166,7 @@ void monitor_kb(char *product) {
}
listener_loop = CFRunLoopGetCurrent();
open_matching_devices(product, iter);
IONotificationPortRef notification_port = IONotificationPortCreate(kIOMasterPortDefault);
IONotificationPortRef notification_port = IONotificationPortCreate(kIOMainPortDefault);
CFRunLoopSourceRef notification_source = IONotificationPortGetRunLoopSource(notification_port);
CFRunLoopAddSource(listener_loop, notification_source, kCFRunLoopDefaultMode);
CFRetain(matching_dictionary);
Expand Down