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();