[Keymap] Add narze userspace (#6652)
* Refactor & reimplement mod tap macros * Reduce tapping term * Update readme * Add narze userspace * Make use of narze userspace * Extract Superduper mode * Refactor Superduper mode * (Ergodox Infinity) Prevent stuck modifiers * Update ergodox_infinity/narze likewise * Add warning for building Infinity with docker * Fix include eeprom.h in superduper * Try enabling superduper mode with combo for ergodox infinity * Apply suggestions on #4546 * Convert to 4 spaces * Map backlight step key * Replace PLAY_NOTE_ARRAY * Fix superduper toggle * Re enable audio in planck rev4 * Use perform_space_cadet * Remove superduper mod tap triggers * Add readme for planck light firmware flashing command * Remove unused layers * Remove unused keycodes * Add backlight toggle * Remove unused songs & use DEFAULT_LAYER_SONGS * Update readme * Move includes to header file
This commit is contained in:
		
							parent
							
								
									6ca29f2b9b
								
							
						
					
					
						commit
						c21281c593
					
				
					 14 changed files with 523 additions and 775 deletions
				
			
		
							
								
								
									
										1
									
								
								users/narze/narze.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								users/narze/narze.c
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
#include "narze.h"
 | 
			
		||||
							
								
								
									
										9
									
								
								users/narze/narze.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								users/narze/narze.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "quantum.h"
 | 
			
		||||
#include "eeconfig.h"
 | 
			
		||||
#include "keymap_colemak.h"
 | 
			
		||||
 | 
			
		||||
#ifdef COMBO_ENABLE
 | 
			
		||||
#   include "superduper.h"
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										18
									
								
								users/narze/readme.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								users/narze/readme.md
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
# TODO
 | 
			
		||||
- [ ] Make SuperDuper mode fully-compatible in Windows by swapping GUI with Ctrl
 | 
			
		||||
 | 
			
		||||
# LICENSE
 | 
			
		||||
Copyright 2019 Manassarn Manoonchai manassarn@gmail.com @narze
 | 
			
		||||
 | 
			
		||||
This program is free software: you can redistribute it and/or modify
 | 
			
		||||
it under the terms of the GNU General Public License as published by
 | 
			
		||||
the Free Software Foundation, either version 2 of the License, or
 | 
			
		||||
(at your option) any later version.
 | 
			
		||||
 | 
			
		||||
This program is distributed in the hope that it will be useful,
 | 
			
		||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
GNU General Public License for more details.
 | 
			
		||||
 | 
			
		||||
You should have received a copy of the GNU General Public License
 | 
			
		||||
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
							
								
								
									
										5
									
								
								users/narze/rules.mk
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								users/narze/rules.mk
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,5 @@
 | 
			
		|||
SRC += narze.c
 | 
			
		||||
 | 
			
		||||
ifeq ($(strip $(COMBO_ENABLE)), yes)
 | 
			
		||||
    SRC += superduper.c
 | 
			
		||||
endif
 | 
			
		||||
							
								
								
									
										66
									
								
								users/narze/superduper.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								users/narze/superduper.c
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,66 @@
 | 
			
		|||
#include "superduper.h"
 | 
			
		||||
#include "eeconfig.h"
 | 
			
		||||
#include "eeprom.h"
 | 
			
		||||
#include "keymap_colemak.h"
 | 
			
		||||
 | 
			
		||||
// SuperDuper
 | 
			
		||||
 | 
			
		||||
#define SUPERDUPER_COMBO_COUNT 3
 | 
			
		||||
#define EECONFIG_SUPERDUPER_INDEX (uint8_t *) 19
 | 
			
		||||
 | 
			
		||||
enum process_combo_event {
 | 
			
		||||
    CB_SUPERDUPER,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum supported_layers {
 | 
			
		||||
    _QWERTY,
 | 
			
		||||
    _COLEMAK,
 | 
			
		||||
    _QWOC
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const uint16_t PROGMEM superduper_combos[SUPERDUPER_COMBO_COUNT][3] = {
 | 
			
		||||
    [_QWERTY] = {KC_S, KC_D, COMBO_END},
 | 
			
		||||
    [_COLEMAK] = {KC_R, KC_S, COMBO_END},
 | 
			
		||||
    [_QWOC] = {CM_S, CM_D, COMBO_END},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
combo_t key_combos[COMBO_COUNT] = {
 | 
			
		||||
    [CB_SUPERDUPER] = COMBO_ACTION(superduper_combos[_QWERTY]),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
volatile bool superduper_enabled = true;
 | 
			
		||||
 | 
			
		||||
const uint16_t PROGMEM empty_combo[] = {COMBO_END};
 | 
			
		||||
 | 
			
		||||
bool toggle_superduper_mode(void) {
 | 
			
		||||
    superduper_enabled = !superduper_enabled;
 | 
			
		||||
 | 
			
		||||
    if (superduper_enabled) {
 | 
			
		||||
        set_superduper_key_combos();
 | 
			
		||||
    } else {
 | 
			
		||||
        clear_superduper_key_combos();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return superduper_enabled;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void set_superduper_key_combo_layer(uint16_t layer) {
 | 
			
		||||
    key_combos[CB_SUPERDUPER].keys = superduper_combos[layer];
 | 
			
		||||
    eeprom_update_byte(EECONFIG_SUPERDUPER_INDEX, layer);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void set_superduper_key_combos(void) {
 | 
			
		||||
    uint8_t layer = eeprom_read_byte(EECONFIG_SUPERDUPER_INDEX);
 | 
			
		||||
 | 
			
		||||
    switch (layer) {
 | 
			
		||||
        case _QWERTY:
 | 
			
		||||
        case _COLEMAK:
 | 
			
		||||
        case _QWOC:
 | 
			
		||||
            key_combos[CB_SUPERDUPER].keys = superduper_combos[layer];
 | 
			
		||||
            break;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void clear_superduper_key_combos(void) {
 | 
			
		||||
    key_combos[CB_SUPERDUPER].keys = empty_combo;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								users/narze/superduper.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								users/narze/superduper.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
#pragma once
 | 
			
		||||
#include "narze.h"
 | 
			
		||||
 | 
			
		||||
bool toggle_superduper_mode(void);
 | 
			
		||||
void set_superduper_key_combo_layer(uint16_t layer);
 | 
			
		||||
void set_superduper_key_combos(void);
 | 
			
		||||
void clear_superduper_key_combos(void);
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue