Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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`