Skip to content

Commit 3011f64

Browse files
committed
Fix documentation and rebuild demo
1 parent b5992d3 commit 3011f64

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A React component for handling keyboard events (keyup, keydown and keypress<sup>
55
## Main features
66

77
1. Supports combined keys ( e.g. CTRL + S and even CTRL + SHIFT + S );
8-
1. Supports handling midifier key alone (e.g. handle pressing 'ctrl' key);
8+
1. Supports handling modifier key alone (e.g. handle pressing 'ctrl' key);
99
1. Supports almost all keys including function keys (e.g. 'F1');
1010
1. Provides easy-to-use and consistent key names to free you from dealing with numeric key codes and/or browser compatibilities;
1111
1. Supports key alias such 'alphanumeric' and 'all' as short cuts for handling multiple keys;
@@ -90,7 +90,7 @@ The `handleKeys` prop accepts an array of key names. Key names and key alias fre
9090

9191
### Common keys
9292

93-
You can handle one of more common keys by using an array of their names.
93+
You can handle one or more common keys by using an array of their names.
9494

9595
```
9696
<KeyboardEventHandler
@@ -123,21 +123,21 @@ You can handle one of more common keys by using an array of their names.
123123
| ctrl | 17 |
124124
| alt | 18 |
125125
| cap | 20 |
126-
| num | 144 | Num Lock |
126+
| num | Num Lock, 144 |
127127
| clear | 12 |
128-
| meta | 91 | Meta, Win, Window, Cmd, Command |
128+
| meta | Meta, Win, Window, Cmd, Command, 91 |
129129
| ; | 186, 59 |
130130
| = | 187, 61 |
131131
| , | 188, 44 |
132-
| - / minus | 189, 45, 173, 109 |
132+
| -/minus | 189, 45, 173, 109 |
133133
| . | 190, 110 |
134134
| / | 191, 111 |
135135
| `| 192 |
136136
| [ | 219 |
137137
| &#92; | 220 |
138138
| ] | 221 |
139139
| \* | 106 |
140-
| + / plus | 107 |
140+
| +/plus | 107 |
141141

142142
**Note**: Native keyboard events with modifier key(s) will **NOT** match common keys in `handleKeys`. e.g. `handleKeys=['a']` will not handler events with combined keys 'Ctrl' and 'a'. To match native keyboard event with modifiers, read the next section.
143143

@@ -164,9 +164,9 @@ You can handle modifier key combined with a common keys by using key name in the
164164
- Modifier keys only work well with common keys a-z. OS and/or browsers use other combinations for other purposes. For example, `cmd + right` is used as the shortcut to navigate 'forward' in some browsers.
165165
- Modifier keys are themself common keys. You can handle key event of single 'ctrl' key with `handleKeys=['ctrl']`;
166166

167-
### Key alias
167+
### Key set alias
168168

169-
Key alias provide any easy way to specify common key sets. It is useful when you want to handle multiple keys
169+
Key set alias provide any easy way to specify common key sets. It is useful when you want to handle multiple keys
170170
and put all handling logic for each key inside the handler callback function.
171171

172172
```
@@ -186,7 +186,7 @@ and put all handling logic for each key inside the handler callback function.
186186

187187
**Note**:
188188

189-
1. Alias keys are alias to a list of common keys. Expect the same behavior as if the respective array of of common key names is in use.
189+
1. Alias keys are alias to a list of common keys. Expect the same behavior as if the respective array of common key names is in use.
190190
1. When a keyboard event matches, the first (`key`) parameter to the callback function will be the matched lowercase common key name. e.g. `a` for alias `numeric`.
191191
1. Alias key names do not work with modifiers. e.g. `handleKeys=['ctrl+numeric'] // doesn't work`
192192
1. You can mix alias with common keys. e.g. `handleKeys=['numeric', 'a', 'enter', 'ctrl+b']`
@@ -229,7 +229,7 @@ Enzyme has two main limitations (ref: https://github.com/airbnb/enzyme/blob/mast
229229

230230
2. Event propagation is not supported. However, Key events on wrapped components are bubbled up and handled by at the document level by this component.
231231

232-
Therefore, when teting with Enzyme:
232+
Therefore, when testing with Enzyme:
233233

234234
1. We can only simulate keyboard events fired from `document.body`;
235235
1. `mount` is required.

0 commit comments

Comments
 (0)