https://github.com/pot-app/selection
Get the text selected by the cursor
https://github.com/pot-app/selection
gui rust selection
Last synced: 7 months ago
JSON representation
Get the text selected by the cursor
- Host: GitHub
- URL: https://github.com/pot-app/selection
- Owner: pot-app
- License: gpl-3.0
- Created: 2023-06-04T15:07:12.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-05T04:13:12.000Z (almost 2 years ago)
- Last Synced: 2025-09-12T06:49:02.861Z (8 months ago)
- Topics: gui, rust, selection
- Language: Rust
- Homepage: https://crates.io/crates/selection
- Size: 33.2 KB
- Stars: 61
- Watchers: 3
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Selection
Get the text selected by the cursor
## Example
```toml
selection = "1.2.0"
```
```rust
use selection::get_text;
fn main() {
// Return the selected text on success
// Otherwise return the empty string
let text = get_text();
println!("{}", text);
}
```
## Support Platform
- [x] Windows
- [x] MacOS
- [x] Linux
- [x] X11
- [x] Wayland
## Implementation details
### Windows
- Automation API
- Clipboard
### MacOS
- Accessibility API
- Clipboard
### Linux
- Primary Clipboard
- X11: `x11-clipboard`
- Wayland: `wl-clipboard`