From 3ea6f6d6474d2578dae4cad90c525a36039e29dd Mon Sep 17 00:00:00 2001 From: Sendy Aditya Suryana Date: Wed, 17 May 2023 16:55:00 +0700 Subject: [PATCH] Add Cacah numpad --- boards/kbdksp/cacah/main.py | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 boards/kbdksp/cacah/main.py diff --git a/boards/kbdksp/cacah/main.py b/boards/kbdksp/cacah/main.py new file mode 100644 index 000000000..7708a2a1a --- /dev/null +++ b/boards/kbdksp/cacah/main.py @@ -0,0 +1,49 @@ +print("Starting Cacah Keyboard") + +import board + +from kmk.kmk_keyboard import KMKKeyboard +from kmk.keys import KC +from kmk.scanners import DiodeOrientation +from kmk.modules.encoder import EncoderHandler + +keyboard = KMKKeyboard() + +keyboard.col_pins = ( + board.GP18, + board.GP19, + board.GP0, + board.GP1 +) + +keyboard.row_pins = ( + board.GP2, + board.GP3, + board.GP4, + board.GP8, + board.GP9 +) + +keyboard.diode_orientation = DiodeOrientation.COL2ROW + +keyboard.keymap = [ + [ + KC.NLCK, KC.PSLS, KC.PAST, KC.PMNS, + KC.P7, KC.P8, KC.P9, KC.PPLS, + KC.P4, KC.P5, KC.P6, KC.NUBS, + KC.P1, KC.P2, KC.P3, KC.PENT, + KC.P0, KC.P0, KC.PDOT, KC.PENT + ] +] + +encoder_handler = EncoderHandler() +encoder_handler.pins = ((board.GP16, board.GP17, None, False),) +encoder_handler.map = ( + ((KC.VOLD, KC.VOLU),), # base layer +) + +keyboard.modules.append(encoder_handler) + +if __name__ == '__main__': + keyboard.go() +