Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ kanata-tcp-protocol = { path = "tcp_protocol", version = "0.1110.0" }
arboard = "3.4"

[target.'cfg(target_os = "macos")'.dependencies]
karabiner-driverkit = "0.2.1"
karabiner-driverkit = "0.3.0"
objc = "0.2.7"
core-graphics = "0.24.0"
open = { version = "5", optional = true }
Expand Down
16 changes: 13 additions & 3 deletions src/main_lib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,19 @@ pub(crate) fn list_devices_macos() {
return;
}

println!(
"\nTo address devices with empty names (product key), hash values can be used in the configuration!"
);
let has_empty_names = kb_list.iter().any(|k| k.product_key.trim().is_empty());
if has_empty_names {
println!(
"\nTo address devices with empty names (product key), hash values can be used in the configuration!"
);
}

if kb_list.iter().any(|k| k.product_key.contains("Karabiner")) {
println!(
"\nNote: Karabiner virtual devices detected. Device hashes may not be stable \
because Karabiner virtualizes HID devices. Prefer name-based matching."
);
}

println!("\nConfiguration example:");
println!(" (defcfg");
Expand Down
2 changes: 2 additions & 0 deletions src/oskbd/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl From<InputEvent> for DKEvent {
value: event.value,
page: event.page,
code: event.code,
device_hash: 0,
}
}
}
Expand Down Expand Up @@ -123,6 +124,7 @@ impl KbdIn {
value: 0,
page: 0,
code: 0,
device_hash: 0,
};

let got_event = wait_key(&mut event);
Expand Down
Loading