Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Write out emojis to system instead of copying #7

Merged
merged 3 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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