1
0
Fork 0

[Keymap] Big Drashna code update (#6639)

* Add a quefrency keymap

* New Alt-ernate layouts

* Enable Per Key Tapping Term to preserve sanity

* Use underglow and mod lights for status on Corne

* Update the drashna_ms keymap for quefrency

* Disable Audio since there isn't enough space

* Update KC_MAKE to ues :flash target

* Cleanup ergodox layout

* Enable i2c support for Iris

* Add keymap support for CG_SWAP

* Enable RGB Matrix Shutdown mode

* enable heatmap

* Update gitlab CI to install python3

* Remove game macros

These are no longer needed, and haven't been used in ages

* Cleanup planck layout

* Add RGB Matrix fun and RGB cleanup

* Add keycode and config for RGB Matrix idle animations

* Clean up rgb idle animation code

* Add rgb idle keycode to keymaps

* Fix issues with rgb matrix idle animation

* Fix some handling for idle animation

* Reduce idle animation timeout to 15s to be more reasonable

* fix up rgb stuff

* Fix isses with rgb functions not being called for matrix

* Use custom EEPROM Magic Number so testing is easier

* Extend Default Layer macro to support a lot more layers

* Fix bjohnson macropad

* Adjust KC_MAKE to process mods for more consistent behavior

* Fix up rgb stuff on corne

* Corne OLED Overhaul

* Fixes a number of issues with weirdness.
* Fixes issues with keylogger (should be more reliable now)
* Modulaize the OLED render sections
* Rewrite layer display code
* Update URL for Font Editor

Due to odd issues, I ended up rewriting from scratch.  And using PROGMEM versions, since I think I was getting memory overflows.

* Update polling rate on all keebs

* Fix planck ez layout config

* Remove macros from Viterbi
This commit is contained in:
Drashna Jaelre 2019-09-07 08:57:30 -07:00 committed by GitHub
parent 79a6c6eda5
commit e88f80a891
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 440 additions and 368 deletions

View file

@ -9,8 +9,8 @@
#define PROGMEM #define PROGMEM
#endif #endif
// Helidox 8x6 font with QMK Firmware Logo // Corne 8x6 font with QMK Firmware Logo
// Online editor: http://teripom.x0.com/ // Online editor: https://helixfonteditor.netlify.com/
const unsigned char font[] PROGMEM = { const unsigned char font[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

View file

@ -8,6 +8,14 @@ extern uint8_t is_master;
// Following line allows macro to read current RGB settings // Following line allows macro to read current RGB settings
extern rgblight_config_t rgblight_config; extern rgblight_config_t rgblight_config;
#endif #endif
#ifdef OLED_DRIVER_ENABLE
static uint32_t oled_timer = 0;
static char keylog_str[6] = {};
static uint16_t log_timer = 0;
static const char code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};
void add_keylog(uint16_t keycode);
#endif
enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE };
@ -19,7 +27,7 @@ enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE };
) \ ) \
LAYOUT_wrapper( \ LAYOUT_wrapper( \
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \
KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \
KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \ KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \
) )
@ -98,34 +106,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_ADJUST] = LAYOUT_wrapper( \ [_ADJUST] = LAYOUT_wrapper( \
KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET,
VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST,
_______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, MG_NKRO, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL,
_______, KC_NUKE, _______, _______, TG_MODS, _______ _______, KC_NUKE, _______, _______, TG_MODS, _______
) )
}; };
// clang-format on // clang-format on
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
#ifdef OLED_DRIVER_ENABLE
oled_timer = timer_read32();
add_keylog(keycode);
#endif
#ifndef SPLIT_KEYBOARD
if (keycode == RESET && !is_master) {
return false;
}
#endif
}
return true;
}
#ifdef OLED_DRIVER_ENABLE #ifdef OLED_DRIVER_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; }
uint16_t oled_timer;
char keylog_str[5] = {};
uint8_t keylogs_str_idx = 0;
uint16_t log_timer = 0;
const char code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};
void add_keylog(uint16_t keycode) { void add_keylog(uint16_t keycode) {
if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) {
keycode = keycode & 0xFF; keycode = keycode & 0xFF;
} }
for (uint8_t i = 4; i > 0; i--) { for (uint8_t i = 4; i > 0; --i) {
keylog_str[i] = keylog_str[i - 1]; keylog_str[i] = keylog_str[i - 1];
} }
if (keycode < 60) { if (keycode < 60) {
keylog_str[0] = code_to_name[keycode]; keylog_str[0] = code_to_name[keycode];
} }
keylog_str[5] = 0;
log_timer = timer_read(); log_timer = timer_read();
} }
@ -136,149 +152,118 @@ void update_log(void) {
} }
} }
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { void render_keylogger_status(void) {
if (record->event.pressed) { oled_write_P(PSTR("KLogr"), false);
add_keylog(keycode); oled_write(keylog_str, false);
oled_timer = timer_read();
}
return true;
} }
void render_rgb_status(void) { void render_default_layer_state(void) {
oled_write_ln("RGB:", false); oled_write_P(PSTR("Lyout"), false);
static char temp[20] = {0}; switch (biton32(default_layer_state)) {
snprintf(temp, sizeof(temp) + 1, "M:%3dH:%3dS:%3dV:%3d", rgb_matrix_config.mode, rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); case _QWERTY:
oled_write(temp, false); oled_write_P(PSTR(" QRTY"), false);
break;
case _COLEMAK:
oled_write_P(PSTR(" COLE"), false);
break;
case _DVORAK:
oled_write_P(PSTR(" DVRK"), false);
break;
case _WORKMAN:
oled_write_P(PSTR(" WKMN"), false);
break;
case _NORMAN:
oled_write_P(PSTR(" NORM"), false);
break;
case _MALTRON:
oled_write_P(PSTR(" MLTN"), false);
break;
case _EUCALYN:
oled_write_P(PSTR(" ECLN"), false);
break;
case _CARPLAX:
oled_write_P(PSTR(" CRPX"), false);
break;
}
}
void render_layer_state(void) {
oled_write_P(PSTR("LAYER"), false);
oled_write_P(PSTR("Lower"), layer_state_is(_LOWER));
oled_write_P(PSTR("Raise"), layer_state_is(_RAISE));
oled_write_P(PSTR(" Mods"), layer_state_is(_MODS));
}
void render_keylock_status(uint8_t led_usb_state) {
oled_write_P(PSTR("Lock:"), false);
oled_write_P(PSTR(" "), false);
oled_write_P(PSTR("NUM "), led_usb_state & (1 << USB_LED_NUM_LOCK));
oled_write_P(PSTR(" "), false);
oled_write_P(PSTR("CAPS"), led_usb_state & (1 << USB_LED_CAPS_LOCK));
oled_write_P(PSTR(" "), false);
oled_write_P(PSTR("SCRL"), led_usb_state & (1 << USB_LED_SCROLL_LOCK));
}
void render_mod_status(uint8_t modifiers) {
oled_write_P(PSTR("Mods:"), false);
oled_write_P(PSTR(" SHFT"), (modifiers & MOD_MASK_SHIFT));
oled_write_P(PSTR(" CTRL"), (modifiers & MOD_MASK_CTRL));
oled_write_P(PSTR(" ALT "), (modifiers & MOD_MASK_ALT));
oled_write_P(PSTR(" GUI "), (modifiers & MOD_MASK_GUI));
}
void render_bootmagic_status(void) {
/* Show Ctrl-Gui Swap options */
static const char PROGMEM logo[][2][3] = {
{{0x97, 0x98, 0}, {0xb7, 0xb8, 0}},
{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}},
};
oled_write_P(PSTR("BTMGK"), false);
oled_write_P(PSTR(" "), false);
oled_write_P(logo[0][0], !keymap_config.swap_lctl_lgui);
oled_write_P(logo[1][0], keymap_config.swap_lctl_lgui);
oled_write_P(PSTR(" "), false);
oled_write_P(logo[0][1], !keymap_config.swap_lctl_lgui);
oled_write_P(logo[1][1], keymap_config.swap_lctl_lgui);
oled_write_P(PSTR(" NKRO"), keymap_config.nkro);
}
void render_user_status(void) {
oled_write_P(PSTR("USER:"), false);
oled_write_P(PSTR(" Anim"), userspace_config.rgb_matrix_idle_anim);
oled_write_P(PSTR(" Layr"), userspace_config.rgb_layer_change);
oled_write_P(PSTR(" Nuke"), userspace_config.nuke_switch);
} }
void render_status_main(void) { void render_status_main(void) {
/* Show Keyboard Layout */ /* Show Keyboard Layout */
oled_write("Lyout", false); render_default_layer_state();
switch (biton32(default_layer_state)) { render_keylock_status(host_keyboard_leds());
case _QWERTY: render_bootmagic_status();
oled_write(" QRTY", false); render_user_status();
break;
case _COLEMAK:
oled_write(" COLE", false);
break;
case _DVORAK:
oled_write(" DVRK", false);
break;
case _WORKMAN:
oled_write(" WKMN", false);
break;
case _NORMAN:
oled_write(" NORM", false);
break;
case _MALTRON:
oled_write(" MLTN", false);
break;
case _EUCALYN:
oled_write(" ECLN", false);
break;
case _CARPLAX:
oled_write(" CRPX", false);
break;
}
/* Show Lock Status (only work on master side) */ render_keylogger_status();
uint8_t led_usb_state = host_keyboard_leds();
oled_write("Lock:", false);
oled_write(" ", false);
oled_write_ln("NUM", led_usb_state & (1 << USB_LED_NUM_LOCK));
oled_write(" ", false);
oled_write("CAPS", led_usb_state & (1 << USB_LED_CAPS_LOCK));
oled_write(" ", false);
oled_write("SCRL", led_usb_state & (1 << USB_LED_SCROLL_LOCK));
/* Show Alt-Gui Swap options */
oled_write("BTMGK", false);
oled_write(" ", false);
oled_write_ln("Win", !keymap_config.swap_lalt_lgui);
oled_write(" ", false);
oled_write_ln("Mac", keymap_config.swap_lalt_lgui);
# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
/* Show RGB Options */
render_rgb_status();
# endif
oled_write(keylog_str, false);
} }
void render_status_secondary(void) { void render_status_secondary(void) {
/* Show Keyboard Layout */ /* Show Keyboard Layout */
oled_write("Lyout", false); render_default_layer_state();
switch (biton32(default_layer_state)) { render_layer_state();
case _QWERTY: render_mod_status(get_mods()|get_oneshot_mods());
oled_write(" QRTY", false);
break;
case _COLEMAK:
oled_write(" COLE", false);
break;
case _DVORAK:
oled_write(" DVRK", false);
break;
case _WORKMAN:
oled_write(" WKMN", false);
break;
case _NORMAN:
oled_write(" NORM", false);
break;
case _MALTRON:
oled_write(" MLTN", false);
break;
case _EUCALYN:
oled_write(" ECLN", false);
break;
case _CARPLAX:
oled_write(" CRPX", false);
break;
}
/* Show Activate layer */ render_keylogger_status();
oled_write("Layer", false);
switch (biton32(layer_state)) {
case _RAISE:
oled_write("Raise", false);
break;
case _LOWER:
oled_write("Lower", false);
break;
case _ADJUST:
oled_write("Adjst", false);
break;
default:
oled_write("Dflt ", false);
break;
}
/* Show Mod */
uint8_t modifiers = get_mods() | get_oneshot_mods();
oled_write("Mods:", false);
oled_write(" ", false);
oled_write_ln("SFT", (modifiers & MOD_MASK_SHIFT));
oled_write(" ", false);
oled_write_ln("CTL", (modifiers & MOD_MASK_CTRL));
oled_write(" ", false);
oled_write_ln("ALT", (modifiers & MOD_MASK_ALT));
oled_write(" ", false);
oled_write_ln("GUI", (modifiers & MOD_MASK_GUI));
# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
render_rgb_status();
# endif
/* Show logged Keys */
oled_write(keylog_str, false);
} }
void oled_task_user(void) { void oled_task_user(void) {
if (timer_elapsed(oled_timer) > 60000) { if (timer_elapsed32(oled_timer) > 30000) {
oled_off(); oled_off();
return; return;
} }
#ifndef SPLIT_KEYBOARD
else { oled_on(); }
#endif
update_log();
if (is_master) { if (is_master) {
render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
} else { } else {
@ -286,7 +271,6 @@ void oled_task_user(void) {
} }
} }
void matrix_scan_keymap(void) { update_log(); }
#endif #endif
uint16_t get_tapping_term(uint16_t keycode) { uint16_t get_tapping_term(uint16_t keycode) {
@ -300,25 +284,43 @@ uint16_t get_tapping_term(uint16_t keycode) {
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
static bool is_suspended;
static bool rgb_matrix_enabled;
void suspend_power_down_keymap(void) { void suspend_power_down_keymap(void) {
rgb_matrix_set_suspend_state(true); rgb_matrix_set_suspend_state(true);
if (!is_suspended) {
is_suspended = true;
rgb_matrix_enabled = (bool)rgb_matrix_config.enable;
rgb_matrix_disable_noeeprom();
}
} }
void suspend_wakeup_init_keymap(void) { void suspend_wakeup_init_keymap(void) {
rgb_matrix_set_suspend_state(false); rgb_matrix_set_suspend_state(false);
is_suspended = false; }
if (rgb_matrix_enabled) {
rgb_matrix_enable_noeeprom(); void check_default_layer(uint8_t mode, uint8_t type) {
switch (biton32(default_layer_state)) {
case _QWERTY:
rgb_matrix_layer_helper(HSV_CYAN, mode, rgb_matrix_config.speed, type);
break;
case _COLEMAK:
rgb_matrix_layer_helper(HSV_MAGENTA, mode, rgb_matrix_config.speed, type);
break;
case _DVORAK:
rgb_matrix_layer_helper(HSV_SPRINGGREEN, mode, rgb_matrix_config.speed, type);
break;
case _WORKMAN:
rgb_matrix_layer_helper(HSV_GOLDENROD, mode, rgb_matrix_config.speed, type);
break;
case _NORMAN:
rgb_matrix_layer_helper(HSV_CORAL, mode, rgb_matrix_config.speed, type);
break;
case _MALTRON:
rgb_matrix_layer_helper(HSV_YELLOW, mode, rgb_matrix_config.speed, type);
break;
case _EUCALYN:
rgb_matrix_layer_helper(HSV_PINK, mode, rgb_matrix_config.speed, type);
break;
case _CARPLAX:
rgb_matrix_layer_helper(HSV_BLUE, mode, rgb_matrix_config.speed, type);
break;
} }
} }
void rgb_matrix_indicators_user(void) { void rgb_matrix_indicators_user(void) {
if (userspace_config.rgb_layer_change && if (userspace_config.rgb_layer_change &&
# ifdef RGB_DISABLE_WHEN_USB_SUSPENDED # ifdef RGB_DISABLE_WHEN_USB_SUSPENDED
@ -332,51 +334,26 @@ void rgb_matrix_indicators_user(void) {
) { ) {
switch (biton32(layer_state)) { switch (biton32(layer_state)) {
case _GAMEPAD: case _GAMEPAD:
rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); rgb_matrix_layer_helper(HSV_ORANGE, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break; break;
case _DIABLO: case _DIABLO:
rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break; break;
case _RAISE: case _RAISE:
rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break; break;
case _LOWER: case _LOWER:
rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); rgb_matrix_layer_helper(HSV_GREEN, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break; break;
case _ADJUST: case _ADJUST:
rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break; break;
default: { default: {
bool mods_enabled = IS_LAYER_ON(_MODS); check_default_layer(IS_LAYER_ON(_MODS), LED_FLAG_UNDERGLOW);
switch (biton32(default_layer_state)) {
case _QWERTY:
rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break;
case _COLEMAK:
rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break;
case _DVORAK:
rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break;
case _WORKMAN:
rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break;
case _NORMAN:
rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break;
case _MALTRON:
rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break;
case _EUCALYN:
rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break;
case _CARPLAX:
rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW);
break;
}
break; break;
} }
} }
check_default_layer(0, LED_FLAG_MODIFIER);
} }
} }
#endif #endif

View file

@ -17,7 +17,7 @@
) \ ) \
LAYOUT_gergo_wrapper( \ LAYOUT_gergo_wrapper( \
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_PIPE, \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_PIPE, \
KC_TAB, K11, K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, KC_QUOT, \ KC_TAB, K11, K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, _______, _______, _______, _______, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ OS_LSFT, CTL_T(K21), K22, K23, K24, K25, _______, _______, _______, _______, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \
KC_GRV, KC_SPC, BK_LWER, OS_LALT, OS_RGUI, DL_RAIS, KC_ENT, _______ \ KC_GRV, KC_SPC, BK_LWER, OS_LALT, OS_RGUI, DL_RAIS, KC_ENT, _______ \
) )

View file

@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Use I2C or Serial, not both */ /* Use I2C or Serial, not both */
#define USE_SERIAL // #define USE_SERIAL
// #define USE_I2C #define USE_I2C
/* Select hand configuration */ /* Select hand configuration */

View file

@ -11,7 +11,7 @@
LAYOUT_wrapper( \ LAYOUT_wrapper( \
KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \ KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \
KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \ KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \
KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ KC_C1R3, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \
KC_GRV, KC_SPC, LT(_LOWER,KC_BSPC), LT(_RAISE,KC_DEL), KC_ENT, RAISE \ KC_GRV, KC_SPC, LT(_LOWER,KC_BSPC), LT(_RAISE,KC_DEL), KC_ENT, RAISE \
) )

View file

@ -5,14 +5,13 @@ CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration COMMAND_ENABLE = no # Commands for debug and configuration
TAP_DANCE_ENABLE = no TAP_DANCE_ENABLE = no
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
AUDIO_ENABLE = yes AUDIO_ENABLE = no
NKRO_ENABLE = yes NKRO_ENABLE = yes
BACKLIGHT_ENABLE = no BACKLIGHT_ENABLE = no
SWAP_HANDS_ENABLE = no SWAP_HANDS_ENABLE = no
SPACE_CADET_ENABLE = no SPACE_CADET_ENABLE = no
INDICATOR_LIGHTS = no INDICATOR_LIGHTS = no
MACROS_ENABLED = no
RGBLIGHT_TWINKLE = no RGBLIGHT_TWINKLE = no
RGBLIGHT_STARTUP_ANIMATION = no RGBLIGHT_STARTUP_ANIMATION = no

View file

@ -0,0 +1,39 @@
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
Copyright 2018 Danny Nguyen <danny@keeb.io>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// #define USE_I2C
#define EE_HANDS
#ifdef RGBLIGHT_ENABLE
#define RGBLIGHT_SPLIT
#undef RGBLED_NUM
#define RGBLED_NUM 17
#define RGBLED_SPLIT { 9, 8 }
#define RGBLIGHT_SLEEP
#endif
#ifdef AUDIO_ENABLE
#define B7_AUDIO
#define AUDIO_CLICKY
#endif

View file

@ -0,0 +1,43 @@
#include QMK_KEYBOARD_H
#include "version.h"
enum layers {
_BASE,
_FN1,
};
enum custom_keycodes {
KC_MAKE = SAFE_RANGE,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT_65_with_macro(
KC_F1, KC_F2, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, KC_HOME, \
KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \
KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \
KC_F7, KC_F8, 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_UP, KC_PGDN, \
KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN1), KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[_FN1] = LAYOUT_65_with_macro(
_______, _______, KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC, RESET, \
_______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
if (!record->event.pressed)
send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP ":dfu" SS_TAP(X_ENTER)), 10);
break;
}
return true;
}

