aboutsummaryrefslogtreecommitdiff
path: root/keyboards/ergo42
diff options
context:
space:
mode:
authorBiacco42 <secondimpact_2000@yahoo.co.jp>2018-07-21 01:05:45 +0900
committerDrashna Jaelre <drashna@live.com>2018-07-20 09:05:45 -0700
commitd21b287e7d08484c95f0df2e34213d237a62806e (patch)
tree70d7eed56579c3f273597a5bd76b5510c4eaac31 /keyboards/ergo42
parentc50e80e13be5e34505f38eab31374ed2cee31da4 (diff)
downloadqmk_firmware-d21b287e7d08484c95f0df2e34213d237a62806e.tar.gz
qmk_firmware-d21b287e7d08484c95f0df2e34213d237a62806e.zip
Keymap: Underglow support for Ergo42 default-ish keymap (#3431)
* Transprot underglow implementation to default map * Remove needless old lines
Diffstat (limited to 'keyboards/ergo42')
-rw-r--r--keyboards/ergo42/keymaps/default-underglow/config.h43
-rw-r--r--keyboards/ergo42/keymaps/default-underglow/keymap.c133
-rw-r--r--keyboards/ergo42/keymaps/default-underglow/rules.mk1
3 files changed, 177 insertions, 0 deletions
diff --git a/keyboards/ergo42/keymaps/default-underglow/config.h b/keyboards/ergo42/keymaps/default-underglow/config.h
new file mode 100644
index 000000000..bc80be306
--- /dev/null
+++ b/keyboards/ergo42/keymaps/default-underglow/config.h
@@ -0,0 +1,43 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2012 Jun Wako <wakojun@gmail.com>
5Copyright 2015 Jack Humbert
6
7This program is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#ifndef CONFIG_USER_H
22#define CONFIG_USER_H
23
24#include "../../config.h"
25
26/* Use I2C or Serial, not both */
27
28#define USE_SERIAL
29// #define USE_I2C
30
31/* Select hand configuration */
32
33#define MASTER_LEFT
34// #define MASTER_RIGHT
35// #define EE_HANDS
36
37// Underglow
38#undef RGBLED_NUM
39#define RGBLED_NUM 14 // Number of LEDs
40#define RGBLIGHT_ANIMATIONS
41#define RGBLIGHT_SLEEP
42
43#endif
diff --git a/keyboards/ergo42/keymaps/default-underglow/keymap.c b/keyboards/ergo42/keymaps/default-underglow/keymap.c
new file mode 100644
index 000000000..a4d812c5d
--- /dev/null
+++ b/keyboards/ergo42/keymaps/default-underglow/keymap.c
@@ -0,0 +1,133 @@
1#include QMK_KEYBOARD_H
2
3extern keymap_config_t keymap_config;
4
5#define BASE 0
6#define META 1
7#define SYMB 2
8#define GAME 3
9#define RGB 4
10
11// Fillers to make layering more clear
12#define _______ KC_TRNS
13#define XXXXXXX KC_NO
14
15#ifdef RGBLIGHT_ENABLE
16//Following line allows macro to read current RGB settings
17extern rgblight_config_t rgblight_config;
18#endif
19
20enum custom_keycodes {
21 RGB_RST = SAFE_RANGE,
22 TAP_ANIM
23};
24
25const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
26
27 /* BASE
28 * ,------------------------------------------------. ,------------------------------------------------.
29 * | ESC | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | Bksp |
30 * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
31 * | Del | RCtrl| A | S | D | F | G | | H | J | K | L | ; | ] | Enter|
32 * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
33 * | RGB | LSft | Z | X | C | V | B | | N | M | , | . | / | UP | RSft |
34 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
35 * | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT|
36 * `------------------------------------------------' `------------------------------------------------'
37 */
38 [BASE] = LAYOUT( \
39 KC_ESC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_BSPC, \
40 KC_DELT, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RBRC, KC_ENT, \
41 MO(RGB), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \
42 MO(META), KC_LCTL, KC_GRV, KC_BSLS, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_QUOT, KC_MINS, KC_EQL, KC_LEFT, KC_DOWN, KC_RGHT \
43 ),
44
45 /* META
46 * ,------------------------------------------------. ,------------------------------------------------.
47 * | Reset| 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 | Bksp |
48 * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
49 * | Del | F1 | |Muhen | Henk | | | | Left | Down | Up |Right | | | Enter|
50 * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
51 * | RGB | F2 | F3 | F4 | F5 | F6 | { | | } | F7 | F8 | F9 | F10 | F11 | F12 |
52 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
53 * | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | | | |
54 * `------------------------------------------------' `------------------------------------------------'
55 */
56 [META] = LAYOUT( \
57 RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \
58 _______, KC_F1, XXXXXXX, KC_MHEN, KC_HENK, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, _______, \
59 _______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, S(KC_LBRC), S(KC_RBRC), KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
60 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX \
61 ),
62
63 /* SYMB
64 * ,------------------------------------------------. ,------------------------------------------------.
65 * | ESC | ! | @ | # | $ | % | [ | | ] | ^ | & | * | ( | ) | Bksp |
66 * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
67 * | Del | | | | | | ( | | ) | | | | | | Enter|
68 * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
69 * | RGB | | | | | | { | | } | | | | | UP | Sft |
70 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
71 * | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT|
72 * `------------------------------------------------' `------------------------------------------------'
73 */
74 [SYMB] = LAYOUT( \
75 _______, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), KC_LBRC, KC_RBRC, S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), _______, \
76 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_9), S(KC_0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \
77 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_LBRC), S(KC_RBRC), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, \
78 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
79 ),
80
81 /* RGB
82 * ,------------------------------------------------. ,------------------------------------------------.
83 * | | | | | | | | | | | | | | | |
84 * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
85 * | | | | | | | | | | TOG | HUI | SAI | VAI |HUANIM| |
86 * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
87 * | | | | | | | | | | MOD | HUD | SAD | VAD |RESET | |
88 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
89 * | | | | | | | | | | | | | |=>RGB | |
90 * `------------------------------------------------' `------------------------------------------------'
91 */
92 [RGB] = LAYOUT( \
93 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
94 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, TAP_ANIM,XXXXXXX, \
95 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_HUI, RGB_SAD, RGB_VAD, RGB_RST, XXXXXXX, \
96 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \
97 )
98
99};
100
101bool isTapAnim = false;
102
103bool process_record_user(uint16_t keycode, keyrecord_t *record) {
104 switch (keycode) {
105 case RGB_MOD:
106 if (record->event.pressed) {
107 isTapAnim = false;
108 }
109 break;
110 case RGB_RST:
111 #ifdef RGBLIGHT_ENABLE
112 if (record->event.pressed) {
113 eeconfig_update_rgblight_default();
114 rgblight_enable();
115 }
116 #endif
117 break;
118 case TAP_ANIM:
119 if (record->event.pressed) {
120 isTapAnim = !isTapAnim;
121 }
122 break;
123 }
124
125 if (isTapAnim) {
126 rgblight_mode_noeeprom(1);
127 uint16_t hue = (rgblight_config.hue + 5) % 360;
128 rgblight_sethsv_noeeprom(hue, rgblight_config.sat, rgblight_config.val);
129 }
130
131 return true;
132}
133
diff --git a/keyboards/ergo42/keymaps/default-underglow/rules.mk b/keyboards/ergo42/keymaps/default-underglow/rules.mk
new file mode 100644
index 000000000..1e3cebb14
--- /dev/null
+++ b/keyboards/ergo42/keymaps/default-underglow/rules.mk
@@ -0,0 +1 @@
RGBLIGHT_ENABLE = yes