diff options
| author | Leon Anavi <leon@anavi.org> | 2020-10-29 10:28:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-29 01:28:13 -0700 |
| commit | 1bfec6ddd974c570d087ba93f0e811e281f817b6 (patch) | |
| tree | 607f7f745c9da3879d332c31233e3a5e02941524 /keyboards/anavi | |
| parent | db9204c7e1d1da9ba041aa34a50e92083d5726e9 (diff) | |
| download | qmk_firmware-1bfec6ddd974c570d087ba93f0e811e281f817b6.tar.gz qmk_firmware-1bfec6ddd974c570d087ba93f0e811e281f817b6.zip | |
[Keymap] Add KiCad keymap for ANAVI Macro Pad 8 (#10766)
KiCad is a cross platform, free and open source electronics design
automation (EDA) suite. It was used to create ANAVI Macro Pad 8.
This keymap contains 2 layers for KiCad hotkeys and a 3rd layer
for controlling the backlighting and the underlighting.
- Layer for KiCad Schematic hotkeys:
m - to move selected component
r - to rotate selected component
w - to wire components
v - to edit component value
F1 - zoom in
F2 - zoom out
F4 - zoom center
- Layer for KiCad PCB layout hotkets:
m - to move selected component
r - to rotate selected component
x - to route a new track
v - to add a via
F1 - zoom in
F2 - zoom out
F4 - zoom center
Signed-off-by: Leon Anavi <leon@anavi.org>
Diffstat (limited to 'keyboards/anavi')
| -rw-r--r-- | keyboards/anavi/macropad8/keymaps/kicad/keymap.c | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/keyboards/anavi/macropad8/keymaps/kicad/keymap.c b/keyboards/anavi/macropad8/keymaps/kicad/keymap.c new file mode 100644 index 000000000..938d0d53f --- /dev/null +++ b/keyboards/anavi/macropad8/keymaps/kicad/keymap.c | |||
| @@ -0,0 +1,117 @@ | |||
| 1 | /* Copyright 2020 Leon Anavi <leon@anavi.org> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include QMK_KEYBOARD_H | ||
| 18 | |||
| 19 | #define _SCH 0 | ||
| 20 | #define _PCB 1 | ||
| 21 | #define _FN 2 | ||
| 22 | |||
| 23 | #define KC_X0 LT(_FN, KC_ESC) | ||
| 24 | |||
| 25 | #ifdef RGBLIGHT_ENABLE | ||
| 26 | // How long (in ms) to wait between animation steps for the rainbow mode | ||
| 27 | const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {60, 30, 15}; | ||
| 28 | // How long (in milliseconds) to wait between animation steps for each of the "Swirling rainbow" animations | ||
| 29 | const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {20, 10, 4}; | ||
| 30 | #endif | ||
| 31 | |||
| 32 | /* | ||
| 33 | * The keymap contains 2 layers for KiCad hotkeys and a 3rd layer | ||
| 34 | * for controlling the backlighting and the underlighting. | ||
| 35 | * | ||
| 36 | * - Layer for KiCad Schematic hotkeys: | ||
| 37 | * m - to move selected component | ||
| 38 | * r - to rotate selected component | ||
| 39 | * w - to wire components | ||
| 40 | * v - to edit component value | ||
| 41 | * F1 - zoom in | ||
| 42 | * F2 - zoom out | ||
| 43 | * F4 - zoom center | ||
| 44 | * | ||
| 45 | * - Layer for KiCad PCB layout hotkets: | ||
| 46 | * m - to move selected component | ||
| 47 | * r - to rotate selected component | ||
| 48 | * x - to route a new track | ||
| 49 | * v - to add a via | ||
| 50 | * F1 - zoom in | ||
| 51 | * F2 - zoom out | ||
| 52 | * F4 - zoom center | ||
| 53 | * | ||
| 54 | */ | ||
| 55 | |||
| 56 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 57 | [_SCH] = LAYOUT_ortho_2x4( | ||
| 58 | KC_M, KC_R, KC_W, KC_V, | ||
| 59 | KC_F1, KC_F2, KC_F4, TO(_PCB) | ||
| 60 | ), | ||
| 61 | |||
| 62 | [_PCB] = LAYOUT_ortho_2x4( | ||
| 63 | KC_M, KC_R, KC_X, KC_V, | ||
| 64 | KC_F1, KC_F2, KC_F4, TO(_FN) | ||
| 65 | ), | ||
| 66 | |||
| 67 | [_FN] = LAYOUT_ortho_2x4( | ||
| 68 | RGB_TOG, RGB_MOD, RGB_M_R, RGB_M_SN, | ||
| 69 | BL_TOGG, BL_STEP, BL_BRTG, TO(_SCH) | ||
| 70 | ) | ||
| 71 | }; | ||
| 72 | |||
| 73 | #ifdef OLED_DRIVER_ENABLE | ||
| 74 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
| 75 | return OLED_ROTATION_180; // flips the display 180 degrees if offhand | ||
| 76 | } | ||
| 77 | |||
| 78 | void oled_task_user(void) { | ||
| 79 | // Host Keyboard Layer Status | ||
| 80 | oled_write_ln_P(PSTR("ANAVI Macro Pad 8"), false); | ||
| 81 | oled_write_P(PSTR("Layer: "), false); | ||
| 82 | |||
| 83 | switch (get_highest_layer(layer_state)) { | ||
| 84 | case _SCH: | ||
| 85 | oled_write_ln_P(PSTR("KiCad Schema"), false); | ||
| 86 | break; | ||
| 87 | case _PCB: | ||
| 88 | oled_write_ln_P(PSTR("KiCad PCB"), false); | ||
| 89 | break; | ||
| 90 | case _FN: | ||
| 91 | oled_write_ln_P(PSTR("FN "), false); | ||
| 92 | break; | ||
| 93 | default: | ||
| 94 | // Or use the write_ln shortcut over adding '\n' to the end of your string | ||
| 95 | oled_write_ln_P(PSTR("N/A"), false); | ||
| 96 | } | ||
| 97 | |||
| 98 | // Host Keyboard LED Status | ||
| 99 | led_t led_state = host_keyboard_led_state(); | ||
| 100 | oled_write_P(PSTR("Num Lock: "), false); | ||
| 101 | oled_write_ln_P(led_state.num_lock ? PSTR("On") : PSTR("Off"), false); | ||
| 102 | oled_write_P(PSTR("Caps Lock: "), false); | ||
| 103 | oled_write_ln_P(led_state.caps_lock ? PSTR("On") : PSTR("Off"), false); | ||
| 104 | oled_write_P(PSTR("Scroll Lock: "), false); | ||
| 105 | oled_write_ln_P(led_state.scroll_lock ? PSTR("On") : PSTR("Off"), false); | ||
| 106 | oled_write_P(PSTR("Backlit: "), false); | ||
| 107 | oled_write_ln_P(is_backlight_enabled() ? PSTR("On") : PSTR("Off"), false); | ||
| 108 | #ifdef RGBLIGHT_ENABLE | ||
| 109 | static char rgbStatusLine1[26] = {0}; | ||
| 110 | snprintf(rgbStatusLine1, sizeof(rgbStatusLine1), "RGB Mode: %d", rgblight_get_mode()); | ||
| 111 | oled_write_ln(rgbStatusLine1, false); | ||
| 112 | static char rgbStatusLine2[26] = {0}; | ||
| 113 | snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val()); | ||
| 114 | oled_write_ln(rgbStatusLine2, false); | ||
| 115 | #endif | ||
| 116 | } | ||
| 117 | #endif | ||