View file

@ -0,0 +1,5 @@
LINK_TIME_OPTIMIZATION_ENABLE = yes
RGBLIGHT_ENABLE = yes
EXTRAKEY_ENABLE = yes
AUDIO_ENABLE = yes
BOOTLOADER = qmk-dfu

View file

@ -10,7 +10,6 @@ extern keymap_config_t keymap_config;
// Fillers to make layering more clear // Fillers to make layering more clear
#define LMACRO OSL(_MACROS)
#define DIABLO TG(_DIABLO) #define DIABLO TG(_DIABLO)
#define GAMEPAD TG(_GAMEPAD) #define GAMEPAD TG(_GAMEPAD)
#define MEDIA TT(_MEDIA) #define MEDIA TT(_MEDIA)
@ -23,7 +22,7 @@ extern keymap_config_t keymap_config;
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_NUMLOCK] = LAYOUT_ortho_5x7( [_NUMLOCK] = LAYOUT_ortho_5x7(
LMACRO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, KC_NO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS,
MEDIA, KC_CALC, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PAST, MEDIA, KC_CALC, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PAST,
KC_HOME, KC_DEL, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_HOME, KC_DEL, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PMNS,
KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS,
@ -39,22 +38,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
[_GAMEPAD] = LAYOUT_ortho_5x7( // Game pad layout designed primarily for Overwatch [_GAMEPAD] = LAYOUT_ortho_5x7( // Game pad layout designed primarily for Overwatch
LMACRO, KC_ESC, GAMEPAD, KC_1, KC_2, KC_3, KC_4, KC_NO, KC_ESC, GAMEPAD, KC_1, KC_2, KC_3, KC_4,
MEDIA, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MEDIA, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T,
KC_Z, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_Z, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G,
KC_Y, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_Y, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B,
KC_F1, KC_U, KC_I, KC_Y, KC_V, KC_SPC, KC_V KC_F1, KC_U, KC_I, KC_Y, KC_V, KC_SPC, KC_V
), ),
[_MACROS] = LAYOUT_ortho_5x7(
LMACRO, KC_OVERWATCH,GAMEPAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
KC_C9, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
KC_SYMM, KC_TORB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
KC_GLHF, KC_GOODGAME, KC_GGEZ, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
KC_SALT, KC_MORESALT, KC_SALTHARD, KC_JUSTGAME, KC_AIM, XXXXXXX, KC_PENT
),
[_MEDIA] = LAYOUT_ortho_5x7( [_MEDIA] = LAYOUT_ortho_5x7(
KC_MAKE, KC_RESET,MU_TOG, AU_ON, AU_OFF, CK_TOGG, RGB_SAD, KC_MAKE, KC_RESET,MU_TOG, AU_ON, AU_OFF, CK_TOGG, RGB_SAD,
MEDIA, EEP_RST, KC_RGB_T,RGB_M_P, RGB_M_B, RGB_M_R, RGB_SAI, MEDIA, EEP_RST, KC_RGB_T,RGB_M_P, RGB_M_B, RGB_M_R, RGB_SAI,

View file

@ -11,7 +11,6 @@ SPLIT_KEYBOARD = no
SPACE_CADET_ENABLE = no SPACE_CADET_ENABLE = no
NO_SECRETS = yes NO_SECRETS = yes
MACROS_ENABLED = yes
INDICATOR_LIGHTS = no INDICATOR_LIGHTS = no
RGBLIGHT_TWINKLE = no RGBLIGHT_TWINKLE = no
LAYOUTS = ortho_5x7 LAYOUTS = ortho_5x7

View file

@ -38,7 +38,7 @@ uint8_t last_osm;
) \ ) \
LAYOUT_wrapper( \ LAYOUT_wrapper( \
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \
KC_TAB, K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, KC_QUOT, \ KC_TAB, ALT_T(K11), K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF \
) )
#define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__) #define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__)

View file

@ -10,7 +10,6 @@ NKRO_ENABLE = yes
SPACE_CADET_ENABLE = no SPACE_CADET_ENABLE = no
INDICATOR_LIGHTS = yes INDICATOR_LIGHTS = yes
MACROS_ENABLED = no
RGBLIGHT_TWINKLE = no RGBLIGHT_TWINKLE = no
RGBLIGHT_STARTUP_ANIMATION = yes RGBLIGHT_STARTUP_ANIMATION = yes

View file

@ -14,3 +14,5 @@
#undef DEBOUNCE #undef DEBOUNCE
#define DEBOUNCE 15 #define DEBOUNCE 15
#define TAPPING_TERM_PER_KEY

View file

@ -23,8 +23,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef UNICODE_ENABLE #ifndef UNICODE_ENABLE
# define UC(x) KC_NO # define UC(x) KC_NO
#endif #endif
#ifdef RGBLIGHT_ENABLE
extern userspace_config_t userspace_config; extern rgblight_config_t rgblight_config;
#endif
enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE }; enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE };
@ -40,7 +41,7 @@ bool skip_leds = false;
LAYOUT_ergodox_pretty_wrapper( \ LAYOUT_ergodox_pretty_wrapper( \
KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \
KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \
KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ KC_C1R3, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \
KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \
OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \
@ -291,8 +292,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_ADJUST] = LAYOUT_ergodox_pretty_wrapper( [_ADJUST] = LAYOUT_ergodox_pretty_wrapper(
KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, _________________ADJUST_R1_________________, KC_RST,
VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EEP_RST, VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EEP_RST,
_______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG(_MODS), _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, RGB_IDL,
_______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, KC_MPLY, _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, TG(_MODS),
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______,
@ -464,3 +465,13 @@ void rgb_matrix_indicators_user(void) {
} }
#endif // RGB_MATRIX_INIT #endif // RGB_MATRIX_INIT
uint16_t get_tapping_term(uint16_t keycode) {
if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) {
if (mod_config(keycode & 0xf) & MOD_MASK_ALT) {
return (2 * TAPPING_TERM);
}
}
return TAPPING_TERM;
}

View file

@ -12,7 +12,6 @@ BOOTMAGIC_ENABLE = yes
UNICODE_ENABLE = yes UNICODE_ENABLE = yes
UNICDOEMAP_ENABLE = no UNICDOEMAP_ENABLE = no
MACROS_ENABLED = no
RGBLIGHT_TWINKLE = no RGBLIGHT_TWINKLE = no
INDICATOR_LIGHTS = no INDICATOR_LIGHTS = no
RGBLIGHT_STARTUP_ANIMATION = yes RGBLIGHT_STARTUP_ANIMATION = yes

View file

@ -4,7 +4,7 @@
#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM)
#define RGB_DI_PIN B7 #define RGB_DI_PIN B7
#define RGBLED_NUM 16 // Number of LEDs #define RGBLED_NUM 13 // Number of LEDs
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_HUE_STEP 12

View file

@ -25,9 +25,10 @@ void keyboard_post_init_user(void) {
uint8_t temp_mode = rgblight_config.mode; uint8_t temp_mode = rgblight_config.mode;
rgblight_enable_noeeprom(); rgblight_enable_noeeprom();
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
for (uint16_t i = 360; i > 0; i--) { for (uint16_t i = 255; i > 0; i--) {
rgblight_sethsv_noeeprom( ( i + 180) % 360, 255, 255); rgblight_sethsv_noeeprom( ( i + 128) % 255, 255, 255);
wait_ms(8); matrix_scan();
wait_ms(10);
} }
led_set_user(host_keyboard_leds()); led_set_user(host_keyboard_leds());
rgblight_mode_noeeprom(temp_mode); rgblight_mode_noeeprom(temp_mode);

View file

@ -5,6 +5,5 @@ NO_SECRETS = yes
BOOTMAGIC_ENABLE = lite BOOTMAGIC_ENABLE = lite
INDICATOR_LIGHTS = no INDICATOR_LIGHTS = no
RGBLIGHT_TWINKLE = yes RGBLIGHT_TWINKLE = yes
MACROS_ENABLED = no
MAKE_BOOTLOADER = yes MAKE_BOOTLOADER = yes
RGBLIGHT_STARTUP_ANIMATION = yes RGBLIGHT_STARTUP_ANIMATION = yes

View file

@ -17,6 +17,7 @@
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) # define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot)
// #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened)
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
// #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
// #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 // #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended # define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended

View file

@ -27,6 +27,9 @@ enum planck_keycodes {
}; };
#else #else
# define BACKLIT OSM(MOD_LSFT) # define BACKLIT OSM(MOD_LSFT)
enum planck_keycodes {
TH_LVL = NEW_SAFE_RANGE,
};
#endif #endif
#ifdef KEYBOARD_planck_ez #ifdef KEYBOARD_planck_ez
@ -48,8 +51,8 @@ enum planck_keycodes {
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
) \ ) \
LAYOUT_ortho_4x12_wrapper( \ LAYOUT_ortho_4x12_wrapper( \
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_DEL, \
KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_ENT, \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_ENT, \
BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, PLNK_1, PLNK_2, PLNK_3, PLNK_4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, PLNK_1, PLNK_2, PLNK_3, PLNK_4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
) )
@ -117,7 +120,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC,
KC_DEL, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, KC_DEL, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE,
_______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
), ),
[_RAISE] = LAYOUT_ortho_4x12_wrapper( [_RAISE] = LAYOUT_ortho_4x12_wrapper(
@ -130,8 +133,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_ADJUST] = LAYOUT_ortho_4x12_wrapper( [_ADJUST] = LAYOUT_ortho_4x12_wrapper(
KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST, KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST,
VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST,
_______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, TH_LVL, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_NUKE _______, _______, _______, _______, _______, KC_NUKE, _______, _______, _______, _______, _______, TG_MODS
) )
}; };
@ -149,7 +152,20 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
} else { } else {
unregister_code(KC_RSFT); unregister_code(KC_RSFT);
} }
return false; break;
#endif
#ifdef KEYBOARD_planck_ez
case TH_LVL:
if (record->event.pressed) {
keyboard_config.led_level++;
if (keyboard_config.led_level > 4) {
keyboard_config.led_level = 0;
}
planck_ez_right_led_level((uint8_t)keyboard_config.led_level * 255 / 4 );
planck_ez_left_led_level((uint8_t)keyboard_config.led_level * 255 / 4 );
eeconfig_update_kb(keyboard_config.raw);
layer_state_set_kb(layer_state);
}
break; break;
#endif #endif
} }
@ -265,7 +281,7 @@ void rgb_matrix_indicators_user(void) {
break; break;
} }
if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) { if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) {
rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); if (!layer_state_cmp(layer_state, _ADJUST)) { rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); }
rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); rgb_matrix_set_color(36, 0x00, 0xFF, 0x00);
} }
if ((this_mod | this_osm) & MOD_MASK_CTRL) { if ((this_mod | this_osm) & MOD_MASK_CTRL) {
@ -353,18 +369,18 @@ void dip_update(uint8_t index, bool active) {
#ifdef KEYBOARD_planck_ez #ifdef KEYBOARD_planck_ez
layer_state_t layer_state_set_keymap(layer_state_t state) { layer_state_t layer_state_set_keymap(layer_state_t state) {
palClearPad(GPIOB, 8); planck_ez_left_led_off();
palClearPad(GPIOB, 9); planck_ez_right_led_off();
switch (biton32(state)) { switch (biton32(state)) {
case _LOWER: case _LOWER:
palSetPad(GPIOB, 9); planck_ez_left_led_on();
break; break;
case _RAISE: case _RAISE:
palSetPad(GPIOB, 8); planck_ez_right_led_on();
break; break;
case _ADJUST: case _ADJUST:
palSetPad(GPIOB, 9); planck_ez_right_led_on();
palSetPad(GPIOB, 8); planck_ez_left_led_on();
break; break;
default: default:
break; break;

View file

@ -33,6 +33,3 @@ NKRO_ENABLE = no
else else
NKRO_ENABLE = yes NKRO_ENABLE = yes
endif endif
MACROS_ENABLED = no

View file

@ -29,10 +29,11 @@
LAYOUT_ortho_5x12_wrapper( \ LAYOUT_ortho_5x12_wrapper( \
KC_GRV, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ KC_GRV, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \
KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_BSPC, \ KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_BSPC, \
KC_ESC, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, KC_QUOT, \ KC_ESC, ALT_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, K2A, RALT_T(KC_QUOT), \
KC_MLSF, CTL_T(K31), K32, K33, K34, K35, K36, K37, K38, K39, CTL_T(K3A), KC_ENT, \ KC_MLSF, CTL_T(K31), K32, K33, K34, K35, K36, K37, K38, K39, RCTL_T(K3A), KC_ENT, \
KC_NO, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ KC_NO, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
) )
#define LAYOUT_ortho_5x12_base_wrapper(...) LAYOUT_ortho_5x12_base(__VA_ARGS__) #define LAYOUT_ortho_5x12_base_wrapper(...) LAYOUT_ortho_5x12_base(__VA_ARGS__)
@ -132,7 +133,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_ADJUST] = LAYOUT_ortho_5x12_wrapper( \ [_ADJUST] = LAYOUT_ortho_5x12_wrapper( \
KC_MAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RST, KC_MAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RST,
VRSN, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, EEP_RST, VRSN, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, EEP_RST,
_______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, _______, _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, RGB_IDL,
_______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
) )

View file

@ -18,6 +18,3 @@ NKRO_ENABLE = no
else else
NKRO_ENABLE = yes NKRO_ENABLE = yes
endif endif
MACROS_ENABLED = no

View file

@ -10,7 +10,7 @@ QMK Firmware:
image: ubuntu:18.10 image: ubuntu:18.10
before_script: before_script:
- apt-get update -qy - apt-get update -qy
- apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi git libnewlib-arm-none-eabi gcc-avr unzip wget zip - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi git libnewlib-arm-none-eabi gcc-avr python3 unzip wget zip
- avr-gcc --version - avr-gcc --version
- uname -a - uname -a
script: script:

View file

@ -1,5 +1,11 @@
#pragma once #pragma once
// Use custom magic number so that when switching branches, EEPROM always gets reset
#define EECONFIG_MAGIC_NUMBER (uint16_t)0x1337
/* Set Polling rate to 1000Hz */
#define USB_POLLING_INTERVAL_MS 1
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
# if __GNUC__ > 7 # if __GNUC__ > 7
# if __has_include("drashna_song_list.h") # if __has_include("drashna_song_list.h")

View file

@ -25,26 +25,7 @@ userspace_config_t userspace_config;
# define DRASHNA_UNICODE_MODE 2 # define DRASHNA_UNICODE_MODE 2
#endif #endif
// This block is for all of the gaming macros, as they were all doing
// the same thing, but with differring text sent.
bool send_game_macro(const char *str, keyrecord_t *record, bool override) {
if (!record->event.pressed || override) {
uint16_t keycode;
if (userspace_config.is_overwatch) {
keycode = KC_BSPC;
} else {
keycode = KC_ENTER;
}
clear_keyboard();
tap_code(keycode);
wait_ms(TAP_CODE_DELAY);
send_string_with_delay(str, TAP_CODE_DELAY);
wait_ms(TAP_CODE_DELAY);
tap_code(KC_ENTER);
}
if (override) wait_ms(3000);
return false;
}
bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) { bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) {
static uint16_t this_timer; static uint16_t this_timer;
@ -123,7 +104,7 @@ __attribute__((weak))
void keyboard_post_init_keymap(void) {} void keyboard_post_init_keymap(void) {}
void keyboard_post_init_user(void) { void keyboard_post_init_user(void) {
#ifdef RGBLIGHT_ENABLE #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
keyboard_post_init_rgb(); keyboard_post_init_rgb();
#endif #endif
keyboard_post_init_keymap(); keyboard_post_init_keymap();
@ -132,6 +113,8 @@ void keyboard_post_init_user(void) {
__attribute__((weak)) __attribute__((weak))
void shutdown_keymap(void) {} void shutdown_keymap(void) {}
void rgb_matrix_update_pwm_buffers(void);
void shutdown_user(void) { void shutdown_user(void) {
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
rgblight_enable_noeeprom(); rgblight_enable_noeeprom();
@ -139,9 +122,9 @@ void shutdown_user(void) {
rgblight_setrgb_red(); rgblight_setrgb_red();
#endif // RGBLIGHT_ENABLE #endif // RGBLIGHT_ENABLE
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
// uint16_t timer_start = timer_read(); rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 );
// rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); rgb_matrix_update_pwm_buffers();
// while(timer_elapsed(timer_start) < 250) { wait_ms(1); }
#endif // RGB_MATRIX_ENABLE #endif // RGB_MATRIX_ENABLE
shutdown_keymap(); shutdown_keymap();
} }
@ -176,7 +159,7 @@ void matrix_scan_user(void) {
run_diablo_macro_check(); run_diablo_macro_check();
#endif // TAP_DANCE_ENABLE #endif // TAP_DANCE_ENABLE
#ifdef RGBLIGHT_ENABLE #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
matrix_scan_rgb(); matrix_scan_rgb();
#endif // RGBLIGHT_ENABLE #endif // RGBLIGHT_ENABLE
@ -190,7 +173,7 @@ layer_state_t layer_state_set_keymap(layer_state_t state) { return state; }
// Then runs keymap's layer change check // Then runs keymap's layer change check
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
#ifdef RGBLIGHT_ENABLE #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
state = layer_state_set_rgb(state); state = layer_state_set_rgb(state);
#endif // RGBLIGHT_ENABLE #endif // RGBLIGHT_ENABLE
return layer_state_set_keymap(state); return layer_state_set_keymap(state);
@ -203,7 +186,7 @@ layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state
layer_state_t default_layer_state_set_user(layer_state_t state) { layer_state_t default_layer_state_set_user(layer_state_t state) {
state = default_layer_state_set_keymap(state); state = default_layer_state_set_keymap(state);
#if 0 #if 0
# ifdef RGBLIGHT_ENABLE #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
state = default_layer_state_set_rgb(state); state = default_layer_state_set_rgb(state);
# endif // RGBLIGHT_ENABLE # endif // RGBLIGHT_ENABLE
#endif #endif

View file

@ -49,13 +49,8 @@ enum userspace_layers {
_ADJUST, _ADJUST,
}; };
/*
define modifiers here, since MOD_* doesn't seem to work for these
*/
bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed); bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed);
bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
bool send_game_macro(const char *str, keyrecord_t *record, bool override);
void matrix_init_keymap(void); void matrix_init_keymap(void);
void shutdown_keymap(void); void shutdown_keymap(void);
void suspend_power_down_keymap(void); void suspend_power_down_keymap(void);
@ -74,6 +69,7 @@ typedef union {
bool nuke_switch :1; bool nuke_switch :1;
uint8_t unicode_mod :4; uint8_t unicode_mod :4;
bool swapped_numbers :1; bool swapped_numbers :1;
bool rgb_matrix_idle_anim :1;
}; };
} userspace_config_t; } userspace_config_t;

View file

@ -21,16 +21,23 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#endif // KEYLOGGER_ENABLE #endif // KEYLOGGER_ENABLE
switch (keycode) { switch (keycode) {
case KC_QWERTY ... KC_CARPLAX: case KC_QWERTY ... KC_WORKMAN:
if (record->event.pressed) { if (record->event.pressed) {
uint8_t mods = mod_config(get_mods()|get_oneshot_mods());
if (!mods) {
set_single_persistent_default_layer(keycode - KC_QWERTY); set_single_persistent_default_layer(keycode - KC_QWERTY);
} else if (mods & MOD_MASK_SHIFT) {
set_single_persistent_default_layer(keycode - KC_QWERTY + 4);
} else if (mods & MOD_MASK_CTRL) {
set_single_persistent_default_layer(keycode - KC_QWERTY + 8);
}
} }
break; break;
case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
if (!record->event.pressed) { if (!record->event.pressed) {
uint8_t temp_mod = get_mods(); uint8_t temp_mod = mod_config(get_mods());
uint8_t temp_osm = get_oneshot_mods(); uint8_t temp_osm = mod_config(get_oneshot_mods());
clear_mods(); clear_mods();
clear_oneshot_mods(); clear_oneshot_mods();
send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY); send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY);
@ -38,15 +45,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) if ((temp_mod | temp_osm) & MOD_MASK_SHIFT)
#endif #endif
{ {
#if defined(__arm__) send_string_with_delay_P(PSTR(":flash"), TAP_CODE_DELAY);
send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY);
#elif defined(BOOTLOADER_DFU)
send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY);
#elif defined(BOOTLOADER_HALFKAY)
send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY);
#elif defined(BOOTLOADER_CATERINA)
send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY);
#endif // bootloader options
} }
if ((temp_mod | temp_osm) & MOD_MASK_CTRL) { if ((temp_mod | temp_osm) & MOD_MASK_CTRL) {
send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY);
@ -68,44 +67,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
break; break;
// These are a serious of gaming macros.
// Only enables for the viterbi, basically,
// to save on firmware space, since it's limited.
#ifdef MACROS_ENABLED
case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros
if (record->event.pressed) {
userspace_config.is_overwatch ^= 1;
eeconfig_update_user(userspace_config.raw);
}
# ifdef RGBLIGHT_ENABLE
userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18);
# endif // RGBLIGHT_ENABLE
break;
case KC_SALT:
return send_game_macro("Salt, salt, salt...", record, false);
case KC_MORESALT:
return send_game_macro("Please sir, can I have some more salt?!", record, false);
case KC_SALTHARD:
return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false);
case KC_GOODGAME:
return send_game_macro("Good game, everyone!", record, false);
case KC_GLHF:
return send_game_macro("Good luck, have fun!!!", record, false);
case KC_SYMM:
return send_game_macro("Left click to win!", record, false);
case KC_JUSTGAME:
return send_game_macro("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games.", record, false);
case KC_TORB:
return send_game_macro("That was positively riveting!", record, false);
case KC_AIM:
send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true);
return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false);
case KC_C9:
return send_game_macro("OMG!!! C9!!!", record, false);
case KC_GGEZ:
return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false);
#endif // MACROS_ENABLED
case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them
#ifdef TAP_DANCE_ENABLE #ifdef TAP_DANCE_ENABLE
if (record->event.pressed) { if (record->event.pressed) {

View file

@ -13,25 +13,10 @@ enum userspace_custom_keycodes {
KC_COLEMAK, // Sets default layer to COLEMAK KC_COLEMAK, // Sets default layer to COLEMAK
KC_DVORAK, // Sets default layer to DVORAK KC_DVORAK, // Sets default layer to DVORAK
KC_WORKMAN, // Sets default layer to WORKMAN KC_WORKMAN, // Sets default layer to WORKMAN
KC_NORMAN, // Sets default layer to NORMAN
KC_MALTRON, // Sets default layer to MALTRON
KC_EUCALYN, // Sets default layer to EUCALYN
KC_CARPLAX, // Sets default layer to CARPLAX
KC_DIABLO_CLEAR, // Clears all Diablo Timers KC_DIABLO_CLEAR, // Clears all Diablo Timers
KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat)
KC_SALT, // See drashna.c for details
KC_MORESALT,
KC_SALTHARD,
KC_GOODGAME,
KC_SYMM,
KC_JUSTGAME,
KC_GLHF,
KC_TORB,
KC_AIM,
KC_C9,
KC_GGEZ,
KC_MAKE, // Run keyboard's customized make command KC_MAKE, // Run keyboard's customized make command
KC_RGB_T, // Toggles RGB Layer Indication mode KC_RGB_T, // Toggles RGB Layer Indication mode
RGB_IDL, // RGB Idling animations
KC_SECRET_1, // test1 KC_SECRET_1, // test1
KC_SECRET_2, // test2 KC_SECRET_2, // test2
KC_SECRET_3, // test3 KC_SECRET_3, // test3

View file

@ -5,12 +5,24 @@
#if defined(RGBLIGHT_ENABLE) #if defined(RGBLIGHT_ENABLE)
extern rgblight_config_t rgblight_config; extern rgblight_config_t rgblight_config;
bool has_initialized; bool has_initialized;
#endif
#ifdef RGBLIGHT_ENABLE
void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); } void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); }
#endif // RGBLIGHT_ENABLE #endif // RGBLIGHT_ENABLE
#if defined(RGB_MATRIX_ENABLE)
static uint32_t hypno_timer;
# if defined(SPLIT_KEYBOARD) || defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_crkbd)
# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN_DUAL
# else
# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN
# endif
#endif
/* Custom indicators for modifiers.
* This allows for certain lights to be lit up, based on what mods are active, giving some visual feedback.
* This is especially useful for One Shot Mods, since it's not always obvious if they're still lit up.
*/
#ifdef RGBLIGHT_ENABLE
#ifdef INDICATOR_LIGHTS #ifdef INDICATOR_LIGHTS
void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) {
@ -77,6 +89,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
} }
} }
/* Function for the indicators */
void matrix_scan_indicator(void) { void matrix_scan_indicator(void) {
if (has_initialized) { if (has_initialized) {
set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods());
@ -89,6 +102,7 @@ static rgblight_fadeout lights[RGBLED_NUM];
__attribute__((weak)) bool rgblight_twinkle_is_led_used_keymap(uint8_t index) { return false; } __attribute__((weak)) bool rgblight_twinkle_is_led_used_keymap(uint8_t index) { return false; }
/* This function checks for used LEDs. This way, collisions don't occur and cause weird rendering */
bool rgblight_twinkle_is_led_used(uint8_t index) { bool rgblight_twinkle_is_led_used(uint8_t index) {
switch (index) { switch (index) {
# ifdef INDICATOR_LIGHTS # ifdef INDICATOR_LIGHTS
@ -130,6 +144,7 @@ bool rgblight_twinkle_is_led_used(uint8_t index) {
} }
} }
/* Handler for fading/twinkling effect */
void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive
bool litup = false; bool litup = false;
for (uint8_t light_index = 0; light_index < RGBLED_NUM; ++light_index) { for (uint8_t light_index = 0; light_index < RGBLED_NUM; ++light_index) {
@ -156,6 +171,9 @@ void scan_rgblight_fadeout(void) { // Don't effing change this function .... rg
} }
} }
/* Triggers a LED to fade/twinkle.
* This function handles the selection of the LED and prepres for it to be used.
*/
void start_rgb_light(void) { void start_rgb_light(void) {
uint8_t indices[RGBLED_NUM]; uint8_t indices[RGBLED_NUM];
uint8_t indices_count = 0; uint8_t indices_count = 0;
@ -194,12 +212,23 @@ void start_rgb_light(void) {
rgblight_sethsv_at(light->hue, 255, light->life, light_index); rgblight_sethsv_at(light->hue, 255, light->life, light_index);
} }
#endif #endif
#endif // RGBLIGHT_ENABLE
bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
uint16_t temp_keycode = keycode;
// Filter out the actual keycode from MT and LT keys.
if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) {
keycode = keycode & 0xFF; temp_keycode &= 0xFF;
} }
switch (keycode) {
#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
hypno_timer = timer_read32();
if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_REST_MODE) {
rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP);
}
#endif
switch (temp_keycode) {
#ifdef RGBLIGHT_TWINKLE #ifdef RGBLIGHT_TWINKLE
case KC_A ... KC_SLASH: case KC_A ... KC_SLASH:
case KC_F1 ... KC_F12: case KC_F1 ... KC_F12:
@ -210,40 +239,58 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {
start_rgb_light(); start_rgb_light();
} }
return true;
break; break;
#endif // RGBLIGHT_TWINKLE #endif // RGBLIGHT_TWINKLE
case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
if (record->event.pressed) { if (record->event.pressed) {
userspace_config.rgb_layer_change ^= 1; userspace_config.rgb_layer_change ^= 1;
xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
eeconfig_update_user(userspace_config.raw); eeconfig_update_user(userspace_config.raw);
if (userspace_config.rgb_layer_change) { if (userspace_config.rgb_layer_change) {
layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better)
} }
} }
#endif // RGBLIGHT_ENABLE #endif // RGBLIGHT_ENABLE
return false;
break; break;
#ifdef RGBLIGHT_ENABLE case RGB_IDL: // This allows me to use underglow as layer indication, or as normal
#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
if (record->event.pressed) {
userspace_config.rgb_matrix_idle_anim ^= 1;
dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim);
eeconfig_update_user(userspace_config.raw);
if (userspace_config.rgb_matrix_idle_anim) { rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); }
}
#endif
break;
case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions
if (record->event.pressed) { // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled if (record->event.pressed) {
bool is_eeprom_updated = false;
#ifdef RGBLIGHT_ENABLE
// This disables layer indication, as it's assumed that if you're changing this ... you want that disabled
if (userspace_config.rgb_layer_change) { if (userspace_config.rgb_layer_change) {
userspace_config.rgb_layer_change = false; userspace_config.rgb_layer_change = false;
xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
eeconfig_update_user(userspace_config.raw); is_eeprom_updated = true;
} }
#endif
#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
if (userspace_config.rgb_matrix_idle_anim) {
userspace_config.rgb_matrix_idle_anim = false;
dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim);
is_eeprom_updated = true;
}
#endif
if (is_eeprom_updated) { eeconfig_update_user(userspace_config.raw); }
} }
return true;
break; break;
#endif // RGBLIGHT_ENABLE
} }
return true; return true;
} }
void keyboard_post_init_rgb(void) { void keyboard_post_init_rgb(void) {
#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) #if defined(RGBLIGHT_ENABLE)
# if defined(RGBLIGHT_STARTUP_ANIMATION)
bool is_enabled = rgblight_config.enable; bool is_enabled = rgblight_config.enable;
if (userspace_config.rgb_layer_change) { if (userspace_config.rgb_layer_change) {
rgblight_enable_noeeprom(); rgblight_enable_noeeprom();
@ -262,17 +309,31 @@ void keyboard_post_init_rgb(void) {
rgblight_disable_noeeprom(); rgblight_disable_noeeprom();
} }
#endif # endif
layer_state_set_user(layer_state); layer_state_set_user(layer_state);
#endif
#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
if (userspace_config.rgb_matrix_idle_anim) {
rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE);
}
#endif
} }
void matrix_scan_rgb(void) { void matrix_scan_rgb(void) {
#ifdef RGBLIGHT_TWINKLE #ifdef RGBLIGHT_ENABLE
# ifdef RGBLIGHT_TWINKLE
scan_rgblight_fadeout(); scan_rgblight_fadeout();
#endif // RGBLIGHT_ENABLE # endif // RGBLIGHT_ENABLE
#ifdef INDICATOR_LIGHTS # ifdef INDICATOR_LIGHTS
matrix_scan_indicator(); matrix_scan_indicator();
# endif
#endif
#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_TYPING_HEATMAP && timer_elapsed32(hypno_timer) > 15000) {
rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE);
}
#endif #endif
} }

