diff options
author | Konstantin Đorđević <konstantin.djordjevic@tradecore.com> | 2019-07-25 21:31:40 +0200 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-07-25 12:31:40 -0700 |
commit | 36d3902504d6aa0d2bdac88c90339c902ade11b3 (patch) | |
tree | b4a36c6b3cb5d54f44680df60c1845e8cb917197 /users/konstantin/konstantin.h | |
parent | f204ed67f210b1dde20333727c79c47a5b70518a (diff) |
[User] Update personal userspace and keymaps, add reactive underglow (#6410)
* Update MODERN_DOLCH_RED color
* Remove unused RAL_LAL tap dance
* Disable Space Cadet on all boards
* Rework SEND_STRING_CLEAN into CLEAN_MODS, fix DST_P_R/DST_N_A
* Disable unnecessary underglow animations
* Rearrange feature flags in rules.mk files
* Change custom colors from structs to defines
* Add some explicit initializers
* Add MODERN_DOLCH_CYAN color
* Add IS_LAYER_ON_STATE()/IS_LAYER_OFF_STATE() macros
* Add led_set_keymap() template function
* Change underglow color based on Caps/Fn state
* Preserve val when changing underglow colors
* Only trigger Fn light for Fn layer
* Refactor fn_light() and caps_light() slightly
* Add comments to fn_light() and caps_light()
Diffstat (limited to 'users/konstantin/konstantin.h')
-rw-r--r-- | users/konstantin/konstantin.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/users/konstantin/konstantin.h b/users/konstantin/konstantin.h index d43712b965..84d90dda57 100644 --- a/users/konstantin/konstantin.h +++ b/users/konstantin/konstantin.h @@ -47,15 +47,16 @@ #define LCT_CPS LCTL_T(KC_CAPS) -#ifdef SEND_STRING_CLEAN - #undef SEND_STRING - #define SEND_STRING(string) { \ - uint8_t ss_mods = get_mods(); \ - clear_mods(); \ - send_string_P(PSTR(string)); \ - set_mods(ss_mods); \ - } -#endif +#define IS_LAYER_ON_STATE(state, layer) ( (state) & (1UL << (layer))) +#define IS_LAYER_OFF_STATE(state, layer) (~(state) & (1UL << (layer))) + +// Clear mods, perform action, restore mods +#define CLEAN_MODS(action) { \ + uint8_t mods = get_mods(); \ + clear_mods(); \ + action; \ + set_mods(mods); \ + } enum keycodes_user { CLEAR = SAFE_RANGE, @@ -81,5 +82,6 @@ void keyboard_pre_init_keymap(void); void eeconfig_init_keymap(void); void keyboard_post_init_keymap(void); -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); uint32_t layer_state_set_keymap(uint32_t state); +void led_set_keymap(uint8_t usb_led); |