#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

#552 in GUI

Download history 93/week @ 2024-10-29 5/week @ 2024-11-05 62/week @ 2024-11-12 18/week @ 2024-11-19 10/week @ 2024-11-26 15/week @ 2024-12-03 24/week @ 2024-12-10 19/week @ 2024-12-17 52/week @ 2024-12-24 36/week @ 2024-12-31 20/week @ 2025-01-07 10/week @ 2025-01-14 245/week @ 2025-01-21 29/week @ 2025-01-28 12/week @ 2025-02-04 59/week @ 2025-02-11

346 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
~662K SLoC