Refactor Leader key feature (#19632)
Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
		
							parent
							
								
									d10350cd2c
								
							
						
					
					
						commit
						bbf7a20b33
					
				
					 77 changed files with 2457 additions and 1968 deletions
				
			
		| 
						 | 
				
			
			@ -984,31 +984,26 @@ bool dip_switch_update_user(uint8_t index, bool active) {
 | 
			
		|||
    return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
LEADER_EXTERNS();
 | 
			
		||||
 | 
			
		||||
void matrix_scan_user(void) {
 | 
			
		||||
  LEADER_DICTIONARY() {
 | 
			
		||||
    leading = false;
 | 
			
		||||
    leader_end();
 | 
			
		||||
 | 
			
		||||
    SEQ_ONE_KEY(KC_F) {
 | 
			
		||||
void leader_end_user(void) {
 | 
			
		||||
    if (leader_sequence_one_key(KC_F)) {
 | 
			
		||||
      // Anything you can do in a macro.
 | 
			
		||||
      SEND_STRING("QMK is awesome.");
 | 
			
		||||
    }
 | 
			
		||||
    SEQ_TWO_KEYS(KC_D, KC_D) {
 | 
			
		||||
    if (leader_sequence_two_keys(KC_D, KC_D)) {
 | 
			
		||||
      SEND_STRING(SS_LCTL("a") SS_LCTL("c"));
 | 
			
		||||
    }
 | 
			
		||||
    SEQ_THREE_KEYS(KC_D, KC_D, KC_S) {
 | 
			
		||||
    if (leader_sequence_three_keys(KC_D, KC_D, KC_S)) {
 | 
			
		||||
      SEND_STRING("https://start.duckduckgo.com\n");
 | 
			
		||||
    }
 | 
			
		||||
    SEQ_TWO_KEYS(KC_A, KC_S) {
 | 
			
		||||
    if (leader_sequence_two_keys(KC_A, KC_S)) {
 | 
			
		||||
      register_code(KC_LGUI);
 | 
			
		||||
      register_code(KC_S);
 | 
			
		||||
      unregister_code(KC_S);
 | 
			
		||||
      unregister_code(KC_LGUI);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void matrix_scan_user(void) {
 | 
			
		||||
#ifdef AUDIO_ENABLE
 | 
			
		||||
    if (muse_mode) {
 | 
			
		||||
        if (muse_counter == 0) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue