Skip to content

Commit

Permalink
feat: read text from clipboard and write back to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
ademkoc committed Mar 19, 2022
1 parent f8272b9 commit 54a73e7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/server/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
const path = require("path");
const { app, BrowserWindow, globalShortcut } = require("electron");
const { app, BrowserWindow, globalShortcut, clipboard } = require("electron");
const { NSEventMonitor, NSEventMask } = require("nseventmonitor");
const { is } = require("electron-util");
const Store = require("electron-store");

const { Deasciifier } = require('../lib/deasciifier.min');
const patterns = require('../lib/deasciifier.patterns.min');

Deasciifier.init(patterns)

const TrayGenerator = require("./TrayGenerator");

let mainWindow = null;
Expand Down Expand Up @@ -106,6 +111,12 @@ const createMainWindow = () => {
// stop capturing global mouse events
macEventMonitor.stop();
});

globalShortcut.register("Command+1", () =>{
const readText = clipboard.readText('clipboard');
const deasciifyedObject = Deasciifier.deasciify(readText)
clipboard.write(deasciifyedObject, 'clipboard')
});
};

const createTray = () => {
Expand Down

0 comments on commit 54a73e7

Please sign in to comment.