mirror of
https://github.com/System-End/hackpad.git
synced 2026-04-19 23:32:54 +00:00
.
This commit is contained in:
parent
28f0af15ca
commit
b82da4ba02
1 changed files with 35 additions and 0 deletions
|
|
@ -0,0 +1,35 @@
|
|||
# You import all the IOs of your board
|
||||
import board
|
||||
|
||||
# These are imports from the kmk library
|
||||
from kmk.kmk_keyboard import KMKKeyboard
|
||||
from kmk.scanners.keypad import KeysScanner
|
||||
from kmk.keys import KC
|
||||
from kmk.modules.macros import Press, Release, Tap, Macros
|
||||
|
||||
# This is the main instance of your keyboard
|
||||
keyboard = KMKKeyboard()
|
||||
|
||||
# Add the macro extension
|
||||
macros = Macros()
|
||||
keyboard.modules.append(macros)
|
||||
|
||||
# Define your pins here!
|
||||
PINS = [board.D3, board.D4, board.D2, board.D1]
|
||||
|
||||
# Tell kmk we are not using a key matrix
|
||||
keyboard.matrix = KeysScanner(
|
||||
pins=PINS,
|
||||
value_when_pressed=False,
|
||||
)
|
||||
|
||||
# Here you define the buttons corresponding to the pins
|
||||
# Look here for keycodes: https://github.com/KMKfw/kmk_firmware/blob/main/docs/en/keycodes.md
|
||||
# And here for macros: https://github.com/KMKfw/kmk_firmware/blob/main/docs/en/macros.md
|
||||
keyboard.keymap = [
|
||||
[KC.A, KC.DELETE, KC.MACRO("Hello world!"), KC.Macro(Press(KC.LCMD), Tap(KC.S), Release(KC.LCMD)),]
|
||||
]
|
||||
|
||||
# Start kmk!
|
||||
if __name__ == '__main__':
|
||||
keyboard.go()
|
||||
Loading…
Add table
Reference in a new issue