Skip to content

Commit 674cf38

Browse files
committed
temporary readme file
1 parent 0cc6829 commit 674cf38

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Keyboard Layouts For Circuitpython
2+
3+
The goal of this repository is to contain a list of keyboard layouts for use with the adafruit_hid library, that can be used as a reference for international keyboards and can be distributed as a "bundle" in the style of the Adafruit bundle.
4+
5+
It is intended to be compatible with circup for easy installation with a command like this, once circup supports third-party bundles.
6+
7+
```
8+
circup install keyboard_layout_win_fr
9+
```
10+
11+
`keyboard_layout_<platform>_<lang>` modules will contain the layout information for use with the `Keyboard` to type text.
12+
13+
```py
14+
import usb_hid
15+
from adafruit_hid.keyboard import Keyboard
16+
from keyboard_layout_win_fr import KeyboardLayoutFR
17+
keyboard = Keyboard(usb_hid.devices)
18+
keyboard_fr = KeyboardLayoutFR(keyboard)
19+
keyboard_fr.write("Bonjour le monde")
20+
```
21+
22+
`keycode_<platform>_<lang>` modules are an attempt to make it easier to swap layouts. HID Keycodes normally reference the US keyboard. These these localized keycodes offer a level of conversion allowing to use `Keycode.A` across azerty and qwerty keyboards for example. It won't swap `control` and `command` to match the platform however. (yet ?)
23+
24+
```py
25+
if IS_AZERTY:
26+
from keycode_mac_fr import Keycode
27+
else:
28+
from adafruit_hid.keycode import Keycode
29+
30+
kbd.send(Keycode.COMMAND, Keycode.A)
31+
```
32+
33+
NOTE: this is pretty much experimental for now, these layouts are not for use.

0 commit comments

Comments
 (0)