Make user keymaps fully declarative
This removes the need for the user to define... most things, honestly. Notably, `main()` is no longer the end user's responsibility. This also allows us to do fun stuff going forward like validating keymaps for sanity (ex: the key assigned to `KC_MO(x)` should be assigned to `KC_TRNS` on the target layer or the user will never be able to escape that layer). This also disambiguates `BOARD` to always refer to an actual slab of silicon, renaming to `USER_KEYMAP`. Entrypoints are now a bit more wild, and mostly-unsupported boards no longer have working entrypoints. It's probably just time to scrap those boards for now (until we have BLE HID and/or bitbang USB HID, at least).
This commit is contained in:
0
kmk/entrypoints/__init__.py
Normal file
0
kmk/entrypoints/__init__.py
Normal file
4
kmk/entrypoints/global.py
Normal file
4
kmk/entrypoints/global.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from kmk_keyboard_user import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
11
kmk/entrypoints/handwire/Pipfile
Normal file
11
kmk/entrypoints/handwire/Pipfile
Normal file
@@ -0,0 +1,11 @@
|
||||
[[source]]
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
[packages]
|
||||
|
||||
[dev-packages]
|
||||
|
||||
[requires]
|
||||
python_version = "3.7"
|
0
kmk/entrypoints/handwire/__init__.py
Normal file
0
kmk/entrypoints/handwire/__init__.py
Normal file
24
kmk/entrypoints/handwire/pyboard.py
Normal file
24
kmk/entrypoints/handwire/pyboard.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import sys
|
||||
from logging import DEBUG
|
||||
|
||||
from kmk.firmware import Firmware
|
||||
from kmk.micropython.pyb_hid import HIDHelper
|
||||
|
||||
|
||||
def main():
|
||||
from kmk_keyboard_user import cols, diode_orientation, keymap, rows
|
||||
|
||||
try:
|
||||
firmware = Firmware(
|
||||
keymap=keymap,
|
||||
row_pins=rows,
|
||||
col_pins=cols,
|
||||
diode_orientation=diode_orientation,
|
||||
hid=HIDHelper,
|
||||
log_level=DEBUG,
|
||||
)
|
||||
|
||||
firmware.go()
|
||||
except Exception as e:
|
||||
sys.print_exception(e)
|
||||
sys.exit(1)
|
3
kmk/entrypoints/handwire/pyboard_boot.py
Normal file
3
kmk/entrypoints/handwire/pyboard_boot.py
Normal file
@@ -0,0 +1,3 @@
|
||||
import pyb
|
||||
|
||||
pyb.usb_mode('VCP+HID', hid=pyb.hid_keyboard) # act as a serial device and a mouse
|
Reference in New Issue
Block a user