feat(extensions): most of the extensions implementation, by kdb424

This commit is contained in:
Kyle Brown
2020-10-21 12:19:42 -07:00
committed by Josh Klar
parent 9821f7bcc3
commit e72d2b8c34
140 changed files with 3860 additions and 2312 deletions

View File

@@ -0,0 +1,20 @@
# Reviung41
![Reviung41](https://boardsource.imgix.net/ea77f3f8-6cc4-4cb4-a801-cf58b5af8fcc.jpg?raw=true)
The Reviung41 is a 41 key keyboard designed by gtips, it is a slightly larger version of the popular Reviung 39. These "split non-split" keyboards offer a lot of features split keyboards have in terms of comfort and ergonomics but do so in a single-piece package. Many people consider keyboards in this style easier to travel with since you don't have to manage two halves and there is of course no need for a TRRS cable. This board sits somewhere between and Atreus and Corne, and it is extremely comfortable to use.
kb.py is designed to work with the nice!nano
Hardware Availability: [PCB & Case Data](https://github.com/gtips/reviung/tree/master/reviung41)
Retailers (USA)
[Boardsource](https://boardsource.xyz/store/5f2ef1b52bf5e8714a60f613)
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
- [ModTap](https://github.com/KMKfw/kmk_firmware/tree/master/docs/modtap.md) Allows mod keys to act as different keys when tapped.
Common Extentions
- [Power](https://github.com/KMKfw/kmk_firmware/tree/master/docs/power.md) Powersaving features for battery life

38
boards/reviung41/kb.py Normal file
View File

@@ -0,0 +1,38 @@
import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
from kmk.matrix import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard):
col_pins = (
board.P0_22,
board.P0_24,
board.P1_00,
board.P0_11,
board.P1_04,
board.P1_06,
)
row_pins = (
board.P0_31,
board.P0_29,
board.P0_02,
board.P1_15,
board.P1_13,
board.P1_11,
board.P0_10,
)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.P0_06
rgb_num_pixels = 11
i2c = board.I2C
powersave_pin = board.P0_13
coord_mapping = []
coord_mapping.extend(ic(0, x) for x in range(12))
coord_mapping.extend(ic(1, x) for x in range(12))
coord_mapping.extend(ic(2, x) for x in range(12))
# And now, to handle R3, which at this point is down to just five keys
coord_mapping.extend(ic(3, x) for x in range(5))

64
boards/reviung41/main.py Normal file
View File

@@ -0,0 +1,64 @@
from kb import KMKKeyboard
from kmk.extensions.rgb import RGB
from kmk.keys import KC
from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
keyboard = KMKKeyboard()
# 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)
modtap = ModTap()
layers_ext = Layers()
keyboard.modules = [layers_ext, modtap]
keyboard.extensions = [rgb]
# Cleaner key names
_______ = KC.TRNS
XXXXXXX = KC.NO
LOWER = KC.MO(1)
RAISE = KC.MO(2)
ADJUST = KC.LT(3, KC.SPC)
RSFT_ENT = KC.MT(KC.ENT, KC.RSFT)
RSFT_SPC = KC.MT(KC.SPC, KC.RSFT)
RGB_TOG = KC.RGB_TOG
RGB_HUI = KC.RGB_HUI
RGB_HUD = KC.RGB_HUI
RGB_SAI = KC.RGB_SAI
RGB_SAD = KC.RGB_SAD
RGB_VAI = KC.RGB_VAI
RGB_VAD = KC.RGB_VAD
keyboard.keymap = [
[ #QWERTY
KC.TAB, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.BSPC,
KC.LCTL, KC.A, KC.S, KC.D, KC.F, KC.G, KC.H, KC.J, KC.K, KC.L, KC.SCLN, KC.QUOT,
KC.LSFT, KC.Z, KC.X, KC.C, KC.V, KC.B, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSH, RSFT_ENT,
KC.LALT, LOWER, KC.SPC, RAISE, KC.RGUI,
],
[ #LOWER
KC.ESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.BSPC,
KC.LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.LEFT, KC.DOWN, KC.UP, KC.RIGHT, XXXXXXX, XXXXXXX,
KC.LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RSFT_SPC,
KC.LALT, LOWER, KC.SPC, RAISE, KC.RGUI,
],
[ #RAISE
KC.ESC, KC.EXLM, KC.AT, KC.HASH, KC.DLR, KC.PERC, KC.CIRC, KC.AMPR, KC.ASTR, KC.LPRN, KC.RPRN, KC.BSPC,
KC.LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.MINS, KC.EQL, KC.LCBR, KC.RCBR, KC.PIPE, KC.GRV,
KC.LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.UNDS, KC.PLUS, KC.LBRC, KC.RBRC, KC.BSLS, KC.TILD,
KC.LALT, LOWER, KC.SPC, RAISE, KC.RGUI,
],
[ #ADJUST
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
KC.LALT, LOWER, KC.SPC, RAISE, KC.RGUI,
]
]
if __name__ == '__main__':
keyboard.go()