mirror of
https://github.com/heyman/heynote.git
synced 2025-08-17 10:01:19 +02:00
Refactor the way we handle copy/cut/paste in Emacs mode
Previously we listened for the key bindings for copy, cut and paste in the Electron main process, and triggered the event using copy(), paste() and cut() methods on win.webContent. Now this is fully handled within the renderer process using the window.navigator.clipboard API. This will make it simpler to implement fully customizable key bindings.
This commit is contained in:
@ -6,7 +6,6 @@ import fs from "fs"
|
||||
import { menu, getTrayMenu } from './menu'
|
||||
import { WINDOW_CLOSE_EVENT, SETTINGS_CHANGE_EVENT } from '../constants';
|
||||
import CONFIG from "../config"
|
||||
import { onBeforeInputEvent } from "../keymap"
|
||||
import { isDev, isMac, isWindows } from '../detect-platform';
|
||||
import { initializeAutoUpdate, checkForUpdates } from './auto-update';
|
||||
import { fixElectronCors } from './cors';
|
||||
@ -126,11 +125,6 @@ async function createWindow() {
|
||||
//win.webContents.openDevTools()
|
||||
}
|
||||
|
||||
// custom keyboard shortcuts for Emacs keybindings
|
||||
win.webContents.on("before-input-event", function (event, input) {
|
||||
onBeforeInputEvent({event, input, win, currentKeymap})
|
||||
})
|
||||
|
||||
// Test actively push message to the Electron-Renderer
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
win?.webContents.send('main-process-message', new Date().toLocaleString())
|
||||
|
Reference in New Issue
Block a user