Rename "Firmware" to "KeyboardConfig" for clarity in main.py and to illustrate separation of KeyboardConfig/InternalState
This commit is contained in:
parent
e8c3b5ac70
commit
1e9625ae0e
@ -5,17 +5,17 @@ Keymaps in KMK are simple Python class objects with various attributes assigned
|
|||||||
|
|
||||||
The basics of what you'll need to get started are:
|
The basics of what you'll need to get started are:
|
||||||
|
|
||||||
- Import the `Firmware` object for your keyboard from `kmk.boards` (or, if
|
- Import the `KeyboardConfig` object for your keyboard from `kmk.boards` (or, if
|
||||||
handwiring your keyboard, import `Firmware` from the appropriate MCU for your
|
handwiring your keyboard, import `KeyboardConfig` from the appropriate MCU for your
|
||||||
board from `kmk.mcus`. See `hardware.md` for the list of supported boards and
|
board from `kmk.mcus`. See `hardware.md` for the list of supported boards and
|
||||||
map this to the correct Python module under either of those paths.
|
map this to the correct Python module under either of those paths.
|
||||||
|
|
||||||
- Add a file to `user_keymaps/your_username` called whatever you'd like
|
- Add a file to `user_keymaps/your_username` called whatever you'd like
|
||||||
|
|
||||||
- Assign a `Firmware` instance to a variable (ex. `keyboard = Firmware()` - note
|
- Assign a `KeyboardConfig` instance to a variable (ex. `keyboard = KeyboardConfig()` - note
|
||||||
the parentheses)
|
the parentheses)
|
||||||
|
|
||||||
- Make sure this `Firmware` instance is actually run at the end of the file with
|
- Make sure this `KeyboardConfig` instance is actually run at the end of the file with
|
||||||
a block such as the following:
|
a block such as the following:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
@ -85,14 +85,14 @@ matrix pins (in somewhat of a "spider" setup), utilizing most of the above
|
|||||||
features:
|
features:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from kmk.boards.klarank import Firmware
|
from kmk.boards.klarank import KeyboardConfig
|
||||||
from kmk.consts import UnicodeMode
|
from kmk.consts import UnicodeMode
|
||||||
from kmk.keycodes import KC
|
from kmk.keycodes import KC
|
||||||
from kmk.keycodes import generate_leader_dictionary_seq as glds
|
from kmk.keycodes import generate_leader_dictionary_seq as glds
|
||||||
from kmk.macros.simple import send_string
|
from kmk.macros.simple import send_string
|
||||||
from kmk.macros.unicode import compile_unicode_string_sequences as cuss
|
from kmk.macros.unicode import compile_unicode_string_sequences as cuss
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = KeyboardConfig()
|
||||||
|
|
||||||
keyboard.debug_enabled = True
|
keyboard.debug_enabled = True
|
||||||
keyboard.unicode_mode = UnicodeMode.LINUX
|
keyboard.unicode_mode = UnicodeMode.LINUX
|
||||||
|
@ -40,11 +40,11 @@ Here's an example of all this in action:
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
# user_keymaps/some_silly_example.py
|
# user_keymaps/some_silly_example.py
|
||||||
from kmk.boards.klarank import Firmware
|
from kmk.boards.klarank import KeyboardConfig
|
||||||
from kmk.keycodes import KC
|
from kmk.keycodes import KC
|
||||||
from kmk.macros.simple import send_string
|
from kmk.macros.simple import send_string
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = KeyboardConfig()
|
||||||
|
|
||||||
keyboard.tap_time = 750
|
keyboard.tap_time = 750
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.D9, P.D10, P.D11, P.D12, P.D13, P.SCL)
|
col_pins = (P.D9, P.D10, P.D11, P.D12, P.D13, P.SCL)
|
||||||
row_pins = (P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
row_pins = (P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.A0, P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
col_pins = (P.A0, P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
||||||
row_pins = (P.TX, P.RX, P.SDA, P.SCL, P.D13, P.D12, P.D11, P.D10)
|
row_pins = (P.TX, P.RX, P.SDA, P.SCL, P.D13, P.D12, P.D11, P.D10)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.RX, P.D13, P.A0, P.D11, P.A4, P.A5, P.D10, P.D9, P.SCK)
|
col_pins = (P.RX, P.D13, P.A0, P.D11, P.A4, P.A5, P.D10, P.D9, P.SCK)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
rgb_pixel_pin = board.TX
|
rgb_pixel_pin = board.TX
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
col_pins = (P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
||||||
row_pins = (P.A0, P.D11, P.D10, P.D9)
|
row_pins = (P.A0, P.D11, P.D10, P.D9)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
col_pins = (P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
||||||
row_pins = (P.D11, P.D10, P.D9, P.D7, P.D13)
|
row_pins = (P.D11, P.D10, P.D9, P.D7, P.D13)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
from kmk.util import intify_coordinate as ic
|
from kmk.util import intify_coordinate as ic
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
# Pin mappings for converter board found at hardware/README.md
|
# Pin mappings for converter board found at hardware/README.md
|
||||||
# QMK: MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 }
|
# QMK: MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 }
|
||||||
# QMK: MATRIX_ROW_PINS { D7, E6, B4, D2, D4 }
|
# QMK: MATRIX_ROW_PINS { D7, E6, B4, D2, D4 }
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.SDA, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
col_pins = (P.SDA, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
||||||
row_pins = (P.TX, P.A0, P.RX, P.A1, P.D11, P.D9, P.D12, P.D10)
|
row_pins = (P.TX, P.A0, P.RX, P.A1, P.D11, P.D9, P.D12, P.D10)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.A2, P.A3, P.A4, P.A5, P.SCK, P.A0)
|
col_pins = (P.A2, P.A3, P.A4, P.A5, P.SCK, P.A0)
|
||||||
row_pins = (P.D11, P.D10, P.D9, P.D7)
|
row_pins = (P.D11, P.D10, P.D9, P.D7)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
col_pins = (P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
||||||
row_pins = (P.D13, P.D11, P.D10, P.D9)
|
row_pins = (P.D13, P.D11, P.D10, P.D9)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
col_pins = (P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
||||||
row_pins = (P.D13, P.D11, P.D10, P.D9, P.D7)
|
row_pins = (P.D13, P.D11, P.D10, P.D9, P.D7)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.RX, P.A1, P.A2, P.A3, P.A4, P.A5)
|
col_pins = (P.RX, P.A1, P.A2, P.A3, P.A4, P.A5)
|
||||||
row_pins = (P.D13, P.D11, P.D10, P.D9, P.D7)
|
row_pins = (P.D13, P.D11, P.D10, P.D9, P.D7)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
# Will need additional work and testing
|
# Will need additional work and testing
|
||||||
col_pins = (P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI, P.D12)
|
col_pins = (P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI, P.D12)
|
||||||
row_pins = (P.A0, P.D13, P.D11, P.D10, P.D9, P.D7)
|
row_pins = (P.A0, P.D13, P.D11, P.D10, P.D9, P.D7)
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
col_pins = (P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
||||||
row_pins = (P.D11, P.D10, P.D9, P.RX, P.D13)
|
row_pins = (P.D11, P.D10, P.D9, P.RX, P.D13)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.A0, P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
col_pins = (P.A0, P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
||||||
row_pins = (P.TX, P.RX, P.SDA, P.SCL, P.D9, P.D10, P.D12, P.D11, P.D13)
|
row_pins = (P.TX, P.RX, P.SDA, P.SCL, P.D9, P.D10, P.D12, P.D11, P.D13)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
col_pins = (P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
||||||
row_pins = (P.D13, P.D11, P.D10, P.D9, P.D7)
|
row_pins = (P.D13, P.D11, P.D10, P.D9, P.D7)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.A0, P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK)
|
col_pins = (P.A0, P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK)
|
||||||
row_pins = (P.D13, P.D11, P.D10, P.D9, P.D7)
|
row_pins = (P.D13, P.D11, P.D10, P.D9, P.D7)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.A5, P.A4, P.A3, P.A2, P.A1, P.A0)
|
col_pins = (P.A5, P.A4, P.A3, P.A2, P.A1, P.A0)
|
||||||
row_pins = (P.D7, P.D9, P.D10, P.D11)
|
row_pins = (P.D7, P.D9, P.D10, P.D11)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import board
|
import board
|
||||||
|
|
||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
col_pins = (P.MOSI, P.SCK, P.A5, P.A4, P.A3, P.A2)
|
col_pins = (P.MOSI, P.SCK, P.A5, P.A4, P.A3, P.A2)
|
||||||
row_pins = (P.D11, P.D10, P.D9, P.D7)
|
row_pins = (P.D11, P.D10, P.D9, P.D7)
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COLUMNS
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
from kmk.consts import DiodeOrientation
|
from kmk.consts import DiodeOrientation
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware as _Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
from kmk.util import intify_coordinate as ic
|
from kmk.util import intify_coordinate as ic
|
||||||
|
|
||||||
# Implements what used to be handled by Firmware.swap_indicies for this
|
# Implements what used to be handled by KeyboardConfig.swap_indicies for this
|
||||||
# board, by flipping various row3 (bottom physical row) keys so their
|
# board, by flipping various row3 (bottom physical row) keys so their
|
||||||
# coord_mapping matches what the user pressed (even if the wiring
|
# coord_mapping matches what the user pressed (even if the wiring
|
||||||
# underneath is sending different coordinates)
|
# underneath is sending different coordinates)
|
||||||
@ -24,7 +24,7 @@ def r3_swap(col):
|
|||||||
return col
|
return col
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
# physical, visible cols (SCK, MO, MI, RX, TX, D4)
|
# physical, visible cols (SCK, MO, MI, RX, TX, D4)
|
||||||
# physical, visible rows (10, 11, 12, 13) (9, 6, 5, SCL)
|
# physical, visible rows (10, 11, 12, 13) (9, 6, 5, SCL)
|
||||||
col_pins = (P.SCK, P.MOSI, P.MISO, P.RX, P.TX, P.D4)
|
col_pins = (P.SCK, P.MOSI, P.MISO, P.RX, P.TX, P.D4)
|
||||||
|
@ -53,7 +53,7 @@ from kmk.util import intify_coordinate as ic
|
|||||||
from kmk import led, rgb # isort:skip
|
from kmk import led, rgb # isort:skip
|
||||||
|
|
||||||
|
|
||||||
class Firmware:
|
class KeyboardConfig:
|
||||||
debug_enabled = False
|
debug_enabled = False
|
||||||
|
|
||||||
keymap = None
|
keymap = None
|
||||||
@ -95,7 +95,7 @@ class Firmware:
|
|||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return (
|
return (
|
||||||
'Firmware('
|
'KeyboardConfig('
|
||||||
'debug_enabled={} '
|
'debug_enabled={} '
|
||||||
'keymap=truncated '
|
'keymap=truncated '
|
||||||
'coord_mapping=truncated '
|
'coord_mapping=truncated '
|
@ -1,6 +1,6 @@
|
|||||||
from kmk.firmware import Firmware as _Firmware
|
|
||||||
from kmk.hid import CircuitPythonUSB_HID
|
from kmk.hid import CircuitPythonUSB_HID
|
||||||
|
from kmk.keyboard_config import KeyboardConfig as _KeyboardConfig
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class KeyboardConfig(_KeyboardConfig):
|
||||||
hid_helper = CircuitPythonUSB_HID
|
hid_helper = CircuitPythonUSB_HID
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from kmk.boards.converter.fourtypercentclub.luddite import Firmware
|
from kmk.boards.converter.fourtypercentclub.luddite import KeyboardConfig
|
||||||
from kmk.keys import KC
|
from kmk.keys import KC
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = KeyboardConfig()
|
||||||
|
|
||||||
_______ = KC.TRNS
|
_______ = KC.TRNS
|
||||||
XXXXXXX = KC.NO
|
XXXXXXX = KC.NO
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from kmk.boards.converter.keebio.nyquist_r2 import Firmware
|
from kmk.boards.converter.keebio.nyquist_r2 import KeyboardConfig
|
||||||
from kmk.keys import KC
|
from kmk.keys import KC
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = KeyboardConfig()
|
||||||
|
|
||||||
_______ = KC.TRNS
|
_______ = KC.TRNS
|
||||||
XXXXXXX = KC.NO
|
XXXXXXX = KC.NO
|
||||||
|
@ -2,11 +2,11 @@ from kmk.consts import DiodeOrientation, UnicodeMode
|
|||||||
from kmk.handlers.sequences import (compile_unicode_string_sequences,
|
from kmk.handlers.sequences import (compile_unicode_string_sequences,
|
||||||
send_string)
|
send_string)
|
||||||
from kmk.keys import KC
|
from kmk.keys import KC
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
from kmk.types import AttrDict
|
from kmk.types import AttrDict
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = KeyboardConfig()
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Converter/handwire:
|
Converter/handwire:
|
||||||
|
@ -2,11 +2,11 @@ from kmk.consts import DiodeOrientation, UnicodeMode
|
|||||||
from kmk.handlers.sequences import (compile_unicode_string_sequences,
|
from kmk.handlers.sequences import (compile_unicode_string_sequences,
|
||||||
send_string)
|
send_string)
|
||||||
from kmk.keys import KC
|
from kmk.keys import KC
|
||||||
from kmk.mcus.circuitpython_usbhid import Firmware
|
from kmk.mcus.circuitpython_usbhid import KeyboardConfig
|
||||||
from kmk.pins import Pin as P
|
from kmk.pins import Pin as P
|
||||||
from kmk.types import AttrDict
|
from kmk.types import AttrDict
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = KeyboardConfig()
|
||||||
|
|
||||||
keyboard.col_pins = (P.A0, P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI, P.MISO, P.RX, P.TX, P.D4)
|
keyboard.col_pins = (P.A0, P.A1, P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI, P.MISO, P.RX, P.TX, P.D4)
|
||||||
keyboard.row_pins = (P.D10, P.D11, P.D12, P.D13)
|
keyboard.row_pins = (P.D10, P.D11, P.D12, P.D13)
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
from kmk.boards.converter.keebio.levinson_r2 import Firmware
|
from kmk.boards.converter.keebio.levinson_r2 import KeyboardConfig
|
||||||
from kmk.consts import LeaderMode, UnicodeMode
|
from kmk.consts import LeaderMode, UnicodeMode
|
||||||
from kmk.handlers.sequences import compile_unicode_string_sequences
|
from kmk.handlers.sequences import compile_unicode_string_sequences
|
||||||
from kmk.keys import KC
|
from kmk.keys import KC
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = KeyboardConfig()
|
||||||
|
|
||||||
# ------------------User level config variables ---------------------------------------
|
# ------------------User level config variables ---------------------------------------
|
||||||
keyboard.leader_mode = LeaderMode.TIMEOUT
|
keyboard.leader_mode = LeaderMode.TIMEOUT
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from kmk.boards.converter.fourtypercentclub.luddite import Firmware
|
from kmk.boards.converter.fourtypercentclub.luddite import KeyboardConfig
|
||||||
from kmk.keys import KC
|
from kmk.keys import KC
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = KeyboardConfig()
|
||||||
|
|
||||||
# ---------------------------------- Config --------------------------------------------
|
# ---------------------------------- Config --------------------------------------------
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from kmk.boards.converter.keebio.nyquist_r2 import Firmware
|
from kmk.boards.converter.keebio.nyquist_r2 import KeyboardConfig
|
||||||
from kmk.keys import KC
|
from kmk.keys import KC
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = KeyboardConfig()
|
||||||
|
|
||||||
# ------------------User level config variables ---------------------------------------
|
# ------------------User level config variables ---------------------------------------
|
||||||
keyboard.tap_time = 150
|
keyboard.tap_time = 150
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
from kmk.boards.converter.keebio.iris_r2 import Firmware
|
from kmk.boards.converter.keebio.iris_r2 import KeyboardConfig
|
||||||
from kmk.consts import LeaderMode, UnicodeMode
|
from kmk.consts import LeaderMode, UnicodeMode
|
||||||
from kmk.handlers.sequences import compile_unicode_string_sequences as cuss
|
from kmk.handlers.sequences import compile_unicode_string_sequences as cuss
|
||||||
from kmk.handlers.sequences import send_string
|
from kmk.handlers.sequences import send_string
|
||||||
from kmk.keys import KC
|
from kmk.keys import KC
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = KeyboardConfig()
|
||||||
|
|
||||||
keyboard.debug_enabled = False
|
keyboard.debug_enabled = False
|
||||||
keyboard.unicode_mode = UnicodeMode.LINUX
|
keyboard.unicode_mode = UnicodeMode.LINUX
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
from kmk.boards.klarank import Firmware
|
from kmk.boards.klarank import KeyboardConfig
|
||||||
from kmk.consts import LeaderMode, UnicodeMode
|
from kmk.consts import LeaderMode, UnicodeMode
|
||||||
from kmk.handlers.sequences import compile_unicode_string_sequences as cuss
|
from kmk.handlers.sequences import compile_unicode_string_sequences as cuss
|
||||||
from kmk.handlers.sequences import send_string
|
from kmk.handlers.sequences import send_string
|
||||||
from kmk.keys import KC, make_key
|
from kmk.keys import KC, make_key
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = KeyboardConfig()
|
||||||
|
|
||||||
keyboard.debug_enabled = True
|
keyboard.debug_enabled = True
|
||||||
keyboard.unicode_mode = UnicodeMode.LINUX
|
keyboard.unicode_mode = UnicodeMode.LINUX
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
from kmk.boards.converter.keebio.levinson_r2 import Firmware
|
from kmk.boards.converter.keebio.levinson_r2 import KeyboardConfig
|
||||||
from kmk.consts import LeaderMode, UnicodeMode
|
from kmk.consts import LeaderMode, UnicodeMode
|
||||||
from kmk.handlers.sequences import compile_unicode_string_sequences
|
from kmk.handlers.sequences import compile_unicode_string_sequences
|
||||||
from kmk.keys import KC
|
from kmk.keys import KC
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = KeyboardConfig()
|
||||||
|
|
||||||
# ------------------User level config variables ---------------------------------------
|
# ------------------User level config variables ---------------------------------------
|
||||||
keyboard.leader_mode = LeaderMode.TIMEOUT
|
keyboard.leader_mode = LeaderMode.TIMEOUT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user