mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Add search clear options; closes #1525
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const electron = require('electron')
|
||||
const BrowserWindow = electron.BrowserWindow
|
||||
const shell = electron.shell
|
||||
const ipc = electron.ipcMain
|
||||
const mainWindow = require('./main-window')
|
||||
|
||||
const macOS = process.platform === 'darwin'
|
||||
@@ -259,6 +260,23 @@ const view = {
|
||||
]
|
||||
}
|
||||
|
||||
let editorFocused
|
||||
|
||||
// Define extra shortcut keys
|
||||
mainWindow.webContents.on('before-input-event', (event, input) => {
|
||||
// Synonyms for Search (Find)
|
||||
if (input.control && input.key === 'f' && input.type === 'keyDown') {
|
||||
if (!editorFocused) {
|
||||
mainWindow.webContents.send('top:focus-search')
|
||||
event.preventDefault()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
ipc.on('editor:focused', (event, isFocused) => {
|
||||
editorFocused = isFocused
|
||||
})
|
||||
|
||||
const window = {
|
||||
label: 'Window',
|
||||
submenu: [
|
||||
|
||||
Reference in New Issue
Block a user