Initial commit.
This commit is contained in:
commit
cb1700ee18
4
config.h
Normal file
4
config.h
Normal file
|
@ -0,0 +1,4 @@
|
|||
#define UNICODE_SELECTED_MODES UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_LINUX
|
||||
#define UNICODE_KEY_WINC KC_F14
|
||||
#define UNICODE_KEY_LNX KC_F14
|
||||
#define UNICODE_TYPE_DELAY 50
|
394
keymap.c
Normal file
394
keymap.c
Normal file
|
@ -0,0 +1,394 @@
|
|||
#include QMK_KEYBOARD_H
|
||||
|
||||
enum ctrl_keycodes {
|
||||
U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active
|
||||
U_T_AGCR, //USB Toggle Automatic GCR control
|
||||
DBG_MTRX, //DEBUG Toggle Matrix Prints
|
||||
DBG_KBD, //DEBUG Toggle Keyboard Prints
|
||||
DBG_MOU, //DEBUG Toggle Mouse Prints
|
||||
MD_BOOT, //Restart into bootloader after hold timeout
|
||||
AB_TYPE,
|
||||
AB_FFXIV,
|
||||
AB_GENSHIN,
|
||||
AB_IDLE,
|
||||
AB_DIM,
|
||||
AB_KSP,
|
||||
AB_ROSE, // TODO: delete if we ever figure out unicode support
|
||||
AB_MUSHROOM, // TODO: delete if we ever figure out unicode support
|
||||
};
|
||||
|
||||
enum tapdance_codes {
|
||||
TD_TRIPLE_COMPOSE,
|
||||
TD_TRIPLE_META,
|
||||
};
|
||||
|
||||
enum layer_codes {
|
||||
_LAYER_DEFAULT,
|
||||
_LAYER_QWERTY,
|
||||
_LAYER_PROTECT,
|
||||
_LAYER_FUNCTION,
|
||||
};
|
||||
|
||||
// FIXME: These should be used with UM() for unicode input, but it doesn't seem to work...
|
||||
/* enum unicode_names { */
|
||||
/* AB_MUSHROOM, */
|
||||
/* AB_ROSE, */
|
||||
/* }; */
|
||||
|
||||
/* const uint32_t PROGMEM unicode_map[] = { */
|
||||
/* [AB_MUSHROOM] = 0x1f344, // <20><> */
|
||||
/* [AB_ROSE] = 0x1f339, // <20><> */
|
||||
/* }; */
|
||||
|
||||
keymap_config_t keymap_config;
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_LAYER_DEFAULT] = LAYOUT(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, \
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \
|
||||
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \
|
||||
KC_F14, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \
|
||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, \
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(_LAYER_FUNCTION), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
|
||||
),
|
||||
[_LAYER_QWERTY] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, _______, _______, _______, \
|
||||
_______, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, _______, _______, _______, _______, \
|
||||
_______, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, _______, \
|
||||
_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
// protection mask - triple-tap protection for caps and windows button
|
||||
[_LAYER_PROTECT] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
TD(TD_TRIPLE_COMPOSE), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, TD(TD_TRIPLE_META), _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
[_LAYER_FUNCTION] = LAYOUT(
|
||||
TG(_LAYER_QWERTY), _______, _______, _______, _______, _______, _______, _______, _______, UC_WINC, UC_LINX, _______, DB_TOGG, _______, KC_MUTE, _______, \
|
||||
_______, AB_TYPE, AB_DIM, AB_FFXIV, AB_KSP, AB_IDLE, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \
|
||||
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO, U_T_AGCR, AB_ROSE, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
|
||||
KC_CAPS, AB_MUSHROOM, AB_ROSE, RGB_MOD, RGB_HUD, RGB_SAD, RGB_RMOD, _______, _______, _______, _______, _______, _______, \
|
||||
_______, RGB_TOG, RGB_VAD, _______, _______, MD_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, \
|
||||
_______, TG(_LAYER_PROTECT), _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
/*
|
||||
[X] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
*/
|
||||
};
|
||||
|
||||
// TAP DANCE FUNCTIONS
|
||||
|
||||
void triple_protect_meta(tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 3) {
|
||||
register_code(KC_LGUI);
|
||||
}
|
||||
}
|
||||
|
||||
void triple_protect_meta_reset(tap_dance_state_t *state, void *user_data) {
|
||||
unregister_code(KC_LGUI);
|
||||
}
|
||||
|
||||
void triple_protect_compose(tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 3) {
|
||||
register_code(KC_F14);
|
||||
}
|
||||
}
|
||||
|
||||
void triple_protect_compose_reset(tap_dance_state_t *state, void *user_data) {
|
||||
unregister_code(KC_F14);
|
||||
}
|
||||
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_TRIPLE_META] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, triple_protect_meta, triple_protect_meta_reset),
|
||||
[TD_TRIPLE_COMPOSE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, triple_protect_compose, triple_protect_compose_reset),
|
||||
};
|
||||
|
||||
// END TAP DANCE FUNCTIONS
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
};
|
||||
|
||||
#define MODS_SHIFT (get_mods() & MOD_MASK_SHIFT)
|
||||
#define MODS_CTRL (get_mods() & MOD_MASK_CTRL)
|
||||
#define MODS_ALT (get_mods() & MOD_MASK_ALT)
|
||||
|
||||
// CUSTOM RGB LIGHTING CODE
|
||||
led_t local_led_state;
|
||||
bool led_update_user(led_t led_state) {
|
||||
local_led_state = led_state;
|
||||
return false;
|
||||
}
|
||||
|
||||
#define RGB_DIM 0x55, 0x55, 0x55
|
||||
#define HSV_DIM 0, 0, 0x55
|
||||
|
||||
enum annabunches_mode{
|
||||
ANNABUNCHES_NONE,
|
||||
ANNABUNCHES_TYPE,
|
||||
ANNABUNCHES_FFXIV,
|
||||
ANNABUNCHES_KSP,
|
||||
ANNABUNCHES_GENSHIN,
|
||||
ANNABUNCHES_DIM,
|
||||
ANNABUNCHES_IDLE
|
||||
};
|
||||
enum annabunches_mode custom_mode = 0;
|
||||
|
||||
enum color_map_codes {
|
||||
_COLOR_FFXIV,
|
||||
_COLOR_KSP,
|
||||
_COLOR_GENSHIN,
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM color_map[][119][3] = {
|
||||
[_COLOR_FFXIV] = {
|
||||
{RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_BLUE}, {RGB_BLUE}, {RGB_BLUE}, {RGB_BLUE}, {RGB_BLUE}, {RGB_BLUE}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_BLUE}, {RGB_PURPLE}, {RGB_BLUE}, {RGB_BLUE}, {RGB_BLUE}, {RGB_DIM}, {RGB_DIM}, {RGB_GREEN}, {RGB_GREEN}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_PURPLE}, {RGB_PURPLE}, {RGB_PURPLE}, {RGB_BLUE}, {RGB_YELLOW}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_BLUE}, {RGB_BLUE}, {RGB_BLUE}, {RGB_BLUE}, {RGB_BLUE}, {RGB_YELLOW}, {RGB_RED}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}
|
||||
},
|
||||
[_COLOR_KSP] = {
|
||||
{RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_PURPLE}, {RGB_PURPLE}, {RGB_PURPLE}, {RGB_RED}, {RGB_RED}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_GREEN}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_PURPLE}, {RGB_PURPLE}, {RGB_PURPLE}, {RGB_DIM}, {RGB_GREEN}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_RED}, {RGB_RED}, {RGB_RED}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_GREEN}, {RGB_YELLOW}, {RGB_YELLOW}, {RGB_YELLOW}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_RED}, {RGB_DIM}, {RGB_DIM}, {RGB_RED}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}
|
||||
},
|
||||
[_COLOR_GENSHIN] = {
|
||||
{RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_GREEN}, {RGB_GREEN}, {RGB_GREEN}, {RGB_GREEN}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_BLUE}, {RGB_PURPLE}, {RGB_BLUE}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_PURPLE}, {RGB_PURPLE}, {RGB_PURPLE}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_YELLOW}, {RGB_DIM}, {RGB_YELLOW}, {RGB_DIM}, {RGB_RED}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM},
|
||||
{RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}, {RGB_DIM}
|
||||
}
|
||||
};
|
||||
|
||||
uint8_t PROGMEM rainbow_ring[][3] = {{RGB_RED}, {RGB_ORANGE}, {RGB_YELLOW}, {RGB_GREEN}, {RGB_BLUE}, {RGB_PURPLE}, {RGB_MAGENTA}};
|
||||
uint8_t rainbow_ring_size = 7;
|
||||
uint8_t PROGMEM bisexual_ring[][3] = {{RGB_PURPLE}, {RGB_BLUE}, {RGB_MAGENTA}};
|
||||
uint8_t bisexual_ring_size = 3;
|
||||
|
||||
// set the under-keyboard LED ring to use alternating color pattern
|
||||
void set_led_ring(uint8_t colors[][3], uint8_t num_colors) {
|
||||
for (int i = 87; i < 119; i++) {
|
||||
rgb_matrix_set_color(i, colors[i%num_colors][0], colors[i%num_colors][1], colors[i%num_colors][2]);
|
||||
}
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_user() {
|
||||
switch (custom_mode) {
|
||||
case ANNABUNCHES_FFXIV:
|
||||
for (int i = 0; i < 87; i++) {
|
||||
rgb_matrix_set_color(i, color_map[_COLOR_FFXIV][i][0], color_map[_COLOR_FFXIV][i][1], color_map[_COLOR_FFXIV][i][2]);
|
||||
}
|
||||
set_led_ring(rainbow_ring, rainbow_ring_size);
|
||||
break;
|
||||
case ANNABUNCHES_KSP:
|
||||
for (int i = 0; i < 87; i++) {
|
||||
rgb_matrix_set_color(i, color_map[_COLOR_KSP][i][0], color_map[_COLOR_KSP][i][1], color_map[_COLOR_KSP][i][2]);
|
||||
}
|
||||
set_led_ring(bisexual_ring, bisexual_ring_size);
|
||||
break;
|
||||
case ANNABUNCHES_GENSHIN:
|
||||
for (int i = 0; i < 87; i++) {
|
||||
rgb_matrix_set_color(i, color_map[_COLOR_GENSHIN][i][0], color_map[_COLOR_GENSHIN][i][1], color_map[_COLOR_GENSHIN][i][2]);
|
||||
}
|
||||
set_led_ring(bisexual_ring, bisexual_ring_size);
|
||||
break;
|
||||
case ANNABUNCHES_TYPE:
|
||||
case ANNABUNCHES_IDLE:
|
||||
case ANNABUNCHES_DIM:
|
||||
case ANNABUNCHES_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (IS_LAYER_ON(_LAYER_PROTECT)) {
|
||||
rgb_matrix_set_color(77, RGB_WHITE);
|
||||
}
|
||||
if (IS_LAYER_ON(_LAYER_QWERTY)) {
|
||||
rgb_matrix_set_color(0, RGB_RED);
|
||||
}
|
||||
|
||||
if (local_led_state.caps_lock) {
|
||||
rgb_matrix_set_color(50, RGB_WHITE);
|
||||
}
|
||||
if (local_led_state.scroll_lock) {
|
||||
rgb_matrix_set_color(14, RGB_WHITE);
|
||||
}
|
||||
|
||||
return true; // TODO: if colors get wonky, change this!
|
||||
}
|
||||
|
||||
void annabunches_mode_init(void) {
|
||||
#ifndef RGB_MATRIX_MODE
|
||||
rgb_matrix_enable_noeeprom();
|
||||
#endif
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
custom_mode = ANNABUNCHES_NONE;
|
||||
layer_off(_LAYER_PROTECT);
|
||||
layer_off(_LAYER_QWERTY);
|
||||
}
|
||||
|
||||
void annabunches_mode_type(void) {
|
||||
annabunches_mode_init();
|
||||
rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE);
|
||||
rgb_matrix_set_speed_noeeprom(32);
|
||||
rgb_matrix_sethsv_noeeprom(HSV_PINK);
|
||||
custom_mode = ANNABUNCHES_TYPE;
|
||||
}
|
||||
|
||||
void annabunches_mode_dim(void) {
|
||||
annabunches_mode_init();
|
||||
rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR);
|
||||
rgb_matrix_sethsv_noeeprom(HSV_DIM);
|
||||
custom_mode = ANNABUNCHES_DIM;
|
||||
}
|
||||
|
||||
void annabunches_mode_ffxiv(void) {
|
||||
annabunches_mode_init();
|
||||
layer_on(_LAYER_PROTECT);
|
||||
rgb_matrix_mode_noeeprom(RGB_MATRIX_NONE);
|
||||
custom_mode = ANNABUNCHES_FFXIV;
|
||||
}
|
||||
|
||||
void annabunches_mode_ksp(void) {
|
||||
annabunches_mode_init();
|
||||
rgb_matrix_mode_noeeprom(RGB_MATRIX_NONE);
|
||||
custom_mode = ANNABUNCHES_KSP;
|
||||
}
|
||||
|
||||
void annabunches_mode_genshin(void) {
|
||||
annabunches_mode_init();
|
||||
layer_on(_LAYER_PROTECT);
|
||||
layer_on(_LAYER_QWERTY);
|
||||
rgb_matrix_mode_noeeprom(RGB_MATRIX_NONE);
|
||||
custom_mode = ANNABUNCHES_GENSHIN;
|
||||
}
|
||||
|
||||
void annabunches_mode_idle(void) {
|
||||
annabunches_mode_init();
|
||||
rgb_matrix_mode_noeeprom(RGB_MATRIX_JELLYBEAN_RAINDROPS);
|
||||
custom_mode = ANNABUNCHES_IDLE;
|
||||
}
|
||||
|
||||
// END CUSTOM RGB LIGHTING CODE
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
static uint32_t key_timer;
|
||||
|
||||
switch (keycode) {
|
||||
case U_T_AUTO:
|
||||
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
|
||||
TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode");
|
||||
}
|
||||
return false;
|
||||
case U_T_AGCR:
|
||||
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
|
||||
TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
|
||||
}
|
||||
return false;
|
||||
case DBG_MTRX:
|
||||
if (record->event.pressed) {
|
||||
TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix");
|
||||
}
|
||||
return false;
|
||||
case DBG_KBD:
|
||||
if (record->event.pressed) {
|
||||
TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard");
|
||||
}
|
||||
return false;
|
||||
case DBG_MOU:
|
||||
if (record->event.pressed) {
|
||||
TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse");
|
||||
}
|
||||
return false;
|
||||
case MD_BOOT:
|
||||
if (record->event.pressed) {
|
||||
key_timer = timer_read32();
|
||||
} else {
|
||||
if (timer_elapsed32(key_timer) >= 500) {
|
||||
reset_keyboard();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case RGB_TOG:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case LED_FLAG_UNDERGLOW: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_disable_noeeprom();
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case AB_TYPE:
|
||||
if (record->event.pressed) annabunches_mode_type();
|
||||
return false;
|
||||
case AB_FFXIV:
|
||||
if (record->event.pressed) annabunches_mode_ffxiv();
|
||||
return false;
|
||||
case AB_KSP:
|
||||
if (record->event.pressed) annabunches_mode_ksp();
|
||||
return false;
|
||||
case AB_GENSHIN:
|
||||
if (record->event.pressed) annabunches_mode_genshin();
|
||||
return false;
|
||||
case AB_DIM:
|
||||
if (record->event.pressed) annabunches_mode_dim();
|
||||
return false;
|
||||
case AB_IDLE:
|
||||
if (record->event.pressed) annabunches_mode_idle();
|
||||
return false;
|
||||
case AB_MUSHROOM:
|
||||
if (record->event.pressed) SEND_STRING(SS_TAP(X_F14)"u1f344"SS_TAP(X_ENT));
|
||||
return false;
|
||||
case AB_ROSE:
|
||||
if (record->event.pressed) SEND_STRING(SS_TAP(X_F14)"u1f339"SS_TAP(X_ENT));
|
||||
return false;
|
||||
default:
|
||||
return true; //Process all other keycodes normally
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
annabunches_mode_idle();
|
||||
};
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
debug_keyboard=true;
|
||||
}
|
36
readme.md
Normal file
36
readme.md
Normal file
|
@ -0,0 +1,36 @@
|
|||
This is my custom keymap for the [Drop CTRL](https://drop.com/buy/drop-ctrl-mechanical-keyboard) keyboard.
|
||||
|
||||
### About the Drop CTRL
|
||||
|
||||
Note that I *do not* actually recommend buying one of these keyboards if your needs extend to custom QMK firmware. Drop currently has licensing issues that may result in QMK pulling support for their boards.
|
||||
|
||||
That said, the CTRL is a very attractive TKL keyboard with full QMK support, per-key RGB LEDs and a lightstrip that requires no assembly, and a lightstrip around the edges. It's a gorgeous board that fills a much-needed gap between casual mechanical keyboard enjoyers and hobbyists with the time, energy, and skill to assemble their own boards.
|
||||
|
||||
|
||||
### About this keymap
|
||||
|
||||
My keymap defaults to Dvorak in firmware; that means it will type like a Dvorak keyboard on a computer whose system settings are set to Qwerty. (or any other keymap, probably) It can be switched to Qwerty by pressing `Fn+Esc`, and has a bunch of other fun features including custom RGB light maps for various games I have enjoyed. (Many of them are now essentially deprecated, but that's neither here nor there) Other fun features:
|
||||
|
||||
* Caps lock defaults to `F14`, useful for implementing a dedicated compose key in Wincompose. Caps lock is still accessible by pressing `Fn+Caps Lock`.
|
||||
* `Fn+Win` will disable the Windows and Caps Lock / F14 keys. These keys can still be accessed in this "protected" mode by triple-tapping the key. This allows you to disable those keys while playing games (to avoid accidentally breaking the game input in a stressful moment) but still lets you get to those buttons if you really need them.
|
||||
* `Fn+a` and `Fn+s` print <20><> and <20><> emoji, respectively. For personal reasons.
|
||||
|
||||
This code is a bit of a mess, but I'm sticking it out in the public anyway in classic open source fashion, in case anyone finds it useful.
|
||||
|
||||
### Using this code
|
||||
|
||||
Clone the [QMK firmware](https://github.com/qmk/qmk_firmware) repository, and then clone this repo into the appropriate directory:
|
||||
|
||||
```
|
||||
git clone https://github.com/qmk/qmk_firmware.git keyboards/massdrop/ctrl/ctrl-kbd-annabunches
|
||||
```
|
||||
|
||||
Modify it as you like, then run (from the QMK project's root directory):
|
||||
|
||||
```
|
||||
make massdrop/ctrl:ctrl-kbd-annabunches
|
||||
```
|
||||
|
||||
This should produce a `.bin` file in the `qmk_firmware` directory. You can flash that to the keyboard following Drop's flashing instruction. (I typically scp the file to my Windows machine and use the QMK Toolbox app there, but that's only because the keyboard is connected to my Windows machine)
|
||||
|
||||
The keymap currently builds on QMK firmware commit `71d5d14c139cb9c5e0103aa701ca8bce4be1cd7a`. Successful building on future commits is not guaranteed.
|
Loading…
Reference in New Issue
Block a user