| Crates.io | selectic |
| lib.rs | selectic |
| version | 0.1.0 |
| created_at | 2025-02-28 11:28:40.693386+00 |
| updated_at | 2025-02-28 11:28:40.693386+00 |
| description | Selectic is a Rust library that provides a cross-platform way to retrieve user-selected content from the operating system. Currently, it focuses on obtaining selected text, but it is designed to be extensible to handle other types of selected content like images and files in the future. |
| homepage | |
| repository | https://github.com/zibo-chen/Selectic |
| max_upload_size | |
| id | 1572677 |
| size | 69,376 |
Selectic is a Rust library that provides a cross-platform way to retrieve user-selected content from the operating system. Currently, it focuses on obtaining selected text, but it is designed to be extensible to handle other types of selected content like images and files in the future.
This crate aims to abstract away the platform-specific APIs for accessing selected content, offering a simple and consistent interface for Rust developers to integrate selection retrieval into their applications.
Currently Implemented:
String.Planned Features (Contributions Welcome!):
To use Selectic in your Rust project, add the following to your Cargo.toml file under [dependencies]:
selectic = "0.1.0" # Replace with the actual version
Example: Getting Selected Text
Here's a simple example demonstrating how to get the currently selected text:
use selectic;
fn main() {
match selectic::get_text() {
Ok(text) => {
println!("Selected text: {:?}", text);
}
Err(err) => {
eprintln!("Error getting selected text: {:?}", err);
}
}
}
To run this example:
Selectic leverages platform-specific APIs to access selected content:
If your platform is not explicitly listed, Selectic will return an UnsupportedPlatform error.
Contributions to Selectic are highly welcome! If you are interested in helping to expand Selectic's capabilities, particularly with image and file selection, or improving platform support, please feel free to:
Areas for potential contributions include:
This project is licensed under the MIT License - see the LICENSE file for details
https://github.com/zibo-chen/Selectic