flextrek

Crates.ioflextrek
lib.rsflextrek
version0.1.0
sourcesrc
created_at2024-11-08 19:17:52.113381
updated_at2024-11-08 19:17:52.113381
descriptionA super-easy, windows-only crate to get focused explorer location or selected files path using hotkey!
homepagehttps://github.com/initialencounter/flextrek
repositoryhttps://github.com/initialencounter/flextrek
max_upload_size
id1441456
size29,359
WWWw (initialencounter)

documentation

README

Flextrek

Description

A super-easy, windows-only crate to get focused explorer location or selected files path using hotkey!

Usage

Get selected files

example/get_explorer_selected_file.rs

use flextrek::listen_selected_files;
#[tokio::main(flavor = "current_thread")]
async fn main() {
    let hotkey_str = "Ctrl+Shift+z";
    println!("Start to listen explorer selected files");
    println!("Hotkey: {}", hotkey_str);
    listen_selected_files(hotkey_str, |files| async move {
        println!("Selected files: {:?}", files);
    })
    .await;
}

Get focused explorer location

example/get_explorer_location.rs

use flextrek::listen_path;
#[tokio::main(flavor = "current_thread")]
async fn main() {
    let hotkey_str = "Ctrl+Shift+z";
    println!("Start to listen explorer location");
    println!("Hotkey: {}", hotkey_str);
    let _ = listen_path(hotkey_str, |path| async move {
        println!("Current path: {:?}", path);
    })
    .await;
}
Commit count: 5

cargo fmt