highcharts-editor icon indicating copy to clipboard operation
highcharts-editor copied to clipboard

Additional keyboard shortcuts in Electron

Open phoenixrip opened this issue 8 years ago • 2 comments

I noticed some really useful keyboard shortcuts like 'select all' & 'undo', aren't available when using the editor as a stand alone app in Electron.

I was able to easily add them by adding them to the menu template in the main.js of the electron:

Just wondering if you'd be interested in adding them :) here's the working menu template I'm using:

var template = [{ label: "Application", submenu: [ // { label: "About Application", selector: "orderFrontStandardAboutPanel:" }, // { type: "separator" }, { label: "Quit", accelerator: "Command+Q", click: function() { app.quit(); }} ]}, { label: "Edit", submenu: [
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" }, { label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" }, { type: "separator" }, { label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" }, { label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" }, { label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" }, { label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" } ]}, { label: 'View', submenu: [ { label: 'Toggle Developer Tools', accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I', click (item, focusedWindow) { if (focusedWindow) focusedWindow.webContents.toggleDevTools() } }] } ];

phoenixrip avatar Jan 30 '17 16:01 phoenixrip

Hi,

thanks!

We originally had a similar setup, but the undo/redo entries added some confusion amongst users in the initial testing because people tried to use them to undo changes made in the charts.

I'll see what we can do to compromise between both sides. :)

cvasseng avatar Jan 31 '17 11:01 cvasseng

Ah ok yeah, I can see where confusion might arise there :)

Yeah, cheers man, even just 'cut' and 'select all' I found to be useful additions when working on data at the import step and working in fields that can end up with a lot of text in them.

Thanks again for your wonderful work on this brilliant app and swift responses to questions! :) Very very much appreciated!

phoenixrip avatar Jan 31 '17 13:01 phoenixrip