Skip to content

Commit

Permalink
Merge pull request #283 from Liance/keyboard-shortcuts
Browse files Browse the repository at this point in the history
Keyboard shortcuts
  • Loading branch information
joethephish authored Feb 21, 2021
2 parents 5d7b710 + a90fda4 commit 9e6d493
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/main-process/appmenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ function setupMenus(callbacks) {
accelerator: 'CmdOrCtrl+A',
role: 'selectall'
},
{
type: 'separator'
},
{
label: 'Useful Keyboard Shortcuts',
enabled: callbacks.isFocusedWindow,
click: callbacks.keyboardShortcuts
}
]
},
{
Expand Down
4 changes: 4 additions & 0 deletions app/main-process/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ app.on('ready', function () {
showAbout: () => {
AboutWindow.showAboutWindow(theme);
},
keyboardShortcuts: () => {
var win = ProjectWindow.focused();
if (win) win.keyboardShortcuts();
},
stats: () => {
var win = ProjectWindow.focused();
if (win) win.stats();
Expand Down
4 changes: 4 additions & 0 deletions app/main-process/projectWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ ProjectWindow.prototype.stats = function() {
this.browserWindow.webContents.send('project-stats');
}

ProjectWindow.prototype.keyboardShortcuts = function() {
this.browserWindow.webContents.send('keyboard-shortcuts');
}

ProjectWindow.prototype.finalClose = function() {
this.safeToClose = true;
Inklecate.killSessions(this.browserWindow);
Expand Down
22 changes: 22 additions & 0 deletions app/renderer/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,28 @@ ipc.on("project-stats", (event, visible) => {
});
});

ipc.on("keyboard-shortcuts", (event, visible) => {
let messageLines = [];
messageLines.push("Useful Keyboard Shortcuts");
messageLines.push("");
messageLines.push("Find and Replace: Ctrl+H or Cmd+H");
messageLines.push("");
messageLines.push("Find: Ctrl+F or Cmd+F");
messageLines.push("");
messageLines.push("Go to Anything: Ctrl+P or Cmd+P");
messageLines.push("");
messageLines.push("Toggle Comment: Ctrl+/ or Cmd+/");
messageLines.push("");
messageLines.push("Add Multicursor Above: Ctrl+Alt+Up or Ctrl+Option+Up");
messageLines.push("");
messageLines.push("Add Multicursor Below: Ctrl+Alt+Down or Ctrl+Option+Down");
messageLines.push("");
messageLines.push("Temporarily Fold/Unfold Selection: Alt+L or Ctrl+Option+Down");
messageLines.push("");
alert(messageLines.join("\n"));
});


EditorView.setEvents({
"change": () => {
LiveCompiler.setEdited();
Expand Down

0 comments on commit 9e6d493

Please sign in to comment.