diff --git a/c_src/mac/dext.cpp b/c_src/mac/dext.cpp index 4c7a089f..a61015a2 100644 --- a/c_src/mac/dext.cpp +++ b/c_src/mac/dext.cpp @@ -1,3 +1,5 @@ +#include // Include this before virtual_hid_device_service.hpp to avoid compile error + #include "keyio_mac.hpp" #include "virtual_hid_device_driver.hpp" @@ -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(); diff --git a/c_src/mac/keyio_mac.hpp b/c_src/mac/keyio_mac.hpp index a88a7708..d2cc0a45 100644 --- a/c_src/mac/keyio_mac.hpp +++ b/c_src/mac/keyio_mac.hpp @@ -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) { @@ -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);