Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@todesktop/client-selected-text

Package Overview
Dependencies
Maintainers
0
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@todesktop/client-selected-text

Retrieve the selected text from any application.

  • 0.27.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

ToDesktop Selected Text

Retrieve the selected text from any application.

Installation

Install @todesktop/client-selected-text in your client-side application using

npm install @todesktop/client-selected-text

Installation of the plugin package is also necessary. Using ToDesktop Builder, navigate to Plugins. Click on the Explore button for "Selected Text" and install the package.

Usage

Gets selected text by synthesizing the keyboard shortcut "CommandOrControl+c" then reading text from the clipboard

getSelectedText

import { getSelectedText } from "@todesktop/client-selected-text";

getSelectedText().then((selectedText) => console.log(selectedText));

registerShortcut

Registers a global shortcut of accelerator. The callback is called with the selected text when the registered shorcut is pressed by the user

Returns true if the shortcut was registered successfully

import { registerShortcut } from "@todesktop/client-selected-text";

const isRegistered = registerShortcut("F6", (selectedText) =>
  console.log(selectedText)
);

unregisterShortcut

Unregisters a global shortcut of accelerator and is equivalent to electron.globalShortcut.unregister

import { unregisterShortcut } from "@todesktop/client-selected-text";

unregisterShortcut("F6"); // void

FAQs

Package last updated on 27 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc