diff options
Diffstat (limited to 'layouts/community/ergodox/belak')
| -rw-r--r-- | layouts/community/ergodox/belak/keymap.c | 35 | ||||
| -rw-r--r-- | layouts/community/ergodox/belak/visualizer.c | 49 |
2 files changed, 15 insertions, 69 deletions
diff --git a/layouts/community/ergodox/belak/keymap.c b/layouts/community/ergodox/belak/keymap.c index bca0dec91..de0fe1b1a 100644 --- a/layouts/community/ergodox/belak/keymap.c +++ b/layouts/community/ergodox/belak/keymap.c | |||
| @@ -33,11 +33,6 @@ enum belak_keycodes { | |||
| 33 | E_TSET, | 33 | E_TSET, |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | inline void tap(uint16_t keycode) { | ||
| 37 | register_code(keycode); | ||
| 38 | unregister_code(keycode); | ||
| 39 | }; | ||
| 40 | |||
| 41 | // TODO: Add LED support to the tap dance by using the advanced macro | 36 | // TODO: Add LED support to the tap dance by using the advanced macro |
| 42 | #define LTOGGLE TD(TD_LAYER_TOGGLE) | 37 | #define LTOGGLE TD(TD_LAYER_TOGGLE) |
| 43 | 38 | ||
| @@ -273,17 +268,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 273 | case E_SHRUG: // ¯\_(ツ)_/¯ | 268 | case E_SHRUG: // ¯\_(ツ)_/¯ |
| 274 | if (record->event.pressed) { | 269 | if (record->event.pressed) { |
| 275 | process_unicode((0x00AF|QK_UNICODE), record); // Hand | 270 | process_unicode((0x00AF|QK_UNICODE), record); // Hand |
| 276 | tap(KC_BSLS); // Arm | 271 | tap_code16(KC_BSLS); // Arm |
| 277 | register_code(KC_RSFT); | 272 | register_code(KC_RSFT); |
| 278 | tap(KC_UNDS); // Arm | 273 | tap_code16(KC_UNDS); // Arm |
| 279 | tap(KC_LPRN); // Head | 274 | tap_code16(KC_LPRN); // Head |
| 280 | unregister_code(KC_RSFT); | 275 | unregister_code(KC_RSFT); |
| 281 | process_unicode((0x30C4|QK_UNICODE), record); // Face | 276 | process_unicode((0x30C4|QK_UNICODE), record); // Face |
| 282 | register_code(KC_RSFT); | 277 | register_code(KC_RSFT); |
| 283 | tap(KC_RPRN); // Head | 278 | tap_code16(KC_RPRN); // Head |
| 284 | tap(KC_UNDS); // Arm | 279 | tap_code16(KC_UNDS); // Arm |
| 285 | unregister_code(KC_RSFT); | 280 | unregister_code(KC_RSFT); |
| 286 | tap(KC_SLSH); // Arm | 281 | tap_code16(KC_SLSH); // Arm |
| 287 | process_unicode((0x00AF|QK_UNICODE), record); // Hand | 282 | process_unicode((0x00AF|QK_UNICODE), record); // Hand |
| 288 | } | 283 | } |
| 289 | return false; | 284 | return false; |
| @@ -291,19 +286,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 291 | case E_TFLIP: // (╯°□°)╯ ︵ ┻━┻ | 286 | case E_TFLIP: // (╯°□°)╯ ︵ ┻━┻ |
| 292 | if (record->event.pressed) { | 287 | if (record->event.pressed) { |
| 293 | register_code(KC_RSFT); | 288 | register_code(KC_RSFT); |
| 294 | tap(KC_9); | 289 | tap_code16(KC_9); |
| 295 | unregister_code(KC_RSFT); | 290 | unregister_code(KC_RSFT); |
| 296 | process_unicode((0x256F|QK_UNICODE), record); // Arm | 291 | process_unicode((0x256F|QK_UNICODE), record); // Arm |
| 297 | process_unicode((0x00B0|QK_UNICODE), record); // Eye | 292 | process_unicode((0x00B0|QK_UNICODE), record); // Eye |
| 298 | process_unicode((0x25A1|QK_UNICODE), record); // Mouth | 293 | process_unicode((0x25A1|QK_UNICODE), record); // Mouth |
| 299 | process_unicode((0x00B0|QK_UNICODE), record); // Eye | 294 | process_unicode((0x00B0|QK_UNICODE), record); // Eye |
| 300 | register_code(KC_RSFT); | 295 | register_code(KC_RSFT); |
| 301 | tap(KC_0); | 296 | tap_code16(KC_0); |
| 302 | unregister_code(KC_RSFT); | 297 | unregister_code(KC_RSFT); |
| 303 | process_unicode((0x256F|QK_UNICODE), record); // Arm | 298 | process_unicode((0x256F|QK_UNICODE), record); // Arm |
| 304 | tap(KC_SPC); | 299 | tap_code16(KC_SPC); |
| 305 | process_unicode((0x0361|QK_UNICODE), record); // Flippy | 300 | process_unicode((0x0361|QK_UNICODE), record); // Flippy |
| 306 | tap(KC_SPC); | 301 | tap_code16(KC_SPC); |
| 307 | process_unicode((0x253B|QK_UNICODE), record); // Table | 302 | process_unicode((0x253B|QK_UNICODE), record); // Table |
| 308 | process_unicode((0x2501|QK_UNICODE), record); // Table | 303 | process_unicode((0x2501|QK_UNICODE), record); // Table |
| 309 | process_unicode((0x253B|QK_UNICODE), record); // Table | 304 | process_unicode((0x253B|QK_UNICODE), record); // Table |
| @@ -316,18 +311,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 316 | process_unicode((0x2500|QK_UNICODE), record); // Table | 311 | process_unicode((0x2500|QK_UNICODE), record); // Table |
| 317 | process_unicode((0x2500|QK_UNICODE), record); // Table | 312 | process_unicode((0x2500|QK_UNICODE), record); // Table |
| 318 | process_unicode((0x252C|QK_UNICODE), record); // Table | 313 | process_unicode((0x252C|QK_UNICODE), record); // Table |
| 319 | tap(KC_SPC); | 314 | tap_code16(KC_SPC); |
| 320 | process_unicode((0x30CE|QK_UNICODE), record); // Arm | 315 | process_unicode((0x30CE|QK_UNICODE), record); // Arm |
| 321 | register_code(KC_RSFT); | 316 | register_code(KC_RSFT); |
| 322 | tap(KC_9); | 317 | tap_code16(KC_9); |
| 323 | unregister_code(KC_RSFT); | 318 | unregister_code(KC_RSFT); |
| 324 | tap(KC_SPC); | 319 | tap_code16(KC_SPC); |
| 325 | process_unicode((0x309C|QK_UNICODE), record); // Eye | 320 | process_unicode((0x309C|QK_UNICODE), record); // Eye |
| 326 | tap(KC_MINS); | 321 | tap_code16(KC_MINS); |
| 327 | process_unicode((0x309C|QK_UNICODE), record); // Eye | 322 | process_unicode((0x309C|QK_UNICODE), record); // Eye |
| 328 | process_unicode((0x30CE|QK_UNICODE), record); // Arm | 323 | process_unicode((0x30CE|QK_UNICODE), record); // Arm |
| 329 | register_code(KC_RSFT); | 324 | register_code(KC_RSFT); |
| 330 | tap(KC_0); | 325 | tap_code16(KC_0); |
| 331 | unregister_code(KC_RSFT); | 326 | unregister_code(KC_RSFT); |
| 332 | } | 327 | } |
| 333 | return false; | 328 | return false; |
diff --git a/layouts/community/ergodox/belak/visualizer.c b/layouts/community/ergodox/belak/visualizer.c deleted file mode 100644 index b92890a66..000000000 --- a/layouts/community/ergodox/belak/visualizer.c +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2017 Fred Sundvik | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | // Currently we are assuming that both the backlight and LCD are enabled | ||
| 19 | // But it's entirely possible to write a custom visualizer that use only | ||
| 20 | // one of them | ||
| 21 | #ifndef LCD_BACKLIGHT_ENABLE | ||
| 22 | #error This visualizer needs that LCD backlight is enabled | ||
| 23 | #endif | ||
| 24 | |||
| 25 | #ifndef LCD_ENABLE | ||
| 26 | #error This visualizer needs that LCD is enabled | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #include "simple_visualizer.h" | ||
| 30 | |||
| 31 | static void get_visualizer_layer_and_color(visualizer_state_t* state) { | ||
| 32 | uint8_t saturation = 60; | ||
| 33 | if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) { | ||
| 34 | saturation = 255; | ||
| 35 | } | ||
| 36 | |||
| 37 | if (state->status.layer & 0x4) { | ||
| 38 | state->target_lcd_color = LCD_COLOR(0, saturation, 0xFF); | ||
| 39 | state->layer_text = "Media"; | ||
| 40 | } | ||
| 41 | else if (state->status.layer & 0x2) { | ||
| 42 | state->target_lcd_color = LCD_COLOR(168, saturation, 0xFF); | ||
| 43 | state->layer_text = "Symbols"; | ||
| 44 | } | ||
| 45 | else { | ||
| 46 | state->target_lcd_color = LCD_COLOR(84, saturation, 0xFF); | ||
| 47 | state->layer_text = "Base"; | ||
| 48 | } | ||
| 49 | } | ||
