2022-05-04 19:15:30 +02:00
|
|
|
# Stringy Keymaps
|
2022-04-29 20:21:16 +02:00
|
|
|
|
2022-04-30 19:00:12 +02:00
|
|
|
Enables referring to keys by `'NAME'` rather than `KC.NAME`.
|
2022-04-29 20:21:16 +02:00
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
```python
|
2022-05-04 19:15:30 +02:00
|
|
|
from kmk.extensions.stringy_keymaps import Stringy_keymaps
|
2022-04-29 20:21:16 +02:00
|
|
|
|
|
|
|
# Normal
|
|
|
|
# keyboard.keymap = [[ KC.A, KC.B, KC.RESET ]]
|
|
|
|
|
|
|
|
# Indexed
|
|
|
|
# keyboard.keymap = [[ KC['A'], KC['B'], KC['RESET'] ]]
|
|
|
|
|
|
|
|
# String names
|
|
|
|
keyboard.keymap = [[ 'A' , 'B', 'RESET' ]]
|
|
|
|
|
2022-05-04 19:15:30 +02:00
|
|
|
stringy_keymaps = Stringy_keymaps()
|
2022-04-29 20:21:16 +02:00
|
|
|
|
|
|
|
# Enabling debug will show each replacement or failure.
|
|
|
|
# This is recommended during the initial development of a keyboard.
|
2022-05-04 19:15:30 +02:00
|
|
|
# stringy_keymaps.debug_enable = True
|
2022-04-29 20:21:16 +02:00
|
|
|
|
2022-05-04 19:15:30 +02:00
|
|
|
keyboard.extensions.append(stringy_keymaps)
|
2022-04-29 20:21:16 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
It should be noted that these are **not** ASCII. The string is **not** what
|
|
|
|
will be sent to the computer. The examples above have no functional difference.
|