Skip to content

Commit fc8de29

Browse files
committed
add a macropad-dedicated readme file
1 parent 55dfa19 commit fc8de29

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

README-MACROPAD.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Adafruit's Macropad and Keyboard Layouts
2+
3+
When using the `adafruit_macropad` library with Adafruit's Macropad, you can setup the layout and keycode classes in the constructor with code like this.
4+
5+
```py
6+
from adafruit_macropad import MacroPad
7+
8+
from keyboard_layout_win_fr import KeyboardLayout
9+
from keycode_win_fr import Keycode
10+
11+
macropad = MacroPad(
12+
layout_class=KeyboardLayout,
13+
keycode_class=Keycode,
14+
)
15+
```
16+
17+
[See this file in the macropad library](https://github.com/adafruit/Adafruit_CircuitPython_MacroPad/blob/main/examples/macropad_keyboard_layout.py) for a full example script.
18+
19+
## The Hotkeys Project
20+
21+
For [the popular hotkeys project](https://learn.adafruit.com/macropad-hotkeys), not only will you have to update `code.py` with the change above, you also have to change the macros to use the keycodes setup in the macropad module instead of the `adafruit_hid` default keycode module.
22+
23+
The `adafruit_macropad.keycodes` is a module-level variable that is setup with the value defined in the MacroPad class. When it's imported in the macros files it shares that value with the one defined in `code.py`.
24+
25+
Replace:
26+
```py
27+
from adafruit_hid.keycode import Keycode
28+
```
29+
With:
30+
```py
31+
from adafruit_macropad import keycodes as Keycode
32+
```
33+
34+
Note that some of the default macros might still use key names that are not available on your keyboard, or shortcuts that do not match the localized version of your applications. For example there is no `[` key on a French keyboard, if a shortcut uses it, it pust be changed to the correct shortcut for your application.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ circup bundle-add Neradoc/Circuitpython_Keyboard_Layouts
99
circup install keyboard_layout_win_fr keycode_win_fr
1010
```
1111

12-
NOTE: for pico-ducky users, [there's a dedicated guide](PICODUCKY.md).
12+
There's a couple of project-specific guides:
13+
14+
- [How to use the layouts with Adafruit's Macropad and the **Hotkeys** project](README-MACROPAD.md).
15+
- [For pico-ducky users, there's a dedicated guide](PICODUCKY.md).
1316

1417
## Install your language
1518

0 commit comments

Comments
 (0)