#linux #windows #macos

selection

Get the text selected by the cursor

4 stable releases

1.2.0 May 5, 2024
1.1.1 Dec 23, 2023
1.1.0 Nov 14, 2023
1.0.0 Sep 7, 2023
0.1.0 Sep 7, 2023

#351 in GUI

Download history 14/week @ 2024-07-22 50/week @ 2024-07-29 128/week @ 2024-08-05 16/week @ 2024-08-12 7/week @ 2024-08-19 9/week @ 2024-08-26 49/week @ 2024-09-09 184/week @ 2024-09-16 78/week @ 2024-09-23 39/week @ 2024-09-30 87/week @ 2024-10-07 56/week @ 2024-10-14 17/week @ 2024-10-21 105/week @ 2024-10-28 7/week @ 2024-11-04

187 downloads per month

GPL-3.0-only

17KB
310 lines

Selection

Get the text selected by the cursor

Example

selection = "1.2.0"
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

  • Windows
  • MacOS
  • Linux
    • X11
    • Wayland

Implementation details

Windows

  • Automation API
  • Clipboard

MacOS

  • Accessibility API
  • Clipboard

Linux

  • Primary Clipboard
    • X11: x11-clipboard
    • Wayland: wl-clipboard

Dependencies

~0–44MB
~705K SLoC