diff options
| author | Fred Silberberg <fred@silberberg.xyz> | 2019-05-29 07:44:43 -0700 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-05-29 07:44:43 -0700 |
| commit | 287767bba10ac866fae2ffadd45b2315c1e184e6 (patch) | |
| tree | d61470be9593b60b06d9eda693e6cbaad6f52421 /users/333fred | |
| parent | 38d3b7aa45424f47797eae738c04a82377f198c9 (diff) | |
| download | qmk_firmware-287767bba10ac866fae2ffadd45b2315c1e184e6.tar.gz qmk_firmware-287767bba10ac866fae2ffadd45b2315c1e184e6.zip | |
Update 333fred keymaps and add new iris map. (#6010)
* Update 333fred keymaps and add new iris map.
* Fix iris key
Diffstat (limited to 'users/333fred')
| -rw-r--r-- | users/333fred/333fred.c | 38 | ||||
| -rw-r--r-- | users/333fred/333fred.h | 9 | ||||
| -rw-r--r-- | users/333fred/333fred_config.h | 1 | ||||
| -rw-r--r-- | users/333fred/rgb.c | 12 |
4 files changed, 37 insertions, 23 deletions
diff --git a/users/333fred/333fred.c b/users/333fred/333fred.c index 3b2b36d02..79df8c4de 100644 --- a/users/333fred/333fred.c +++ b/users/333fred/333fred.c | |||
| @@ -86,31 +86,37 @@ qk_tap_dance_action_t tap_dance_actions[] = { | |||
| 86 | [TD_COPY_PASTE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_copy_paste_finished, NULL) | 86 | [TD_COPY_PASTE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_copy_paste_finished, NULL) |
| 87 | }; | 87 | }; |
| 88 | 88 | ||
| 89 | void tap_dance_process_record(uint16_t keycode) { | 89 | void tap_dance_process_keycode(uint16_t keycode) { |
| 90 | if (tap_dance_state == SINGLE_TAP && keycode != TD(TD_SYM_VIM)) { | 90 | if (tap_dance_state == SINGLE_TAP && keycode != TD(TD_SYM_VIM)) { |
| 91 | tap_dance_active = false; | 91 | tap_dance_active = false; |
| 92 | } | 92 | } |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | __attribute__ ((weak)) | 95 | __attribute__ ((weak)) |
| 96 | void matrix_init_rgb(void) {} | ||
| 97 | |||
| 98 | __attribute__ ((weak)) | ||
| 99 | void layer_state_set_rgb(uint32_t state) {} | 96 | void layer_state_set_rgb(uint32_t state) {} |
| 100 | 97 | ||
| 101 | __attribute__ ((weak)) | ||
| 102 | void matrix_scan_user_keyboard(void) {} | ||
| 103 | |||
| 104 | void matrix_scan_user() { | ||
| 105 | static bool first_run = true; | ||
| 106 | if (first_run) { | ||
| 107 | first_run = false; | ||
| 108 | matrix_init_rgb(); | ||
| 109 | } | ||
| 110 | matrix_scan_user_keyboard(); | ||
| 111 | } | ||
| 112 | |||
| 113 | uint32_t layer_state_set_user(uint32_t state) { | 98 | uint32_t layer_state_set_user(uint32_t state) { |
| 114 | layer_state_set_rgb(state); | 99 | layer_state_set_rgb(state); |
| 115 | return state; | 100 | return state; |
| 116 | } | 101 | } |
| 102 | |||
| 103 | bool try_handle_macro(uint16_t keycode, keyrecord_t *record) { | ||
| 104 | switch (keycode) | ||
| 105 | { | ||
| 106 | case DLEFT: | ||
| 107 | if (record->event.pressed) | ||
| 108 | SEND_STRING(SS_LGUI(SS_LALT(SS_TAP(X_LEFT)))); | ||
| 109 | return true; | ||
| 110 | case DRIGHT: | ||
| 111 | if (record->event.pressed) | ||
| 112 | SEND_STRING(SS_LGUI(SS_LALT(SS_TAP(X_RIGHT)))); | ||
| 113 | return true; | ||
| 114 | case PSCREEN_APP: | ||
| 115 | if (record->event.pressed) | ||
| 116 | SEND_STRING(SS_LALT(SS_TAP(X_PSCREEN))); | ||
| 117 | return true; | ||
| 118 | |||
| 119 | default: | ||
| 120 | return false; | ||
| 121 | } | ||
| 122 | } | ||
diff --git a/users/333fred/333fred.h b/users/333fred/333fred.h index 0e6c6a196..17f3779b7 100644 --- a/users/333fred/333fred.h +++ b/users/333fred/333fred.h | |||
| @@ -17,6 +17,13 @@ enum tap_dance_declarations { | |||
| 17 | TD_COPY_PASTE, | 17 | TD_COPY_PASTE, |
| 18 | }; | 18 | }; |
| 19 | 19 | ||
| 20 | enum custom_keys { | ||
| 21 | DLEFT = SAFE_RANGE, | ||
| 22 | DRIGHT, | ||
| 23 | PSCREEN_APP | ||
| 24 | }; | ||
| 25 | |||
| 20 | void tap_dance_sym_vim_finished(qk_tap_dance_state_t*, void*); | 26 | void tap_dance_sym_vim_finished(qk_tap_dance_state_t*, void*); |
| 21 | void tap_dance_sym_vim_reset(qk_tap_dance_state_t*, void*); | 27 | void tap_dance_sym_vim_reset(qk_tap_dance_state_t*, void*); |
| 22 | void tap_dance_process_record(uint16_t); | 28 | void tap_dance_process_keycode(uint16_t); |
| 29 | bool try_handle_macro(uint16_t keycode, keyrecord_t *record); | ||
diff --git a/users/333fred/333fred_config.h b/users/333fred/333fred_config.h index b158e2d5a..c099072fc 100644 --- a/users/333fred/333fred_config.h +++ b/users/333fred/333fred_config.h | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | 2 | ||
| 3 | #define PERMISSIVE_HOLD | 3 | #define PERMISSIVE_HOLD |
| 4 | #define NO_ACTION_MACRO | ||
diff --git a/users/333fred/rgb.c b/users/333fred/rgb.c index a3dfd905c..5a6d74b5a 100644 --- a/users/333fred/rgb.c +++ b/users/333fred/rgb.c | |||
| @@ -1,16 +1,11 @@ | |||
| 1 | #include "quantum.h" | 1 | #include "quantum.h" |
| 2 | #include "333fred.h" | 2 | #include "333fred.h" |
| 3 | 3 | ||
| 4 | void matrix_init_rgb(void) { | ||
| 5 | rgblight_enable_noeeprom(); | ||
| 6 | rgblight_sethsv_noeeprom(270, 255, 20); | ||
| 7 | } | ||
| 8 | |||
| 9 | void layer_state_set_rgb(uint32_t state) { | 4 | void layer_state_set_rgb(uint32_t state) { |
| 10 | switch (biton32(state)) { | 5 | switch (biton32(state)) { |
| 11 | case BASE: | 6 | case BASE: |
| 12 | // purple | 7 | // purple |
| 13 | rgblight_sethsv_noeeprom(270, 255, 20); | 8 | rgblight_sethsv_noeeprom(255, 255, 20); |
| 14 | break; | 9 | break; |
| 15 | case SYMB: | 10 | case SYMB: |
| 16 | // blue | 11 | // blue |
| @@ -26,3 +21,8 @@ void layer_state_set_rgb(uint32_t state) { | |||
| 26 | break; | 21 | break; |
| 27 | } | 22 | } |
| 28 | } | 23 | } |
| 24 | |||
| 25 | void keyboard_post_init_user(void) { | ||
| 26 | rgblight_enable_noeeprom(); | ||
| 27 | layer_state_set_rgb(1); // Set layer 0 (bit 1) on | ||
| 28 | } | ||
