Skip to content

Commit

Permalink
Update dext related code
Browse files Browse the repository at this point in the history
  • Loading branch information
vosaica authored and slotThe committed Oct 25, 2023
1 parent f6f6f8d commit f409a4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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

0 comments on commit f409a4b

Please sign in to comment.