final commit before rebase

This commit is contained in:
Kyle Brown 2019-06-21 16:31:20 -07:00
parent 5158094549
commit 39b0b1e7f2
4 changed files with 22 additions and 81 deletions

View File

@ -294,8 +294,7 @@ class Firmware:
if self.pixels:
# Only check animations if pixels is initialized
if self.pixels.animation_mode:
if self.pixels.animation_mode:
self.pixels = self.pixels.animate()
self.pixels = self.pixels.animate()
if self.led:
# Only check animations if led is initialized

View File

@ -67,9 +67,10 @@ class RGB:
self.breathe_center = const(config['breathe_center'])
self.knight_effect_length = const(config['knight_effect_length'])
self.val_limit = const(config['val_limit'])
self.rgb_animation_mode = const(config['animation_mode'])
self.animation_mode = config['animation_mode']
self.animation_speed = const(config['animation_speed'])
if config['user_animation']:
if 'user_animation' in config:
print(config['user_animation'])
self.user_animation = config['user_animation']
except ImportError as e:
@ -282,14 +283,11 @@ class RGB:
return self
def increase_val(self, step=None):
def increase_val(self, step=0):
"""
Increases value by step amount stopping at 100
:param step:
"""
if not step:
step = self.val_step
if (self.val + step) >= 100:
self.val = 100
else:
@ -300,14 +298,11 @@ class RGB:
return self
def decrease_val(self, step=None):
def decrease_val(self, step=0):
"""
Decreases value by step amount stopping at 0
:param step:
"""
if not step:
step = self.val_step
if (self.val - step) <= 0:
self.val = 0
else:

View File

@ -1,5 +1,4 @@
from kmk.boards.converter.keebio.levinson_r2 import Firmware
from kmk.consts import LeaderMode, UnicodeMode
from kmk.handlers.sequences import compile_unicode_string_sequences
from kmk.keys import KC
@ -13,6 +12,19 @@ keyboard.tap_time = 150
keyboard.leader_timeout = 2000
keyboard.debug_enabled = True
keyboard.rgb_config['num_pixels'] = 16
keyboard.rgb_config['val_limit'] = 150
keyboard.rgb_config['hue_step'] = 10
keyboard.rgb_config['sat_step'] = 5
keyboard.rgb_config['val_step'] = 5
keyboard.rgb_config['hue_default'] = 260
keyboard.rgb_config['sat_default'] = 100
keyboard.rgb_config['val_default'] = 20
keyboard.rgb_config['knight_effect_length'] = 6
keyboard.rgb_config['animation_mode'] = 'swirl'
keyboard.rgb_config['animation_speed'] = 2
keyboard.debug_enabled = False
emoticons = compile_unicode_string_sequences({
# Emoticons, but fancier
'ANGRY_TABLE_FLIP': r'(ノಠ痊ಠ)ノ彡┻━┻',
@ -45,7 +57,7 @@ keyboard.keymap = [
KC.GESC, KC.QUOTE, KC.COMMA, KC.DOT, KC.P, KC.Y, KC.F, KC.G, KC.C, KC.R, KC.L, KC.BKSP,
KC.TAB, KC.A, KC.O, KC.E, KC.U, KC.I, KC.D, KC.H, KC.T, KC.N, KC.S, KC.ENT,
KC.LSFT, KC.SCLN, KC.Q, KC.J, KC.K, KC.X, KC.B, KC.M, KC.W, KC.V, KC.Z, KC.SLSH,
KC.LCTRL, KC.LGUI, KC.LALT, KC.LEAD, KC.MO(2), KC.LT(3, KC.SPC), KC.LT(3, KC.SPC), KC.MO(4), KC.LEFT, KC.DOWN, KC.UP, KC.RIGHT,
KC.LCTRL, KC.LGUI, KC.LALT, KC.RGB_TOG, KC.MO(2), KC.LT(3, KC.SPC), KC.LT(3, KC.SPC), KC.MO(4), KC.LEFT, KC.DOWN, KC.UP, KC.RIGHT,
],
[
# Gaming

View File

@ -1,16 +1,11 @@
from kmk.boards.converter.fourtypercentclub.luddite import Firmware
from kmk.consts import LeaderMode, UnicodeMode
from kmk.handlers.sequences import compile_unicode_string_sequences
from kmk.keys import KC, make_key
from kmk.keys import KC
keyboard = Firmware()
# ---------------------------------- Config --------------------------------------------
keyboard.leader_mode = LeaderMode.ENTER
keyboard.unicode_mode = UnicodeMode.LINUX
keyboard.tap_time = 150
keyboard.leader_timeout = 999999
keyboard.rgb_config['num_pixels'] = 16
keyboard.rgb_config['val_limit'] = 150
@ -19,7 +14,7 @@ keyboard.rgb_config['sat_step'] = 5
keyboard.rgb_config['val_step'] = 5
keyboard.rgb_config['hue_default'] = 260
keyboard.rgb_config['sat_default'] = 100
keyboard.rgb_config['val_default'] = 20
keyboard.rgb_config['val_default'] = 0
keyboard.rgb_config['knight_effect_length'] = 6
keyboard.rgb_config['animation_mode'] = 'static'
keyboard.rgb_config['animation_speed'] = 2
@ -28,39 +23,6 @@ keyboard.debug_enabled = False
# ---------------------- Custom Functions --------------------------------------------
def portal_lights(*args, **kwargs):
keyboard.pixels.animation_mode = 'static_standby'
keyboard.pixels.disable_auto_write = True
for i in range(0, 9):
keyboard.pixels.set_hsv(10, 100, 100, i)
for i in range(10, 16):
keyboard.pixels.set_hsv(220, 100, 100, i)
keyboard.pixels.show()
def portal_off(*args, **kwargs):
keyboard.pixels.disable_auto_write = False
keyboard.pixels.off()
keyboard.pixels.animation_mode = 'static'
def start_light_show(*args, **kwargs):
keyboard.pixels.animation_mode = 'user'
def light_show(self):
self.hue = (self.hue + 35) % 360
keyboard.pixels.set_hsv_fill(self.hue, self.sat, self.val)
return self
keyboard.rgb_config['user_animation'] = light_show
LS = make_key(on_press=start_light_show)
# ---------------------- Custom Keys --------------------------------------------
LON = make_key(on_press=portal_lights)
LOFF = make_key(on_press=portal_off)
_______ = KC.TRNS
XXXXXXX = KC.NO
HOME = KC.MT(KC.HOME, KC.LSFT)
@ -70,33 +32,6 @@ END = KC.MT(KC.END, KC.RSFT)
BASE = 0
FN1 = 1
# ---------------------- Leader Key Macros --------------------------------------------
emoticons = compile_unicode_string_sequences({
# Emoticons, but fancier
'ANGRY_TABLE_FLIP': r'(ノಠ痊ಠ)ノ彡┻━┻',
'CHEER': r'+。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚',
'TABLE_FLIP': r'(╯°□°)╯︵ ┻━┻',
'WAT': r'⊙.☉',
'FF': r'凸(゚Д゚#)',
'F': r'( ̄^ ̄)凸',
'MEH': r'╮( ̄_ ̄)╭',
'YAY': r'o(^▽^)o',
})
keyboard.leader_dictionary = {
'flip': emoticons.ANGRY_TABLE_FLIP,
'cheer': emoticons.CHEER,
'wat': emoticons.WAT,
'f': emoticons.FF,
'fu': emoticons.F,
'meh': emoticons.MEH,
'yay': emoticons.YAY,
'p': LON,
'po': LOFF,
}
# ---------------------- Keymap ---------------------------------------------------------