Skip to content

Commit af472c8

Browse files
committed
Formatting and language updates
1 parent c622104 commit af472c8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

docs/macro.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Macro
22

3-
To setup a macro, add a macro to the keymap and define its function. For example, use <kbd>Fn</kbd> as No.0 macro:
3+
To set up a macro, add a macro to the keymap and define its function. By default, <kbd>Fn</kbd> is configured as macro number 0:
44

55
```python
66
# code.py
@@ -27,9 +27,11 @@ keyboard.macro_handler = macro_handler
2727
keyboard.run()
2828
```
2929

30-
## Use a macro to launch the Calculator on Windows
30+
## Examples
3131

32-
Replace the function `macro_handler` with the following code to launch the Calculator with a single keystroke.
32+
### Use a macro to launch the Calculator on Windows
33+
34+
Replace the function `macro_handler` with the following code to launch the Calculator with a single keystroke:
3335

3436
```python
3537
def macro_handler(dev, n, is_down):
@@ -39,9 +41,9 @@ def macro_handler(dev, n, is_down):
3941
dev.send_text('calc\n')
4042
```
4143

42-
## Automatic typing
44+
### Automatic typing
4345

44-
Read a file in the USB storage and type its content automatically.
46+
Read a file in the keyboard's USB storage and type its content automatically.
4547

4648
```python
4749
def macro_handler(dev, n, is_down):
@@ -51,9 +53,9 @@ def macro_handler(dev, n, is_down):
5153
dev.send_text(line)
5254
```
5355

54-
## Repeated typing
56+
### Repeated typing
5557

56-
Use a macro to trigger a repeated sequence of typing until a new key is pressed.
58+
Use a macro to trigger a repeated sequence of key presses until a new key is pressed.
5759

5860
```python
5961
def macro_handler(dev, n, is_down):

0 commit comments

Comments
 (0)