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
-`key`: string representing the keyboard key to listen to
16
+
-`keysOrFilter`: one of following:
17
+
-`string`: representing the keyboard key to listen to
18
+
-`Array<string>`: representing any of keys to listen to
19
+
-`Function`: custom filter function to validate event key
20
+
-`true`: to listen for all events
17
21
18
-
See [KeyboardEvent.key Value column](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values) for possible values
22
+
See [KeyboardEvent.key Value column](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values) for possible values
19
23
-`callback`: a function to be called when the key is pressed. Before called, it will be checked whether keyboard shortcuts are disabled, or interactive element is currently focused, or whether options should be applied
20
24
-`options`: options to be applied to the shortcut:
21
-
-`push`: whether the event should be triggered on both keydown and keyup
22
-
-`prevent`: prevents the default action of the event
23
-
-`stop`: prevents propagation of the event in the capturing and bubbling phases
24
-
-`ctrl`: whether the Ctrl key should be pressed (Cmd key on MacOS)
25
-
-`alt`: whether the Alt key should be pressed
26
-
-`shift`: whether the Shift key should be pressed
25
+
-`push`: whether the event should be triggered on both keydown and keyup (default: `false`)
26
+
-`prevent`: prevents the default action of the event (default: `false`)
27
+
-`stop`: prevents propagation of the event in the capturing and bubbling phases (default: `false`)
28
+
-`ctrl`: whether the Ctrl key (Cmd key on MacOS) should be pressed (default: `false`)
29
+
-`alt`: whether the Alt key should be pressed (default: `false`)
30
+
-`shift`: whether the Shift key should be pressed (should be explicitly defined as `true`|`false` if needed)
31
+
-`caseSensitive`: whether specific case should be listened, e.g. only 'd' and not 'D' (default: `false`)
27
32
-`stopCallback`: a callback to stop listening to the event
0 commit comments