|
| 1 | +How to use a layout this with the pico-ducky repository. |
| 2 | + |
| 3 | +#### Go to the [latest release page](https://github.com/Neradoc/Circuitpython_Keyboard_Layouts/releases/latest), look if your language is in the list. |
| 4 | + |
| 5 | +## If your language/layout is in the bundle |
| 6 | + |
| 7 | +Download the `py` zip, named `circuitpython-keyboard-layouts-py-XXXXXXXX.zip` |
| 8 | + |
| 9 | +*You can use the mpy version targetting the version of Circuitpython that is on the device, but on Raspberry Pi Pico you don't need it - they only reduce file size and memory use on load, which the pico has plenty of.* |
| 10 | + |
| 11 | +## If your language/layout is not in the bundle |
| 12 | + |
| 13 | +Try the online generator, it should get you a zip file with the bundles for yout language |
| 14 | + |
| 15 | +https://www.neradoc.me/layouts/ |
| 16 | + |
| 17 | +## Now you have a zip file |
| 18 | + |
| 19 | +#### Find your language/layout in the lib directory |
| 20 | + |
| 21 | +For a language `LANG`, copy the following files from the zip's `lib` folder to the `lib` folder of the board. Don't change the names of the files. |
| 22 | + |
| 23 | +- `keyboard_layout.py` |
| 24 | +- `keyboard_layout_win_LANG.py` |
| 25 | +- `keycode_win_LANG.py` |
| 26 | + |
| 27 | +#### Modify the pico-ducky code to use your language file: |
| 28 | + |
| 29 | +At the start of the file replace: |
| 30 | + |
| 31 | +```py |
| 32 | +from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS |
| 33 | +from adafruit_hid.keycode import Keycode |
| 34 | +``` |
| 35 | + |
| 36 | +With this. Change `LANG` for you language, so the module names match the files without the extention. |
| 37 | +```py |
| 38 | +from keyboard_layout_win_LANG import KeyboardLayout |
| 39 | +from keycode_win_LANG import Keycode |
| 40 | +``` |
| 41 | + |
| 42 | +And also replace: |
| 43 | +```py |
| 44 | +layout = KeyboardLayoutUS(kbd) |
| 45 | +``` |
| 46 | +With: |
| 47 | +```py |
| 48 | +layout = KeyboardLayout(kbd) |
| 49 | +``` |
0 commit comments