|
6 | 6 |
|
7 | 7 | from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values |
8 | 8 |
|
9 | | -DELAY_AFTER_ESCAPE = 0.05 |
| 9 | +# NOTE: There appears to be some delay when bringing up the command screen. |
| 10 | + |
| 11 | +DELAY_AFTER_SLASH = 0.80 # required so minecraft has time to bring up command screen |
| 12 | + |
| 13 | + |
| 14 | +# NOTE: On PC, characters are sometimes lost due to lag. No simple fix for |
| 15 | +# lost keystrokes is known. However, the commands do work most of the time. |
| 16 | + |
10 | 17 |
|
11 | 18 | app = { # REQUIRED dict, must be named 'app' |
12 | 19 | 'name' : 'Minecraft (/msg)', # Application name |
13 | 20 | 'macros' : [ # List of button macros... |
14 | 21 | # COLOR LABEL KEY SEQUENCE |
15 | 22 | # 1st row ---------- |
16 | 23 | (0x000020, 'list', [ |
17 | | - Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE, |
18 | | - '/list', |
| 24 | + '/', DELAY_AFTER_SLASH, |
| 25 | + 'list', |
19 | 26 | Keycode.RETURN, -Keycode.RETURN]), |
20 | 27 | (0x000020, 'list', [ |
21 | | - Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE, |
22 | | - '/list', |
| 28 | + '/', DELAY_AFTER_SLASH, |
| 29 | + 'list', |
23 | 30 | Keycode.RETURN, -Keycode.RETURN]), |
24 | 31 | (0x000020, 'list', [ |
25 | | - Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE, |
26 | | - '/list', |
| 32 | + '/', DELAY_AFTER_SLASH, |
| 33 | + 'list', |
27 | 34 | Keycode.RETURN, -Keycode.RETURN]), |
28 | 35 | # 2nd row ---------- |
29 | 36 | (0x000000, '', []), |
|
35 | 42 | (0x000000, '', []), |
36 | 43 | # 4th row ---------- |
37 | 44 | (0x101010, 'bed', [ |
38 | | - Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE, |
39 | | - '/msg @a Time for bed!', |
| 45 | + '/', DELAY_AFTER_SLASH, |
| 46 | + 'msg @a Time for bed!', |
40 | 47 | Keycode.RETURN, -Keycode.RETURN]), |
41 | 48 | (0x101010, 'bed', [ |
42 | | - Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE, |
43 | | - '/msg @a Time for bed!', |
| 49 | + '/', DELAY_AFTER_SLASH, |
| 50 | + 'msg @a Time for bed!', |
44 | 51 | Keycode.RETURN, -Keycode.RETURN]), |
45 | 52 | (0x101010, 'bed', [ |
46 | | - Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE, |
47 | | - '/msg @a Time for bed!', |
| 53 | + '/', DELAY_AFTER_SLASH, |
| 54 | + 'msg @a Time for bed!', |
48 | 55 | Keycode.RETURN, -Keycode.RETURN]), |
49 | 56 | # Encoder button --- |
50 | 57 | (0x000000, '', []) |
|
0 commit comments