diff options
| author | YouCanFly <65446+YCF@users.noreply.github.com> | 2019-04-18 17:37:26 -0500 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-04-18 15:37:26 -0700 |
| commit | 9e3b38425feedbe8d95c6cb738d713cc6e15af56 (patch) | |
| tree | 240250dd95b42a242363629bb6514829174992c8 /keyboards/tetris | |
| parent | a58c66df88d1da9c57e5e4ccffb78c7882b55706 (diff) | |
| download | qmk_firmware-9e3b38425feedbe8d95c6cb738d713cc6e15af56.tar.gz qmk_firmware-9e3b38425feedbe8d95c6cb738d713cc6e15af56.zip | |
[Keyboard] Update Tetris (#5513)
* Update Tetris
Add a fake row to config the encoder's keycode easily.
* Delete rules.mk
* Update keyboards/tetris/readme.md
Co-Authored-By: YCF <65446+YCF@users.noreply.github.com>
* Update config.h
add #define RGBLIGHT_SLEEP
Diffstat (limited to 'keyboards/tetris')
| -rwxr-xr-x[-rw-r--r--] | keyboards/tetris/config.h | 22 | ||||
| -rw-r--r-- | keyboards/tetris/info.json | 6 | ||||
| -rwxr-xr-x[-rw-r--r--] | keyboards/tetris/keymaps/default/keymap.c | 950 | ||||
| -rw-r--r-- | keyboards/tetris/keymaps/default/rules.mk | 1 | ||||
| -rw-r--r-- | keyboards/tetris/readme.md | 4 | ||||
| -rwxr-xr-x[-rw-r--r--] | keyboards/tetris/rules.mk | 13 | ||||
| -rwxr-xr-x[-rw-r--r--] | keyboards/tetris/tetris.c | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | keyboards/tetris/tetris.h | 8 |
8 files changed, 182 insertions, 824 deletions
diff --git a/keyboards/tetris/config.h b/keyboards/tetris/config.h index 20ec2e655..2cc7d2951 100644..100755 --- a/keyboards/tetris/config.h +++ b/keyboards/tetris/config.h | |||
| @@ -10,17 +10,12 @@ | |||
| 10 | #define PRODUCT Tetris | 10 | #define PRODUCT Tetris |
| 11 | #define DESCRIPTION Planck mit | 11 | #define DESCRIPTION Planck mit |
| 12 | 12 | ||
| 13 | #define QMK_ESC_OUTPUT B0 | ||
| 14 | #define QMK_ESC_INPUT D7 | ||
| 15 | #define QMK_LED B7 | ||
| 16 | #define QMK_SPEAKER B5 | ||
| 17 | |||
| 18 | /* key matrix size */ | 13 | /* key matrix size */ |
| 19 | #define MATRIX_ROWS 4 | 14 | #define MATRIX_ROWS 5 |
| 20 | #define MATRIX_COLS 12 | 15 | #define MATRIX_COLS 12 |
| 21 | 16 | ||
| 22 | /* key matrix pins */ | 17 | /* key matrix pins */ |
| 23 | #define MATRIX_ROW_PINS { B3, B2, B1, B0 } | 18 | #define MATRIX_ROW_PINS { B3, B2, B1, B0, E6 } |
| 24 | #define MATRIX_COL_PINS { D7, B4, B6, C6, C7, F6, F7, D4, D2, D3, D5, D6 } | 19 | #define MATRIX_COL_PINS { D7, B4, B6, C6, C7, F6, F7, D4, D2, D3, D5, D6 } |
| 25 | #define UNUSED_PINS | 20 | #define UNUSED_PINS |
| 26 | 21 | ||
| @@ -39,19 +34,22 @@ | |||
| 39 | #define NO_ACTION_MACRO | 34 | #define NO_ACTION_MACRO |
| 40 | #define NO_ACTION_FUNCTION | 35 | #define NO_ACTION_FUNCTION |
| 41 | 36 | ||
| 42 | #define TAPPING_TERM 200 | ||
| 43 | |||
| 44 | #ifdef AUDIO_ENABLE | 37 | #ifdef AUDIO_ENABLE |
| 45 | #define B5_AUDIO | 38 | #define B5_AUDIO |
| 46 | #define STARTUP_SONG SONG(ONE_UP_SOUND) | 39 | #define STARTUP_SONG SONG(ONE_UP_SOUND) |
| 47 | #define NO_MUSIC_MODE | 40 | #define NO_MUSIC_MODE |
| 48 | #endif | 41 | #endif |
| 49 | 42 | ||
| 50 | #if RGBLIGHT_ENABLE | 43 | #define NUMBER_OF_ENCODERS 2 |
| 44 | #define ENCODERS_PAD_A { D1,F1 } | ||
| 45 | #define ENCODERS_PAD_B { D0,F0 } | ||
| 46 | |||
| 51 | #define RGB_DI_PIN F5 | 47 | #define RGB_DI_PIN F5 |
| 52 | #define RGBLIGHT_ANIMATIONS | 48 | #define RGBLIGHT_ANIMATIONS |
| 53 | #define RGBLIGHT_SLEEP | 49 | #define RGBLIGHT_SLEEP |
| 54 | #define RGBLED_NUM 47 | 50 | #define RGBLED_NUM 47 |
| 51 | #define RGBLIGHT_HUE_STEP 8 | ||
| 52 | #define RGBLIGHT_SAT_STEP 8 | ||
| 53 | #define RGBLIGHT_VAL_STEP 8 | ||
| 55 | #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 12 | 54 | #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 12 |
| 56 | //#define RGBLIGHT_LIMIT_VAL 128 | 55 | |
| 57 | #endif | ||
diff --git a/keyboards/tetris/info.json b/keyboards/tetris/info.json index b21a46d63..c58e9be52 100644 --- a/keyboards/tetris/info.json +++ b/keyboards/tetris/info.json | |||
| @@ -3,10 +3,10 @@ | |||
| 3 | "url": "", | 3 | "url": "", |
| 4 | "maintainer": "qmk", | 4 | "maintainer": "qmk", |
| 5 | "width": 12, | 5 | "width": 12, |
| 6 | "height": 4, | 6 | "height": 5, |
| 7 | "layouts": { | 7 | "layouts": { |
| 8 | "LAYOUT_planck_mit": { | 8 | "LAYOUT_planck_mit": { |
| 9 | "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3, "w":2}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] | 9 | "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3, "w":2}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}] |
| 10 | } | ||
| 10 | } | 11 | } |
| 11 | } | ||
| 12 | } | 12 | } |
diff --git a/keyboards/tetris/keymaps/default/keymap.c b/keyboards/tetris/keymaps/default/keymap.c index 0ec12435e..c1b5ad2b1 100644..100755 --- a/keyboards/tetris/keymaps/default/keymap.c +++ b/keyboards/tetris/keymaps/default/keymap.c | |||
| @@ -1,828 +1,186 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | 2 | ||
| 3 | #ifdef AUDIO_ENABLE | ||
| 4 | float tone_caps[][2] = SONG( CAPS_LOCK_ON_SOUND ); | ||
| 5 | float tone_taps[][2] = SONG( E__NOTE( _A6 ) ); | ||
| 6 | #endif | ||
| 7 | |||
| 8 | #define _BASE 0 | ||
| 9 | #define _CODE 1 | ||
| 10 | #define _NAVI 2 | ||
| 11 | #define _FUNC 3 | ||
| 12 | #define _SYMB 4 | ||
| 13 | #define _NUMB 5 | ||
| 14 | #define _MARO 6 | ||
| 15 | #define _RGB 7 | ||
| 16 | #define _ADJUST 8 | ||
| 17 | #define _GAME 9 | ||
| 18 | |||
| 19 | /* RGB colors */ | ||
| 20 | #define RGB_Layer_1_Base_Color 0, 128, 0 | ||
| 21 | #define RGB_Layer_2_Base_Color 0,0,0 | ||
| 22 | #define RGB_Layer_3_Base_Color 0,0,0 | ||
| 23 | #define RGB_Layer_4_Base_Color 0,0,0 | ||
| 24 | #define RGB_Layer_5_Base_Color 0,0,0 | ||
| 25 | #define RGB_Layer_6_Base_Color 64, 0, 64 | ||
| 26 | #define RGB_Layer_7_Base_Color 0, 0,0 | ||
| 27 | #define RGB_Layer_8_Base_Color 0,0,0 | ||
| 28 | #define RGB_Layer_9_Base_Color 0,0,0 | ||
| 29 | #define RGB_Caps_Color 6,50,50 | ||
| 30 | #define RGB_TAP_On_Color 0,128,0 | ||
| 31 | #define RGB_TAP_Off_Color 128,0,0 | ||
| 32 | #define RGB_TAP_Base_Color 0,0,0 | ||
| 33 | |||
| 34 | extern rgblight_config_t rgblight_config; | ||
| 35 | bool NUMLAY_STATUS = false; | ||
| 36 | int RGB_LAYER0_mode = 6; | ||
| 37 | bool RGB_TAP_STATE = false; | ||
| 38 | static uint8_t current_layer = 0; | ||
| 39 | static bool has_layer_changed = true; | ||
| 40 | static bool save_rgbmode = true; | ||
| 41 | static bool caps = false; | ||
| 42 | |||
| 43 | /* Tap Dance function */ | ||
| 44 | void dance_cln_finished( qk_tap_dance_state_t* state, void* user_data ) | ||
| 45 | { | ||
| 46 | if ( state->count == 1 ) | ||
| 47 | { | ||
| 48 | register_code( KC_LSFT ); | ||
| 49 | } else { | ||
| 50 | layer_on( _SYMB ); | ||
| 51 | #ifdef AUDIO_ENABLE | ||
| 52 | PLAY_SONG( tone_taps ); | ||
| 53 | #endif | ||
| 54 | } | ||
| 55 | } | ||
| 56 | |||
| 57 | |||
| 58 | void dance_cln_reset( qk_tap_dance_state_t* state, void* user_data ) | ||
| 59 | { | ||
| 60 | if ( state->count == 1 ) | ||
| 61 | { | ||
| 62 | unregister_code( KC_LSFT ); | ||
| 63 | }else { | ||
| 64 | uint8_t layer = biton32( layer_state ); | ||
| 65 | if ( layer == _SYMB ) | ||
| 66 | { | ||
| 67 | layer_off( _SYMB ); | ||
| 68 | rgblight_mode( RGB_LAYER0_mode ); | ||
| 69 | } | ||
| 70 | } | ||
| 71 | } | ||
| 72 | |||
| 73 | enum my_keycodes { | ||
| 74 | RGB_TAP = SAFE_RANGE, | ||
| 75 | KC_00 | ||
| 76 | }; | ||
| 77 | |||
| 78 | /* Tap Dance Declarations */ | ||
| 79 | enum { | ||
| 80 | TD_Mute_Next = 0, | ||
| 81 | TD_SFT, | ||
| 82 | TD_LBRC, | ||
| 83 | TD_RBRC | ||
| 84 | }; | ||
| 85 | |||
| 86 | /* Tap Dance Definitions */ | ||
| 87 | qk_tap_dance_action_t tap_dance_actions[] = { | ||
| 88 | [TD_Mute_Next] = ACTION_TAP_DANCE_DOUBLE( KC_MUTE, KC_MNXT ) | ||
| 89 | ,[TD_SFT] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, dance_cln_finished, dance_cln_reset ) | ||
| 90 | ,[TD_LBRC] = ACTION_TAP_DANCE_DOUBLE( KC_LBRC, KC_LCBR ) | ||
| 91 | ,[TD_RBRC] = ACTION_TAP_DANCE_DOUBLE( KC_RBRC, KC_RCBR ) | ||
| 92 | }; | ||
| 93 | |||
| 94 | |||
| 95 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 3 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 96 | /* BASE - QWERTY | 4 | [0] = LAYOUT_planck_mit( |
| 97 | * ,-----------------------------------------------------------------------------------. | 5 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, |
| 98 | * | Tab | Q | W | E | R | T | Y | U | I | O | P | BS | | 6 | KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, |
| 99 | * |------+------+------+------+------+-------------+------+------+------+------+------| | 7 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, |
| 100 | * shift + Esc = ~ --> | Esc | A | S | D | F | G | H | J | K | L | ; | Enter| <-- shift + Enter = " | 8 | KC_LCTL, KC_LGUI, KC_LALT, KC_LBRC, KC_MINS, LT(1, KC_SPC), KC_EQL, KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT, |
| 101 | * |------+------+------+------+------+------|------+------+------+------+------+------| | 9 | KC_VOLD, KC_VOLU, KC_PGDN, KC_PGUP), |
| 102 | * | Shift| Z | X | C | V | B | N | M | , | . | / | Mute | | 10 | [1] = LAYOUT_planck_mit( |
| 103 | * |------+------+------+------+------+------+------+------+------+------+------+------| <-- tap: 1.Mute 2.Next | 11 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, |
| 104 | * | Ctrl | GUI | Alt | [ | - | Space | = | ] | Fx | \ | Del | | 12 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 105 | * `-----------------------------------------------------------------------------------' | 13 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 106 | */ | 14 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, |
| 107 | 15 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | |
| 108 | [_BASE] = LAYOUT_planck_mit( | ||
| 109 | LT( _ADJUST,KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
| 110 | LT( _NUMB,KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, LT( _RGB, KC_L ), KC_SCLN, KC_ENT, | ||
| 111 | TD( TD_SFT ), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, TD( TD_Mute_Next ), | ||
| 112 | KC_LCTL, KC_LGUI, KC_LALT, TD( TD_LBRC ), LT( _NAVI, KC_MINS ), LT( _CODE, KC_SPC ), LT( _FUNC, KC_EQL ), TD( TD_RBRC ), KC_LEFT, KC_DOWN, KC_RGHT ), | ||
| 113 | |||
| 114 | /* Code | ||
| 115 | * ,-----------------------------------------------------------------------------------. | ||
| 116 | * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | ||
| 117 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 118 | * | ` | < | [ | { | ( | & | Left | Down | Up | Down | ; | ' | | ||
| 119 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 120 | * | | > | ] | } | ) | | | | | , | . | / | Play | | ||
| 121 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 122 | * | | | | [ | BkSp | ======= | Del | ] | | \ | | | ||
| 123 | * `-----------------------------------------------------------------------------------' | ||
| 124 | */ | ||
| 125 | |||
| 126 | [_CODE] = LAYOUT_planck_mit( /* 1 - Code */ | ||
| 127 | _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, | ||
| 128 | KC_GRV, KC_LABK, KC_LBRC, KC_LCBR, KC_LPRN, KC_AMPR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, KC_QUOT, | ||
| 129 | _______, KC_RABK, KC_RBRC, KC_RCBR, KC_RPRN, KC_PIPE, XXXXXXX, XXXXXXX, _______, _______, KC_SLSH, KC_MPLY, | ||
| 130 | _______, _______, _______, KC_LBRC, KC_BSPC, _______, KC_DEL, KC_RBRC, _______, KC_BSLS, _______ ), | ||
| 131 | |||
| 132 | /* Navi | ||
| 133 | * ,-----------------------------------------------------------------------------------. | ||
| 134 | * | | | | PgUp | | | | |Insert| |Prtsc | | | ||
| 135 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 136 | * | ~ | | Home | PgDn | End | | | | |SrcLck| | | | ||
| 137 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 138 | * | | | | | | Break| | | | | PgUp | | | ||
| 139 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 140 | * | | | | | | | | | Home | PgDn | End | | ||
| 141 | * `-----------------------------------------------------------------------------------' | ||
| 142 | */ | ||
| 143 | |||
| 144 | [_NAVI] = LAYOUT_planck_mit( | ||
| 145 | _______, XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, XXXXXXX, KC_PSCR, _______, | ||
| 146 | KC_TILD, XXXXXXX, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLCK, _______, _______, | ||
| 147 | _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, _______, | ||
| 148 | _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END ), | ||
| 149 | |||
| 150 | /* Func | ||
| 151 | * ,-----------------------------------------------------------------------------------. | ||
| 152 | * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | | ||
| 153 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 154 | * | | F11 | F12 | | | | | | | | | | | ||
| 155 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 156 | * | | | | | | | | | | | | | | ||
| 157 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 158 | * | | | | | | | | | | | | | ||
| 159 | * `-----------------------------------------------------------------------------------' | ||
| 160 | */ | ||
| 161 | |||
| 162 | [_FUNC] = LAYOUT_planck_mit( | ||
| 163 | _______ , KC_F1, KC_F2 , KC_F3, KC_F4, KC_F5, KC_F6 , KC_F7, KC_F8, KC_F9, KC_F10, _______, | ||
| 164 | _______ , KC_F12, KC_F12 , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, | ||
| 165 | _______ , XXXXXXX, XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, | ||
| 166 | _______ , _______, _______ , _______, _______, _______, _______ , _______, _______, _______, _______ ), | ||
| 167 | |||
| 168 | |||
| 169 | /* Symb - double tap shift | ||
| 170 | * ,-----------------------------------------------------------------------------------. | ||
| 171 | * | | | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | ||
| 172 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 173 | * | | | | | | | | | | | : | " | | ||
| 174 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 175 | * | | | | | | | | | < | > | ? | | | ||
| 176 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 177 | * | | | | { | _ | | + | } | | | | | ||
| 178 | * `-----------------------------------------------------------------------------------' | ||
| 179 | */ | ||
| 180 | |||
| 181 | [_SYMB] = LAYOUT_planck_mit( | ||
| 182 | KC_PIPE, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, | ||
| 183 | KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_COLN, KC_DQUO, | ||
| 184 | _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LABK, KC_RABK, KC_QUES, _______, | ||
| 185 | _______, _______, _______, KC_LCBR, KC_UNDS, _______, KC_PLUS, KC_RCBR, _______, KC_PIPE, _______ ), | ||
| 186 | |||
| 187 | /* Number | ||
| 188 | * ,-----------------------------------------------------------------------------------. | ||
| 189 | * | | + | - | | | | | 7 | 8 | 9 | | | | ||
| 190 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 191 | * | | * | / | = | | | | 4 | 5 | 6 | | | | ||
| 192 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 193 | * | | | | | | | | 1 | 2 | 3 | |Layer0| | ||
| 194 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 195 | * | | | | | | | 0 | 00 | . | | | | ||
| 196 | * `-----------------------------------------------------------------------------------' | ||
| 197 | */ | ||
| 198 | |||
| 199 | [_NUMB] = LAYOUT_planck_mit( /* 5 - Numpad */ | ||
| 200 | _______, KC_PPLS, KC_PMNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, XXXXXXX, _______, | ||
| 201 | _______, KC_PAST, KC_PSLS, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, XXXXXXX, _______, | ||
| 202 | _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX, TO( 0 ), | ||
| 203 | _______, _______, _______, _______, _______, XXXXXXX, KC_0, KC_00, KC_DOT, XXXXXXX, _______ ), | ||
| 204 | |||
| 205 | /* MARO Empty | ||
| 206 | * ,-----------------------------------------------------------------------------------. | ||
| 207 | * | | | | | | | | | | | | | | ||
| 208 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 209 | * | | | | | | | | | | | | | | ||
| 210 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 211 | * | | | | | | | | | | | | | | ||
| 212 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 213 | * | | | | | | | | | | | | | ||
| 214 | * `-----------------------------------------------------------------------------------' | ||
| 215 | */ | ||
| 216 | |||
| 217 | [_MARO] = LAYOUT_planck_mit( | ||
| 218 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 219 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 220 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 221 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), | ||
| 222 | |||
| 223 | /* RGB | ||
| 224 | * ,-----------------------------------------------------------------------------------. | ||
| 225 | * | | | | | | _TAP | | | | | | | | ||
| 226 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 227 | * | MOD | M_R | M_SW | M_K | M_X | M_G | | | | | | | | ||
| 228 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 229 | * | HUI | SAI | VAI | | | | | | | | | | | ||
| 230 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 231 | * | HUD | SAD | VAD | | | RGB_TOG | | | | | | | ||
| 232 | * `-----------------------------------------------------------------------------------' | ||
| 233 | */ | ||
| 234 | |||
| 235 | [_RGB] = LAYOUT_planck_mit( | ||
| 236 | _______, _______, _______, _______, _______, RGB_TAP, _______, _______, _______, _______, _______, _______, | ||
| 237 | RGB_MOD, RGB_M_R, RGB_M_SW, RGB_M_K, RGB_M_X, RGB_M_G, _______, _______, _______, _______, _______, _______, | ||
| 238 | RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 239 | RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, RGB_TOG, _______, _______, _______, _______, _______ ), | ||
| 240 | |||
| 241 | /* Func | ||
| 242 | * ,-----------------------------------------------------------------------------------. | ||
| 243 | * | | | | | | | | | | |Layer0| Rest | | ||
| 244 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 245 | * | Caps | | | | | Game | | | | | | | | ||
| 246 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 247 | * | | | | | | | Numb | Music| | | | | | ||
| 248 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 249 | * | | | | | | | | | | | | | ||
| 250 | * `-----------------------------------------------------------------------------------' | ||
| 251 | */ | ||
| 252 | |||
| 253 | [_ADJUST] = LAYOUT_planck_mit( | ||
| 254 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO( 0 ), RESET , | ||
| 255 | KC_CAPS, _______, _______, _______, _______, TO(_GAME), _______, _______, _______, _______, _______, _______, | ||
| 256 | _______, _______, _______, _______, _______, _______, TO(_NUMB), MU_TOG, _______, _______, _______, _______, | ||
| 257 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), | ||
| 258 | |||
| 259 | [_GAME] = LAYOUT_planck_mit( | ||
| 260 | XXXXXXX,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX, | ||
| 261 | XXXXXXX,KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
| 262 | XXXXXXX,KC_LCTL, KC_A, KC_S, KC_D, KC_B, KC_N, KC_M, XXXXXXX, XXXXXXX, KC_UP, TO( 0 ), | ||
| 263 | XXXXXXX,KC_LSFT, KC_Z, KC_X, KC_C, KC_SPC, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT ), | ||
| 264 | }; | 16 | }; |
| 265 | 17 | ||
| 266 | /* Encoder */ | 18 | extern rgblight_config_t rgblight_config; |
| 267 | static uint8_t encoder_state = 0; | 19 | int RGB_LAYER0_mode = 6; |
| 268 | static int8_t encoder_value = 0; | 20 | static uint8_t current_layer = 0; |
| 269 | static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; | 21 | static bool has_layer_changed = true; |
| 270 | 22 | uint16_t i = 0; | |
| 271 | /* Timer */ | 23 | uint16_t j = 0; |
| 272 | static uint16_t TAP_RGB_timer; | ||
| 273 | static uint16_t RGB_encoder_timer; | 24 | static uint16_t RGB_encoder_timer; |
| 25 | static uint16_t RGB_encoder_timer2; | ||
| 26 | static uint8_t RGB_encoder_dir = 0; | ||
| 274 | 27 | ||
| 275 | /* Encoder state RGB_display */ | 28 | const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = { |
| 276 | static uint8_t RGB_encoder_count=6; | 29 | 30, |
| 277 | static bool RGB_encoder_bool = false; | 30 | 5, |
| 278 | 31 | -5 | |
| 279 | /* RGB tap HUE */ | 32 | }; |
| 280 | static uint16_t Type_Hue=270; | ||
| 281 | |||
| 282 | void matrix_init_user( void ) | ||
| 283 | { | ||
| 284 | wait_ms( 200 ); | ||
| 285 | |||
| 286 | /* Encoder init */ | ||
| 287 | encoder_state = PIND & 0x3; | ||
| 288 | 33 | ||
| 289 | /* Timer init */ | 34 | void matrix_init_user(void) { |
| 290 | RGB_encoder_timer= timer_read(); | 35 | RGB_encoder_timer = timer_read(); |
| 291 | TAP_RGB_timer= timer_read(); | 36 | RGB_encoder_timer2 = timer_read(); |
| 292 | } | 37 | } |
| 293 | 38 | ||
| 39 | void matrix_scan_user(void) { | ||
| 40 | uint8_t layer = biton32(layer_state); | ||
| 294 | 41 | ||
| 295 | void matrix_scan_user( void ) | 42 | if (RGB_encoder_dir != 0) { |
| 296 | { | 43 | if (timer_elapsed(RGB_encoder_timer) > 1400) { |
| 297 | /* Layer */ | 44 | RGB_encoder_dir = 0; |
| 298 | uint8_t layer = biton32( layer_state ); | 45 | rgblight_mode(RGB_LAYER0_mode); |
| 299 | 46 | } else { | |
| 300 | /* Encoder */ | 47 | if (timer_elapsed(RGB_encoder_timer2) > 700) { |
| 301 | encoder_state <<= 2; | ||
| 302 | encoder_state |= (PIND & 0x3); | ||
| 303 | encoder_value += encoder_LUT[encoder_state & 0xF]; | ||
| 304 | |||
| 305 | /* Encoder state RGB display */ | ||
| 306 | if (RGB_encoder_bool){ | ||
| 307 | if (timer_elapsed(RGB_encoder_timer) > 2500) { | ||
| 308 | RGB_encoder_bool=false; | ||
| 309 | if (RGB_TAP_STATE) { | ||
| 310 | rgblight_mode( 1 ); | ||
| 311 | rgblight_setrgb( RGB_TAP_Base_Color ); | ||
| 312 | }else{ | ||
| 313 | rgblight_mode( RGB_LAYER0_mode ); | ||
| 314 | } | ||
| 315 | } | ||
| 316 | } | ||
| 317 | |||
| 318 | /* Display the Caps state */ | ||
| 319 | if (caps==true){ | ||
| 320 | rgblight_setrgb_at(RGB_Caps_Color,12); | ||
| 321 | } | ||
| 322 | |||
| 323 | /* Start of Encoder clockwise */ | ||
| 324 | if ( encoder_value >= 4 ) { | ||
| 325 | |||
| 326 | /* Start of Encoder state RGB_display */ | ||
| 327 | if (!RGB_encoder_bool){ | ||
| 328 | RGB_encoder_timer=timer_read(); | ||
| 329 | RGB_encoder_bool=true; | ||
| 330 | RGB_encoder_count=5; | ||
| 331 | rgblight_mode(1); | ||
| 332 | rgblight_setrgb( 0,0,0 ); | ||
| 333 | }else if (RGB_encoder_bool && timer_elapsed(RGB_encoder_timer) < 800) { | ||
| 334 | RGB_encoder_timer=timer_read(); | ||
| 335 | RGB_encoder_count-=1; | ||
| 336 | if (RGB_encoder_count>5 || RGB_encoder_count<1){ | ||
| 337 | RGB_encoder_count=5; | ||
| 338 | rgblight_setrgb(0, 0, 0); | 48 | rgblight_setrgb(0, 0, 0); |
| 49 | RGB_encoder_timer2 = timer_read(); | ||
| 339 | } | 50 | } |
| 340 | } | 51 | if (timer_elapsed(RGB_encoder_timer2) > 80) { |
| 341 | rgblight_setrgb_at(0,255,0,5); | 52 | if (RGB_encoder_dir == 1) { |
| 342 | if (RGB_encoder_count<1) {RGB_encoder_count=1;} | 53 | rgblight_setrgb_at(128, 128, 0, 19); |
| 343 | switch (RGB_encoder_count) { | 54 | } else { |
| 344 | case 5: | 55 | rgblight_setrgb_at(128, 128, 0, 16); |
| 345 | rgblight_setrgb_at(0, 255, 0,4); | 56 | } |
| 346 | break; | ||
| 347 | case 4: | ||
| 348 | rgblight_setrgb_at(0, 255, 0,3); | ||
| 349 | break; | ||
| 350 | case 3: | ||
| 351 | rgblight_setrgb_at(0, 255, 0,2); | ||
| 352 | break; | ||
| 353 | case 2: | ||
| 354 | rgblight_setrgb_at(0, 255, 0,1); | ||
| 355 | break; | ||
| 356 | case 1: | ||
| 357 | rgblight_setrgb_at(0, 255, 0,0); | ||
| 358 | break; | ||
| 359 | } | 57 | } |
| 360 | /* End of Encoder state RGB_display */ | 58 | if (timer_elapsed(RGB_encoder_timer2) > 180) { |
| 361 | 59 | if (RGB_encoder_dir == 1) { | |
| 362 | /* Start of Set Encoder Keycode */ | 60 | rgblight_setrgb_at(160, 160, 0, 8); |
| 363 | switch ( layer ) | 61 | } else { |
| 364 | { | 62 | rgblight_setrgb_at(160, 160, 0, 3); |
| 365 | case 0: | 63 | } |
| 366 | tap_code( KC_VOLD ); | 64 | } |
| 367 | break; | 65 | if (timer_elapsed(RGB_encoder_timer2) > 280) { |
| 368 | case _CODE: | 66 | if (RGB_encoder_dir == 1) { |
| 369 | tap_code( KC_LEFT ); | 67 | rgblight_setrgb_at(192, 192, 0, 9); |
| 370 | break; | 68 | } else { |
| 371 | case _RGB: | 69 | rgblight_setrgb_at(192, 192, 0, 2); |
| 372 | rgblight_decrease_val(); | 70 | } |
| 373 | break; | 71 | } |
| 374 | case _NUMB: | 72 | if (timer_elapsed(RGB_encoder_timer2) > 400) { |
| 375 | tap_code( KC_LEFT ); | 73 | if (RGB_encoder_dir == 1) { |
| 376 | break; | 74 | rgblight_setrgb_at(224, 224, 0, 10); |
| 377 | case _MARO: | 75 | } else { |
| 378 | tap_code( KC_UP ); | 76 | rgblight_setrgb_at(224, 224, 0, 1); |
| 379 | break; | 77 | } |
| 380 | default: | ||
| 381 | tap_code( KC_VOLD ); | ||
| 382 | } | ||
| 383 | /* End of Set Encoder Keycode */ | ||
| 384 | |||
| 385 | } | ||
| 386 | |||
| 387 | /* End of Encoder clockwise */ | ||
| 388 | |||
| 389 | /* Start of Encoder anti-clockwise */ | ||
| 390 | if ( encoder_value <= -4 ) | ||
| 391 | { | ||
| 392 | /* Start of Encoder state RGB_display */ | ||
| 393 | if (!RGB_encoder_bool){ | ||
| 394 | RGB_encoder_timer=timer_read(); | ||
| 395 | RGB_encoder_bool=true; | ||
| 396 | RGB_encoder_count=6; | ||
| 397 | rgblight_mode(1); | ||
| 398 | rgblight_setrgb( 0,0,0 ); | ||
| 399 | }else if (RGB_encoder_bool && timer_elapsed(RGB_encoder_timer) < 800) { | ||
| 400 | RGB_encoder_timer=timer_read(); | ||
| 401 | RGB_encoder_count+=1; | ||
| 402 | if (RGB_encoder_count<6 || RGB_encoder_count> 10){ | ||
| 403 | RGB_encoder_count=6; | ||
| 404 | rgblight_setrgb(0, 0, 0); | ||
| 405 | } | 78 | } |
| 406 | } | ||
| 407 | rgblight_setrgb_at(0, 0,255,6); | ||
| 408 | if (RGB_encoder_count>11) { | ||
| 409 | RGB_encoder_count=11; | ||
| 410 | } | ||
| 411 | switch (RGB_encoder_count) { | ||
| 412 | case 6: | ||
| 413 | rgblight_setrgb_at(0, 0,255,7); | ||
| 414 | break; | ||
| 415 | case 7: | ||
| 416 | rgblight_setrgb_at(0, 0,255,8); | ||
| 417 | break; | ||
| 418 | case 8: | ||
| 419 | rgblight_setrgb_at(0, 0,255,9); | ||
| 420 | break; | ||
| 421 | case 9: | ||
| 422 | rgblight_setrgb_at(0, 0,255,10); | ||
| 423 | break; | ||
| 424 | case 10: | ||
| 425 | rgblight_setrgb_at(0, 0,128,11); | ||
| 426 | break; | ||
| 427 | } | ||
| 428 | /* End of Encoder state RGB_display */ | ||
| 429 | |||
| 430 | /* Start of Set Encoder Keycode */ | ||
| 431 | switch ( layer ) | ||
| 432 | { | ||
| 433 | case 0: | ||
| 434 | tap_code( KC_VOLU ); | ||
| 435 | break; | ||
| 436 | case _CODE: | ||
| 437 | tap_code( KC_RGHT ); | ||
| 438 | break; | ||
| 439 | case _RGB: | ||
| 440 | rgblight_increase_val(); | ||
| 441 | break; | ||
| 442 | case _NUMB: | ||
| 443 | tap_code( KC_RGHT ); | ||
| 444 | break; | ||
| 445 | case _MARO: | ||
| 446 | tap_code( KC_DOWN ); | ||
| 447 | break; | ||
| 448 | default: | ||
| 449 | tap_code( KC_VOLU ); | ||
| 450 | } | ||
| 451 | /* End of Set Encoder Keycode */ | ||
| 452 | |||
| 453 | } | ||
| 454 | |||
| 455 | /* End of Encoder anti-clockwise */ | ||
| 456 | |||
| 457 | encoder_value %= 4; | ||
| 458 | |||
| 459 | /* Start of RGB with Layer change */ | ||
| 460 | |||
| 461 | /* Save the Layer0 RGB state */ | ||
| 462 | if ( save_rgbmode == true ) { | ||
| 463 | if (RGB_TAP_STATE==false) | ||
| 464 | { | ||
| 465 | RGB_LAYER0_mode = rgblight_config.mode; | ||
| 466 | } | 79 | } |
| 467 | } | 80 | } |
| 468 | save_rgbmode = false; | ||
| 469 | 81 | ||
| 470 | /* When the layer is changed */ | 82 | /* layer rgb */ |
| 471 | if ( layer != current_layer && caps == false) { | 83 | if (layer != current_layer) { |
| 472 | has_layer_changed = true; | 84 | has_layer_changed = true; |
| 473 | current_layer = layer; /* update layer information */ | 85 | current_layer = layer; |
| 474 | } | 86 | } |
| 475 | /* Check for layer change, and apply color if its changed since last check */ | 87 | if (has_layer_changed) { |
| 476 | if ( has_layer_changed ) | 88 | if (layer == 0) { |
| 477 | { | 89 | rgblight_mode(RGB_LAYER0_mode); |
| 478 | /* change backlight based on layer. These should be numbers or whatever you defined the layers as */ | 90 | } else { |
| 479 | switch ( layer ) | 91 | rgblight_mode(1); |
| 480 | { | 92 | for (i = 0; i < 48; i++) { |
| 481 | case 0: | 93 | (i > 41) ? (j = i - 1) : (j = i); |
| 482 | 94 | uint16_t kc = keymap_key_to_keycode(layer, (keypos_t) {.row = 0, .col = i | |
| 483 | /* if the key tap RGB effect is enable */ | 95 | }); |
| 484 | if (RGB_TAP_STATE==true){ | 96 | if (kc == KC_TRNS) { |
| 485 | rgblight_mode(1); | 97 | setrgb(5, 5, 5, (LED_TYPE * ) & led[j]); /* TRNS color 0-255*/ |
| 486 | rgblight_setrgb( RGB_TAP_Base_Color ); | 98 | } else if (kc == KC_NO) { |
| 487 | } | 99 | setrgb(0, 0, 0, (LED_TYPE * ) & led[j]); /* NO color 0-255*/ |
| 488 | else{ | 100 | } else { |
| 489 | rgblight_mode( RGB_LAYER0_mode ); | 101 | if (layer == 1) { |
| 102 | setrgb(128, 64, 0, (LED_TYPE * ) & led[j]); /* 1 layer 0-255*/ | ||
| 103 | } else if (layer == 2) { | ||
| 104 | setrgb(0, 64, 128, (LED_TYPE * ) & led[j]); /* 2*/ | ||
| 105 | } else if (layer == 3) { | ||
| 106 | setrgb(64, 128, 0, (LED_TYPE * ) & led[j]); /* 3*/ | ||
| 107 | } else if (layer == 4) { | ||
| 108 | setrgb(0, 128, 64, (LED_TYPE * ) & led[j]); /* 4*/ | ||
| 109 | } else if (layer == 5) { | ||
| 110 | setrgb(128, 0, 128, (LED_TYPE * ) & led[j]); /* 5*/ | ||
| 111 | } else if (layer == 6) { | ||
| 112 | setrgb(128, 0, 128, (LED_TYPE * ) & led[j]); /* 6*/ | ||
| 113 | } else if (layer == 7) { | ||
| 114 | setrgb(128, 128, 0, (LED_TYPE * ) & led[j]); /* 7*/ | ||
| 115 | } else if (layer == 8) { | ||
| 116 | setrgb(0, 128, 128, (LED_TYPE * ) & led[j]); /* 8*/ | ||
| 117 | } else if (layer == 9) { | ||
| 118 | setrgb(128, 192, 64, (LED_TYPE * ) & led[j]); /* 9*/ | ||
| 119 | } else if (layer == 10) { | ||
| 120 | setrgb(64, 192, 128, (LED_TYPE * ) & led[j]); /* 10*/ | ||
| 121 | } else if (layer == 11) { | ||
| 122 | setrgb(128, 64, 192, (LED_TYPE * ) & led[j]); /* 11*/ | ||
| 123 | } else if (layer == 12) { | ||
| 124 | setrgb(64, 128, 192, (LED_TYPE * ) & led[j]); /* 12*/ | ||
| 125 | } else if (layer == 13) { | ||
| 126 | setrgb(128, 192, 0, (LED_TYPE * ) & led[j]); /* 13*/ | ||
| 127 | } else if (layer == 14) { | ||
| 128 | setrgb(192, 0, 128, (LED_TYPE * ) & led[j]); /* 14*/ | ||
| 129 | } else if (layer == 15) { | ||
| 130 | setrgb(0, 192, 128, (LED_TYPE * ) & led[j]); /* 15*/ | ||
| 131 | } | ||
| 490 | } | 132 | } |
| 491 | break; | 133 | } |
| 492 | 134 | rgblight_set(); | |
| 493 | case _CODE: //1 | ||
| 494 | /* Save Layer0 RGB state */ | ||
| 495 | RGB_LAYER0_mode = rgblight_config.mode; | ||
| 496 | |||
| 497 | /* set all the RGB color under the switch */ | ||
| 498 | rgblight_mode( 1 ); | ||
| 499 | rgblight_setrgb(RGB_Layer_1_Base_Color); | ||
| 500 | |||
| 501 | /* set each of the RGB led color under the switch */ | ||
| 502 | rgblight_setrgb_at(64, 64, 64,1); // Q | ||
| 503 | rgblight_setrgb_at(64, 64, 64,2); // W | ||
| 504 | rgblight_setrgb_at(64, 64, 64,3); // E | ||
| 505 | rgblight_setrgb_at(64, 64, 64,4); // R | ||
| 506 | rgblight_setrgb_at(64, 64, 64,5); // T | ||
| 507 | rgblight_setrgb_at(64, 64, 64,6); // Y | ||
| 508 | rgblight_setrgb_at(64, 64, 64,7); // U | ||
| 509 | rgblight_setrgb_at(64, 64, 64,8); // I | ||
| 510 | rgblight_setrgb_at(64, 64, 64,9); // O | ||
| 511 | rgblight_setrgb_at(64, 64, 64,10); // P | ||
| 512 | rgblight_setrgb_at(64, 0, 0,40); // - | ||
| 513 | rgblight_setrgb_at(64, 0, 0,42); // = | ||
| 514 | break; | ||
| 515 | |||
| 516 | case _NAVI: //2 | ||
| 517 | RGB_LAYER0_mode = rgblight_config.mode; | ||
| 518 | |||
| 519 | rgblight_mode( 1 ); | ||
| 520 | rgblight_setrgb(RGB_Layer_2_Base_Color); | ||
| 521 | |||
| 522 | rgblight_setrgb_at(64, 0, 64,3); | ||
| 523 | rgblight_setrgb_at(64, 0, 64,14); | ||
| 524 | rgblight_setrgb_at(64, 0, 64,15); | ||
| 525 | rgblight_setrgb_at(64, 0, 64,16); | ||
| 526 | rgblight_setrgb_at(64, 64, 0,8); | ||
| 527 | rgblight_setrgb_at(64, 64, 0,10); | ||
| 528 | rgblight_setrgb_at(64, 64, 0,21); | ||
| 529 | rgblight_setrgb_at(64, 64, 0,29); | ||
| 530 | rgblight_setrgb_at(64, 0, 0,11); | ||
| 531 | rgblight_setrgb_at(0, 0, 64,34); | ||
| 532 | rgblight_setrgb_at(0, 0, 64,44); | ||
| 533 | rgblight_setrgb_at(0, 0, 64,45); | ||
| 534 | rgblight_setrgb_at(0, 0, 64,46); | ||
| 535 | break; | ||
| 536 | case _FUNC: //3 | ||
| 537 | RGB_LAYER0_mode = rgblight_config.mode; | ||
| 538 | |||
| 539 | rgblight_mode( 1 ); | ||
| 540 | rgblight_setrgb(RGB_Layer_3_Base_Color); | ||
| 541 | |||
| 542 | rgblight_setrgb_at(0, 0, 64,1); | ||
| 543 | rgblight_setrgb_at(0, 0, 64,2); | ||
| 544 | rgblight_setrgb_at(0, 0, 64,3); | ||
| 545 | rgblight_setrgb_at(0, 0, 64,4); | ||
| 546 | rgblight_setrgb_at(0, 0, 64,5); | ||
| 547 | rgblight_setrgb_at(0, 0, 64,6); | ||
| 548 | rgblight_setrgb_at(0, 0, 64,7); | ||
| 549 | rgblight_setrgb_at(0, 0, 64,8); | ||
| 550 | rgblight_setrgb_at(0, 0, 64,9); | ||
| 551 | rgblight_setrgb_at(0, 0, 64,10); | ||
| 552 | rgblight_setrgb_at(0, 0, 64,13); | ||
| 553 | rgblight_setrgb_at(0, 0, 64,14); | ||
| 554 | break; | ||
| 555 | |||
| 556 | case _SYMB: //4 | ||
| 557 | RGB_LAYER0_mode = rgblight_config.mode; | ||
| 558 | |||
| 559 | rgblight_mode( 1 ); | ||
| 560 | rgblight_setrgb(RGB_Layer_4_Base_Color); | ||
| 561 | |||
| 562 | rgblight_setrgb_at(0, 64, 64,1); | ||
| 563 | rgblight_setrgb_at(0, 64, 64,2); | ||
| 564 | rgblight_setrgb_at(0, 64, 64,3); | ||
| 565 | rgblight_setrgb_at(0, 64, 64,4); | ||
| 566 | rgblight_setrgb_at(0, 64, 64,5); | ||
| 567 | rgblight_setrgb_at(0, 64, 64,6); | ||
| 568 | rgblight_setrgb_at(0, 64, 64,7); | ||
| 569 | rgblight_setrgb_at(0, 64, 64,8); | ||
| 570 | rgblight_setrgb_at(0, 64, 64,9); | ||
| 571 | rgblight_setrgb_at(0, 64, 64,10); | ||
| 572 | rgblight_setrgb_at(0, 64, 64,12); | ||
| 573 | rgblight_setrgb_at(0, 64, 64,22); | ||
| 574 | rgblight_setrgb_at(0, 64, 64,23); | ||
| 575 | rgblight_setrgb_at(0, 64, 64,32); | ||
| 576 | rgblight_setrgb_at(0, 64, 64,33); | ||
| 577 | rgblight_setrgb_at(0, 64, 64,34); | ||
| 578 | rgblight_setrgb_at(0, 64, 64,39); | ||
| 579 | rgblight_setrgb_at(0, 64, 64,40); | ||
| 580 | rgblight_setrgb_at(0, 64, 64,42); | ||
| 581 | rgblight_setrgb_at(0, 64, 64,43); | ||
| 582 | break; | ||
| 583 | |||
| 584 | case _NUMB: //5 | ||
| 585 | RGB_LAYER0_mode = rgblight_config.mode; | ||
| 586 | |||
| 587 | rgblight_mode( 1 ); | ||
| 588 | rgblight_setrgb(RGB_Layer_5_Base_Color); | ||
| 589 | |||
| 590 | rgblight_setrgb_at(0,64,0,1); | ||
| 591 | rgblight_setrgb_at(0,64,0,2); | ||
| 592 | rgblight_setrgb_at(0,64,0,13); | ||
| 593 | rgblight_setrgb_at(0,64,0,14); | ||
| 594 | rgblight_setrgb_at(0,64,64,15); | ||
| 595 | rgblight_setrgb_at(64,64,64,7); | ||
| 596 | rgblight_setrgb_at(64,64,64,8); | ||
| 597 | rgblight_setrgb_at(64,64,64,9); | ||
| 598 | rgblight_setrgb_at(64,64,64,19); | ||
| 599 | rgblight_setrgb_at(64,64,64,20); | ||
| 600 | rgblight_setrgb_at(64,64,64,21); | ||
| 601 | rgblight_setrgb_at(64,64,64,31); | ||
| 602 | rgblight_setrgb_at(64,64,64,32); | ||
| 603 | rgblight_setrgb_at(64,64,64,33); | ||
| 604 | rgblight_setrgb_at(64,64,64,42); | ||
| 605 | rgblight_setrgb_at(64,64,64,43); | ||
| 606 | rgblight_setrgb_at(0,128,0,44); | ||
| 607 | break; | ||
| 608 | case _MARO: //6 | ||
| 609 | RGB_LAYER0_mode = rgblight_config.mode; | ||
| 610 | |||
| 611 | rgblight_mode( 1 ); | ||
| 612 | rgblight_setrgb(RGB_Layer_6_Base_Color); | ||
| 613 | break; | ||
| 614 | |||
| 615 | case _RGB: //7 | ||
| 616 | RGB_LAYER0_mode = rgblight_config.mode; | ||
| 617 | |||
| 618 | rgblight_mode( 1 ); | ||
| 619 | rgblight_setrgb(RGB_Layer_7_Base_Color); | ||
| 620 | |||
| 621 | rgblight_setrgb_at(1,143,225,0); | ||
| 622 | rgblight_setrgb_at(39,21,107,1); | ||
| 623 | rgblight_setrgb_at(208,0,0,2); | ||
| 624 | rgblight_setrgb_at(64,64,64,21); | ||
| 625 | break; | ||
| 626 | case _ADJUST: //8 | ||
| 627 | RGB_LAYER0_mode = rgblight_config.mode; | ||
| 628 | |||
| 629 | rgblight_mode( 1 ); | ||
| 630 | rgblight_setrgb(RGB_Layer_8_Base_Color); | ||
| 631 | |||
| 632 | rgblight_setrgb_at(0,64,0,10); | ||
| 633 | rgblight_setrgb_at(64,0,0,11); | ||
| 634 | rgblight_setrgb_at(0,64,0,17); | ||
| 635 | rgblight_setrgb_at(0,64,0,30); | ||
| 636 | rgblight_setrgb_at(6,50,50,12); | ||
| 637 | break; | ||
| 638 | |||
| 639 | case _GAME: //9 | ||
| 640 | RGB_LAYER0_mode = rgblight_config.mode; | ||
| 641 | |||
| 642 | rgblight_mode( 1 ); | ||
| 643 | rgblight_setrgb(RGB_Layer_9_Base_Color); | ||
| 644 | |||
| 645 | rgblight_setrgb_at(0,0,64,15); | ||
| 646 | rgblight_setrgb_at(0,0,64,26); | ||
| 647 | rgblight_setrgb_at(0,0,64,27); | ||
| 648 | rgblight_setrgb_at(0,0,64,28); | ||
| 649 | rgblight_setrgb_at(64,0,0,35); | ||
| 650 | break; | ||
| 651 | |||
| 652 | default: | ||
| 653 | rgblight_mode( RGB_LAYER0_mode ); | ||
| 654 | } | 135 | } |
| 655 | has_layer_changed = false; | 136 | has_layer_changed = false; |
| 656 | } | 137 | } |
| 657 | /* End of RGB with Layer change */ | 138 | /* end of layer rgb */ |
| 658 | 139 | } | |
| 659 | } // End of matrix_scan_user | ||
| 660 | |||
| 661 | |||
| 662 | |||
| 663 | /* shift + enter = " from:https://github.com/qmk/qmk_firmware/blob/e899cb8940da04fa2610604f0aab417db7fac119/keyboards/mitosis/keymaps/datagrok/keymap.c */ | ||
| 664 | |||
| 665 | bool comm_shifted = false; | ||
| 666 | bool ques_shifted = false; | ||
| 667 | static uint8_t key_index = 0; | ||
| 668 | uint8_t shifted; | ||
| 669 | uint16_t s_keycode; | ||
| 670 | bool *k_shifted; | ||
| 671 | |||
| 672 | bool process_record_user( uint16_t keycode, keyrecord_t *record ){ | ||
| 673 | |||
| 674 | /* Start of key tap RGB effect */ | ||
| 675 | if ( RGB_TAP_STATE ==true ) { | ||
| 676 | key_index=(record->event.key.col)+(record->event.key.row)*12; | ||
| 677 | |||
| 678 | /* Change the Hue of the RGB color with the type speed */ | ||
| 679 | if (timer_elapsed(TAP_RGB_timer) >10000){ | ||
| 680 | TAP_RGB_timer=timer_read(); | ||
| 681 | Type_Hue=270; | ||
| 682 | }else if (timer_elapsed(TAP_RGB_timer) >1000){ | ||
| 683 | Type_Hue+=30; | ||
| 684 | if (Type_Hue>270) { | ||
| 685 | Type_Hue=270;} | ||
| 686 | }else{ | ||
| 687 | TAP_RGB_timer=timer_read(); | ||
| 688 | Type_Hue-=10; | ||
| 689 | if (Type_Hue<10) { | ||
| 690 | Type_Hue=10;} | ||
| 691 | } | ||
| 692 | if (key_index>42){ //fix the RGB index of the MIT layout position | ||
| 693 | key_index=key_index-1; | ||
| 694 | } | ||
| 695 | if ( record->event.pressed ) { | ||
| 696 | rgblight_sethsv_at(Type_Hue,255,255,key_index); | ||
| 697 | } else { | ||
| 698 | rgblight_setrgb_at(RGB_TAP_Base_Color,key_index); | ||
| 699 | } | ||
| 700 | } | ||
| 701 | /* End of key tap RGB effect */ | ||
| 702 | |||
| 703 | switch ( keycode ) | ||
| 704 | { | ||
| 705 | /* save the RGB state when set the new */ | ||
| 706 | case RGB_M_R: | ||
| 707 | save_rgbmode = true; | ||
| 708 | break; | ||
| 709 | case RGB_M_SW: | ||
| 710 | save_rgbmode = true; | ||
| 711 | break; | ||
| 712 | case RGB_M_X: | ||
| 713 | save_rgbmode = true; | ||
| 714 | break; | ||
| 715 | case RGB_M_G: | ||
| 716 | save_rgbmode = true; | ||
| 717 | break; | ||
| 718 | case RGB_MODE_KNIGHT: | ||
| 719 | save_rgbmode = true; | ||
| 720 | break; | ||
| 721 | |||
| 722 | /* Define a New Keycode: double zero */ | ||
| 723 | case KC_00: | ||
| 724 | if (record->event.pressed) { | ||
| 725 | // Do something when pressed | ||
| 726 | } else { | ||
| 727 | tap_code( KC_0 ); // send 0 | ||
| 728 | tap_code( KC_0 ); // send 0 twice without macro | ||
| 729 | } | ||
| 730 | return false; // Skip all further processing of this key | ||
| 731 | |||
| 732 | /* when the REST key is pressed the 'R' key will RED,the "Bottom Left"(esc of qmk-dfu) will be GREEN */ | ||
| 733 | case RESET: | ||
| 734 | rgblight_mode( 1 ); | ||
| 735 | rgblight_setrgb( 0, 0, 0 ); | ||
| 736 | rgblight_setrgb_at(128, 0, 0,4); // R | ||
| 737 | rgblight_setrgb_at(6, 128, 24,36); // Bottom Left key | ||
| 738 | break; | ||
| 739 | |||
| 740 | /* Define a New Keycode: key tap RGB effect toggle */ | ||
| 741 | case RGB_TAP: | ||
| 742 | if ( !(record->event.pressed)) { | ||
| 743 | /* If enable,the 'On' key will be green */ | ||
| 744 | if (RGB_TAP_STATE) { | ||
| 745 | RGB_TAP_STATE=false; | ||
| 746 | rgblight_mode( 1 ); | ||
| 747 | rgblight_setrgb( RGB_TAP_Base_Color ); | ||
| 748 | rgblight_setrgb_at(RGB_TAP_Off_Color,16); // O - on | ||
| 749 | }else{ | ||
| 750 | /* If disenable,the 'oFf' key will be red */ | ||
| 751 | RGB_TAP_STATE=true; | ||
| 752 | rgblight_mode( 1 ); | ||
| 753 | rgblight_setrgb( RGB_TAP_Base_Color ); | ||
| 754 | rgblight_setrgb_at(RGB_TAP_On_Color,9); // F - off | ||
| 755 | } | ||
| 756 | } | ||
| 757 | break; | ||
| 758 | 140 | ||
| 759 | /* special shift keys */ | 141 | bool process_record_user(uint16_t keycode, keyrecord_t * record) { |
| 760 | case KC_ENT: | 142 | switch (keycode) { |
| 761 | s_keycode = KC_QUOT; | 143 | case RGB_MOD: |
| 762 | k_shifted = &ques_shifted; | 144 | RGB_LAYER0_mode = rgblight_config.mode; |
| 763 | break; | ||
| 764 | case KC_UP: | ||
| 765 | s_keycode = KC_SLSH; | ||
| 766 | k_shifted = &ques_shifted; | ||
| 767 | break; | ||
| 768 | case KC_DOWN: | ||
| 769 | s_keycode = KC_BSLS; | ||
| 770 | k_shifted = &ques_shifted; | ||
| 771 | break; | 145 | break; |
| 772 | default: | 146 | default: |
| 773 | return(true); | 147 | return (true); |
| 774 | } | 148 | } |
| 149 | return (true); | ||
| 150 | } | ||
| 775 | 151 | ||
| 776 | shifted = get_mods() & (MOD_BIT( KC_LSHIFT ) | MOD_BIT( KC_RSHIFT ) ); | 152 | void encoder_update_user(uint8_t index, bool clockwise) { |
| 777 | 153 | RGB_encoder_timer = timer_read(); | |
| 778 | /* Keydown. If shift is currently pressed, register its alternate keycode. */ | 154 | RGB_encoder_timer2 = timer_read(); |
| 779 | if ( record->event.pressed && shifted ) | 155 | uint8_t layer = biton32(layer_state); |
| 780 | { | 156 | if (clockwise) { |
| 781 | *k_shifted = true; | 157 | RGB_encoder_dir = 1; |
| 782 | register_code( s_keycode ); | ||
| 783 | return(false); | ||
| 784 | /* | ||
| 785 | * Keyup. If shift was pressed back when the key was pressed, unregister | ||
| 786 | * its alternate keycode. | ||
| 787 | */ | ||
| 788 | } else if ( !(record->event.pressed) && *k_shifted ) { | ||
| 789 | *k_shifted = false; | ||
| 790 | unregister_code( s_keycode ); | ||
| 791 | return(false); | ||
| 792 | /* Otherwise, behave as normal. */ | ||
| 793 | } else { | 158 | } else { |
| 794 | return(true); | 159 | RGB_encoder_dir = -1; |
| 795 | } | 160 | } |
| 796 | 161 | if (index == 0) /* Right encoder */ { | |
| 797 | } // End ofprocess_record_user | 162 | if (clockwise) { |
| 798 | 163 | register_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 11 | |
| 799 | 164 | })); | |
| 800 | void led_set_user( uint8_t usb_led ) | 165 | unregister_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 11 |
| 801 | { | 166 | })); |
| 802 | static uint8_t old_usb_led = 0; | 167 | } else { |
| 803 | wait_ms( 10 ); /* gets rid of tick */ | 168 | register_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 10 |
| 804 | 169 | })); | |
| 805 | if ( (usb_led & (1 << USB_LED_CAPS_LOCK) ) && !(old_usb_led & (1 << USB_LED_CAPS_LOCK) ) ) { | 170 | unregister_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 10 |
| 806 | /* CAPS on */ | 171 | })); |
| 807 | caps= true; | 172 | } |
| 808 | rgblight_setrgb( 0,0,0 ); | 173 | } else if (index == 1) /* Left encoder */ { |
| 809 | rgblight_setrgb_at(RGB_Caps_Color,12); // caps key | 174 | if (clockwise) { |
| 810 | #ifdef AUDIO_ENABLE | 175 | register_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 1 |
| 811 | PLAY_SONG( tone_caps ); | 176 | })); |
| 812 | #endif | 177 | unregister_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 1 |
| 813 | }else if ( !(usb_led & (1 << USB_LED_CAPS_LOCK) ) && (old_usb_led & (1 << USB_LED_CAPS_LOCK) ) ) { | 178 | })); |
| 814 | 179 | } else { | |
| 815 | /* CAPS off */ | 180 | register_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 0 |
| 816 | caps= false; | 181 | })); |
| 817 | if (RGB_TAP_STATE==false){ | 182 | unregister_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 0 |
| 818 | rgblight_mode( RGB_LAYER0_mode ); | 183 | })); |
| 819 | }else{ | ||
| 820 | rgblight_mode(1); | ||
| 821 | rgblight_setrgb( 0,0,0 ); | ||
| 822 | } | 184 | } |
| 823 | #ifdef AUDIO_ENABLE | ||
| 824 | PLAY_SONG( tone_caps ); | ||
| 825 | #endif | ||
| 826 | } | 185 | } |
| 827 | old_usb_led = usb_led; | 186 | } |
| 828 | } // End of led_set_user | ||
diff --git a/keyboards/tetris/keymaps/default/rules.mk b/keyboards/tetris/keymaps/default/rules.mk deleted file mode 100644 index e5ddcae8d..000000000 --- a/keyboards/tetris/keymaps/default/rules.mk +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | TAP_DANCE_ENABLE = yes | ||
diff --git a/keyboards/tetris/readme.md b/keyboards/tetris/readme.md index b2741caf1..260d453a8 100644 --- a/keyboards/tetris/readme.md +++ b/keyboards/tetris/readme.md | |||
| @@ -2,6 +2,8 @@ Tetris | |||
| 2 | === | 2 | === |
| 3 | A compact 40% (12x4) ortholinear keyboard (Planck Mit layout) with per switch RGB and encoder made by Fengz. | 3 | A compact 40% (12x4) ortholinear keyboard (Planck Mit layout) with per switch RGB and encoder made by Fengz. |
| 4 | 4 | ||
| 5 | Fake keys on the 5th row are for configuring the encoder's keycode. | ||
| 6 | |||
| 5 |  | 7 |  |
| 6 | 8 | ||
| 7 | More: [Imgur](https://imgur.com/gallery/Azq2zUm). | 9 | More: [Imgur](https://imgur.com/gallery/Azq2zUm). |
| @@ -12,4 +14,4 @@ Make example for this keyboard (after setting up your build environment): | |||
| 12 | 14 | ||
| 13 | make tetris:default | 15 | make tetris:default |
| 14 | 16 | ||
| 15 | See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file | 17 | See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. |
diff --git a/keyboards/tetris/rules.mk b/keyboards/tetris/rules.mk index 64c434554..c3e641c8f 100644..100755 --- a/keyboards/tetris/rules.mk +++ b/keyboards/tetris/rules.mk | |||
| @@ -36,26 +36,25 @@ F_USB = $(F_CPU) | |||
| 36 | # Interrupt driven control endpoint task(+60) | 36 | # Interrupt driven control endpoint task(+60) |
| 37 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | 37 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT |
| 38 | 38 | ||
| 39 | |||
| 39 | # Boot Section Size in *bytes* | 40 | # Boot Section Size in *bytes* |
| 40 | #OPT_DEFS += -DBOOTLOADER_SIZE=4096 | 41 | #OPT_DEFS += -DBOOTLOADER_SIZE=4096 |
| 41 | 42 | ||
| 42 | BOOTLOADER =qmk-dfu | 43 | BOOTLOADER =qmk-dfu |
| 43 | 44 | ||
| 45 | |||
| 44 | # Build Options | 46 | # Build Options |
| 45 | # comment out to disable the options. | 47 | # comment out to disable the options. |
| 46 | # | 48 | # |
| 47 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | 49 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) |
| 48 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) | 50 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) |
| 49 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | 51 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) |
| 50 | CONSOLE_ENABLE = no # Console for debug(+400) | 52 | CONSOLE_ENABLE = no # Console for debug(+400) |
| 51 | COMMAND_ENABLE = no # Commands for debug and configuration | 53 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 52 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 54 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
| 53 | NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 55 | NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
| 54 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | 56 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality |
| 55 | AUDIO_ENABLE = no | 57 | AUDIO_ENABLE = yes |
| 56 | RGBLIGHT_ENABLE = yes | 58 | RGBLIGHT_ENABLE = yes |
| 57 | TAP_DANCE_ENABLE = no | 59 | EXTRAFLAGS = -flto |
| 58 | 60 | ENCODER_ENABLE = yes | |
| 59 | EXTRAFLAGS += -flto # Make the hex smaller | ||
| 60 | |||
| 61 | LAYOUTS = planck_mit | ||
diff --git a/keyboards/tetris/tetris.c b/keyboards/tetris/tetris.c index 8d494c17f..f78de2f7b 100644..100755 --- a/keyboards/tetris/tetris.c +++ b/keyboards/tetris/tetris.c | |||
| @@ -1 +1 @@ | |||
| #include "tetris.h" | #include QMK_KEYBOARD_H | ||
diff --git a/keyboards/tetris/tetris.h b/keyboards/tetris/tetris.h index 0a036ec3b..f5d13e5c2 100644..100755 --- a/keyboards/tetris/tetris.h +++ b/keyboards/tetris/tetris.h | |||
| @@ -7,12 +7,14 @@ | |||
| 7 | K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ | 7 | K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ |
| 8 | K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ | 8 | K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ |
| 9 | K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ | 9 | K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ |
| 10 | K300, K301, K302, K303, K304, K305, K307, K308, K309, K310, K311 \ | 10 | K300, K301, K302, K303, K304, K305, K307, K308, K309, K310, K311, \ |
| 11 | K400, K401, K410, K411 \ | ||
| 11 | ) { \ | 12 | ) { \ |
| 12 | { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ | 13 | { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ |
| 13 | { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ | 14 | { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ |
| 14 | { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ | 15 | { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ |
| 15 | { K300, K301, K302, K303, K304, K305, KC_NO, K307, K308, K309, K310, K311 } \ | 16 | { K300, K301, K302, K303, K304, K305, KC_NO, K307, K308, K309, K310, K311 }, \ |
| 17 | { K400, K401, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K410, K411 } \ | ||
| 16 | } | 18 | } |
| 17 | 19 | ||
| 18 | #endif \ No newline at end of file | 20 | #endif |
