You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Supports almost all keys including function keys (e.g. 'F1');
10
10
1. Provides easy-to-use and consistent key names to free you from dealing with numeric key codes and/or browser compatibilities;
11
11
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
90
90
91
91
### Common keys
92
92
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.
94
94
95
95
```
96
96
<KeyboardEventHandler
@@ -123,21 +123,21 @@ You can handle one of more common keys by using an array of their names.
123
123
| ctrl | 17 |
124
124
| alt | 18 |
125
125
| cap | 20 |
126
-
| num |144 | Num Lock|
126
+
| num |Num Lock, 144|
127
127
| clear | 12 |
128
-
| meta |91 |Meta, Win, Window, Cmd, Command |
128
+
| meta | Meta, Win, Window, Cmd, Command, 91 |
129
129
| ; | 186, 59 |
130
130
| = | 187, 61 |
131
131
| , | 188, 44 |
132
-
| - / minus | 189, 45, 173, 109 |
132
+
| -/minus| 189, 45, 173, 109 |
133
133
| . | 190, 110 |
134
134
| / | 191, 111 |
135
135
| `| 192 |
136
136
|[| 219 |
137
137
|\| 220 |
138
138
|]| 221 |
139
139
|\*| 106 |
140
-
| + / plus | 107 |
140
+
| +/plus| 107 |
141
141
142
142
**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.
143
143
@@ -164,9 +164,9 @@ You can handle modifier key combined with a common keys by using key name in the
164
164
- 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.
165
165
- Modifier keys are themself common keys. You can handle key event of single 'ctrl' key with `handleKeys=['ctrl']`;
166
166
167
-
### Key alias
167
+
### Key set alias
168
168
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
170
170
and put all handling logic for each key inside the handler callback function.
171
171
172
172
```
@@ -186,7 +186,7 @@ and put all handling logic for each key inside the handler callback function.
186
186
187
187
**Note**:
188
188
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.
190
190
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`.
191
191
1. Alias key names do not work with modifiers. e.g. `handleKeys=['ctrl+numeric'] // doesn't work`
192
192
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
229
229
230
230
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.
231
231
232
-
Therefore, when teting with Enzyme:
232
+
Therefore, when testing with Enzyme:
233
233
234
234
1. We can only simulate keyboard events fired from `document.body`;
0 commit comments