|
1 | 1 | # Keyboard Configuration
|
2 | 2 |
|
3 | 3 | M60 is not just a USB HID device, but also a USB storage device. Python code can be saved and executed in the keyboard. When the keyboard powers on, it will run the Python file `code.py` in its USB storage.
|
4 |
| -In `code.py`, we can modify its keymap, add a macro and add a new feature to keyboard. |
| 4 | +Using `code.py`, you can modify they keyboard's keymap, and add macros, Tap-keys and more. |
5 | 5 |
|
6 | 6 | 
|
7 | 7 |
|
8 |
| -The default content of `code.py` is: |
| 8 | +An up-to-date `code.py` is included in this repository. Example content for `code.py` could be: |
9 | 9 |
|
10 | 10 | ```python
|
11 | 11 |
|
@@ -95,11 +95,13 @@ keyboard.run()
|
95 | 95 |
|
96 | 96 | ```
|
97 | 97 |
|
98 |
| -`keymap` contains multiple layers of keycodes. `macro_handler` is used to handle all macros. `pairs_handler` is used to handle any pair-keys. |
| 98 | +The `keymap` variable can contains multiple layers of keycodes. The `macro_handler` is used to handle all macros. The `pairs_handler` is used to handle any pair-keys. |
99 | 99 |
|
100 |
| -**When `code.py` is saved, the keyboard will reload it. If `code.py` has a syntax error, the keyboard will stop working. But, don't worry, it wouldn't damage the hardware. Fix the error and save it, then the keyboard will recover** |
| 100 | +**When `code.py` is saved, the keyboard will reload it. If `code.py` has a syntax error, the keyboard will stop working. But, don't worry, it wouldn't damage the hardware. Use another keyboard to fix the error and save it, then the keyboard will recover.** |
101 | 101 |
|
102 |
| -If you know how Python works, configuring the keyboard would be very easy. If not, we have some examples to get started. |
| 102 | +## Examples |
| 103 | + |
| 104 | +If you already Python, configuring the keyboard is simple. If not, here are some examples to get started. |
103 | 105 |
|
104 | 106 | 1. To swap the positions of <kbd>Caps</kbd> and <kbd>LCtrl</kbd>, just swap `CAPS` and `LCTRL` in `layer 0` of `keymap`:
|
105 | 107 |
|
@@ -127,7 +129,7 @@ If you know how Python works, configuring the keyboard would be very easy. If no
|
127 | 129 | ),
|
128 | 130 | ```
|
129 | 131 |
|
130 |
| -2. Add a new macro. Use <kbd>Fn</kbd> and <kbd>Enter</kbd> to trigger No.1 macro. Just add `MACRO(1)` to `layer 1`: |
| 132 | +3. Add a new macro. Use <kbd>Fn</kbd> and <kbd>Enter</kbd> to trigger No.1 macro. Just add `MACRO(1)` to `layer 1`: |
131 | 133 |
|
132 | 134 | ```python
|
133 | 135 | # layer 1
|
|
0 commit comments