From a67870ee5b7cd8b5ec93871997a3c9c51179341d Mon Sep 17 00:00:00 2001 From: MasonBone <78284872+MasonBone@users.noreply.github.com> Date: Tue, 30 Nov 2021 12:04:26 -0600 Subject: [PATCH 1/3] Masonbone (#13) * added initial webpage * Added webpage * Update package.json * Update package.json * Updating stuff * Update src/commands.ts Co-authored-by: Jake Grossman * updated extension.ts * Added Key binding pages * Read html from file Co-authored-by: Jake Grossman --- media/html/mackeys.html | 33 +++++++++++++++++++++++++++++ media/html/main.html | 43 +++++++++++++++++++++++++++++++++++++ media/html/winkeys.html | 33 +++++++++++++++++++++++++++++ package.json | 39 +++++++++++++++++++++++++++++++++- src/commands.ts | 47 +++++++++++++++++++++++++++++++++++++++++ src/extension.ts | 2 +- 6 files changed, 195 insertions(+), 2 deletions(-) create mode 100644 media/html/mackeys.html create mode 100644 media/html/main.html create mode 100644 media/html/winkeys.html diff --git a/media/html/mackeys.html b/media/html/mackeys.html new file mode 100644 index 0000000..5f4cd71 --- /dev/null +++ b/media/html/mackeys.html @@ -0,0 +1,33 @@ + + + + + + Mind Reader Key Bindings for Mac + + +

Here is a list of all the Mind Reader commands and their keybindings on Mac systems

+

+

Editor Settings

+ Increase Font Scale -
+ Decrease Font Scale -
+ Increase Editor Scale -
+ Decrease Editor Scale -
+ Reset Editor Scale -
+ Select Theme -
+

Navigation

+ Get Indent -
+ Show All Symbols -
+ Go To Line -
+ Quick Open -
+ Go To Symbol -
+ Show Problems -
+ Next In File -
+ Previous In File -
+ Open Previous Editor Group -
+ Navigate Forward -
+ Navigate Back -
+ Get Quick Input Back - +

+ + diff --git a/media/html/main.html b/media/html/main.html new file mode 100644 index 0000000..afd1508 --- /dev/null +++ b/media/html/main.html @@ -0,0 +1,43 @@ + + + + + + Mind Reader + + + +

+

Welcome to Mind_Reader!

+

We are the Single Semester Snobs and this is our tool to Help Blind Students Program Lego Mindstorms Robots in Python.

+ +

Use the following key binding to bring up a page for all key bindings for windows +
+ Control and Shift and 8 +

+

Use this key binding to do the same for mac computers: +
+ Command and Shift and 9 +

+

This is the Lego Spike Prime! +

+ +

+ Get the robot! + + diff --git a/media/html/winkeys.html b/media/html/winkeys.html new file mode 100644 index 0000000..fd89cfa --- /dev/null +++ b/media/html/winkeys.html @@ -0,0 +1,33 @@ + + + + + + Mind Reader Key Bindings for Windows + + +

Here is a list of all Mind Reader's commands and their keybindings on windows and linux systems

+

+

Editor Settings

+ Increase Font Scale - Number Pad Add
+ Decrease Font Scale - Number Pad Subtract
+ Increase Editor Scale - Shift and Number Pad Add
+ Decrease Editor Scale - Shift and Number Pad Subtract
+ Reset Editor Scale - Shift and Enter
+ Select Theme - Control and Shift and 1
+

Navigation

+ Get Indent - Shift and Tab
+ Show All Symbols - Control and T
+ Go To Line - Control and G
+ Quick Open - Control and P
+ Go To Symbol - Control and Shift and 0
+ Show Problems - Control and Shift and M
+ Next In File - F8
+ Previous In File - Shift and F8
+ Open Previous Editor Group - Control and Tab
+ Navigate Forward - Control and Shift and Minus
+ Navigate Back - Control and Alt and Minus
+ Get Quick Input Back - Control and Alt and Minus +

+ + diff --git a/package.json b/package.json index 8fd1068..d8436df 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,18 @@ "command": "mind-reader.selectTheme", "title": "Select Theme" }, - + { + "command": "mind-reader.openWebview", + "title": "Mind Reader Webview" + }, + { + "command": "mind-reader.openKeyBindWin", + "title": "Key Bindings for Windows" + }, + { + "command": "mind-reader.openKeyBindMac", + "title": "Key Bindings for Mac" + }, { "command": "mind-reader.runLineContext", "title": "Run Line Context" @@ -169,6 +180,16 @@ "command": "mind-reader.getIndent", "key": "Shift+Tab", "mac": "" + }, + { + "command": "mind-reader.openKeyBindWin", + "key": "Ctrl+Shift+8", + "mac": "Cmd+Shift+8" + }, + { + "command": "mind-reader.openKeyBindMac", + "key": "Ctrl+Shift+9", + "mac": "Cmd+Shift+9" } ], "menus": { @@ -213,7 +234,23 @@ "command": "mind-reader.selectTheme", "group": "mind-reader", "when": "activeEditor" + }, + { + "command": "mind-reader.openWebview", + "group": "mind-reader", + "when": "activeEditor" + }, + { + "command": "mind-reader.openKeyBindWin", + "group": "mind-reader", + "when": "activeEditor" + }, + { + "command": "mind-reader.openKeyBindMac", + "group": "mind-reader", + "when": "activeEditor" } + ] }, "submenus": [ diff --git a/src/commands.ts b/src/commands.ts index 596c082..64aa0c9 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -1,5 +1,6 @@ import * as vscode from 'vscode'; import * as pl from './pylex'; +import * as fs from 'fs'; /** * @type {Object} Command // Command to register with the VS Code Extension API @@ -50,6 +51,20 @@ const commands: Command[] = [ callback: resetEditorScale, }, + { + name: 'mind-reader.openWebview', + callback: openWebview, + }, + + { + name: 'mind-reader.openKeyBindWin', + callback: () => openKeyBindWin('Windows') + }, + { + name: 'mind-reader.openKeyBindMac', + callback: () => openKeyBindWin('Mac'), + }, + //Navigation Keys...... { name: 'mind-reader.showAllSymbols', @@ -150,6 +165,38 @@ function resetEditorScale(): void { vscode.commands.executeCommand('workbench.action.zoomReset'); } +function openWebview(): void { + //vscode.commands.executeCommand('workbench.action.zoomOut'); + const panel = vscode.window.createWebviewPanel( + 'mindReader', // Identifies the type of the webview. Used internally + 'Mind Reader', // Title of the panel displayed to the user + vscode.ViewColumn.One, // Editor column to show the new webview panel in. + {} + ); // Webview options. More on these later. + + panel.webview.html = getWebviewContent('media/html/main.html'); +} + +function getWebviewContent(filepath: string) { + return fs.readFileSync(filepath, {encoding: 'utf-8'}); +} + +function openKeyBindWin(os: 'Mac' | 'Windows'): void { + //vscode.commands.executeCommand('workbench.action.zoomOut'); + const panel = vscode.window.createWebviewPanel( + 'mindReader', // Identifies the type of the webview. Used internally + 'MR Key Bindings', // Title of the panel displayed to the user + vscode.ViewColumn.One, // Editor column to show the new webview panel in. + {} + ); // Webview options. More on these later. + + if (os === 'Windows') { + panel.webview.html = getWebviewContent('media/html/winkeys.html'); + } else if (os === 'Mac') { + panel.webview.html = getWebviewContent('media/html/mackeys.html'); + } +} + function getIndent(): void { let editor = vscode.window.activeTextEditor; if(editor) diff --git a/src/extension.ts b/src/extension.ts index ffeab0f..1fece80 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -3,7 +3,7 @@ import * as vscode from 'vscode'; import * as pl from './pylex'; import commands from './commands'; -import AccessNodeProvider from './accessNodeProvider' +import AccessNodeProvider from './accessNodeProvider'; let parser: pl.Parser = new pl.Parser(); From bdc6c4d0509a5d7ab6195a099181412f373a1ab7 Mon Sep 17 00:00:00 2001 From: JosiahMoses <32985363+JosiahMoses@users.noreply.github.com> Date: Tue, 30 Nov 2021 12:18:58 -0600 Subject: [PATCH 2/3] Update package.json Added Navigation Keys for Mac --- package.json | 49 ++++++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index d8436df..ee4ef32 100644 --- a/package.json +++ b/package.json @@ -74,122 +74,113 @@ } ], - "keybindings": [ + "keybindings": [ { "command": "mind-reader.decreaseFontScale", "key": "numpad_subtract", - "mac": "" + "mac": "d" }, { "command": "mind-reader.increaseFontScale", "key": "numpad_add", - "mac": "" + "mac": "[NumpadAdd]" }, { "command": "mind-reader.increaseEditorScale", - "key": "shift+numpad_add" + "key": "shift+numpad_add", + "mac": "Shift+[NumpadAdd]" }, { "command": "mind-reader.decreaseEditorScale", "key": "shift+numpad_subtract", - "mac": "" + "mac": "Shift+[NumpadSubtract]" }, { "command": "mind-reader.resetEditorScale", "key": "shift+enter", - "mac": "" + "mac": "Shift+[Enter]" }, { "command": "mind-reader.showAllSymbols", "key": "Ctrl+T", - "mac": "" + "mac": "Ctrl+[KeyT]" }, { "command": "mind-reader.gotoLine", "key": "CTRL+G", - "mac": "" + "mac": "Ctrl+[KeyG]" }, { "command": "mind-reader.quickOpen", "key": "CTRL+P", - "mac": "" + "mac": "Ctrl+[KeyP]" }, { "command": "mind-reader.gotoSymbol", "key": "Ctrl+Shift+O", - "mac": "" + "mac": "Ctrl+Shift+[KeyO]" }, { "command": "mind-reader.showProblems", "key": "Ctrl+Shift+M", - "mac": "" + "mac": "Ctrl+Shift+[KeyM]" }, { "command": "mind-reader.nextInFiles", "key": "F8", - "mac": "" + "mac": "[F8]" }, { "command": "mind-reader.prevInFiles", "key": "Shift+F8", - "mac": "" + "mac": "Shift+[F8]" }, { "command": "mind-reader.quickOpenPreviousRecentlyUsedEditorInGroup", "key": "Ctrl+Tab", - "mac": "" + "mac": "Ctrl+[Tab]" }, { "command": "mind-reader.navigateBack", "key": "Ctrl+Alt+-", - "mac": "" + "mac": "Ctrl+Alt+[Minus]" }, { "command": "mind-reader.getuickInputBack", "key": "Ctrl+Alt+-", - "mac": "" + "mac": "Ctrl+Alt+[Minus]" }, { "command": "mind-reader.navigateForward", "key": "Ctrl+Shift+-", - "mac": "" + "mac": "Ctrl+Shift+[Minus]" }, { "command": "mind-reader.selectTheme", "key": "Ctrl+Shift+1", - "mac": "" + "mac": "Ctrl+Shift+[Digit1]" }, { "command": "mind-reader.getIndent", "key": "Shift+Tab", - "mac": "" - }, - { - "command": "mind-reader.openKeyBindWin", - "key": "Ctrl+Shift+8", - "mac": "Cmd+Shift+8" - }, - { - "command": "mind-reader.openKeyBindMac", - "key": "Ctrl+Shift+9", - "mac": "Cmd+Shift+9" + "mac": "Shift+[Tab]" } ], "menus": { From 913be402b1b2c697a34be7ec0f41c405caf0e70f Mon Sep 17 00:00:00 2001 From: JosiahMoses <32985363+JosiahMoses@users.noreply.github.com> Date: Tue, 30 Nov 2021 12:27:11 -0600 Subject: [PATCH 3/3] Update package.json Had to fix a few typos --- package.json | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index ee4ef32..0c54c41 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ } ], - "keybindings": [ + "keybindings": [ { "command": "mind-reader.decreaseFontScale", "key": "numpad_subtract", @@ -108,31 +108,31 @@ { "command": "mind-reader.showAllSymbols", "key": "Ctrl+T", - "mac": "Ctrl+[KeyT]" + "mac": "Cmd+[KeyT]" }, { "command": "mind-reader.gotoLine", "key": "CTRL+G", - "mac": "Ctrl+[KeyG]" + "mac": "Cmd+[KeyG]" }, { "command": "mind-reader.quickOpen", "key": "CTRL+P", - "mac": "Ctrl+[KeyP]" + "mac": "Cmd+[KeyP]" }, { "command": "mind-reader.gotoSymbol", "key": "Ctrl+Shift+O", - "mac": "Ctrl+Shift+[KeyO]" + "mac": "Cmd+Shift+[KeyO]" }, { "command": "mind-reader.showProblems", "key": "Ctrl+Shift+M", - "mac": "Ctrl+Shift+[KeyM]" + "mac": "Cmd+Shift+[KeyM]" }, { @@ -150,38 +150,48 @@ { "command": "mind-reader.quickOpenPreviousRecentlyUsedEditorInGroup", "key": "Ctrl+Tab", - "mac": "Ctrl+[Tab]" + "mac": "Cmd+[Tab]" }, { "command": "mind-reader.navigateBack", "key": "Ctrl+Alt+-", - "mac": "Ctrl+Alt+[Minus]" + "mac": "Cmd+Alt+[Minus]" }, { "command": "mind-reader.getuickInputBack", "key": "Ctrl+Alt+-", - "mac": "Ctrl+Alt+[Minus]" + "mac": "Cmd+Alt+[Minus]" }, { "command": "mind-reader.navigateForward", "key": "Ctrl+Shift+-", - "mac": "Ctrl+Shift+[Minus]" + "mac": "Cmd+Shift+[Minus]" }, { "command": "mind-reader.selectTheme", "key": "Ctrl+Shift+1", - "mac": "Ctrl+Shift+[Digit1]" + "mac": "Cmd+Shift+[Digit1]" }, { "command": "mind-reader.getIndent", "key": "Shift+Tab", "mac": "Shift+[Tab]" - } + }, + { + "command": "mind-reader.openKeyBindWin", + "key": "Ctrl+Shift+8", + "mac": "Cmd+Shift+8" + }, + { + "command": "mind-reader.openKeyBindMac", + "key": "Ctrl+Shift+9", + "mac": "Cmd+Shift+9" + } ], "menus": { "editor/context": [