Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@todesktop/electron-selected-text-prebuild

Package Overview
Dependencies
Maintainers
0
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@todesktop/electron-selected-text-prebuild

a utility to get selected text for Electron apps

latest
Source
npmnpm
Version
1.1.21
Version published
Maintainers
0
Created
Source

Electron Selected Text

Get selected text from any application using Electron's clipboard and robotjs

For Electron 9 and later, this module should only be used in the main process because robotjs is not context aware

Install

$ npm install electron-selected-text

Usage

import { app } from "electron";
import { getSelectedText, registerShortcut } from "electron-selected-text";

const printSelectedText = (selectedText) => {
  console.log(`Selected Text: ${selectedText}`);
};

getSelectedText().then(printSelectedText);

app.whenReady().then(() => {
  const ret = registerShortcut("F6", printSelectedText);

  if (!ret) {
    console.warn("registration failed");
  }
});

Keywords

electron

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