aboutsummaryrefslogtreecommitdiff
path: root/keyboards/anavi/macropad8/keymaps/obs/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/anavi/macropad8/keymaps/obs/keymap.c')
-rw-r--r--keyboards/anavi/macropad8/keymaps/obs/keymap.c98
1 files changed, 98 insertions, 0 deletions
diff --git a/keyboards/anavi/macropad8/keymaps/obs/keymap.c b/keyboards/anavi/macropad8/keymaps/obs/keymap.c
new file mode 100644
index 000000000..1d9fd38ee
--- /dev/null
+++ b/keyboards/anavi/macropad8/keymaps/obs/keymap.c
@@ -0,0 +1,98 @@
1 /* Copyright 2020 Leon Anavi <[email protected]>
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 _MAIN 0
20#define _FN 1
21
22#define KC_X0 LT(_FN, KC_ESC)
23
24#ifdef RGBLIGHT_ENABLE
25// How long (in ms) to wait between animation steps for the rainbow mode
26const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {60, 30, 15};
27// How long (in milliseconds) to wait between animation steps for each of the "Swirling rainbow" animations
28const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {20, 10, 4};
29#endif
30
31/*
32 * This keymap contains the following shortcuts for OBS:
33 *
34 * - Shortcuts useful for switching scenes on the 1st row:
35 * Hold Left Control, Shift, Alt and GUI and press F9
36 * Hold Left Control, Shift, Alt and GUI and press F10
37 * Hold Left Control, Shift, Alt and GUI and press F11
38 * Hold Left Control, Shift, Alt and GUI and press F12
39 * - Center to screen: Ctrl+D
40 * - Fit to screen: Ctrl+F
41 * - Move source to top of sources list: Ctrl+Home
42 */
43
44const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
45 [_MAIN] = LAYOUT_ortho_2x4(
46 HYPR(KC_F9), HYPR(KC_F10), HYPR(KC_F11), HYPR(KC_F12),
47 LCTL(KC_D), LCTL(KC_F), LCTL(KC_HOME), MO(_FN)
48 ),
49
50 [_FN] = LAYOUT_ortho_2x4(
51 RGB_TOG, RGB_MOD, RGB_M_R, RGB_M_SN,
52 BL_TOGG, BL_STEP, BL_BRTG, _______
53 )
54};
55
56#ifdef OLED_ENABLE
57oled_rotation_t oled_init_user(oled_rotation_t rotation) {
58 return OLED_ROTATION_180; // flips the display 180 degrees if offhand
59}
60
61bool oled_task_user(void) {
62 // Host Keyboard Layer Status
63 oled_write_ln_P(PSTR("ANAVI Macro Pad 8"), false);
64 oled_write_P(PSTR("Active layer: "), false);
65
66 switch (get_highest_layer(layer_state)) {
67 case _MAIN:
68 oled_write_ln_P(PSTR("OBS"), false);
69 break;
70 case _FN:
71 oled_write_ln_P(PSTR("FN"), false);
72 break;
73 default:
74 // Or use the write_ln shortcut over adding '\n' to the end of your string
75 oled_write_ln_P(PSTR("N/A"), false);
76 }
77
78 // Host Keyboard LED Status
79 led_t led_state = host_keyboard_led_state();
80 oled_write_P(PSTR("Num Lock: "), false);
81 oled_write_ln_P(led_state.num_lock ? PSTR("On") : PSTR("Off"), false);
82 oled_write_P(PSTR("Caps Lock: "), false);
83 oled_write_ln_P(led_state.caps_lock ? PSTR("On") : PSTR("Off"), false);
84 oled_write_P(PSTR("Scroll Lock: "), false);
85 oled_write_ln_P(led_state.scroll_lock ? PSTR("On") : PSTR("Off"), false);
86 oled_write_P(PSTR("Backlit: "), false);
87 oled_write_ln_P(is_backlight_enabled() ? PSTR("On") : PSTR("Off"), false);
88#ifdef RGBLIGHT_ENABLE
89 static char rgbStatusLine1[26] = {0};
90 snprintf(rgbStatusLine1, sizeof(rgbStatusLine1), "RGB Mode: %d", rgblight_get_mode());
91 oled_write_ln(rgbStatusLine1, false);
92 static char rgbStatusLine2[26] = {0};
93 snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val());
94 oled_write_ln(rgbStatusLine2, false);
95#endif
96 return false;
97}
98#endif