bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QMK_REV: if (record->event.pressed) { SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION ":" QMK_BUILDDATE); } return false; break; case KC_WEB: if (record->event.pressed) { SEND_STRING(SS_LGUI("r")); wait_ms(100); SEND_STRING("chrome.exe\n"); } return false; break; case KC_WCLS: if (record->event.pressed) { SEND_STRING (SS_LCTRL("w")); } return false; break; } // Dynamic Macros. if (!process_record_dynamic_macro(keycode, record)) { return false; } return true; }
// For Dynamic Macros. bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_dynamic_macro(keycode, record)) { return false; } return true; }
// Method called at the end of the tap dance on the TAP_MACRO key. That key is // used to start recording a macro (double tap or more), to stop recording (any // number of tap), or to play the recorded macro (1 tap). void macro_tapdance_fn(qk_tap_dance_state_t *state, void *user_data) { uint16_t keycode; keyrecord_t record; dprintf("macro_tap_dance_fn %d\n", state->count); if (is_macro1_recording) { keycode = DYN_REC_STOP; is_macro1_recording = false; layer_state_set_user(current_layer_state); } else if (state->count == 1) { keycode = DYN_MACRO_PLAY1; } else { keycode = DYN_REC_START1; is_macro1_recording = true; layer_state_set_user(current_layer_state); } record.event.pressed = true; process_record_dynamic_macro(keycode, &record); record.event.pressed = false; process_record_dynamic_macro(keycode, &record); }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { uint16_t mask = 1 << (3 - (keycode - FN_A)); if (!process_record_dynamic_macro(keycode, record)) return false; if(FN_A <= keycode && keycode <= FN_D) { if(!(cur_layer_code & mask) == record->event.pressed) { layer_off(cur_layer_code + LY_0000); cur_layer_code ^= mask; layer_on(cur_layer_code + LY_0000); } return false; } return true; }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool try_dynamic_macro = true; if ((keycode == DYN_MACRO_PLAY1 && !did_record_m1) || (keycode == DYN_MACRO_PLAY2 && !did_record_m2)) { try_dynamic_macro = false; } else if (keycode == DM_CLEAR) { try_dynamic_macro = false; did_record_m1 = false; did_record_m2 = false; } if (try_dynamic_macro && !process_record_dynamic_macro(keycode, record)) { if (keycode == DYN_MACRO_PLAY1) { did_record_m1 = true; } if (keycode == DYN_MACRO_PLAY2) { did_record_m2 = true; } if (keycode == DYN_REC_START1 || keycode == DYN_REC_START2) { layer_move(LAYER_RECORD); } else if (keycode == DYN_REC_STOP) { layer_move(LAYER_COLEMAK); } return false; } switch (keycode) { case DYN_MACRO_PLAY1: SEND_STRING(SENDSTRING_MM0); return false; case DYN_MACRO_PLAY2: SEND_STRING(SENDSTRING_MM1); return false; case MM_2: SEND_STRING(SENDSTRING_MM2); return false; case TH_M0 ... TH_LAST: taphold_tapped(keycode - TH_M0, record->event.pressed); return false; } return true; }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { static bool lshift = false; if (!process_record_dynamic_macro(keycode, record)) { return false; } switch (keycode) { case QWERTY: if (record->event.pressed) { set_single_persistent_default_layer(_QWERTY); } return false; break; case WN_SCLN: // コロン「;:」 if (record->event.pressed) { lshift = keyboard_report->mods & MOD_BIT(KC_LSFT); if (lshift) { unregister_code(KC_LSFT); register_code(JP_SCLN); unregister_code(JP_SCLN); } else { register_code(JP_COLN); unregister_code(JP_COLN); } } return false; break; case MCR1: if (record->event.pressed) { SEND_STRING("hoge"); // 送信文字列 } return false; break; case MCR2: if (record->event.pressed) { SEND_STRING("hogehoge"SS_TAP(X_ENTER)); // 送信文字列 } return false; break; case MCR3: if (record->event.pressed) { SEND_STRING("*****@*****.**"); // 送信文字列 } return false; break; } return true; }
void macro_tog_key( qk_tap_dance_state_t *state, void *user_data ) { if ( state->count > 3 ) return; keyrecord_t kr; kr.event.pressed = false; uint16_t action = DYN_REC_STOP; if ( state->count == 1 ) { action = DYN_MACRO_PLAY1; } else if ( state->count == 2 ) { action = DYN_REC_STOP; kr.event.pressed = true; } else if ( state->count == 3 ) { action = DYN_REC_START1; } process_record_dynamic_macro( action, &kr ); }
// Runs for each key down or up event. bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (keycode != TD(TAP_MACRO)) { // That key is processed by the macro_tapdance_fn. Not ignoring it here is // mostly a no-op except that it is recorded in the macros (and uses space). // We can't just return false when the key is a tap dance, because // process_record_user, is called before the tap dance processing (and // returning false would eat the tap dance). if (!process_record_dynamic_macro(keycode, record)) { return false; } if(record->event.pressed) { switch(keycode) { case MC_ARROW: SEND_STRING("=>"); return false; break; } } } return true; // Let QMK send the enter press/release events }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef CFQ_USE_DYNAMIC_MACRO if (!process_record_dynamic_macro(keycode, record)) { return false; } #endif switch (keycode) { /* dynamically generate these. */ case RGB_SLD: if (record->event.pressed) { #ifdef RGBLIGHT_ENABLE rgblight_mode(1); #endif } return false; break; case M_BRACKET_IN_CBR: /* {} */ if (record->event.pressed) { SEND_STRING("{}" SS_TAP(X_LEFT)); return false; } break; case M_BRACKET_IN_PRN: /* () */ if (record->event.pressed) { SEND_STRING("()" SS_TAP(X_LEFT)); return false; } break; case M_BRACKET_IN_BRC: /* [] */ if (record->event.pressed) { SEND_STRING("[]" SS_TAP(X_LEFT)); return false; } break; case M_BRACKET_IN_ANG: /* <> */ if (record->event.pressed) { SEND_STRING("<>" SS_TAP(X_LEFT)); return false; } break; case M_BRACKET_OUT_CBR: /* }{ */ if (record->event.pressed) { SEND_STRING("}{" SS_TAP(X_LEFT)); return false; } break; case M_BRACKET_OUT_PRN: /* )( */ if (record->event.pressed) { SEND_STRING(")(" SS_TAP(X_LEFT)); return false; } break; case M_BRACKET_OUT_BRC: /* ][ */ if (record->event.pressed) { SEND_STRING("][" SS_TAP(X_LEFT)); return false; } break; case M_BRACKET_OUT_ANG: /* >< */ if (record->event.pressed) { SEND_STRING("><" SS_TAP(X_LEFT)); return false; } break; case M_ARROW_LMINUS: /* <- */ if (record->event.pressed) { SEND_STRING("<-"); return false; } break; case M_ARROW_RMINUS: /* -> */ if (record->event.pressed) { SEND_STRING("->"); return false; } break; case M_ARROW_LEQL: /* <= */ if (record->event.pressed) { SEND_STRING("<="); return false; } break; case M_ARROW_REQL: /* => */ if (record->event.pressed) { SEND_STRING("=>"); return false; } break; #ifdef CFQ_USE_SHIFT_QUOTES case KC_LSHIFT: /* '' */ if (record->event.pressed && (keyboard_report->mods & (MOD_BIT(KC_RSFT)))) { WITHOUT_MODS({ SEND_STRING("''" SS_TAP(X_LEFT) SS_DOWN(X_RSHIFT) SS_DOWN(X_LSHIFT)); }); return false; }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { // uint16_t macro_kc = (keycode == ONESHOT ? DYN_REC_STOP : keycode); if (!process_record_dynamic_macro(keycode, record)) { switch(keycode) { case DYN_REC_START1: case DYN_REC_START2: #ifdef AUDIO_ENABLE PLAY_SONG(tone_dyn_macro_rec); #endif break; case DYN_REC_STOP: #ifdef AUDIO_ENABLE PLAY_SONG(tone_dyn_macro_stop); #endif break; } return false; } switch (keycode) { case ONESHOT: if (record->event.pressed) { layer_on(_ONESHOT); set_oneshot_layer(_ONESHOT, ONESHOT_START); clear_oneshot_layer_state(ONESHOT_PRESSED); #ifdef AUDIO_ENABLE PLAY_SONG(tone_oneshot); #endif } return false; break; case QWERTY: if (record->event.pressed) { if (IS_LAYER_ON(_NUMPAD)) { #ifdef AUDIO_ENABLE PLAY_SONG(tone_qwerty); #endif layer_off(_NUMPAD); } } return false; break; case NUMPAD: if (record->event.pressed) { if (!IS_LAYER_ON(_NUMPAD)) { #ifdef AUDIO_ENABLE PLAY_SONG(tone_numpad); #endif layer_on(_NUMPAD); } } return false; break; case RAISE: if (record->event.pressed) { layer_on(_RAISE); update_tri_layer(_RAISE, _LOWER, _FUNCTN); } else { layer_off(_RAISE); update_tri_layer(_RAISE, _LOWER, _FUNCTN); } return false; break; case LOWER: if (record->event.pressed) { layer_on(_LOWER); update_tri_layer(_RAISE, _LOWER, _FUNCTN); } else { layer_off(_LOWER); update_tri_layer(_RAISE, _LOWER, _FUNCTN); } return false; break; case MEDIA: if (record->event.pressed) { layer_on(_MEDIA); } else { layer_off(_MEDIA); } return false; break; } return true; }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_dynamic_macro(keycode, record)) { return false; } switch (keycode) { case QWERTY: if (record->event.pressed) { persistant_default_layer_set(1UL<<_QWERTY); } return false; 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; 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; case MLWR: if (record->event.pressed) { layer_on(_LOWER); layer_on(_MLWR); update_tri_layer(_LOWER, _RAISE, _ADJUST); } else { layer_off(_LOWER); layer_off(_MLWR); update_tri_layer(_LOWER, _RAISE, _ADJUST); } return false; case MRSE: if (record->event.pressed) { layer_on(_RAISE); layer_on(_MRSE); update_tri_layer(_LOWER, _RAISE, _ADJUST); } else { layer_off(_RAISE); layer_off(_MRSE); update_tri_layer(_LOWER, _RAISE, _ADJUST); } return false; case MFNC: if (record->event.pressed) { layer_on(_FUNC); layer_on(_MFNC); } else { layer_off(_FUNC); layer_off(_MFNC); } return false; case MFNC2: if (record->event.pressed) { layer_on(_FUNC2); layer_on(_MFNC2); } else { layer_off(_FUNC2); layer_off(_MFNC2); } return false; } return true; }