aboutsummaryrefslogtreecommitdiff
path: root/layouts/community/60_iso
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/community/60_iso')
-rw-r--r--layouts/community/60_iso/unxmaal/config.h7
-rw-r--r--layouts/community/60_iso/unxmaal/keymap.c116
2 files changed, 3 insertions, 120 deletions
diff --git a/layouts/community/60_iso/unxmaal/config.h b/layouts/community/60_iso/unxmaal/config.h
index 7a500b1bb..4a90186ee 100644
--- a/layouts/community/60_iso/unxmaal/config.h
+++ b/layouts/community/60_iso/unxmaal/config.h
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#ifndef KEYMAP_CONFIG_H 18#pragma once
19#define KEYMAP_CONFIG_H
20
21#include QMK_KEYBOARD_CONFIG_H
22 19
23#ifndef RGB_DI_PIN 20#ifndef RGB_DI_PIN
24 #define RGB_DI_PIN F4 21 #define RGB_DI_PIN F4
@@ -28,5 +25,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
28 #define RGBLIGHT_SAT_STEP 8 25 #define RGBLIGHT_SAT_STEP 8
29 #define RGBLIGHT_VAL_STEP 8 26 #define RGBLIGHT_VAL_STEP 8
30#endif 27#endif
31
32#endif
diff --git a/layouts/community/60_iso/unxmaal/keymap.c b/layouts/community/60_iso/unxmaal/keymap.c
index 9441997b4..e1c0454fb 100644
--- a/layouts/community/60_iso/unxmaal/keymap.c
+++ b/layouts/community/60_iso/unxmaal/keymap.c
@@ -90,52 +90,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
90 [_UL] = LAYOUT_60_iso( 90 [_UL] = LAYOUT_60_iso(
91 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \ 91 KC_TRNS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 RGBLED_DECREASE_VAL,
107 SHIFT_ESC,
108};
109
110const uint16_t PROGMEM fn_actions[] = {
111 [4] = ACTION_FUNCTION(RGBLED_TOGGLE), //Turn on/off underglow
112 [5] = ACTION_FUNCTION(RGBLED_STEP_MODE), // Change underglow mode
113 [6] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
114 [7] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
115 [8] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
116 [9] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
117 [10] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
118 [11] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
119 [12] = ACTION_FUNCTION(SHIFT_ESC),
120};
121
122const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
123{
124 // MACRODOWN only works in this function
125 switch(id) {
126 case 0:
127 if (record->event.pressed) {
128 register_code(KC_RSFT);
129 } else {
130 unregister_code(KC_RSFT);
131 }
132 break;
133 }
134 return MACRO_NONE;
135};
136
137void matrix_scan_user(void) { 98void matrix_scan_user(void) {
138
139// Layer LED indicators 99// Layer LED indicators
140// ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster 100// ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster
141 #ifdef KEYBOARD_gh60 101 #ifdef KEYBOARD_gh60
@@ -153,75 +113,3 @@ void matrix_scan_user(void) {
153 } 113 }
154 #endif 114 #endif
155}; 115};
156
157#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
158
159void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
160 switch (id) {
161#ifdef RGBLIGHT_ENABLE
162 case RGBLED_TOGGLE:
163 //led operations
164 if (record->event.pressed) {
165 rgblight_toggle();
166 }
167 break;
168 case RGBLED_INCREASE_HUE:
169 if (record->event.pressed) {
170 rgblight_increase_hue();
171 }
172 break;
173 case RGBLED_DECREASE_HUE:
174 if (record->event.pressed) {
175 rgblight_decrease_hue();
176 }
177 break;
178 case RGBLED_INCREASE_SAT:
179 if (record->event.pressed) {
180 rgblight_increase_sat();
181 }
182 break;
183 case RGBLED_DECREASE_SAT:
184 if (record->event.pressed) {
185 rgblight_decrease_sat();
186 }
187 break;
188 case RGBLED_INCREASE_VAL:
189 if (record->event.pressed) {
190 rgblight_increase_val();
191 }
192 break;
193 case RGBLED_DECREASE_VAL:
194 if (record->event.pressed) {
195 rgblight_decrease_val();
196 }
197 break;
198 case RGBLED_STEP_MODE:
199 if (record->event.pressed) {
200 rgblight_step();
201 }
202 break;
203#endif
204 static uint8_t shift_esc_shift_mask;
205 // Shift + ESC = ~
206 case SHIFT_ESC:
207 shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
208 if (record->event.pressed) {
209 if (shift_esc_shift_mask) {
210 add_key(KC_GRV);
211 send_keyboard_report();
212 } else {
213 add_key(KC_ESC);
214 send_keyboard_report();
215 }
216 } else {
217 if (shift_esc_shift_mask) {
218 del_key(KC_GRV);
219 send_keyboard_report();
220 } else {
221 del_key(KC_ESC);
222 send_keyboard_report();
223 }
224 }
225 break;
226 }
227};