#include QMK_KEYBOARD_H
enum layers {
_BL = 0,
_NV,
_FN
};
enum custom_keycodes {
KC_DBL0 = SAFE_RANGE,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BL] = LAYOUT(
TG(_NV), KC_PSLS, KC_PAST, LT(_FN, KC_PMNS),
KC_P7, KC_P8, KC_P9,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3,
KC_P0, KC_DBL0, KC_PDOT, KC_PENT
),
[_NV] = LAYOUT(
KC_INS, KC_BSPACE, XXXXXXX, TG(_NV),
KC_HOME, KC_UP, KC_PGUP,
KC_LEFT, KC_DEL, KC_RGHT, XXXXXXX,
KC_END, KC_DOWN, KC_PGDN,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
),
[_FN] = LAYOUT(
RGB_MOD, RGB_M_P, RGB_TOG, _______,
RGB_HUD, RGB_HUI, XXXXXXX,
RGB_SAD, RGB_SAI, XXXXXXX, XXXXXXX,
RGB_VAD, RGB_VAI, XXXXXXX,
RESET, XXXXXXX, XXXXXXX, XXXXXXX
),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_DBL0:
if (record->event.pressed) {
SEND_STRING("00");
} else {
}
break;
}
return true;
};
#ifdef OLED_DRIVER_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_270; }
void oled_task_user(void) {
oled_write_P(PSTR("Layer"), false);
switch (get_highest_layer(layer_state)) {
case _BL:
oled_write_ln_P(PSTR(" BAS"), false);
break;
case _NV:
oled_write_ln_P(PSTR(" NAV"), false);
break;
case _FN:
oled_write_ln_P(PSTR(" RGB"), false);
break;
default:
oled_write_ln_P(PSTR(" UND"), false);
}
led_t led_state = host_keyboard_led_state();
oled_write_P(PSTR("-----"), false);
oled_write_P(PSTR("Stats"), false);
oled_write_P(led_state.num_lock ? PSTR("num:*") : PSTR("num:."), false);
oled_write_P(led_state.caps_lock ? PSTR("cap:*") : PSTR("cap:."), false);
oled_write_P(led_state.scroll_lock ? PSTR("scr:*") : PSTR("scr:."), false);
oled_write_P(PSTR("-----"), false);
oled_write_P(PSTR("Light"), false);
static char led_buf[30];
snprintf(led_buf, sizeof(led_buf) - 1, "RGB:%cM: %2d\nh: %2ds: %2dv: %2d\n",
rgblight_is_enabled() ? '*' : '.', (uint8_t)rgblight_get_mode(),
(uint8_t)(rgblight_get_hue() / RGBLIGHT_HUE_STEP),
(uint8_t)(rgblight_get_sat() / RGBLIGHT_SAT_STEP),
(uint8_t)(rgblight_get_val() / RGBLIGHT_VAL_STEP));
oled_write(led_buf, false);
}
#endif