Compare commits
No commits in common. "b6c552e9e9d2c1ca0c835b4eb62f68e5999720e7" and "de994e4941b7e077ad1d51569085100c497a9cbc" have entirely different histories.
b6c552e9e9
...
de994e4941
|
@ -1,12 +0,0 @@
|
|||
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)
|
|
@ -1,10 +0,0 @@
|
|||
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]])
|
||||
|
20
ardux/kb.py
20
ardux/kb.py
|
@ -2,9 +2,13 @@
|
|||
import os
|
||||
|
||||
import board
|
||||
from kmk.quickpin.pro_micro.kb2040 import pinout as pins
|
||||
|
||||
from kmk.kmk_keyboard import KMKKeyboard
|
||||
from kmk.scanners.keypad import KeysScanner
|
||||
|
||||
from kmk.keys import KC
|
||||
from ardux.chord import ArduxChord # FIXME: Need to fix ArduxChord / sort layer filters for combos
|
||||
from ardux.chord import ArduxChord
|
||||
|
||||
from kmk.modules.layers import Layers
|
||||
from kmk.modules.combos import Combos, Chord
|
||||
|
@ -22,7 +26,7 @@ LAYER_ID_SYMBOLS = 4
|
|||
LAYER_ID_CUSTOM = 5
|
||||
LAYER_ID_MOUSE = 6
|
||||
|
||||
class _ArduxKeyboard(KMKKeyboard):
|
||||
class ArduxKeyboard(KMKKeyboard):
|
||||
coord_mapping = [
|
||||
0, 1, 2, 3,
|
||||
4, 5, 6, 7,
|
||||
|
@ -30,11 +34,6 @@ class _ArduxKeyboard(KMKKeyboard):
|
|||
|
||||
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
|
||||
def __init__(self):
|
||||
# Enable debugging if appropriate
|
||||
|
@ -45,8 +44,8 @@ class _ArduxKeyboard(KMKKeyboard):
|
|||
self.modules = []
|
||||
self.extensions = []
|
||||
|
||||
# Call setup hook -- matrix/direct wire config
|
||||
self.setup_physical_config()
|
||||
# Direct wire & matrix setup
|
||||
self.matrix = KeysScanner([pins[16], pins[17], pins[18], pins[19], pins[12], pins[13], pins[14], pins[15]])
|
||||
|
||||
# Layers
|
||||
self.layers_module = Layers()
|
||||
|
@ -56,6 +55,7 @@ class _ArduxKeyboard(KMKKeyboard):
|
|||
|
||||
# Combos
|
||||
self.combo_module = Combos()
|
||||
self.combo_module.timeout = 250
|
||||
self.combo_module.prefer_hold = True
|
||||
self.combo_module.tap_interrupted = False
|
||||
self.modules.append(self.combo_module)
|
||||
|
@ -187,3 +187,5 @@ class _ArduxKeyboard(KMKKeyboard):
|
|||
#####
|
||||
# std - mouse
|
||||
self.combo_module.combos.append(Chord((KC.MB_RMB, KC.MS_DN, KC.MB_LMB), KC.TO(LAYER_ID_BASE)))
|
||||
|
||||
|
||||
|
|
11
main.py
11
main.py
|
@ -3,15 +3,8 @@ import os
|
|||
|
||||
#####
|
||||
# Main keyboard object
|
||||
ardux_board = os.getenv('ARDUX_BOARD')
|
||||
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"')
|
||||
from ardux.kb import ArduxKeyboard
|
||||
ardux_keyboard = ArduxKeyboard()
|
||||
|
||||
#####
|
||||
# NeoPixel on kb2040 (tune accordingly / remove if different mcu)
|
||||
|
|
Loading…
Reference in a new issue