Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pot-app/selection
Get the text selected by the cursor
https://github.com/pot-app/selection
gui rust selection
Last synced: 6 days 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 (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-05T04:13:12.000Z (9 months ago)
- Last Synced: 2025-01-17T11:09:49.630Z (13 days ago)
- Topics: gui, rust, selection
- Language: Rust
- Homepage: https://crates.io/crates/selection
- Size: 33.2 KB
- Stars: 36
- Watchers: 3
- Forks: 10
- Open Issues: 0
-
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`