More Flake8 fixes, and keymap updates.

This commit is contained in:
Luke D Russell 2022-06-21 17:18:33 +10:00 committed by Kyle Brown
parent 5c8f33fc3e
commit d7bfb917f2
3 changed files with 34 additions and 19 deletions

View File

@ -29,6 +29,7 @@ class KMKKeyboard(_KMKKeyboard):
rgb_num_pixels = 42
i2c = board.I2C
# flake8: noqa
coord_mapping = [
ic(0, 0), ic(0, 1), ic(0, 2), ic(0, 3), ic(0, 4), ic(0, 5), ic(0, 6), ic(0, 7), ic(4, 3), ic(3, 4), ic(4, 5), ic(3, 7),
ic(1, 0), ic(1, 1), ic(1, 2), ic(1, 3), ic(1, 4), ic(1, 5), ic(4, 1), ic(1, 6), ic(1, 7), ic(3, 2), ic(4, 4), ic(3, 5), ic(4, 7),

View File

@ -3,6 +3,7 @@ import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.scanners import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (
board.P1_06,
@ -27,6 +28,7 @@ class KMKKeyboard(_KMKKeyboard):
rgb_num_pixels = 42
i2c = board.I2C
# flake8: noqa
coord_mapping = [
0, 1, 2, 3, 4, 5, 6, 7, 35, 28, 37, 31,
8, 9, 10, 11, 12, 13, 33, 14, 15, 26, 36, 29, 39,

View File

@ -3,30 +3,44 @@ import board
import kb
from kmk.keys import KC
from kmk.modules.layers import Layers
from kmk.modules.combos import Combos, Sequence
from kmk.modules.dynamic_sequences import DynamicSequences
from kmk.modules.layers import Layers
from kmk.modules.oneshot import OneShot
combos = Combos()
dyn_seq = DynamicSequences(
slots=1, # The number of sequence slots to use
timeout=60000, # Maximum time to spend in record or config mode before stopping automatically, milliseconds
key_interval=20, # Milliseconds between key events while playing
use_recorded_speed=False, # Whether to play the sequence at the speed it was typed
)
layers = Layers()
oneshot = OneShot()
keyboard = kb.KMKKeyboard()
keyboard.modules = [
Layers(),
Combos(),
]
keyboard.combos = Combos()
keyboard.modules = [combos, dyn_seq, layers, oneshot]
keyboard.debug_enabled = False
# Convenience variables for the Keymap
_______ = KC.TRNS
xxxxxxx = KC.NO
L1_TAB = KC.LT(1, KC.TAB, prefer_hold=True, tap_interrupted=False, tap_time=250)
L2_ENT = KC.LT(2, KC.ENT, prefer_hold=True, tap_interrupted=False, tap_time=250)
L1_TAB = KC.LT(1, KC.TAB, prefer_hold=True)
L2_ENT = KC.LT(2, KC.ENT, prefer_hold=True)
keyboard.combos = [
OS_LSFT = KC.OS(KC.LSFT)
SEQ_REC = KC.RECORD_SEQUENCE()
SEQ_STP = KC.STOP_SEQUENCE()
SEQ_PLY = KC.PLAY_SEQUENCE()
combos.combos = [
Sequence((KC.LEADER, KC.A), KC.LCTL(KC.A)), # select All
Sequence((KC.LEADER, KC.T), KC.LCTL(KC.X)), # cuT
Sequence((KC.LEADER, KC.C), KC.LCTL(KC.C)), # Copy
Sequence((KC.LEADER, KC.P), KC.LCTL(KC.P)), # Copy
Sequence((KC.LEADER, KC.P), KC.LCTL(KC.V)), # Paste
Sequence((KC.LEADER, KC.U), KC.LCTL(KC.Z)), # Undo
Sequence((KC.LEADER, KC.Y), KC.LCTL(KC.Y)), # redo
]
@ -37,23 +51,21 @@ keyboard.keymap = [
KC.ESC, KC.Q, KC.W, KC.F, KC.P, KC.B, KC.J, KC.L, KC.U, KC.Y, KC.SCLN, KC.LEADER,
KC.LCTL, KC.A, KC.R, KC.S, KC.T, KC.G, xxxxxxx, KC.M, KC.N, KC.E, KC.I, KC.O, KC.QUOT,
KC.LALT, KC.Z, KC.X, KC.C, KC.D, KC.V, KC.K, KC.H, KC.COMM, KC.DOT, KC.SLSH, KC.BSLS,
xxxxxxx, KC.LGUI, KC.LSFT, KC.BSPC, L1_TAB, KC.SPACE,L2_ENT, xxxxxxx,
xxxxxxx, KC.LGUI, OS_LSFT, KC.BSPC, L1_TAB, KC.SPACE,L2_ENT, xxxxxxx,
],
[ # 1: Nav & Numbers
KC.TAB, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.DEL,
_______, KC.LPRN, KC.LEFT, KC.UP, KC.RIGHT,KC.RPRN, _______, xxxxxxx, KC.PLUS, KC.EQL, xxxxxxx, xxxxxxx, xxxxxxx,
_______, KC.LBRC, KC.LCBR, KC.DOWN, KC.RCBR, KC.RBRC, xxxxxxx, KC.MINS, KC.UNDS, xxxxxxx, xxxxxxx, xxxxxxx,
_______, KC.LPRN, KC.LEFT, KC.UP, KC.RIGHT,KC.RPRN, _______, KC.GRV, KC.PLUS, KC.EQL, xxxxxxx, xxxxxxx, xxxxxxx,
_______, KC.LBRC, KC.LCBR, KC.DOWN, KC.RCBR, KC.RBRC, KC.TILD, KC.MINS, KC.UNDS, xxxxxxx, xxxxxxx, xxxxxxx,
_______, _______, _______, KC.DEL, _______, _______, _______, _______,
],
[ # 2: F-row & Board Functions
KC.F12, KC.F1, KC.F2, KC.F3, KC.F4, KC.F5, KC.F6, KC.F7, KC.F8, KC.F9, KC.F10, KC.F11,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, SEQ_REC, SEQ_PLY, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, SEQ_STP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
],
]
keyboard.debug_enabled = False
if __name__ == '__main__':
keyboard.go()