diff options
Diffstat (limited to 'keyboards/anavi/macropad8/keymaps/kodi/keymap.c')
-rw-r--r-- | keyboards/anavi/macropad8/keymaps/kodi/keymap.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/keyboards/anavi/macropad8/keymaps/kodi/keymap.c b/keyboards/anavi/macropad8/keymaps/kodi/keymap.c new file mode 100644 index 000000000..f99a22d72 --- /dev/null +++ b/keyboards/anavi/macropad8/keymaps/kodi/keymap.c | |||
@@ -0,0 +1,81 @@ | |||
1 | #include QMK_KEYBOARD_H | ||
2 | |||
3 | #define _MAIN 0 | ||
4 | #define _FN 1 | ||
5 | |||
6 | #define KC_X0 LT(_FN, KC_ESC) | ||
7 | |||
8 | #ifdef RGBLIGHT_ENABLE | ||
9 | // How long (in ms) to wait between animation steps for the rainbow mode | ||
10 | const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {60, 30, 15}; | ||
11 | // How long (in milliseconds) to wait between animation steps for each of the "Swirling rainbow" animations | ||
12 | const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {20, 10, 4}; | ||
13 | #endif | ||
14 | |||
15 | /** | ||
16 | * Kodi shortcuts: | ||
17 | * | ||
18 | * ESC - Previous menu OR Home screen | ||
19 | * Enter - Select | ||
20 | * X - Stop | ||
21 | * Arrows to move | ||
22 | * | ||
23 | * For details have a look at: | ||
24 | * https://kodi.wiki/view/Keyboard_controls | ||
25 | */ | ||
26 | |||
27 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
28 | [_MAIN] = LAYOUT_ortho_2x4( | ||
29 | KC_ESC, KC_UP, KC_ENTER, KC_X, | ||
30 | KC_LEFT, KC_DOWN, KC_RIGHT, MO(_FN) | ||
31 | ), | ||
32 | |||
33 | [_FN] = LAYOUT_ortho_2x4( | ||
34 | RGB_TOG, RGB_MOD, RGB_M_R, RGB_M_SN, | ||
35 | BL_TOGG, BL_STEP, BL_BRTG, _______ | ||
36 | ) | ||
37 | }; | ||
38 | |||
39 | #ifdef OLED_ENABLE | ||
40 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
41 | return OLED_ROTATION_180; // flips the display 180 degrees if offhand | ||
42 | } | ||
43 | |||
44 | bool oled_task_user(void) { | ||
45 | // Host Keyboard Layer Status | ||
46 | oled_write_ln_P(PSTR("ANAVI Macro Pad 8"), false); | ||
47 | oled_write_P(PSTR("Active layer: "), false); | ||
48 | |||
49 | switch (get_highest_layer(layer_state)) { | ||
50 | case _MAIN: | ||
51 | oled_write_ln_P(PSTR("Kodi"), false); | ||
52 | break; | ||
53 | case _FN: | ||
54 | oled_write_ln_P(PSTR("FN"), false); | ||
55 | break; | ||
56 | default: | ||
57 | // Or use the write_ln shortcut over adding '\n' to the end of your string | ||
58 | oled_write_ln_P(PSTR("N/A"), false); | ||
59 | } | ||
60 | |||
61 | // Host Keyboard LED Status | ||
62 | led_t led_state = host_keyboard_led_state(); | ||
63 | oled_write_P(PSTR("Num Lock: "), false); | ||
64 | oled_write_ln_P(led_state.num_lock ? PSTR("On") : PSTR("Off"), false); | ||
65 | oled_write_P(PSTR("Caps Lock: "), false); | ||
66 | oled_write_ln_P(led_state.caps_lock ? PSTR("On") : PSTR("Off"), false); | ||
67 | oled_write_P(PSTR("Scroll Lock: "), false); | ||
68 | oled_write_ln_P(led_state.scroll_lock ? PSTR("On") : PSTR("Off"), false); | ||
69 | oled_write_P(PSTR("Backlit: "), false); | ||
70 | oled_write_ln_P(is_backlight_enabled() ? PSTR("On") : PSTR("Off"), false); | ||
71 | #ifdef RGBLIGHT_ENABLE | ||
72 | static char rgbStatusLine1[26] = {0}; | ||
73 | snprintf(rgbStatusLine1, sizeof(rgbStatusLine1), "RGB Mode: %d", rgblight_get_mode()); | ||
74 | oled_write_ln(rgbStatusLine1, false); | ||
75 | static char rgbStatusLine2[26] = {0}; | ||
76 | snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val()); | ||
77 | oled_write_ln(rgbStatusLine2, false); | ||
78 | #endif | ||
79 | return false; | ||
80 | } | ||
81 | #endif | ||