aboutsummaryrefslogtreecommitdiff
path: root/keyboards/tetris
diff options
context:
space:
mode:
authornoroadsleft <18669334+noroadsleft@users.noreply.github.com>2018-07-07 11:42:59 -0700
committerDrashna Jaelre <drashna@live.com>2018-07-07 11:42:59 -0700
commit0a8d529d741d927437a9eb8db7375261e8e96d42 (patch)
treecefb506f47dc749d2dee1364d12e60a417e360d9 /keyboards/tetris
parentc418608c1e81fea9987e8faf1d24ecc41bd72c13 (diff)
downloadqmk_firmware-0a8d529d741d927437a9eb8db7375261e8e96d42.tar.gz
qmk_firmware-0a8d529d741d927437a9eb8db7375261e8e96d42.zip
Tetris Configurator support and Rules update (#3317)
* Configurator support * Add LAYOUTS = planck_mit to rules.mk * Disable Tap Dance at the keyboard level * Keymap refactor: QMK_KEYBOARD_H; enable Tap Dance for default keymap * Add keymaps/default/rules.mk to enable Tap Dance * Reverse the addition of config.h in keyboards/tetris/keymaps/default/
Diffstat (limited to 'keyboards/tetris')
-rw-r--r--keyboards/tetris/info.json12
-rw-r--r--keyboards/tetris/keymaps/default/keymap.c31
-rw-r--r--keyboards/tetris/keymaps/default/rules.mk1
-rw-r--r--keyboards/tetris/rules.mk6
4 files changed, 32 insertions, 18 deletions
diff --git a/keyboards/tetris/info.json b/keyboards/tetris/info.json
new file mode 100644
index 000000000..b21a46d63
--- /dev/null
+++ b/keyboards/tetris/info.json
@@ -0,0 +1,12 @@
1{
2 "keyboard_name": "Tetris",
3 "url": "",
4 "maintainer": "qmk",
5 "width": 12,
6 "height": 4,
7 "layouts": {
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}]
10 }
11 }
12}
diff --git a/keyboards/tetris/keymaps/default/keymap.c b/keyboards/tetris/keymaps/default/keymap.c
index b0d22c533..61f2961b4 100644
--- a/keyboards/tetris/keymaps/default/keymap.c
+++ b/keyboards/tetris/keymaps/default/keymap.c
@@ -1,5 +1,4 @@
1#include "tetris.h" 1#include QMK_KEYBOARD_H
2#include "action_layer.h"
3 2
4#ifdef AUDIO_ENABLE 3#ifdef AUDIO_ENABLE
5 #include "audio.h" 4 #include "audio.h"
@@ -101,11 +100,11 @@ qk_tap_dance_action_t tap_dance_actions[] = {
101const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 100const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
102/* BASE - QWERTY 101/* BASE - QWERTY
103 * ,-----------------------------------------------------------------------------------. 102 * ,-----------------------------------------------------------------------------------.
104 * | Tab | Q | W | E | R | T | Y | U | I | O | P | BS | 103 * | Tab | Q | W | E | R | T | Y | U | I | O | P | BS |
105 * |------+------+------+------+------+-------------+------+------+------+------+------| 104 * |------+------+------+------+------+-------------+------+------+------+------+------|
106 * shift + Esc = ~ --> | Esc | A | S | D | F | G | H | J | K | L | ; | Enter| <-- shift + Enter = " 105 * shift + Esc = ~ --> | Esc | A | S | D | F | G | H | J | K | L | ; | Enter| <-- shift + Enter = "
107 * |------+------+------+------+------+------|------+------+------+------+------+------| 106 * |------+------+------+------+------+------|------+------+------+------+------+------|
108 * | Shift| Z | X | C | V | B | N | M | , | . | / | Mute | 107 * | Shift| Z | X | C | V | B | N | M | , | . | / | Mute |
109 * |------+------+------+------+------+------+------+------+------+------+------+------| <-- tap: 1.Mute 2.Next 108 * |------+------+------+------+------+------+------+------+------+------+------+------| <-- tap: 1.Mute 2.Next
110 * | Ctrl | GUI | Alt | [ | - | Space | = | ] | Fx | \ | Del | 109 * | Ctrl | GUI | Alt | [ | - | Space | = | ] | Fx | \ | Del |
111 * `-----------------------------------------------------------------------------------' 110 * `-----------------------------------------------------------------------------------'
@@ -203,9 +202,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
203 */ 202 */
204 203
205[_NUMB] = LAYOUT_planck_mit( /* 5 - Numpad */ 204[_NUMB] = LAYOUT_planck_mit( /* 5 - Numpad */
206 _______, KC_PPLS, KC_PMNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, XXXXXXX, _______, 205 _______, KC_PPLS, KC_PMNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, XXXXXXX, _______,
207 _______, KC_PAST, KC_PSLS, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, XXXXXXX, _______, 206 _______, KC_PAST, KC_PSLS, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, XXXXXXX, _______,
208 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX, TO( 0 ), 207 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX, TO( 0 ),
209 _______, _______, _______, _______, _______, XXXXXXX, KC_0, KC_00, KC_DOT, XXXXXXX, _______ ), 208 _______, _______, _______, _______, _______, XXXXXXX, KC_0, KC_00, KC_DOT, XXXXXXX, _______ ),
210 209
211/* MARO Empty 210/* MARO Empty
@@ -279,11 +278,11 @@ static uint16_t TAP_RGB_timer;
279static uint16_t RGB_encoder_timer; 278static uint16_t RGB_encoder_timer;
280 279
281/* Encoder state RGB_display */ 280/* Encoder state RGB_display */
282static uint8_t RGB_encoder_count=6; 281static uint8_t RGB_encoder_count=6;
283static bool RGB_encoder_bool = false; 282static bool RGB_encoder_bool = false;
284 283
285/* RGB tap HUE */ 284/* RGB tap HUE */
286static uint16_t Type_Hue=270; 285static uint16_t Type_Hue=270;
287 286
288void matrix_init_user( void ) 287void matrix_init_user( void )
289{ 288{
@@ -362,7 +361,7 @@ void matrix_scan_user( void )
362 case 1: 361 case 1:
363 rgblight_setrgb_at(0, 255, 0,0); 362 rgblight_setrgb_at(0, 255, 0,0);
364 break; 363 break;
365 } 364 }
366 /* End of Encoder state RGB_display */ 365 /* End of Encoder state RGB_display */
367 366
368 /* Start of Set Encoder Keycode */ 367 /* Start of Set Encoder Keycode */
@@ -435,7 +434,7 @@ void matrix_scan_user( void )
435 case 10: 434 case 10:
436 rgblight_setrgb_at(0, 0,128,11); 435 rgblight_setrgb_at(0, 0,128,11);
437 break; 436 break;
438 } 437 }
439 /* End of Encoder state RGB_display */ 438 /* End of Encoder state RGB_display */
440 439
441 /* Start of Set Encoder Keycode */ 440 /* Start of Set Encoder Keycode */
@@ -465,11 +464,11 @@ void matrix_scan_user( void )
465 unregister_code( KC_VOLU ); 464 unregister_code( KC_VOLU );
466 } 465 }
467 /* End of Set Encoder Keycode */ 466 /* End of Set Encoder Keycode */
468 467
469} 468}
470 469
471/* End of Encoder anti-clockwise */ 470/* End of Encoder anti-clockwise */
472 471
473 encoder_value %= 4; 472 encoder_value %= 4;
474 473
475/* Start of RGB with Layer change */ 474/* Start of RGB with Layer change */
@@ -512,7 +511,7 @@ void matrix_scan_user( void )
512 511
513/* set all the RGB color under the switch */ 512/* set all the RGB color under the switch */
514 rgblight_mode( 1 ); 513 rgblight_mode( 1 );
515 rgblight_setrgb(RGB_Layer_1_Base_Color); 514 rgblight_setrgb(RGB_Layer_1_Base_Color);
516 515
517 /* set each of the RGB led color under the switch */ 516 /* set each of the RGB led color under the switch */
518 rgblight_setrgb_at(64, 64, 64,1); // Q 517 rgblight_setrgb_at(64, 64, 64,1); // Q
@@ -672,7 +671,7 @@ void matrix_scan_user( void )
672 } 671 }
673/* End of RGB with Layer change */ 672/* End of RGB with Layer change */
674 673
675} // End of matrix_scan_user 674} // End of matrix_scan_user
676 675
677 676
678 677
@@ -768,7 +767,7 @@ bool process_record_user( uint16_t keycode, keyrecord_t *record ){
768 }else{ 767 }else{
769 /* If disenable,the 'oFf' key will be red */ 768 /* If disenable,the 'oFf' key will be red */
770 RGB_TAP_STATE=true; 769 RGB_TAP_STATE=true;
771 rgblight_mode( 1 ); 770 rgblight_mode( 1 );
772 rgblight_setrgb( RGB_TAP_Base_Color ); 771 rgblight_setrgb( RGB_TAP_Base_Color );
773 rgblight_setrgb_at(RGB_TAP_On_Color,9); // F - off 772 rgblight_setrgb_at(RGB_TAP_On_Color,9); // F - off
774 } 773 }
diff --git a/keyboards/tetris/keymaps/default/rules.mk b/keyboards/tetris/keymaps/default/rules.mk
new file mode 100644
index 000000000..e5ddcae8d
--- /dev/null
+++ b/keyboards/tetris/keymaps/default/rules.mk
@@ -0,0 +1 @@
TAP_DANCE_ENABLE = yes
diff --git a/keyboards/tetris/rules.mk b/keyboards/tetris/rules.mk
index 40b098ae6..784f6e462 100644
--- a/keyboards/tetris/rules.mk
+++ b/keyboards/tetris/rules.mk
@@ -54,5 +54,7 @@ NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https:
54BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality 54BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
55AUDIO_ENABLE ?= yes 55AUDIO_ENABLE ?= yes
56RGBLIGHT_ENABLE ?= yes 56RGBLIGHT_ENABLE ?= yes
57TAP_DANCE_ENABLE = yes 57TAP_DANCE_ENABLE = no
58EXTRAFLAGS += -flto # Make the hex smaller \ No newline at end of file 58EXTRAFLAGS += -flto # Make the hex smaller
59
60LAYOUTS = planck_mit