Compare commits

..

4 commits

6 changed files with 40 additions and 13 deletions

0
.metadata_never_index Normal file
View file

View file

View file

@ -0,0 +1,12 @@
from ardux.kb import _ArduxKeyboard
from kmk.scanners import DiodeOrientation
# Quagboard Implementation
class QuagboardArduxKeyboard(_ArduxKeyboard):
def setup_physical_config(self):
self.diode_orientation = DiodeOrientation.COL2ROW
self.row_pins = (board.GP0,)
#right hand pins
#self.col_pins = (board.GP1, board.GP2, board.GP3, board.GP4, board.GP5, board.GP6, board.GP7, board.GP8 , board.GP10 , board.GP9)
#left hand pins
self.col_pins = (board.GP4, board.GP3, board.GP2, board.GP1, board.GP8, board.GP7, board.GP6, board.GP5 , board.GP9 , board.GP10)

View file

@ -0,0 +1,10 @@
from ardux.kb import _ArduxKeyboard
from kmk.scanners.keypad import KeysScanner
from kmk.quickpin.pro_micro.kb2040 import pinout as pins
# ThePaintbrush Implementation
class ThePaintbrushArduxKeyboard(_ArduxKeyboard):
def setup_physical_config(self):
# Direct wire & matrix setup
self.matrix = KeysScanner([pins[16], pins[17], pins[18], pins[19], pins[12], pins[13], pins[14], pins[15]])

View file

@ -2,13 +2,9 @@
import os import os
import board import board
from kmk.quickpin.pro_micro.kb2040 import pinout as pins
from kmk.kmk_keyboard import KMKKeyboard from kmk.kmk_keyboard import KMKKeyboard
from kmk.scanners.keypad import KeysScanner
from kmk.keys import KC from kmk.keys import KC
from ardux.chord import ArduxChord from ardux.chord import ArduxChord # FIXME: Need to fix ArduxChord / sort layer filters for combos
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.combos import Combos, Chord from kmk.modules.combos import Combos, Chord
@ -26,7 +22,7 @@ LAYER_ID_SYMBOLS = 4
LAYER_ID_CUSTOM = 5 LAYER_ID_CUSTOM = 5
LAYER_ID_MOUSE = 6 LAYER_ID_MOUSE = 6
class ArduxKeyboard(KMKKeyboard): class _ArduxKeyboard(KMKKeyboard):
coord_mapping = [ coord_mapping = [
0, 1, 2, 3, 0, 1, 2, 3,
4, 5, 6, 7, 4, 5, 6, 7,
@ -34,6 +30,11 @@ class ArduxKeyboard(KMKKeyboard):
keymap = [] keymap = []
# Switch to ABC python3 stl abstract class methods
# See https://stackoverflow.com/a/4382964 for detail (the accepted answer)
def setup_physical_config(self):
raise NotImplementedError('Please define the physical config for your keyboard')
# Init / constructor / setup # Init / constructor / setup
def __init__(self): def __init__(self):
# Enable debugging if appropriate # Enable debugging if appropriate
@ -44,8 +45,8 @@ class ArduxKeyboard(KMKKeyboard):
self.modules = [] self.modules = []
self.extensions = [] self.extensions = []
# Direct wire & matrix setup # Call setup hook -- matrix/direct wire config
self.matrix = KeysScanner([pins[16], pins[17], pins[18], pins[19], pins[12], pins[13], pins[14], pins[15]]) self.setup_physical_config()
# Layers # Layers
self.layers_module = Layers() self.layers_module = Layers()
@ -55,7 +56,6 @@ class ArduxKeyboard(KMKKeyboard):
# Combos # Combos
self.combo_module = Combos() self.combo_module = Combos()
self.combo_module.timeout = 250
self.combo_module.prefer_hold = True self.combo_module.prefer_hold = True
self.combo_module.tap_interrupted = False self.combo_module.tap_interrupted = False
self.modules.append(self.combo_module) self.modules.append(self.combo_module)
@ -187,5 +187,3 @@ class ArduxKeyboard(KMKKeyboard):
##### #####
# std - mouse # std - mouse
self.combo_module.combos.append(Chord((KC.MB_RMB, KC.MS_DN, KC.MB_LMB), KC.TO(LAYER_ID_BASE))) self.combo_module.combos.append(Chord((KC.MB_RMB, KC.MS_DN, KC.MB_LMB), KC.TO(LAYER_ID_BASE)))

11
main.py
View file

@ -3,8 +3,15 @@ import os
##### #####
# Main keyboard object # Main keyboard object
from ardux.kb import ArduxKeyboard ardux_board = os.getenv('ARDUX_BOARD')
ardux_keyboard = ArduxKeyboard() if ardux_board == 'thepaintbrush':
from ardux.hardware.thepaintbrush import ThePaintbrushArduxKeyboard
ardux_keyboard = ThePaintbrushArduxKeyboard()
elif ardux_board == 'quagboard':
from ardux.hardware.quagboard import QuagboardArduxKeyboard
ardux_keyboard = QuagboardArduxKeyboard()
else:
raise NotImplementedError('Please configure the proper keyboard in "settings.toml"')
##### #####
# NeoPixel on kb2040 (tune accordingly / remove if different mcu) # NeoPixel on kb2040 (tune accordingly / remove if different mcu)