diff options
author | Drashna Jaelre <drashna@live.com> | 2021-12-29 20:17:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-29 20:17:34 -0800 |
commit | c4551d7ef1ed2c1069f23cc8499b7c7fc30f3ecf (patch) | |
tree | 67dc381a45d59626132c4c59b71c4b36fa971f8b /layouts/community | |
parent | 1a8a842cfb3e87a82afb57ba29ca59c5fa6fe97b (diff) | |
download | qmk_firmware-c4551d7ef1ed2c1069f23cc8499b7c7fc30f3ecf.tar.gz qmk_firmware-c4551d7ef1ed2c1069f23cc8499b7c7fc30f3ecf.zip |
[Keymap] Reorganization, cleanup and readmes for drashna code (#15617)
Diffstat (limited to 'layouts/community')
-rw-r--r-- | layouts/community/ergodox/drashna/config.h | 7 | ||||
-rw-r--r-- | layouts/community/ergodox/drashna/keymap.c | 40 | ||||
-rw-r--r-- | layouts/community/ortho_4x12/drashna/keymap.c | 55 | ||||
-rw-r--r-- | layouts/community/ortho_4x12/drashna/rules.mk | 24 | ||||
-rw-r--r-- | layouts/community/split_3x6_3/drashna/config.h | 4 | ||||
-rw-r--r-- | layouts/community/split_3x6_3/drashna/keymap.c | 5 | ||||
-rw-r--r-- | layouts/community/split_3x6_3/drashna/rules.mk | 35 |
7 files changed, 46 insertions, 124 deletions
diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index f9daf277fb..d669f27298 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h @@ -45,6 +45,7 @@ # endif #endif -#define PIMORONI_TRACKBALL_INVERT_X -#define PIMORONI_TRACKBALL_INVERT_Y -#define PIMORONI_TRACKBALL_CLICK +#ifdef TAPPING_TERM +# undef TAPPING_TERM +#endif +#define TAPPING_TERM 185 diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 3c9bcfeaa2..798680628f 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -317,7 +317,7 @@ void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); } void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { +bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { if (layer_state_is(_GAMEPAD)) { RGB_MATRIX_INDICATOR_SET_COLOR(32, 0x00, 0xFF, 0x00); // Q RGB_MATRIX_INDICATOR_SET_COLOR(31, 0x00, 0xFF, 0xFF); // W @@ -332,43 +332,7 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 27 : 26), 0x00, 0xFF, 0x00); // 2 RGB_MATRIX_INDICATOR_SET_COLOR(25, 0x7A, 0x00, 0xFF); // 3 } - -# if defined(RGBLIGHT_ENABLE) - if (!userspace_config.rgb_layer_change) -# else - if (userspace_config.rgb_layer_change) -# endif - { - switch (get_highest_layer(layer_state | default_layer_state)) { - case _GAMEPAD: - rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DIABLO: - rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _RAISE: - rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _LOWER: - rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _ADJUST: - rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_1: - rgb_matrix_layer_helper(DEFAULT_LAYER_1_HSV, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_2: - rgb_matrix_layer_helper(DEFAULT_LAYER_2_HSV, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_3: - rgb_matrix_layer_helper(DEFAULT_LAYER_3_HSV, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_4: - rgb_matrix_layer_helper(DEFAULT_LAYER_4_HSV, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - } - } + return true; } #endif // RGB_MATRIX_INIT diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 3ba9cf64f9..ce241fd76d 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -201,17 +201,8 @@ led_config_t g_led_config = { // clange-format on # endif -// clang-format off -void suspend_power_down_keymap(void) { - rgb_matrix_set_suspend_state(true); -} -void suspend_wakeup_init_keymap(void) { - rgb_matrix_set_suspend_state(false); -} -// clang-format on - -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { +bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { uint8_t this_mod = get_mods(); uint8_t this_led = host_keyboard_leds(); uint8_t this_osm = get_oneshot_mods(); @@ -221,48 +212,6 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { # define THUMB_LED 42 # endif # define RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(...) RGB_MATRIX_INDICATOR_SET_COLOR(__VA_ARGS__) -# if defined(RGBLIGHT_ENABLE) - if (!userspace_config.rgb_layer_change) -# else - if (userspace_config.rgb_layer_change) -# endif - { - switch (get_highest_layer(layer_state)) { - case _GAMEPAD: - rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DIABLO: - rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _RAISE: - rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _LOWER: - rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _ADJUST: - rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - default: - { - switch (get_highest_layer(default_layer_state)) { - case _DEFAULT_LAYER_1: - rgb_matrix_layer_helper(DEFAULT_LAYER_1_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_2: - rgb_matrix_layer_helper(DEFAULT_LAYER_2_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_3: - rgb_matrix_layer_helper(DEFAULT_LAYER_3_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_4: - rgb_matrix_layer_helper(DEFAULT_LAYER_4_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - } - break; - } - } - } switch (get_highest_layer(default_layer_state)) { case _DEFAULT_LAYER_1: @@ -296,6 +245,8 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { if ((this_mod | this_osm) & MOD_MASK_ALT) { RGB_MATRIX_INDICATOR_SET_COLOR(38, 0x00, 0x00, 0xFF); } + + return true; } void matrix_init_keymap(void) { diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index d766245260..2905fb0fd4 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk @@ -1,33 +1,35 @@ BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control TAP_DANCE_ENABLE = no SPACE_CADET_ENABLE = no NKRO_ENABLE = yes +CAPS_WORD_ENABLE = no ifneq ($(strip $(KEYBOARD)), planck/rev6) - CONSOLE_ENABLE = no - COMMAND_ENABLE = no + CONSOLE_ENABLE = no + COMMAND_ENABLE = no ifeq ($(strip $(LAYOUT_HAS_RGB)), yes) RGBLIGHT_ENABLE = yes - INDICATOR_LIGHTS = yes + INDICATOR_LIGHTS = yes RGBLIGHT_STARTUP_ANIMATION = yes endif else - CONSOLE_ENABLE = yes - COMMAND_ENABLE = yes + CONSOLE_ENABLE = yes RGBLIGHT_ENABLE = yes RGBLIGHT_STARTUP_ANIMATION = yes RGB_MATRIX_ENABLE = no - AUDIO_ENABLE = yes - EEPROM_DRIVER = i2c + AUDIO_ENABLE = yes + EEPROM_DRIVER = i2c ENCODER_MAP_ENABLE = yes + AUTOCORRECTION_ENABLE = yes + CAPS_WORD_ENABLE = yes endif ifeq ($(strip $(KEYBOARD)), planck/light) RGB_MATRIX_ENABLE = yes RGBLIGHT_ENABLE = yes RGBLIGHT_STARTUP_ANIMATION = yes - AUDIO_ENABLE = yes + AUDIO_ENABLE = yes endif ifeq ($(strip $(KEYBOARD)), planck/ez) RGBLIGHT_ENABLE = no @@ -39,4 +41,6 @@ ifeq ($(strip $(KEYBOARD)), planck/ez) CONSOLE_ENABLE = yes COMMAND_ENABLE = yes AUDIO_ENABLE = yes + AUTOCORRECTION_ENABLE = yes + CAPS_WORD_ENABLE = yes endif diff --git a/layouts/community/split_3x6_3/drashna/config.h b/layouts/community/split_3x6_3/drashna/config.h index b86448c671..cfcb873a80 100644 --- a/layouts/community/split_3x6_3/drashna/config.h +++ b/layouts/community/split_3x6_3/drashna/config.h @@ -93,3 +93,7 @@ #endif #define TAPPING_TERM_PER_KEY +#ifdef TAPPING_TERM +# undef TAPPING_TERM +#endif +#define TAPPING_TERM 200 diff --git a/layouts/community/split_3x6_3/drashna/keymap.c b/layouts/community/split_3x6_3/drashna/keymap.c index 7c31972e3f..476ca5fcef 100644 --- a/layouts/community/split_3x6_3/drashna/keymap.c +++ b/layouts/community/split_3x6_3/drashna/keymap.c @@ -90,7 +90,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, KEYLOCK, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, - HPT_TOG, KC_NUKE, _______, _______, TG_MODS, HPT_FBK + AUTO_CTN,KC_NUKE, _______, _______, TG_MODS, HPT_FBK ) }; // clang-format on @@ -265,7 +265,7 @@ void check_default_layer(uint8_t mode, uint8_t type, uint8_t led_min, uint8_t le } } -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { +bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { if (userspace_config.rgb_layer_change) { switch (get_highest_layer(layer_state)) { case _GAMEPAD: @@ -291,5 +291,6 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } check_default_layer(0, LED_FLAG_MODIFIER, led_min, led_max); } + return false; } #endif diff --git a/layouts/community/split_3x6_3/drashna/rules.mk b/layouts/community/split_3x6_3/drashna/rules.mk index cf2dfbdc88..9164dcdeba 100644 --- a/layouts/community/split_3x6_3/drashna/rules.mk +++ b/layouts/community/split_3x6_3/drashna/rules.mk @@ -1,9 +1,8 @@ - # Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically +# change to "no" to disable the options # -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite + +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug @@ -12,27 +11,25 @@ NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see her BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality AUDIO_ENABLE = no # Audio output UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - ifeq ($(strip $(KEYBOARD)), crkbd/rev1) - OLED_ENABLE = yes - RGB_MATRIX_ENABLE = yes - HAPTIC_ENABLE = no + OLED_ENABLE = yes + RGB_MATRIX_ENABLE = yes + HAPTIC_ENABLE = no endif ifeq ($(strip $(CTPC)), yes) - HAPTIC_ENABLE = no - WS2812_DRIVER = pwm # won't work without a patch to the ctpc mk file - SERIAL_DRIVER = usart - SWAP_HANDS_ENABLE = yes - WPM_ENABLE = yes + HAPTIC_ENABLE = no + WS2812_DRIVER = pwm # won't work without a patch to the ctpc mk file + SERIAL_DRIVER = usart + SWAP_HANDS_ENABLE = yes + WPM_ENABLE = yes + AUTOCORRECTION_ENABLE = yes + CAPS_WORD_ENABLE = yes else - CUSTOM_UNICODE_ENABLE = no - BOOTLOADER = qmk-hid - BOOTLOADER_SIZE = 512 + CUSTOM_UNICODE_ENABLE = no + BOOTLOADER = qmk-hid + BOOTLOADER_SIZE = 512 endif |