Skip to content

Commit f116262

Browse files
committed
Add help widget
1 parent 9154467 commit f116262

File tree

6 files changed

+71
-25
lines changed

6 files changed

+71
-25
lines changed

HELP.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## KEYBOARD SHORTCUTS
2+
3+
| Context | Modifier | Combination | Action |
4+
| ------------------------ | -------- | ------------------- | ---------------------------------------------------- |
5+
| General | - | 1 ... 9 | Select menu option. |
6+
| General | - | TAB | Focus next widget |
7+
| Layout | SHIFT | TAB | Focus previous widget |
8+
| Rack | - | RETURN | Select plugin. |
9+
| Rack | - | DELETE | Remove Plugin |
10+
| Rack | CTRL | UP / DOWN | Swap plugins up/down |
11+
| Plugin Parameters Widget | - | UP / DOWN - TAB | Cycle through parameters. |
12+
| Plugin Parameters Widget | - | LEFT / RIGHT | Change parameter value by default step |
13+
| Plugin Parameters Widget | SHIFT | LEFT / RIGHT | Change parameter value by small step. |
14+
| Plugin Parameters Widget | CTRL | LEFT / RIGHT | Change parameter value by big step. |
15+
| Plugin Parameters Widget | - | PAGE_UP / PAGE_DOWN | Change parameter value by 1/5 of the maximum allowed |

README.md

+15-18
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,21 @@ Modify `.config.yaml` with your settings, more info [in the docs](https://ajboni
4040

4141
# Keyboard shortcuts
4242

43-
### Layout
44-
45-
- `TAB | Shift + TAB` Cycle between each widget.
46-
- `1...9` Select menu option.
47-
48-
### Rack widget
49-
50-
- `enter` Select plugin for handling
51-
- `delete | backspace` Remove plugin
52-
- `CTRL + up/down` Swap plugins up/down
53-
54-
### Plugin parameters widget
55-
56-
- `up/down / TAB` Cycle through each parameter.
57-
- `left/right` Change parameter value by default step.
58-
- `SHIFT + left/right` Change parameter value by small step.
59-
- `CTRL + left/right` Change parameter value by big step.
60-
- `page_up/page_down` Change parameter value by 1/5 of the maximum allowed
43+
## KEYBOARD SHORTCUTS
44+
45+
| Context | Modifier | Combination | Action |
46+
| ------------------------ | -------- | ------------------- | ---------------------------------------------------- |
47+
| General | - | 1 ... 9 | Select menu option. |
48+
| General | - | TAB | Focus next widget |
49+
| Layout | SHIFT | TAB | Focus previous widget |
50+
| Rack | - | RETURN | Select plugin. |
51+
| Rack | - | DELETE | Remove Plugin |
52+
| Rack | CTRL | UP / DOWN | Swap plugins up/down |
53+
| Plugin Parameters Widget | - | UP / DOWN - TAB | Cycle through parameters. |
54+
| Plugin Parameters Widget | - | LEFT / RIGHT | Change parameter value by default step |
55+
| Plugin Parameters Widget | SHIFT | LEFT / RIGHT | Change parameter value by small step. |
56+
| Plugin Parameters Widget | CTRL | LEFT / RIGHT | Change parameter value by big step. |
57+
| Plugin Parameters Widget | - | PAGE_UP / PAGE_DOWN | Change parameter value by 1/5 of the maximum allowed |
6158

6259
# DEV
6360

package-lock.json

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/layout.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const AudioIO = require("./widgets/audioIO");
2020
const PubSub = require("pubsub-js");
2121
const PluginInfo = require("./widgets/pluginInfo");
2222
const PluginPresetsWidget = require("./widgets/pluginPresets");
23+
const HelpWidget = require("./widgets/help");
2324

2425
let focusIndex = 0;
2526
var mainScreen;
@@ -88,14 +89,16 @@ function setUpLayout(screen) {
8889
new AudioIO(grid, 0, 15, 13, 13, "output")
8990
);
9091

92+
const page6 = new Page(new HelpWidget(grid, 0, 1, 13, 27));
93+
9194
const pageSwitcher = new PageSwitcher(mainScreen, [
9295
page0,
9396
page0,
9497
page2,
9598
page0,
9699
page4,
97100
page0,
98-
// page4,
101+
page6,
99102
]);
100103

101104
PubSub.subscribe("app", function (msg, app) {

src/widgets/help.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const contrib = require("blessed-contrib");
2+
const PubSub = require("pubsub-js");
3+
const fs = require("fs");
4+
const { tree } = require("blessed-contrib");
5+
6+
const HelpWidget = function (grid, x, y, xSpan, ySpan) {
7+
const helpWidget = grid.set(y, x, ySpan, xSpan, contrib.markdown, {
8+
label: " Calvo Help ",
9+
tags: true,
10+
input: false,
11+
mouse: true,
12+
interactive: true,
13+
keys: false,
14+
padding: { left: 1, right: 1, top: 1, bottom: 1 },
15+
style: {
16+
border: { fg: "#7ea87f" },
17+
focus: {
18+
border: { fg: "red" },
19+
// enabled: false,
20+
},
21+
},
22+
});
23+
24+
const help = fs.readFileSync("HELP.md", { encoding: "utf8" });
25+
helpWidget.setMarkdown(help);
26+
return helpWidget;
27+
};
28+
29+
module.exports = HelpWidget;

src/widgets/mainMenu.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ function make(grid, x, y, xSpan, ySpan, page = -1) {
3333
"Reconnect All": () => {
3434
store.reconectAll();
3535
},
36-
Help: () => {},
36+
Help: () => {
37+
store.setCurrentPage(6);
38+
},
3739
Exit: () => {
3840
App.exit();
3941
},

0 commit comments

Comments
 (0)