aboutsummaryrefslogtreecommitdiff
path: root/keyboards/anavi/macropad8/keymaps
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/anavi/macropad8/keymaps')
-rw-r--r--keyboards/anavi/macropad8/keymaps/default/keymap.c61
-rw-r--r--keyboards/anavi/macropad8/keymaps/kodi/keymap.c68
2 files changed, 129 insertions, 0 deletions
diff --git a/keyboards/anavi/macropad8/keymaps/default/keymap.c b/keyboards/anavi/macropad8/keymaps/default/keymap.c
new file mode 100644
index 000000000..8cdf90280
--- /dev/null
+++ b/keyboards/anavi/macropad8/keymaps/default/keymap.c
@@ -0,0 +1,61 @@
1#include QMK_KEYBOARD_H
2
3#define _MAIN 0
4#define _FN 1
5
6#define KC_X0 LT(_FN, KC_ESC)
7
8const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
9 [_MAIN] = LAYOUT_ortho_2x4(
10 G(KC_D), KC_UP, C(KC_C), C(KC_V),
11 KC_LEFT, KC_DOWN, KC_RGHT, MO(_FN)
12 ),
13
14 [_FN] = LAYOUT_ortho_2x4(
15 RGB_TOG, RGB_MOD, RGB_M_R, RGB_M_SN,
16 BL_TOGG, BL_STEP, BL_BRTG, _______
17 )
18};
19
20#ifdef OLED_DRIVER_ENABLE
21oled_rotation_t oled_init_user(oled_rotation_t rotation) {
22 return OLED_ROTATION_180; // flips the display 180 degrees if offhand
23}
24
25void oled_task_user(void) {
26 // Host Keyboard Layer Status
27 oled_write_ln_P(PSTR("ANAVI Macro Pad 8"), false);
28 oled_write_P(PSTR("Active layer:"), false);
29
30 switch (get_highest_layer(layer_state)) {
31 case _MAIN:
32 oled_write_ln_P(PSTR("Main"), false);
33 break;
34 case _FN:
35 oled_write_ln_P(PSTR("FN"), false);
36 break;
37 default:
38 // Or use the write_ln shortcut over adding '\n' to the end of your string
39 oled_write_ln_P(PSTR("N/A"), false);
40 }
41
42 // Host Keyboard LED Status
43 led_t led_state = host_keyboard_led_state();
44 oled_write_P(PSTR("Num Lock: "), false);
45 oled_write_ln_P(led_state.num_lock ? PSTR("On") : PSTR("Off"), false);
46 oled_write_P(PSTR("Caps Lock: "), false);
47 oled_write_ln_P(led_state.caps_lock ? PSTR("On") : PSTR("Off"), false);
48 oled_write_P(PSTR("Scroll Lock: "), false);
49 oled_write_ln_P(led_state.scroll_lock ? PSTR("On") : PSTR("Off"), false);
50 oled_write_P(PSTR("Backlit: "), false);
51 oled_write_ln_P(is_backlight_enabled() ? PSTR("On") : PSTR("Off"), false);
52#ifdef RGBLIGHT_ENABLE
53 static char rgbStatusLine1[26] = {0};
54 snprintf(rgbStatusLine1, sizeof(rgbStatusLine1), "RGB Mode: %d", rgblight_get_mode());
55 oled_write_ln(rgbStatusLine1, false);
56 static char rgbStatusLine2[26] = {0};
57 snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val());
58 oled_write_ln(rgbStatusLine2, false);
59#endif
60}
61#endif
diff --git a/keyboards/anavi/macropad8/keymaps/kodi/keymap.c b/keyboards/anavi/macropad8/keymaps/kodi/keymap.c
new file mode 100644
index 000000000..17b00807e
--- /dev/null
+++ b/keyboards/anavi/macropad8/keymaps/kodi/keymap.c
@@ -0,0 +1,68 @@
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
10const 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
12const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {20, 10, 4};
13#endif
14
15const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
16 [_MAIN] = LAYOUT_ortho_2x4(
17 KC_ESC, KC_UP, KC_ENTER, KC_X,
18 KC_LEFT, KC_DOWN, KC_RIGHT, MO(_FN)
19 ),
20
21 [_FN] = LAYOUT_ortho_2x4(
22 RGB_TOG, RGB_MOD, RGB_M_R, RGB_M_SN,
23 BL_TOGG, BL_STEP, BL_BRTG, _______
24 )
25};
26
27#ifdef OLED_DRIVER_ENABLE
28oled_rotation_t oled_init_user(oled_rotation_t rotation) {
29 return OLED_ROTATION_180; // flips the display 180 degrees if offhand
30}
31
32void oled_task_user(void) {
33 // Host Keyboard Layer Status
34 oled_write_ln_P(PSTR("ANAVI Macro Pad 8"), false);
35 oled_write_P(PSTR("Active layer:"), false);
36
37 switch (get_highest_layer(layer_state)) {
38 case _MAIN:
39 oled_write_ln_P(PSTR("Main"), false);
40 break;
41 case _FN:
42 oled_write_ln_P(PSTR("FN"), false);
43 break;
44 default:
45 // Or use the write_ln shortcut over adding '\n' to the end of your string
46 oled_write_ln_P(PSTR("N/A"), false);
47 }
48
49 // Host Keyboard LED Status
50 led_t led_state = host_keyboard_led_state();
51 oled_write_P(PSTR("Num Lock: "), false);
52 oled_write_ln_P(led_state.num_lock ? PSTR("On") : PSTR("Off"), false);
53 oled_write_P(PSTR("Caps Lock: "), false);
54 oled_write_ln_P(led_state.caps_lock ? PSTR("On") : PSTR("Off"), false);
55 oled_write_P(PSTR("Scroll Lock: "), false);
56 oled_write_ln_P(led_state.scroll_lock ? PSTR("On") : PSTR("Off"), false);
57 oled_write_P(PSTR("Backlit: "), false);
58 oled_write_ln_P(is_backlight_enabled() ? PSTR("On") : PSTR("Off"), false);
59#ifdef RGBLIGHT_ENABLE
60 static char rgbStatusLine1[26] = {0};
61 snprintf(rgbStatusLine1, sizeof(rgbStatusLine1), "RGB Mode: %d", rgblight_get_mode());
62 oled_write_ln(rgbStatusLine1, false);
63 static char rgbStatusLine2[26] = {0};
64 snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val());
65 oled_write_ln(rgbStatusLine2, false);
66#endif
67}
68#endif