Skip to content

Commit 6da2a91

Browse files
committed
Force lowercase for key identifiers and add supported keys to doc
1 parent 0654ea9 commit 6da2a91

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ plugins: [
1717

1818
## Configuration
1919

20-
Default configuration:
20+
### Default configuration:
2121
``` js
2222
module.exports = {
2323
config: {
@@ -47,22 +47,29 @@ module.exports = {
4747
//...
4848
};
4949
```
50+
### Supported keys
51+
Supported keys are the same than for [Mousetrap](https://craig.is/killing/mice).
5052

53+
For modifier keys you can use `shift`, `ctrl`, `alt`, or `meta`. You can substitute `option` for `alt` and `command` for `meta`.
54+
55+
Other special keys are `backspace`, `tab`, `enter`, `return`, `capslock`, `esc`, `escape`, `space`, `pageup`, `pagedown`, `end`, `home`, `left`, `up`, `right`, `down`, `ins`, `del`, and `plus`.
56+
57+
Any other key you should be able to reference by name like `a`, `/`, `$`, `*`, or `=`.
5158

5259
## Usage
5360
### Navigation with arrows
5461

55-
Use `Ctrl+Alt+<Up,Down,Left,Right>` (or your configured hotkeys) to navigate to a neighbor pane.
62+
Use `ctrl+alt+<Up,Down,Left,Right>` (or your configured hotkeys) to navigate to a neighbor pane.
5663

5764
### Jump with digit
5865

59-
Use `Ctrl+Alt+<1-9>` (or your configured hotkeys) to jump directly to a numbered pane.
66+
Use `ctrl+alt+<1-9>` (or your configured hotkeys) to jump directly to a numbered pane.
6067
Panes are ordered "first child descendent" and `9` is reserved to the last pane.
6168

6269
Hotkey indicators are displayed on top left corner of each pane from 2 panes opened.
6370
You can change its content, its style or hide them completly.
6471

6572
### Pane permutation
6673

67-
Adding `Shift` key (or your configured key) to previous hotkeys cause a pane switching.
74+
Adding `shift` key (or your configured key) to previous hotkeys cause a pane switching.
6875

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ exports.decorateTerms = (Terms, { React, notify, Notification }) => {
417417
const document = term.getTermDocument();
418418
const keys = new Mousetrap(document);
419419

420-
const jump_prefix = config.hotkeys.jump_prefix;
421-
const permutation_modifier = config.hotkeys.permutation_modifier;
420+
const jump_prefix = config.hotkeys.jump_prefix.toLowerCase();
421+
const permutation_modifier = config.hotkeys.permutation_modifier.toLowerCase();
422422
if (jump_prefix && jump_prefix.length) {
423423
['1','2','3','4','5','6','7','8','9'].forEach(num => {
424424
let shortcut = jump_prefix+ `+${num}`;
@@ -447,7 +447,7 @@ exports.decorateTerms = (Terms, { React, notify, Notification }) => {
447447
}
448448

449449
Object.keys(config.hotkeys.navigation).forEach(direction => {
450-
const key = config.hotkeys.navigation[direction];
450+
const key = config.hotkeys.navigation[direction].toLowerCase();
451451
const actionType = navigationActionMap[direction];
452452
if (key && key.length && actionType && actionType.length) {
453453
keys.bind(

0 commit comments

Comments
 (0)