#linux #windows #macos

selection

Get the text selected by the cursor

4 stable releases

new 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

#296 in GUI

Download history 95/week @ 2024-01-13 17/week @ 2024-01-20 50/week @ 2024-01-27 43/week @ 2024-02-03 118/week @ 2024-02-10 195/week @ 2024-02-17 183/week @ 2024-02-24 162/week @ 2024-03-02 183/week @ 2024-03-09 55/week @ 2024-03-16 20/week @ 2024-03-23 48/week @ 2024-03-30 70/week @ 2024-04-06 105/week @ 2024-04-13 59/week @ 2024-04-20 32/week @ 2024-04-27

269 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–47MB
~740K SLoC