View file

@ -4,20 +4,29 @@
# include "rgb_matrix.h" # include "rgb_matrix.h"
#endif #endif
#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_TWINKLE)
typedef struct { typedef struct {
bool enabled; bool enabled;
uint8_t hue; uint8_t hue;
uint16_t timer; uint16_t timer;
uint8_t life; uint8_t life;
} rgblight_fadeout; } rgblight_fadeout;
#endif
bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record); bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record);
void scan_rgblight_fadeout(void);
void keyboard_post_init_rgb(void); void keyboard_post_init_rgb(void);
void matrix_scan_rgb(void); void matrix_scan_rgb(void);
layer_state_t layer_state_set_rgb(layer_state_t state); layer_state_t layer_state_set_rgb(layer_state_t state);
layer_state_t default_layer_state_set_rgb(layer_state_t state); layer_state_t default_layer_state_set_rgb(layer_state_t state);
void rgblight_sethsv_default_helper(uint8_t index);
void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue);
#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_TWINKLE)
void scan_rgblight_fadeout(void);
#endif
#if defined(RGBLIGHT_ENABLE)
void rgblight_sethsv_default_helper(uint8_t index);
#endif
#ifdef RGB_MATRIX_ENABLE
void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue);
void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type); void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type);
#endif

View file

@ -40,10 +40,6 @@ ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
endif endif
ifeq ($(strip $(MACROS_ENABLED)), yes)
OPT_DEFS += -DMACROS_ENABLED
endif
ifdef CONSOLE_ENABLE ifdef CONSOLE_ENABLE
ifeq ($(strip $(KEYLOGGER_ENABLE)), yes) ifeq ($(strip $(KEYLOGGER_ENABLE)), yes)
OPT_DEFS += -DKEYLOGGER_ENABLE OPT_DEFS += -DKEYLOGGER_ENABLE

View file

@ -174,11 +174,11 @@ NOTE: These are all the same length. If you do a search/replace
#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG #define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG
#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM #define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, CG_NORM
#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T #define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T
#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 #define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5
#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN #define _________________ADJUST_R2_________________ CG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN
#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT #define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT
// clang-format on // clang-format on