diff options
35 files changed, 459 insertions, 349 deletions
diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h index cb11ea2748..07c4bfc008 100644 --- a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h @@ -37,6 +37,9 @@ # undef POINTING_DEVICE_CS_PIN # define POINTING_DEVICE_CS_PIN A15 // b14 # define PMW33XX_LIFTOFF_DISTANCE 0b1111 + +# define RGB_MATRIX_LED_FLUSH_LIMIT 33 +# define RGB_MATRIX_LED_PROCESS_LIMIT 29 #endif #undef ROTATIONAL_TRANSFORM_ANGLE diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c index 50a05e1b35..85bb2bc77f 100644 --- a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c @@ -16,6 +16,7 @@ */ #include "drashna.h" +// clang-format off #define LAYOUT_charybdis_4x6_wrapper(...) LAYOUT_charybdis_4x6(__VA_ARGS__) #define LAYOUT_charybdis_4x6_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ @@ -26,14 +27,13 @@ KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, UC_CLUE, \ SH_TT, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, SH_TT, \ LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \ - OS_LSFT,CTL_T(K21), K22, K23, K24, K25, K26,K27,RGUI_T(K28),RALT_T(K29),RCTL_T(K2A), OS_RSFT, \ + OS_LSFT,CTL_T(K21),ALT_T(K22),GUI_T(K23),K24,K25, K26,K27,RGUI_T(K28),RALT_T(K29),RCTL_T(K2A), OS_RSFT, \ SFT_T(KC_GRV), OS_LALT, OS_LGUI, TT(_MOUSE), KC_ENT, \ KC_SPC, BK_LWER, DL_RAIS \ ) #define LAYOUT_base_wrapper(...) LAYOUT_charybdis_4x6_base(__VA_ARGS__) -// clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEFAULT_LAYER_1] = LAYOUT_base_wrapper( _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, @@ -120,13 +120,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; // clang-format on - void keyboard_post_init_keymap(void) { #ifdef RGB_MATRIX_ENABLE - g_led_config.flags[53] = g_led_config.flags[54] = g_led_config.flags[55] = - g_led_config.flags[0] = g_led_config.flags[1] = g_led_config.flags[2] = g_led_config.flags[3] = - g_led_config.flags[29] = g_led_config.flags[30] = g_led_config.flags[31] = g_led_config.flags[32] = - LED_FLAG_MODIFIER; + g_led_config.flags[53] = g_led_config.flags[54] = g_led_config.flags[55] = g_led_config.flags[0] = g_led_config.flags[1] = g_led_config.flags[2] = g_led_config.flags[3] = g_led_config.flags[29] = g_led_config.flags[30] = g_led_config.flags[31] = g_led_config.flags[32] = LED_FLAG_MODIFIER; #endif } @@ -171,8 +167,8 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}}, {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}}, {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}}, - {{0, 4}, {3, 4}, {2, 4}, {5, 4}, {4, 4}, {2, 4}}, - }; + {{0, 4}, {3, 4}, {2, 4}, {5, 4}, {4, 4}, {2, 4}} +}; # ifdef ENCODER_MAP_ENABLE const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {1, 0}; diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk index 12e9cecda0..0b7759f156 100644 --- a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk @@ -37,8 +37,7 @@ ifeq ($(strip $(OVERLOAD_FEATURES)), yes) NKRO_ENABLE = yes # Enable N-Key Rollover RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow - KEYBOARD_SHARED_EP = yes - MOUSE_SHARED_EP = yes + MOUSE_SHARED_EP = no AUTOCORRECT_ENABLE = yes CAPS_WORD_ENABLE = yes diff --git a/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/keymap.c b/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/keymap.c index d4aa71440d..d80d006796 100644 --- a/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/keymap.c +++ b/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/keymap.c @@ -133,14 +133,24 @@ bool oled_task_keymap(void) { // render_rgb_hsv(1, 13); oled_set_cursor(1, 13); - // oled_write_P(PSTR("Timer:"), false); - // oled_write(get_u8_str((uint8_t)(timer_elapsed32(oled_timer) / 1000), ' '), false); - oled_write_P(PSTR("Status: "), false); - if (is_oled_enabled) { - oled_write_P(PSTR("on "), false); - } else { - oled_write_P(PSTR("off"), false); - } + oled_write_P(PSTR("OS: "), false); + extern os_variant_t os_type; + switch (os_type) { + case OS_LINUX: + oled_write_ln_P(PSTR("Linux"), false); + break; + case OS_WINDOWS: + oled_write_ln_P(PSTR("Windows"), false); + break; + case OS_MACOS: + oled_write_ln_P(PSTR("MacOS"), false); + break; + case OS_IOS: + oled_write_ln_P(PSTR("iOS"), false); + break; + default: + break; + } render_keylogger_status(1, 14); diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c index afcc9b0a7a..4412130df8 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c @@ -130,25 +130,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_NUKE, _______ ), }; - +// clang-format on #ifdef ENCODER_ENABLE -#ifdef ENCODER_MAP_ENABLE +# ifdef ENCODER_MAP_ENABLE +// clang-format off const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { - [_DEFAULT_LAYER_1] = { { KC_VOLD, KC_VOLU }, { KC_WH_D, KC_WH_U } }, - [_DEFAULT_LAYER_2] = { { _______, _______ }, { _______, _______ } }, - [_DEFAULT_LAYER_3] = { { _______, _______ }, { _______, _______ } }, - [_DEFAULT_LAYER_4] = { { _______, _______ }, { _______, _______ } }, - [_GAMEPAD] = { { _______, _______ }, { _______, _______ } }, - [_DIABLO] = { { _______, _______ }, { _______, _______ } }, - [_MOUSE] = { { _______, _______ }, { KC_WH_D, KC_WH_U } }, - [_MEDIA] = { { _______, _______ }, { _______, _______ } }, - [_RAISE] = { { _______, _______ }, { KC_PGDN, KC_PGUP } }, - [_LOWER] = { { RGB_MOD, RGB_RMOD}, { RGB_HUD, RGB_HUI } }, - [_ADJUST] = { { CK_DOWN, CK_UP }, { _______, _______ } }, + [_DEFAULT_LAYER_1] = { ENCODER_CCW_CW( KC_VOLD, KC_VOLU ), ENCODER_CCW_CW( KC_WH_D, KC_WH_U ) }, + [_DEFAULT_LAYER_2] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, + [_DEFAULT_LAYER_3] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, + [_DEFAULT_LAYER_4] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, + [_GAMEPAD] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, + [_DIABLO] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, + [_MOUSE] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( KC_WH_D, KC_WH_U ) }, + [_MEDIA] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, + [_RAISE] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( KC_PGDN, KC_PGUP ) }, + [_LOWER] = { ENCODER_CCW_CW( RGB_MOD, RGB_RMOD), ENCODER_CCW_CW( RGB_HUD, RGB_HUI ) }, + [_ADJUST] = { ENCODER_CCW_CW( CK_DOWN, CK_UP ), ENCODER_CCW_CW( _______, _______ ) }, }; // clang-format on -#else +# else deferred_token encoder_token = INVALID_DEFERRED_TOKEN; static int8_t last_direction = -1; @@ -160,11 +161,11 @@ static uint32_t encoder_callback(uint32_t trigger_time, void *cb_arg) { } bool encoder_update_user(uint8_t index, bool clockwise) { -# ifdef SWAP_HANDS_ENABLE +# ifdef SWAP_HANDS_ENABLE if (swap_hands) { index ^= 1; } -# endif +# endif if (index == 0) { tap_code_delay(clockwise ? KC_VOLD : KC_VOLU, 5); } else if (index == 1) { @@ -185,7 +186,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } return false; } -#endif +# endif #endif #ifdef OLED_ENABLE @@ -214,4 +215,8 @@ void oled_render_large_display(bool side) { render_unicode_mode(1, 14); } } + +void render_oled_title(bool side) { + oled_write_P(side ? PSTR(" Tractyl ") : PSTR(" Manuform "), true); +} #endif diff --git a/keyboards/keebio/viterbi/keymaps/drashna/keymap.c b/keyboards/keebio/viterbi/keymaps/drashna/keymap.c index 4e393e4196..9b33f35e0e 100644 --- a/keyboards/keebio/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/keebio/viterbi/keymaps/drashna/keymap.c @@ -20,7 +20,7 @@ #define TT_MDIA TT(_MEDIA) // enum more_custom_keycodes { -// KC_P00 = NEW_SAFE_RANGE +// KC_P00 = USER_SAFE_RANGE //}; // clang-format off diff --git a/keyboards/moonlander/keymaps/drashna/keymap.c b/keyboards/moonlander/keymaps/drashna/keymap.c index e38a2828fe..2f38ac790c 100644 --- a/keyboards/moonlander/keymaps/drashna/keymap.c +++ b/keyboards/moonlander/keymaps/drashna/keymap.c @@ -16,7 +16,9 @@ #include "drashna.h" -enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE }; +enum more_custom_keycodes { + KC_SWAP_NUM = USER_SAFE_RANGE, +}; // clang-format off #define LAYOUT_moonlander_wrapper(...) LAYOUT_moonlander(__VA_ARGS__) diff --git a/keyboards/ploopyco/mouse/keymaps/drashna/keymap.c b/keyboards/ploopyco/mouse/keymaps/drashna/keymap.c index cf0b57d433..a249ebdfd9 100644 --- a/keyboards/ploopyco/mouse/keymaps/drashna/keymap.c +++ b/keyboards/ploopyco/mouse/keymaps/drashna/keymap.c @@ -17,6 +17,8 @@ */ #include QMK_KEYBOARD_H +// safe range starts at `USER_SAFE_RANGE` instead. + // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( @@ -26,6 +28,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; // clang-format on +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [0] = { ENCODER_CCW_CW( KC_WH_D, KC_WH_U ) }, + [1] = { ENCODER_CCW_CW( RGB_HUD, RGB_HUI ) }, +}; +#endif + #ifdef RGBLIGHT_ENABLE void eeconkfig_init_user(void) { rgblight_enable(); diff --git a/keyboards/ploopyco/trackball/readme.md b/keyboards/ploopyco/trackball/readme.md index 1648bd20f9..5c76f10187 100644 --- a/keyboards/ploopyco/trackball/readme.md +++ b/keyboards/ploopyco/trackball/readme.md @@ -29,20 +29,17 @@ The PCB should indicate which revision this is. While the defaults are designed so that it can be plugged in and used right away, there are a number of things that you may want to change. Such as adding DPI control, or to use the ball to scroll while holding a button. To allow for this sort of control, there is a callback for both the scroll wheel and the mouse sensor. -The default behavior for this is: ```c -void process_wheel_user(report_mouse_t* mouse_report, int16_t h, int16_t v) { - mouse_report->h = h; - mouse_report->v = v; -} - -void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) { - mouse_report->x = x; - mouse_report->y = y; +report_mouse_t pointing_device_task_user(report_mouse_t mouse_report){ + // executed each time the sensor is updated + // mouse_report.<attribute> - can be used to access indivdual mouse attributes + return mouse_report; } ``` +More information on `report_mouse_t` may be found [here](https://docs.qmk.fm/#/feature_pointing_device?id=manipulating-mouse-reports). + This should allow you to more heavily customize the behavior. Alternatively, the `process_wheel` and `process_mouse` functions can both be replaced too, to allow for even more functionality. diff --git a/keyboards/splitkb/kyria/keymaps/drashna/config.h b/keyboards/splitkb/kyria/keymaps/drashna/config.h index ffd17ebd8f..2d1fbdcb02 100644 --- a/keyboards/splitkb/kyria/keymaps/drashna/config.h +++ b/keyboards/splitkb/kyria/keymaps/drashna/config.h @@ -41,14 +41,21 @@ #define QMK_ESC_INPUT D4 #define QMK_ESC_OUTPUT B2 -#define BOOTMAGIC_LITE_ROW 0 -#define BOOTMAGIC_LITE_COLUMN 7 -#define BOOTMAGIC_LITE_ROW_RIGHT 4 -#define BOOTMAGIC_LITE_COLUMN_RIGHT 7 - -#define BOOTMAGIC_LITE_EEPROM_ROW 1 -#define BOOTMAGIC_LITE_EEPROM_COLUMN 7 -#define BOOTMAGIC_LITE_EEPROM_ROW_RIGHT 5 -#define BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT 7 +#ifndef KEYBOARD_splitkb_kyria_rev3 +# define BOOTMAGIC_LITE_ROW 0 +# define BOOTMAGIC_LITE_COLUMN 7 +# define BOOTMAGIC_LITE_ROW_RIGHT 4 +# define BOOTMAGIC_LITE_COLUMN_RIGHT 7 + +# define BOOTMAGIC_LITE_EEPROM_ROW 1 +# define BOOTMAGIC_LITE_EEPROM_COLUMN 7 +# define BOOTMAGIC_LITE_EEPROM_ROW_RIGHT 5 +# define BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT 7 +#endif #define SERIAL_USART_SPEED 921600 + +#if defined(KEYBOARD_splitkb_kyria_rev1_proton_c) +# define WEAR_LEVELING_BACKING_SIZE 16384 +# define WEAR_LEVELING_LOGICAL_SIZE 8192 +#endif diff --git a/keyboards/splitkb/kyria/keymaps/drashna/keymap.c b/keyboards/splitkb/kyria/keymaps/drashna/keymap.c index 8c028985ef..178d3f2480 100644 --- a/keyboards/splitkb/kyria/keymaps/drashna/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/drashna/keymap.c @@ -105,34 +105,39 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #ifdef ENCODER_MAP_ENABLE const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { - [_DEFAULT_LAYER_1] = { { KC_VOLD, KC_VOLU }, { KC_WH_D, KC_WH_U } }, - [_DEFAULT_LAYER_2] = { { _______, _______ }, { _______, _______ } }, - [_DEFAULT_LAYER_3] = { { _______, _______ }, { _______, _______ } }, - [_DEFAULT_LAYER_4] = { { _______, _______ }, { _______, _______ } }, - [_GAMEPAD] = { { _______, _______ }, { _______, _______ } }, - [_DIABLO] = { { _______, _______ }, { _______, _______ } }, - [_MOUSE] = { { _______, _______ }, { KC_WH_D, KC_WH_U } }, - [_MEDIA] = { { _______, _______ }, { _______, _______ } }, - [_RAISE] = { { _______, _______ }, { KC_PGDN, KC_PGUP } }, - [_LOWER] = { { RGB_MOD, RGB_RMOD}, { RGB_HUD, RGB_HUI } }, - [_ADJUST] = { { CK_DOWN, CK_UP }, { _______, _______ } }, + [_DEFAULT_LAYER_1] = { ENCODER_CCW_CW( KC_VOLD, KC_VOLU ), ENCODER_CCW_CW( KC_WH_D, KC_WH_U ) }, + [_DEFAULT_LAYER_2] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, + [_DEFAULT_LAYER_2] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, + [_DEFAULT_LAYER_2] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, + [_GAMEPAD] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, + [_DIABLO] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, + [_MOUSE] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( KC_WH_D, KC_WH_U ) }, + [_MEDIA] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, + [_RAISE] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( KC_PGDN, KC_PGUP ) }, + [_LOWER] = { ENCODER_CCW_CW( RGB_MOD, RGB_RMOD), ENCODER_CCW_CW( RGB_HUD, RGB_HUI ) }, + [_ADJUST] = { ENCODER_CCW_CW( CK_DOWN, CK_UP ), ENCODER_CCW_CW( _______, _______ ) }, }; #endif // clang-format on #ifdef OLED_ENABLE +void render_oled_title(bool side) { + oled_write_P(side ? PSTR(" Splitkb ") : PSTR(" Kyria "), true); +} + oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { -#ifdef OLED_DRIVER_SH1107 +# ifdef OLED_DRIVER_SH1107 return OLED_ROTATION_0; -#else +# else return OLED_ROTATION_180; -#endif +# endif } void oled_render_large_display(bool side) { if (side) { render_wpm_graph(56, 64); } else { + // clang-format off static const char PROGMEM kyria_logo[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,192,224,240,112,120, 56, 60, 28, 30, 14, 14, 14, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 30, 28, 60, 56,120,112,240,224,192,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,224,240,124, 62, 31, 15, 7, 3, 1,128,192,224,240,120, 56, 60, 28, 30, 14, 14, 7, 7,135,231,127, 31,255,255, 31,127,231,135, 7, 7, 14, 14, 30, 28, 60, 56,120,240,224,192,128, 1, 3, 7, 15, 31, 62,124,240,224,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -144,7 +149,7 @@ void oled_render_large_display(bool side) { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 7, 15, 14, 30, 28, 60, 56,120,112,112,112,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,112,112,112,120, 56, 60, 28, 30, 14, 15, 7, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // clang-format on - oled_set_cursor(0,7); + oled_set_cursor(0, 7); oled_write_raw_P(kyria_logo, sizeof(kyria_logo)); } } @@ -171,7 +176,6 @@ void housekeeping_task_keymap(void) { } #endif - #ifdef KEYBOARD_splitkb_kyria_rev1_proton_c void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { for (int32_t i = 0; i < 40; i++) { diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index e5675854e1..846bbc2351 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -17,7 +17,7 @@ #include "drashna.h" enum more_custom_keycodes { - KC_SWAP_NUM = NEW_SAFE_RANGE, + KC_SWAP_NUM = USER_SAFE_RANGE, PM_SCROLL, PM_PRECISION, }; diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index b22401a77e..d5faf7f7c8 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -16,19 +16,11 @@ #include "drashna.h" -#ifdef BACKLIGHT_ENABLE +#define BACKLIT OSM(MOD_LSFT) enum planck_keycodes { - BACKLIT = NEW_SAFE_RANGE, - TH_LVL, + TH_LVL = USER_SAFE_RANGE, }; -#else -# define BACKLIT OSM(MOD_LSFT) -enum planck_keycodes { - TH_LVL = NEW_SAFE_RANGE, -}; -#endif - #ifdef KEYBOARD_planck_ez # define PLNK_1 BK_LWER # define PLNK_2 SP_LWER @@ -56,10 +48,10 @@ enum planck_keycodes { K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ ) \ LAYOUT_ortho_4x12_wrapper( \ - KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_DEL, \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, PRINT_SETUPS, \ LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \ 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 \ + STORE_SETUPS, OS_LCTL, OS_LALT, OS_LGUI, PLNK_1, PLNK_2, PLNK_3, PLNK_4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ) #define LAYOUT_base_wrapper(...) LAYOUT_ortho_4x12_base(__VA_ARGS__) @@ -130,18 +122,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { switch (keycode) { -#ifdef BACKLIGHT_ENABLE - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); -# ifdef BACKLIGHT_ENABLE - backlight_step(); -# endif - } else { - unregister_code(KC_RSFT); - } - break; -#endif #ifdef KEYBOARD_planck_ez case TH_LVL: if (record->event.pressed) { diff --git a/layouts/community/split_3x6_3/drashna/keymap.c b/layouts/community/split_3x6_3/drashna/keymap.c index 7e051b6b5c..257e033f22 100644 --- a/layouts/community/split_3x6_3/drashna/keymap.c +++ b/layouts/community/split_3x6_3/drashna/keymap.c @@ -16,7 +16,9 @@ #include "drashna.h" -enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; +enum crkbd_keycodes { + RGBRST = USER_SAFE_RANGE, +}; /* * The `LAYOUT_crkbd_base` macro is a template to allow the use of identical @@ -96,33 +98,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // clang-format on #ifdef OLED_ENABLE -oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return OLED_ROTATION_270; } +oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { + return OLED_ROTATION_270; +} # ifdef CONVERT_TO_PROTON_C // WPM-responsive animation stuff here # define SLEEP_FRAMES 2 -# define SLEEP_SPEED 10 // below this wpm value your animation will idle +# define SLEEP_SPEED 10 // below this wpm value your animation will idle -# define WAKE_FRAMES 2 // uncomment if >1 +# define WAKE_FRAMES 2 // uncomment if >1 -# define KAKI_FRAMES 3 -# define KAKI_SPEED 40 // above this wpm value typing animation to triggere +# define KAKI_FRAMES 3 +# define KAKI_SPEED 40 // above this wpm value typing animation to triggere # define RTOGI_FRAMES 2 -//#define LTOGI_FRAMES 2 +// #define LTOGI_FRAMES 2 -//#define ANIM_FRAME_DURATION 500 // how long each frame lasts in ms -// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing -# define ANIM_SIZE 512 // number of bytes in array, minimize for adequate firmware size, max is 1024 +// #define ANIM_FRAME_DURATION 500 // how long each frame lasts in ms +// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing +# define ANIM_SIZE 512 // number of bytes in array, minimize for adequate firmware size, max is 1024 uint32_t anim_timer = 0; uint32_t anim_frame_duration = 500; uint8_t current_sleep_frame = 0; -uint8_t current_wake_frame = 0; // uncomment if WAKE_FRAMES >1 +uint8_t current_wake_frame = 0; // uncomment if WAKE_FRAMES >1 uint8_t current_kaki_frame = 0; -#ifdef SWAP_HANDS_ENABLE -uint8_t current_rtogi_frame = 0; -#endif +# ifdef SWAP_HANDS_ENABLE +uint8_t current_rtogi_frame = 0; +# endif // uint8_t current_ltogi_frame = 0; // clang-format off void render_small_kitty(void) { diff --git a/users/drashna/audio_config.h b/users/drashna/audio_config.h new file mode 100644 index 0000000000..21fe27ee6b --- /dev/null +++ b/users/drashna/audio_config.h @@ -0,0 +1,33 @@ +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define AUDIO_CLICKY +#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f + +#if __has_include("user_song_list.h") +# include "user_song_list.h" +#endif + +#ifdef USER_SONG_LIST +# define STARTUP_SONG SONG(RICK_ROLL) +# define GOODBYE_SONG SONG(SONIC_RING) +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(OVERWATCH_THEME) } +# define UNICODE_SONG_MAC SONG(MARIO_THEME) +# define UNICODE_SONG_LNX SONG(MARIO_POWERUP) +# define UNICODE_SONG_WIN SONG(MARIO_ONEUP) +# define UNICODE_SONG_BSD SONG(RICK_ROLL) +# define UNICODE_SONG_WINC SONG(RICK_ROLL) +#else +# define STARTUP_SONG SONG(STARTUP_SOUND) +# define GOODBYE_SONG SONG(GOODBYE_SOUND) +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(WORKMAN_SOUND) } +# define UNICODE_SONG_MAC SONG(QWERTY_SOUND) +# define UNICODE_SONG_LNX SONG(COLEMAK_SOUND) +# define UNICODE_SONG_WIN SONG(DVORAK_SOUND) +# define UNICODE_SONG_BSD SONG(WORKMAN_SOUND) +# define UNICODE_SONG_WINC SONG(PLOVER_GOODBYE_SOUND) +#endif diff --git a/users/drashna/callbacks.c b/users/drashna/callbacks.c index c2f1156cee..568f56c8d1 100644 --- a/users/drashna/callbacks.c +++ b/users/drashna/callbacks.c @@ -3,9 +3,8 @@ #include "drashna.h" - #ifdef I2C_SCANNER_ENABLE -void matrix_scan_i2c(void); +void housekeeping_task_i2c_scanner(void); void keyboard_post_init_i2c(void); #endif @@ -21,6 +20,64 @@ void keyboard_pre_init_user(void) { // Call user matrix init, set default RGB colors and then // call the keymap's init function +#ifdef CUSTOM_QUANTUM_PAINTER_ENABLE +void keyboard_post_init_qp(void); +#endif + +#ifdef OS_DETECTION_ENABLE +os_variant_t os_type; + +uint32_t startup_exec(uint32_t trigger_time, void *cb_arg) { + /* do something */ + + if (is_keyboard_master()) { + os_type = detected_host_os(); + if (os_type) { + bool is_mac = (os_type == OS_MACOS) || (os_type == OS_IOS); + keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = is_mac; +# ifdef UNICODE_COMMON_ENABLE + uint8_t mode = is_mac ? UNICODE_MODE_MACOS : UNICODE_MODE_WINCOMPOSE; + if (mode != get_unicode_input_mode()) { + set_unicode_input_mode(mode); + } +# endif + switch (os_type) { + case OS_UNSURE: + xprintf("unknown OS Detected\n"); + break; + case OS_LINUX: + xprintf("Linux Detected\n"); + break; + case OS_WINDOWS: + xprintf("Windows Detected\n"); + break; +# if 0 + case OS_WINDOWS_UNSURE: + xprintf("Windows? Detected\n"); + break; +# endif + case OS_MAC |