| Crates.io | flextrek |
| lib.rs | flextrek |
| version | 0.2.2 |
| created_at | 2024-11-08 19:17:52.113381+00 |
| updated_at | 2025-01-13 14:41:42.137464+00 |
| description | A super-easy, windows-only crate to get focused explorer location or selected files path using hotkey! |
| homepage | https://github.com/initialencounter/flextrek |
| repository | https://github.com/initialencounter/flextrek |
| max_upload_size | |
| id | 1441456 |
| size | 32,628 |
A super-easy, windows-only crate to get focused explorer location or selected files path using hotkey!
example/get_explorer_selected_file.rs
use flextrek::listen_selected_files;
fn main() {
let hotkey_str = "Ctrl+Shift+z";
println!("Start to listen explorer selected files");
println!("Hotkey: {}", hotkey_str);
let handle = listen_selected_files(hotkey_str.to_string(), |files| async move {
println!("Selected files: {:?}", files);
});
println!("10 seconds later, unregister");
std::thread::sleep(std::time::Duration::from_secs(10));
println!("Unregister");
handle.unregister();
loop {
std::thread::sleep(std::time::Duration::from_secs(1));
}
}
example/get_explorer_location.rs
use flextrek::listen_path;
fn main() {
let hotkey_str = "Ctrl+Shift+z";
println!("Start to listen explorer location");
println!("Hotkey: {}", hotkey_str);
let handle = listen_path(hotkey_str.to_string(), |path| move {
println!("Current path: {:?}", path);
});
println!("10 seconds later, unregister");
std::thread::sleep(std::time::Duration::from_secs(10));
println!("Unregister");
handle.unregister();
loop {
std::thread::sleep(std::time::Duration::from_secs(1));
}
}