#include "yet-another-developer.h"
uint16_t copy_paste_timer;
__attribute__ ((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
return true;
}
__attribute__ ((weak))
bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
return true;
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef KEYLOGGER_ENABLE
#if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_keebio_iris_rev2)
xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.row, record->event.key.col, record->event.pressed);
#else
xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
#endif
#endif
switch (keycode) {
case KC_QWERTY ... KC_UNICODE:
if (record->event.pressed) {
set_single_persistent_default_layer(keycode - KC_QWERTY);
}
break;
case KC_MAKE: if (!record->event.pressed) {
clear_mods();
clear_oneshot_mods();
send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY);
{
send_string_with_delay_P(PSTR(":flash"), TAP_CODE_DELAY);
}
}
break;
case MC_QT1: if(record->event.pressed){
SEND_STRING("\"\"");
tap_code(KC_LEFT);
}
break;
case MC_QT2: if(record->event.pressed){
SEND_STRING("''");
tap_code(KC_LEFT);
}
break;
case MC_QT3: if(record->event.pressed){
SEND_STRING("`'");
tap_code(KC_LEFT);
}
break;
case MC_PAR: if(record->event.pressed){
SEND_STRING("()");
tap_code(KC_LEFT);
}
break;
case MC_CUR: if(record->event.pressed){
SEND_STRING("{}");
tap_code(KC_LEFT);
}
break;
case MC_SQR: if(record->event.pressed){
SEND_STRING("[]");
tap_code(KC_LEFT);
}
break;
case MC_ABR: if(record->event.pressed){
SEND_STRING("<>");
tap_code(KC_LEFT);
}
break;
case MCT_NEW: if(record->event.pressed){
SEND_STRING(":neww");
tap_code(KC_ENT);
}
break;
case MCT_SH: if(record->event.pressed){
SEND_STRING("%");
}
break;
case MCT_SV: if(record->event.pressed){
SEND_STRING("\"");
}
break;
case MCT_ZM: if(record->event.pressed){
tap_code(KC_Z);
}
break;
case MCT_SCR: if(record->event.pressed){
tap_code(KC_PGUP);
}
break;
case MCT_UP: break;
case MCT_DW: break;
case MCT_LFT: break;
case MCT_RGT: tap_code(KC_RIGHT);
break;
case MCV_B: if(record->event.pressed){
tap_code(KC_0);
}
break;
case MCV_E: if(record->event.pressed){
SEND_STRING(":vsplit");
tap_code(KC_ENT);
}
break;
case MCT_F: if(record->event.pressed){
SEND_STRING(":help");
tap_code(KC_ENT);
}
break;
case VRSN: if (record->event.pressed) {
send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY);
}
break;
case KC_CCCV: if (record->event.pressed) {
copy_paste_timer = timer_read();
} else {
if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { register_code(KC_LCTL);
tap_code(KC_C);
unregister_code(KC_LCTL);
} else { register_code(KC_LCTL);
tap_code(KC_V);
unregister_code(KC_LCTL);
}
}
break;
#ifdef UNICODE_ENABLE
case UC_FLIP:
if (record->event.pressed) {
send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻");
}
break;
case UC_TABL:
if (record->event.pressed) {
send_unicode_string("┬─┬ノ( º _ ºノ)");
}
break;
case UC_SHRG:
if (record->event.pressed) {
send_unicode_string("¯\\_(ツ)_/¯");
}
break;
case UC_DISA:
if (record->event.pressed) {
send_unicode_string("ಠ_ಠ");
}
break;
#endif }
return process_record_keymap(keycode, record) &&
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
process_record_user_rgb(keycode, record) &&
#endif process_record_secrets(keycode, record);
}