From e015ff3e3ce2c986971e539af459a8832efc2449 Mon Sep 17 00:00:00 2001
From: Liance
Date: Sat, 13 Jun 2020 21:08:54 +0100
Subject: [PATCH 1/2] Create keyboard shortcuts window.
---
app/main-process/appmenus.js | 8 ++++++++
app/main-process/main.js | 4 ++++
app/main-process/projectWindow.js | 4 ++++
app/renderer/controller.js | 22 ++++++++++++++++++++++
4 files changed, 38 insertions(+)
diff --git a/app/main-process/appmenus.js b/app/main-process/appmenus.js
index 32952f2c..994056f3 100644
--- a/app/main-process/appmenus.js
+++ b/app/main-process/appmenus.js
@@ -134,6 +134,14 @@ function setupMenus(callbacks) {
accelerator: 'CmdOrCtrl+A',
role: 'selectall'
},
+ {
+ type: 'separator'
+ },
+ {
+ label: 'Useful Shortcuts',
+ enabled: callbacks.isFocusedWindow,
+ click: callbacks.keyboardShortcuts
+ }
]
},
{
diff --git a/app/main-process/main.js b/app/main-process/main.js
index a1aeab4e..5e17d95f 100644
--- a/app/main-process/main.js
+++ b/app/main-process/main.js
@@ -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();
diff --git a/app/main-process/projectWindow.js b/app/main-process/projectWindow.js
index 0381ec03..a78568a6 100644
--- a/app/main-process/projectWindow.js
+++ b/app/main-process/projectWindow.js
@@ -87,6 +87,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);
diff --git a/app/renderer/controller.js b/app/renderer/controller.js
index 841abd2d..096b8bd4 100644
--- a/app/renderer/controller.js
+++ b/app/renderer/controller.js
@@ -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();
From 15fc57e6cb2d64fb87ded5e0e9b4fefa9d539552 Mon Sep 17 00:00:00 2001
From: Liance
Date: Sat, 13 Jun 2020 21:08:54 +0100
Subject: [PATCH 2/2] Create keyboard shortcuts window.
---
app/main-process/appmenus.js | 8 ++++++++
app/main-process/main.js | 4 ++++
app/main-process/projectWindow.js | 4 ++++
app/renderer/controller.js | 22 ++++++++++++++++++++++
4 files changed, 38 insertions(+)
diff --git a/app/main-process/appmenus.js b/app/main-process/appmenus.js
index 32952f2c..7b0abb9f 100644
--- a/app/main-process/appmenus.js
+++ b/app/main-process/appmenus.js
@@ -134,6 +134,14 @@ function setupMenus(callbacks) {
accelerator: 'CmdOrCtrl+A',
role: 'selectall'
},
+ {
+ type: 'separator'
+ },
+ {
+ label: 'Useful Keyboard Shortcuts',
+ enabled: callbacks.isFocusedWindow,
+ click: callbacks.keyboardShortcuts
+ }
]
},
{
diff --git a/app/main-process/main.js b/app/main-process/main.js
index a1aeab4e..5e17d95f 100644
--- a/app/main-process/main.js
+++ b/app/main-process/main.js
@@ -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();
diff --git a/app/main-process/projectWindow.js b/app/main-process/projectWindow.js
index 0381ec03..a78568a6 100644
--- a/app/main-process/projectWindow.js
+++ b/app/main-process/projectWindow.js
@@ -87,6 +87,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);
diff --git a/app/renderer/controller.js b/app/renderer/controller.js
index 841abd2d..096b8bd4 100644
--- a/app/renderer/controller.js
+++ b/app/renderer/controller.js
@@ -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();