1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 10:46:32 +00:00

Merge pull request #1754 from yougotwill/crossplatform_fullscreen_shortcuts

Fullscreen shortcut for non macOS
This commit is contained in:
Junyoung Choi (Sai)
2018-04-20 13:02:33 +09:00
committed by GitHub
2 changed files with 14 additions and 9 deletions

View File

@@ -282,8 +282,8 @@ class NoteList extends React.Component {
ee.emit('detail:focus') ee.emit('detail:focus')
} }
// F or S key // L or S key
if (e.keyCode === 70 || e.keyCode === 83) { if (e.keyCode === 76 || e.keyCode === 83) {
e.preventDefault() e.preventDefault()
ee.emit('top:focus-search') ee.emit('top:focus-search')
} }

View File

@@ -252,10 +252,20 @@ const view = {
}, },
{ {
label: 'Focus Search', label: 'Focus Search',
accelerator: 'Control+S', accelerator: 'CommandOrControl+Shift+L',
click () { click () {
mainWindow.webContents.send('top:focus-search') mainWindow.webContents.send('top:focus-search')
} }
},
{
type: 'separator'
},
{
label: 'Toggle Full Screen',
accelerator: macOS ? 'Command+Control+F' : 'F11',
click () {
mainWindow.setFullScreen(!mainWindow.isFullScreen())
}
} }
] ]
} }
@@ -265,7 +275,7 @@ let editorFocused
// Define extra shortcut keys // Define extra shortcut keys
mainWindow.webContents.on('before-input-event', (event, input) => { mainWindow.webContents.on('before-input-event', (event, input) => {
// Synonyms for Search (Find) // Synonyms for Search (Find)
if (input.control && input.key === 'f' && input.type === 'keyDown') { if (input.control && input.key === 'l' && input.type === 'keyDown') {
if (!editorFocused) { if (!editorFocused) {
mainWindow.webContents.send('top:focus-search') mainWindow.webContents.send('top:focus-search')
event.preventDefault() event.preventDefault()
@@ -285,11 +295,6 @@ const window = {
accelerator: 'Command+M', accelerator: 'Command+M',
selector: 'performMiniaturize:' selector: 'performMiniaturize:'
}, },
{
label: 'Toggle Full Screen',
accelerator: 'Command+Control+F',
selector: 'toggleFullScreen:'
},
{ {
label: 'Close', label: 'Close',
accelerator: 'Command+W', accelerator: 'Command+W',