feat(extensions): most of the extensions implementation, by kdb424
This commit is contained in:
17
boards/tg4x/README.md
Normal file
17
boards/tg4x/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# TG4X
|
||||
|
||||

|
||||
|
||||
TG4X is a 45% staggered keyboard, compared to a standard 40% stagger it has one additional column which makes it an approachable and highly use-able 40%-ish stagger.
|
||||
|
||||
kb.py is designed to work with the nice!nano
|
||||
|
||||
Retailers (USA)
|
||||
[Boardsource](https://boardsource.xyz/store/5eff7ead037395179221b90c)
|
||||
|
||||
Extentions enabled by default
|
||||
- [Layers](https://github.com/KMKfw/kmk_firmware/tree/master/docs/layers.md) Need more keys than switches? Use layers.
|
||||
- [RGB](https://github.com/KMKfw/kmk_firmware/tree/master/docs/rgb.md) Light it up
|
||||
|
||||
Common Extentions
|
||||
- [Power](https://github.com/KMKfw/kmk_firmware/tree/master/docs/power.md) Powersaving features for battery life
|
31
boards/tg4x/kb.py
Normal file
31
boards/tg4x/kb.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import board
|
||||
|
||||
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
|
||||
from kmk.matrix import DiodeOrientation
|
||||
|
||||
|
||||
class KMKKeyboard(_KMKKeyboard):
|
||||
row_pins = (
|
||||
board.P1_06,
|
||||
board.P1_04,
|
||||
board.P0_11,
|
||||
board.P1_00,
|
||||
board.P0_24,
|
||||
board.P0_22,
|
||||
board.P0_20,
|
||||
board.P0_17,
|
||||
)
|
||||
col_pins = [
|
||||
board.P0_06,
|
||||
board.P1_11,
|
||||
board.P1_13,
|
||||
board.P1_15,
|
||||
board.P0_02,
|
||||
board.P0_29,
|
||||
board.P0_31,
|
||||
]
|
||||
diode_orientation = DiodeOrientation.COLUMNS
|
||||
rgb_pixel_pin = board.P0_08
|
||||
rgb_num_pixels = 6
|
||||
i2c = board.I2C
|
||||
powersave_pin = board.P0_13
|
36
boards/tg4x/main.py
Normal file
36
boards/tg4x/main.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from kb import KMKKeyboard
|
||||
from kmk.extensions.rgb import RGB
|
||||
from kmk.keys import KC
|
||||
from kmk.modules.layers import Layers
|
||||
|
||||
keyboard = KMKKeyboard()
|
||||
|
||||
# Cleaner key names
|
||||
_______ = KC.TRNS
|
||||
XXXXXXX = KC.NO
|
||||
|
||||
# Adding extentions
|
||||
rgb = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, val_limit=100, hue_default=190, sat_default=100, val_default=5)
|
||||
|
||||
layers_ext = Layers()
|
||||
|
||||
keyboard.modules = [layers_ext]
|
||||
keyboard.extensions = [rgb]
|
||||
|
||||
keyboard.keymap = [
|
||||
[ #QWERTY
|
||||
KC.ESC, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.MINS, KC.DEL,\
|
||||
KC.TAB, KC.A, KC.S, KC.D, KC.F, KC.G, KC.H, KC.J, KC.K, KC.L, KC.QUOT, KC.ENT,\
|
||||
KC.LSFT, KC.Z, KC.X, KC.C, KC.V, KC.B, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSH, KC.RSFT,\
|
||||
KC.LCTL, KC.LGUI, KC.LALT, KC.SPACE, KC.SPACE, KC.RALT, KC.RGUI, KC.RCTL, KC.MO(1)\
|
||||
],
|
||||
[ #LOWER
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
],
|
||||
]
|
||||
|
||||
if __name__ == '__main__':
|
||||
keyboard.go()
|
Reference in New Issue
Block a user