[Keymap] Cleanup and updating of drashna keymap code (#11516)
* Update other keyboards for rgb matrix changes * Remove customized bootmagic code * Fix corne layout compilation error * Fix compiler errors with all keymaps * Add Simple Visualizer for ergodox infinity * Fix compile issue with Corne * Fix keymap stuff * Add alias for mouse layer * Add Halmak Keyboard layout * Updates for Kyria * Add support for oled interval * Change RGB stuff [CHANGE] Fix coexistence issues * Fix rgb_stuff * Add custom ploopyco mouse keymap * Decrease default dwell time * Updates based on last breaking changes update * Disable command on dactyl * Update ergodox to use proper commands for rgb matrix indicators * Update all rgb matrix indicator functions * Update rules for dactyl-manuform * Reduce wait time for mouse layer off event * Add more info to logger * Add wrappers for get_tapping term * Move version.h include into only file that actually needs it * Update rgb sleep stuff * Update key print function * Change DM keymap settings * Change pin for DM Manuform * Add Proton C stuff for Corne keymap * more arm corne tinkering * Even more arm stuff for corne * Cleanup corne stuff * redirect default keymap to drashna because I am a very bad man * change corne rgb priority * Update tractyl manuform to not conflict * Add more secret stuff * more dactyl tweaks * Add more options to split transport * Changes of oled support * Change split settings * Improve keylogger formatting more * tweak oled stuff * Oled and such tweaks * Reduce brightness due to leds * Decrease brightness more * Only run layer code if master
This commit is contained in:
parent
c16a3dcb54
commit
7a08b9d374
36 changed files with 588 additions and 270 deletions
|
@ -22,6 +22,10 @@
|
|||
/* Set Polling rate to 1000Hz */
|
||||
#define USB_POLLING_INTERVAL_MS 1
|
||||
|
||||
#if defined(SPLIT_KEYBOAD)
|
||||
# define SPLIT_MODS_ENABLE
|
||||
#endif
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
|
||||
# define AUDIO_CLICKY
|
||||
|
@ -40,9 +44,9 @@
|
|||
#endif // !AUDIO_ENABLE
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
# undef RGBLIGHT_ANIMATIONS
|
||||
# define RGBLIGHT_SLEEP
|
||||
# if defined(__AVR__) && !defined(__AVR_AT90USB1286__)
|
||||
# define RGBLIGHT_SLEEP
|
||||
# undef RGBLIGHT_ANIMATIONS
|
||||
# define RGBLIGHT_EFFECT_BREATHING
|
||||
# define RGBLIGHT_EFFECT_SNAKE
|
||||
# define RGBLIGHT_EFFECT_KNIGHT
|
||||
|
@ -101,6 +105,14 @@
|
|||
# endif // AVR
|
||||
#endif // RGB_MATRIX_ENABLE
|
||||
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
# ifdef SPLIT_KEYBOARD
|
||||
# define OLED_UPDATE_INTERVAL 60
|
||||
# else
|
||||
# define OLED_UPDATE_INTERVAL 15
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ONESHOT_TAP_TOGGLE
|
||||
# define ONESHOT_TAP_TOGGLE 2
|
||||
#endif // !ONESHOT_TAP_TOGGLE
|
||||
|
|
|
@ -49,21 +49,6 @@ bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this
|
|||
return false;
|
||||
}
|
||||
|
||||
void bootmagic_lite(void) {
|
||||
matrix_scan();
|
||||
#if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0
|
||||
wait_ms(DEBOUNCING_DELAY * 2);
|
||||
#elif defined(DEBOUNCE) && DEBOUNCE > 0
|
||||
wait_ms(DEBOUNCE * 2);
|
||||
#else
|
||||
wait_ms(30);
|
||||
#endif
|
||||
matrix_scan();
|
||||
if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) {
|
||||
bootloader_jump();
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((weak)) void keyboard_pre_init_keymap(void) {}
|
||||
|
||||
void keyboard_pre_init_user(void) {
|
||||
|
@ -75,6 +60,7 @@ void keyboard_pre_init_user(void) {
|
|||
// customization of the keymap. Use _keymap instead of _user
|
||||
// functions in the keymaps
|
||||
__attribute__((weak)) void matrix_init_keymap(void) {}
|
||||
__attribute__((weak)) void matrix_init_secret(void) {}
|
||||
|
||||
// Call user matrix init, set default RGB colors and then
|
||||
// call the keymap's init function
|
||||
|
@ -86,6 +72,8 @@ void matrix_init_user(void) {
|
|||
DDRB &= ~(1 << 0);
|
||||
PORTB &= ~(1 << 0);
|
||||
#endif
|
||||
|
||||
matrix_init_secret();
|
||||
matrix_init_keymap();
|
||||
}
|
||||
|
||||
|
@ -103,7 +91,9 @@ void keyboard_post_init_user(void) {
|
|||
|
||||
__attribute__((weak)) void shutdown_keymap(void) {}
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
void rgb_matrix_update_pwm_buffers(void);
|
||||
#endif
|
||||
|
||||
void shutdown_user(void) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
|
@ -129,6 +119,8 @@ void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); }
|
|||
|
||||
__attribute__((weak)) void matrix_scan_keymap(void) {}
|
||||
|
||||
__attribute__((weak)) void matrix_scan_secret(void) {}
|
||||
|
||||
// No global matrix scan code, so just run keymap's matrix
|
||||
// scan function
|
||||
void matrix_scan_user(void) {
|
||||
|
@ -149,6 +141,8 @@ void matrix_scan_user(void) {
|
|||
matrix_scan_rgb_matrix();
|
||||
#endif
|
||||
|
||||
matrix_scan_secret();
|
||||
|
||||
matrix_scan_keymap();
|
||||
}
|
||||
|
||||
|
@ -157,6 +151,8 @@ __attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state)
|
|||
// on layer change, no matter where the change was initiated
|
||||
// Then runs keymap's layer change check
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
if (!is_keyboard_master()) { return state; }
|
||||
|
||||
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
|
||||
#if defined(RGBLIGHT_ENABLE)
|
||||
state = layer_state_set_rgb_light(state);
|
||||
|
@ -168,6 +164,8 @@ __attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t
|
|||
|
||||
// Runs state check and changes underglow color and animation
|
||||
layer_state_t default_layer_state_set_user(layer_state_t state) {
|
||||
if (!is_keyboard_master()) { return state; }
|
||||
|
||||
state = default_layer_state_set_keymap(state);
|
||||
#if 0
|
||||
# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#pragma once
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#include "version.h"
|
||||
#include "eeprom.h"
|
||||
#include "wrappers.h"
|
||||
#include "process_records.h"
|
||||
|
@ -58,13 +57,17 @@ enum userspace_layers {
|
|||
_ADJUST,
|
||||
};
|
||||
|
||||
#define _MOUSE _MACROS
|
||||
|
||||
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);
|
||||
void matrix_init_keymap(void);
|
||||
void matrix_init_secret(void);
|
||||
void shutdown_keymap(void);
|
||||
void suspend_power_down_keymap(void);
|
||||
void suspend_wakeup_init_keymap(void);
|
||||
void matrix_scan_keymap(void);
|
||||
void matrix_scan_secret(void);
|
||||
layer_state_t layer_state_set_keymap(layer_state_t state);
|
||||
layer_state_t default_layer_state_set_keymap(layer_state_t state);
|
||||
void led_set_keymap(uint8_t usb_led);
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
#include "drashna.h"
|
||||
|
||||
extern uint8_t is_master;
|
||||
|
||||
#ifndef KEYLOGGER_LENGTH
|
||||
// # ifdef OLED_DISPLAY_128X64
|
||||
# define KEYLOGGER_LENGTH ((int)(OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH))
|
||||
|
@ -187,11 +185,11 @@ void render_bootmagic_status(void) {
|
|||
};
|
||||
|
||||
bool is_bootmagic_on;
|
||||
#ifdef OLED_DISPLAY_128X64
|
||||
#ifdef OLED_DISPLAY_128X64
|
||||
is_bootmagic_on = !keymap_config.swap_lctl_lgui;
|
||||
#else
|
||||
#else
|
||||
is_bootmagic_on = keymap_config.swap_lctl_lgui;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NAME), false);
|
||||
#ifdef OLED_DISPLAY_128X64
|
||||
|
@ -259,21 +257,20 @@ void render_status_secondary(void) {
|
|||
#if !defined(SPLIT_TRANSPORT_MIRROR) || defined(OLED_DISPLAY_128X64)
|
||||
oled_driver_render_logo();
|
||||
#endif
|
||||
#ifdef SPLIT_TRANSPORT_MIRROR
|
||||
/* Show Keyboard Layout */
|
||||
render_default_layer_state();
|
||||
render_layer_state();
|
||||
render_mod_status(get_mods() | get_oneshot_mods());
|
||||
render_keylogger_status();
|
||||
|
||||
#endif
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
void render_status_main(void) {
|
||||
oled_driver_render_logo();
|
||||
/* Show Keyboard Layout */
|
||||
render_default_layer_state();
|
||||
render_keylock_status(host_keyboard_leds());
|
||||
// render_keylock_status(host_keyboard_leds());
|
||||
render_bootmagic_status();
|
||||
render_user_status();
|
||||
|
||||
|
@ -281,19 +278,15 @@ void render_status_main(void) {
|
|||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
if (timer_elapsed32(oled_timer) > 30000) {
|
||||
oled_off();
|
||||
return;
|
||||
}
|
||||
#ifndef SPLIT_KEYBOARD
|
||||
else {
|
||||
oled_on();
|
||||
}
|
||||
#endif
|
||||
|
||||
update_log();
|
||||
|
||||
if (is_master) {
|
||||
if (is_keyboard_master()) {
|
||||
if (timer_elapsed32(oled_timer) > 30000) {
|
||||
oled_off();
|
||||
return;
|
||||
} else {
|
||||
oled_on();
|
||||
}
|
||||
render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||
} else {
|
||||
render_status_secondary();
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
|
||||
#include "drashna.h"
|
||||
#include "version.h"
|
||||
|
||||
uint16_t copy_paste_timer;
|
||||
|
||||
|
@ -27,11 +28,7 @@ __attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t
|
|||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
// If console is enabled, it will print the matrix position and status of each key pressed
|
||||
#ifdef KEYLOGGER_ENABLE
|
||||
# if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_keebio_iris_rev2)
|
||||
xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.row, record->event.key.col, record->event.pressed);
|
||||
# else
|
||||
xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
|
||||
# endif
|
||||
uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count);
|
||||
#endif // KEYLOGGER_ENABLE
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
process_record_user_oled(keycode, record);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#pragma once
|
||||
#include "drashna.h"
|
||||
|
||||
#if defined(KEYMAP_SAFE_RANGE)
|
||||
#if defined(KEYBOARD_handwired_dactyl_manuform_5x6_right_trackball)
|
||||
# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE
|
||||
#else
|
||||
# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE
|
||||
|
|
|
@ -26,7 +26,7 @@ static uint32_t hypno_timer;
|
|||
# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN
|
||||
#endif
|
||||
|
||||
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, uint8_t led_min, uint8_t led_max) {
|
||||
HSV hsv = {hue, sat, val};
|
||||
if (hsv.v > rgb_matrix_get_val()) {
|
||||
hsv.v = rgb_matrix_get_val();
|
||||
|
@ -40,7 +40,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode
|
|||
RGB rgb = hsv_to_rgb(hsv);
|
||||
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
|
||||
if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
|
||||
rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -50,7 +50,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode
|
|||
RGB rgb = hsv_to_rgb(hsv);
|
||||
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
|
||||
if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
|
||||
rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -22,4 +22,4 @@ void keyboard_post_init_rgb_matrix(void);
|
|||
void matrix_scan_rgb_matrix(void);
|
||||
|
||||
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, uint8_t led_min, uint8_t led_max);
|
||||
|
|
|
@ -178,7 +178,11 @@ layer_state_t layer_state_set_rgb_light(layer_state_t state) {
|
|||
uint8_t mode = layer_state_cmp(state,_MODS) ? RGBLIGHT_MODE_BREATHING : RGBLIGHT_MODE_STATIC_LIGHT;
|
||||
switch (get_highest_layer(state|default_layer_state)) {
|
||||
case _MACROS:
|
||||
rgblight_set_hsv_and_mode(HSV_ORANGE, userspace_config.is_overwatch ? RGBLIGHT_MODE_SNAKE + 2 : RGBLIGHT_MODE_SNAKE + 3);
|
||||
# ifdef RGBLIGHT_EFFECT_TWINKLE
|
||||
rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_TWINKLE + 5);
|
||||
# else
|
||||
rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_BREATHING + 3);
|
||||
# endif
|
||||
break;
|
||||
case _MEDIA:
|
||||
rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_KNIGHT + 1);
|
||||
|
|
|
@ -162,6 +162,15 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
#define _________________WHITE_L3__________________ KC_X, KC_R, KC_F, KC_DOT, KC_Z
|
||||
|
||||
|
||||
#define _________________HALMAK_L1_________________ KC_W, KC_L, KC_R, KC_B, KC_Z
|
||||
#define _________________HALMAK_L2_________________ KC_S, KC_H, KC_N, KC_T, KC_COMM
|
||||
#define _________________HALMAK_L3_________________ KC_F, KC_M, KC_V, KC_V, KC_SLASH
|
||||
|
||||
#define _________________HALMAK_R1_________________ KC_SCLN, KC_Q, KC_U, KC_D, KC_J
|
||||
#define _________________HALMAK_R2_________________ KC_DOT, KC_A, KC_E, KC_O, KC_I
|
||||
#define _________________HALMAK_R3_________________ KC_G, KC_P, KC_X, KC_K, KC_Y
|
||||
|
||||
|
||||
#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5
|
||||
#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0
|
||||
#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue