Skip to content

Commit

Permalink
Merge pull request #7 from tomershvueli/write-moji
Browse files Browse the repository at this point in the history
feat: Write out emojis to system instead of copying
  • Loading branch information
virejdasani authored Jul 7, 2021
2 parents de76a8a + e8e6d3a commit ead75ac
Show file tree
Hide file tree
Showing 5 changed files with 403 additions and 890 deletions.
13 changes: 11 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ const {
BrowserWindow,
Tray,
globalShortcut,
Menu
Menu,
ipcMain
} = require('electron')
const robot = require('robotjs');

// This is the npm package `open`, it is used here to open all links in an external browser
const open = require('open')
Expand Down Expand Up @@ -49,7 +51,8 @@ const createWindow = () => {
alwaysOnTop: true,
webPreferences: {
backgroundThrottling: false,
nodeIntegration: true
nodeIntegration: true,
contextIsolation: false
}
})

Expand Down Expand Up @@ -95,6 +98,12 @@ const createWindow = () => {
}
}

// When we get a signal to type an emoji, use RobotJS to type it out
ipcMain.on('typeEmoji', (_event, arg) => {
hideWindow();
robot.typeString(arg);
});

const toggleWindow = () => {
if (window.isVisible()) {
hideWindow()
Expand Down
Loading

0 comments on commit ead75ac

Please sign in to comment.