@msobiecki/react-marauders-path 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ npm install @msobiecki/react-marauders-path
|
|
|
16
16
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
#### Single Key Schema
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
import { useKey } from '@msobiecki/react-marauders-path';
|
|
@@ -30,7 +30,7 @@ function MyComponent() {
|
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
### Multiple Patterns of Single
|
|
33
|
+
### Multiple Patterns of Single Key Schema
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
36
|
// Listen to multiple key patterns
|
|
@@ -39,7 +39,7 @@ useKey(["a", "b", "c"], (event, key) => {
|
|
|
39
39
|
});
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
#### Combination Key Schema
|
|
43
43
|
|
|
44
44
|
```typescript
|
|
45
45
|
// Listen for simultaneous key press (a + b pressed together within 500ms)
|
|
@@ -48,7 +48,7 @@ useKey("a+b", (event, key) => {
|
|
|
48
48
|
});
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
### Multiple Patterns of Combination
|
|
51
|
+
### Multiple Patterns of Combination Key Schema
|
|
52
52
|
|
|
53
53
|
```typescript
|
|
54
54
|
// Listen for multiple combination patterns
|
|
@@ -57,7 +57,7 @@ useKey(["a+b", "c+d"], (event, key) => {
|
|
|
57
57
|
});
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
### Sequential
|
|
60
|
+
### Sequential Key Schema
|
|
61
61
|
|
|
62
62
|
```typescript
|
|
63
63
|
// Listen for Konami code
|
|
@@ -66,7 +66,7 @@ useKey("ArrowUp ArrowUp ArrowDown ArrowDown", (event, key) => {
|
|
|
66
66
|
});
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
#### Multiple Patterns of Sequential Key Schema
|
|
70
70
|
|
|
71
71
|
```typescript
|
|
72
72
|
// Listen for multiple sequences
|