bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch(keycode) { case QWERTZ: if (record->event.pressed) { set_single_persistent_default_layer(_QWZ); } return false; break; case QWERTY: if (record->event.pressed) { set_single_persistent_default_layer(_QWY); } return false; break; case GAMING: if (record->event.pressed) { set_single_persistent_default_layer(_GAM); } return false; break; case UNI_LNX: set_unicode_input_mode(UC_LNX); return false; break; case UNI_WIN: set_unicode_input_mode(UC_WINC); return false; break; case UNI_MAC: set_unicode_input_mode(UC_OSX); return false; break; } return true; }
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { if (record->event.pressed) { switch(id) { case 0: return MACRO( D(LSFT), T(9), U(LSFT), D(LSFT), T(0), U(LSFT), T(LEFT), END ); case 1: return MACRO( D(LSFT), T(LBRC), U(LSFT), D(LSFT), T(RBRC), U(LSFT), T(LEFT), END ); case 2: return MACRO( T(LBRC), T(RBRC), T(LEFT), END); case 3: clear_keyboard(); case 4: return MACRO( D(LSFT), T(SCOLON), U(LSFT), D(LSFT), T(9), U(LSFT), D(LSFT), T(0), U(LSFT), D(LSFT), T(LBRACKET), U(LSFT), D(LSFT), T(9), U(LSFT), D(LSFT), T(SCOLON), U(LSFT), D(LSFT), T(0), U(LSFT), D(LSFT), T(BSLASH), U(LSFT), D(LSFT), T(SCOLON), U(LSFT), D(LSFT), T(7), U(LSFT), D(LSFT), T(RBRACKET), U(LSFT), T(SCOLON), D(LSFT), T(SCOLON), U(LSFT), END ); case WINSH: set_unicode_input_mode(UC_WIN); return false; break; case WIN: set_unicode_input_mode(UC_WINC); return false; break; case OSX: set_unicode_input_mode(UC_OSX); return false; break; } } return MACRO_NONE; };
void startup_user() { _delay_ms(20); // gets rid of tick set_unicode_input_mode(UC_LNX); #ifdef AUDIO_ENABLE PLAY_SONG(tone_startup); #endif }
void eeconfig_init_user(void) { userspace_config.raw = 0; eeconfig_update_user(userspace_config.raw); #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) set_unicode_input_mode(BOCAJ_UNICODE_MODE); get_unicode_input_mode(); #else eeprom_update_byte(EECONFIG_UNICODEMODE, BOCAJ_UNICODE_MODE); #endif }
// Call user matrix init, set default RGB colors and then // call the keymap's init function void matrix_init_user(void) { userspace_config.raw = eeconfig_read_user(); #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) set_unicode_input_mode(BOCAJ_UNICODE_MODE); get_unicode_input_mode(); #endif //UNICODE_ENABLE matrix_init_keymap(); }
void matrix_init_user() { _delay_ms(500); // give time for usb to initialize set_unicode_input_mode(UC_LNX); #ifdef RGBSPS_ENABLE led_init(); #endif // auto detect output on init #ifdef MODULE_ADAFRUIT_BLE uint8_t output = auto_detect_output(); if (output == OUTPUT_USB) { set_output(OUTPUT_USB); } else { set_output(OUTPUT_BLUETOOTH); } #endif }
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { case M_ALT_HASH: return MACRO_TAP_SHFT_KEY_HOLD_MOD(record, 3, LALT); case M_GR_DASH: { const macro_t* macro = MACRO_TAP_HOLD_LAYER(record, MACRO(T(MINS)), _GR); update_tri_layer(_NUM, _GR, _ADJ); return macro; } case M_SYM_LPRN: return MACRO_TAP_SHFT_KEY_HOLD_LAYER(record, 9, _SYM); case M_NAV_UNDS: return MACRO_TAP_SHFT_KEY_HOLD_LAYER(record, MINS, _NAV); case M_NUM_RPRN: { const macro_t* macro = MACRO_TAP_SHFT_KEY_HOLD_LAYER(record, 0, _NUM); update_tri_layer(_NUM, _GR, _ADJ); return macro; } case M_CTRL_DLR: return MACRO_TAP_SHFT_KEY_HOLD_MOD(record, 4, LCTL); case M_LCBR_ENT: return MACRODOWN(I(10), D(LSFT), T(LBRC), U(LSFT), T(ENT), END); case M_PLOVER: if (record->event.pressed) { layer_and(0); layer_on(_PLOVER); default_layer_set(_PLOVER); // Starts plover return MACRO(I(10), D(E), D(R), D(F), D(V), D(I), D(K), U(E), U(R), U(F), U(V), U(I), U(K), END); } break; case M_EXT_PLV: if (!record->event.pressed) { layer_off(_PLOVER); default_layer_set(_COLEMAK); //Pauses plover return MACRO(I(10), D(E), D(R), D(F), D(V), D(Y), D(U), U(E), U(R), U(F), U(V), U(Y), U(U), END); } break; case M_WINDOWS: set_unicode_input_mode(UC_WIN); break; case M_LINUX: set_unicode_input_mode(UC_LNX); break; case M_OSX: set_unicode_input_mode(UC_OSX); break; case M_FUNCTION: if (record->event.pressed) { SEND_STRING("function"); } break; case M_THEN: if (record->event.pressed) { SEND_STRING("then"); } break; case M_CATCH: if (record->event.pressed) { SEND_STRING("catch"); } break; } return MACRO_NONE; };
void matrix_init_user(){ set_unicode_input_mode(UC_LNX); }
void eeconfig_init_user(void) { set_unicode_input_mode(UC_OSX); }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { static bool lshift = false; static bool rshift = false; static uint8_t layer = 0; lshift = keyboard_report->mods & MOD_BIT(KC_LSFT); rshift = keyboard_report->mods & MOD_BIT(KC_RSFT); layer = biton32(layer_state); #ifdef DOUBLESPACE_LAYER_ENABLE // double-space: send space immediately if any other key depressed before space is released if ((lspace_active ^ rspace_active) && keycode != LSPACE && keycode != RSPACE && record->event.pressed) { if (lspace_active) { if (!lspace_emitted) { register_code(KC_SPC); unregister_code(KC_SPC); } lspace_emitted = true; } if (rspace_active) { if (!rspace_emitted) { register_code(KC_SPC); unregister_code(KC_SPC); } rspace_emitted = true; } } if (layer == _SPACE && keycode != S(KC_TAB) && keycode != KC_TAB && keycode != KC_ESC && keycode != XXXXXXX) { if (record->event.pressed) { unregister_code(KC_LALT); } else { register_code(KC_LALT); } } #endif switch (keycode) { #ifdef DOUBLESPACE_LAYER_ENABLE // double-space enter space layer case LSPACE: process_doublespace(record->event.pressed, &lspace_active, &rspace_active, &lspace_emitted); return false; break; case RSPACE: process_doublespace(record->event.pressed, &rspace_active, &lspace_active, &rspace_emitted); return false; break; #endif // handle greek layer shift case KC_LSFT: case KC_RSFT: ; if (layer == _GREEKU || layer == _GREEKL) { if (record->event.pressed) { layer_on(_GREEKU); layer_off(_GREEKL); } else { if (lshift ^ rshift) { // if only one shift was pressed layer_on(_GREEKL); layer_off(_GREEKU); } } } return true; break; // press both ctrls to activate SYS layer case KC_LCTL: case KC_RCTL: ; bool lctrl = keyboard_report->mods & MOD_BIT(KC_LCTL); bool rctrl = keyboard_report->mods & MOD_BIT(KC_RCTL); if (record->event.pressed) { if (lctrl ^ rctrl) { // if only one ctrl was pressed layer_on(_SYS); } } else { layer_off(_SYS); } return true; break; // QWERTZ style comma and dot: semicolon and colon when shifted case KC_COMM: if (record->event.pressed) { if (lshift || rshift) { if (lshift) unregister_code(KC_LSFT); if (rshift) unregister_code(KC_RSFT); register_code(KC_SCLN); unregister_code(KC_SCLN); if (lshift) register_code(KC_LSFT); if (rshift) register_code(KC_RSFT); } else { register_code(KC_COMM); unregister_code(KC_COMM); } } return false; break; case KC_DOT: if (record->event.pressed) { if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT))) { register_code(KC_SCLN); unregister_code(KC_SCLN); } else { register_code(KC_DOT); unregister_code(KC_DOT); } } return false; break; // layout switchers case QWERTY: if (record->event.pressed) { persistent_default_layer_set(1UL<<_QWERTY); } return false; break; #ifdef LAYOUT_DVORAK case DVORAK: if (record->event.pressed) { persistent_default_layer_set(1UL<<_DVORAK); } return false; break; #endif #ifdef LAYOUT_COLEMAK case COLEMAK: if (record->event.pressed) { persistent_default_layer_set(1UL<<_COLEMAK); } return false; break; #endif #ifdef LAYOUT_WORKMAN case WORKMAN: if (record->event.pressed) { persistent_default_layer_set(1UL<<_WORKMAN); } return false; break; #endif #ifdef LAYOUT_NORMAN case NORMAN: if (record->event.pressed) { persistent_default_layer_set(1UL<<_NORMAN); } return false; break; #endif // only process Fnumber on key release, and only when layer switcher is still pressed. // this is to avoid accidental presses on potentially destructive keys case KC_F1 ... KC_F12: case KC_PAUS: case KC_PSCR: case KC_INS: if (!record->event.pressed && layer == _FUN) { // key released and still in FUN layer register_code(keycode); unregister_code(keycode); } return false; break; // layer switcher // case GREEK: if (record->event.pressed) { if (lshift || rshift) { layer_on(_GREEKU); layer_off(_GREEKL); } else { layer_on(_GREEKL); layer_off(_GREEKU); } } else { layer_off(_GREEKU); layer_off(_GREEKL); } return false; break; // OS switchers case LINUX: set_unicode_input_mode(UC_LNX); #ifdef RGBSPS_ENABLE led_set_unicode_input_mode(); #endif return false; break; case WIN: set_unicode_input_mode(UC_WINC); #ifdef RGBSPS_ENABLE led_set_unicode_input_mode(); #endif return false; break; case OSX: set_unicode_input_mode(UC_OSX); #ifdef RGBSPS_ENABLE led_set_unicode_input_mode(); #endif return false; break; // glow mode changer #ifdef RGBSPS_ENABLE case GLOW: if (record->event.pressed) { glow_mode++; if (glow_mode > GLOW_FULL) { glow_mode = GLOW_NONE; } led_reset(); rgbsps_send(); } return false; break; #endif // faux clicky indicator #ifdef FAUXCLICKY_ENABLE case FC_TOG: #ifdef RGBSPS_ENABLE if (fauxclicky_enabled) { rgbsps_set(LED_IND_AUDIO, THEME_COLOR_AUDIO); } else { rgbsps_set(LED_IND_AUDIO, COLOR_BLANK); } rgbsps_send(); #endif return true; break; #endif #ifdef RGBSPS_DEMO_ENABLE case RGBDEMO: led_demo(); return false; break; #endif } return true; }
void matrix_init_user(void) { set_unicode_input_mode(UC_WINC); }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case LENNY: // ( ͡° ͜ʖ ͡°) if(record->event.pressed){ set_unicode_input_mode(UC_WIN); register_code(KC_LSFT); tap(KC_9); // Head unregister_code(KC_LSFT); tap(KC_SPC); // Space process_unicode((0x0361|QK_UNICODE), record); // Eyebrow process_unicode((0x00B0|QK_UNICODE), record); // Eye tap(KC_SPC); process_unicode((0x035C|QK_UNICODE), record); // Mouth process_unicode((0x0296|QK_UNICODE), record); // Nose tap(KC_SPC); process_unicode((0x0361|QK_UNICODE), record); // Eyebrow process_unicode((0x00B0|QK_UNICODE), record); // Eye register_code(KC_LSFT); tap(KC_0); // Head unregister_code(KC_LSFT); } return false; break; case DWNHRT: // (´・ω・`) if(record->event.pressed){ set_unicode_input_mode(UC_WIN); register_code(KC_LSFT); tap(KC_9); // Head unregister_code(KC_LSFT); process_unicode((0x00B4|QK_UNICODE), record); // Eyebrow process_unicode((0x30FB|QK_UNICODE), record); // Eye process_unicode((0x03C9|QK_UNICODE), record); // Mouth process_unicode((0x30FB|QK_UNICODE), record); // Eye process_unicode((0x0060|QK_UNICODE), record); // Eyebrow register_code(KC_LSFT); tap(KC_0); // Head unregister_code(KC_LSFT); } return false; break; case SHRUG: // ¯\_(ツ)_/¯ if(record->event.pressed){ set_unicode_input_mode(UC_WIN); process_unicode((0x00AF|QK_UNICODE), record); // Hand tap(KC_BSLS); // Arm register_code(KC_LSFT); tap(KC_UNDS); // Arm tap(KC_LPRN); // Head unregister_code(KC_LSFT); process_unicode((0x30C4|QK_UNICODE), record); // Face register_code(KC_LSFT); tap(KC_RPRN); // Head tap(KC_UNDS); // Arm unregister_code(KC_LSFT); tap(KC_SLSH); // Arm process_unicode((0x00AF|QK_UNICODE), record); // Hand } return false; break; } return true; };
void matrix_init_user(void) { _delay_ms(20); // Gets rid of tick set_unicode_input_mode(UC_LNX); }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case COLEMAK: if(record->event.pressed){ persistent_default_layer_set(1UL<<_COLEMAK); #ifdef AUDIO_ENABLE PLAY_SONG(tone_colemak); #endif } return false; break; case SWCOLE: if(record->event.pressed){ persistent_default_layer_set(1UL<<_SWCOLE); #ifdef AUDIO_ENABLE PLAY_SONG(tone_swcole); #endif } return false; break; case RAISE: if(record->event.pressed){ layer_on(_RAISE); update_tri_layer(_LOWER, _RAISE, _ADJUST); } else { layer_off(_RAISE); update_tri_layer(_LOWER, _RAISE, _ADJUST); } return false; break; case LOWER: if(record->event.pressed){ layer_on(_LOWER); update_tri_layer(_LOWER, _RAISE, _ADJUST); } else { layer_off(_LOWER); update_tri_layer(_LOWER, _RAISE, _ADJUST); } return false; break; case SHFT_CAP: if(record->event.pressed){ key_timer = timer_read(); // if the key is being pressed, we start the timer. register_code(KC_LSHIFT); } else { // this means the key was just released (tap or "held down") if(timer_elapsed(key_timer) < 152){ // Time in ms, the threshold we pick for counting something as a tap. tap(KC_CAPS); if(caps_status == 0){ caps_status = 1; #ifdef AUDIO_ENABLE PLAY_SONG(tone_capslock_on); #endif } else { caps_status = 0; #ifdef AUDIO_ENABLE PLAY_SONG(tone_capslock_off); #endif } } unregister_code(KC_LSHIFT); } return false; break; case CTRLB: // Control-B on tap (bold) if(record->event.pressed){ key_timer = timer_read(); // if the key is being pressed, we start the timer. register_code(KC_LCTL); } else { // this means the key was just released (tap or "held down") if (timer_elapsed(key_timer) < 152) { // Time in ms, the threshold we pick for counting something as a tap. tap(KC_B); #ifdef AUDIO_ENABLE PLAY_SONG(tone_ctrl_mod); #endif #ifdef BACKLIGHT_BREATHING breathing_period_set(2); breathing_pulse(); #endif } unregister_code(KC_LCTL); } return false; break; case CPYPST: // One key copy/paste if(record->event.pressed){ key_timer = timer_read(); } else { if (timer_elapsed(key_timer) > 152) { // Hold, copy register_code(KC_LCTL); tap(KC_C); unregister_code(KC_LCTL); #ifdef AUDIO_ENABLE PLAY_SONG(tone_copy); #endif } else { // Tap, paste register_code(KC_LCTL); tap(KC_V); unregister_code(KC_LCTL); #ifdef AUDIO_ENABLE PLAY_SONG(tone_paste); #endif } } return false; break; #ifdef UNICODE_ENABLE case UNIWIN: if(record->event.pressed){ set_unicode_input_mode(UC_WIN); #ifdef AUDIO_ENABLE PLAY_SONG(uniwin); #endif } return false; break; case UNILIN: if(record->event.pressed){ set_unicode_input_mode(UC_LNX); #ifdef AUDIO_ENABLE PLAY_SONG(unilin); #endif } return false; break; case DISFACE: // ಠ_ಠ if(record->event.pressed){ process_unicode((0x0CA0|QK_UNICODE), record); // Eye register_code(KC_RSFT); tap(KC_MINS); unregister_code(KC_RSFT); process_unicode((0x0CA0|QK_UNICODE), record); // Eye } return false; break; case TFLIP: // (╯°□°)╯ ︵ ┻━┻ if(record->event.pressed){ register_code(KC_RSFT); tap(KC_9); unregister_code(KC_RSFT); process_unicode((0x256F|QK_UNICODE), record); // Arm process_unicode((0x00B0|QK_UNICODE), record); // Eye process_unicode((0x25A1|QK_UNICODE), record); // Mouth process_unicode((0x00B0|QK_UNICODE), record); // Eye register_code(KC_RSFT); tap(KC_0); unregister_code(KC_RSFT); process_unicode((0x256F|QK_UNICODE), record); // Arm tap(KC_SPC); process_unicode((0x0361|QK_UNICODE), record); // Flippy tap(KC_SPC); process_unicode((0x253B|QK_UNICODE), record); // Table process_unicode((0x2501|QK_UNICODE), record); // Table process_unicode((0x253B|QK_UNICODE), record); // Table } return false; break; case TPUT: // ┬──┬ ノ( ゜-゜ノ) if(record->event.pressed){ process_unicode((0x252C|QK_UNICODE), record); // Table process_unicode((0x2500|QK_UNICODE), record); // Table process_unicode((0x2500|QK_UNICODE), record); // Table process_unicode((0x252C|QK_UNICODE), record); // Table tap(KC_SPC); process_unicode((0x30CE|QK_UNICODE), record); // Arm register_code(KC_RSFT); tap(KC_9); unregister_code(KC_RSFT); tap(KC_SPC); process_unicode((0x309C|QK_UNICODE), record); // Eye tap(KC_MINS); process_unicode((0x309C|QK_UNICODE), record); // Eye process_unicode((0x30CE|QK_UNICODE), record); // Arm register_code(KC_RSFT); tap(KC_0); unregister_code(KC_RSFT); } return false; break; case SHRUG: // ¯\_(ツ)_/¯ if(record->event.pressed){ process_unicode((0x00AF|QK_UNICODE), record); // Hand tap(KC_BSLS); // Arm register_code(KC_RSFT); tap(KC_UNDS); // Arm tap(KC_LPRN); // Head unregister_code(KC_RSFT); process_unicode((0x30C4|QK_UNICODE), record); // Face register_code(KC_RSFT); tap(KC_RPRN); // Head tap(KC_UNDS); // Arm unregister_code(KC_RSFT); tap(KC_SLSH); // Arm process_unicode((0x00AF|QK_UNICODE), record); // Hand } return false; break; #endif case FACE: // (o_O) if(record->event.pressed){ register_code(KC_RSFT); tap(KC_LPRN); unregister_code(KC_RSFT); tap(KC_O); register_code(KC_RSFT); tap(KC_UNDS); tap(KC_O); tap(KC_RPRN); unregister_code(KC_RSFT); } return false; break; case RANDIG: if (record->event.pressed) { tap_random_base64(); } return false; break; } return true; };