Add Retro Shift (Auto Shift for Tap Hold via Retro Tapping) and Custom Auto Shifts (#11059)
* Add Retro Shift and Custom Auto Shifts * Fix compilation errors with no RETRO_SHIFT value
This commit is contained in:
		
							parent
							
								
									282e916d86
								
							
						
					
					
						commit
						d9393b8684
					
				
					 6 changed files with 623 additions and 127 deletions
				
			
		| 
						 | 
				
			
			@ -45,10 +45,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		|||
 | 
			
		||||
int tp_buttons;
 | 
			
		||||
 | 
			
		||||
#if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY)
 | 
			
		||||
#if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
 | 
			
		||||
int retro_tapping_counter = 0;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING)
 | 
			
		||||
#    include "process_auto_shift.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY
 | 
			
		||||
__attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { return false; }
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -69,7 +73,7 @@ void action_exec(keyevent_t event) {
 | 
			
		|||
        dprint("EVENT: ");
 | 
			
		||||
        debug_event(event);
 | 
			
		||||
        dprintln();
 | 
			
		||||
#if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY)
 | 
			
		||||
#if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
 | 
			
		||||
        retro_tapping_counter++;
 | 
			
		||||
#endif
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -106,6 +110,11 @@ void action_exec(keyevent_t event) {
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef NO_ACTION_TAPPING
 | 
			
		||||
#    if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)
 | 
			
		||||
    if (event.pressed) {
 | 
			
		||||
        retroshift_poll_time(&event);
 | 
			
		||||
    }
 | 
			
		||||
#    endif
 | 
			
		||||
    if (IS_NOEVENT(record.event) || pre_process_record_quantum(&record)) {
 | 
			
		||||
        action_tapping_process(record);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -730,7 +739,7 @@ void process_action(keyrecord_t *record, action_t action) {
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef NO_ACTION_TAPPING
 | 
			
		||||
#    if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY)
 | 
			
		||||
#    if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
 | 
			
		||||
    if (!is_tap_action(action)) {
 | 
			
		||||
        retro_tapping_counter = 0;
 | 
			
		||||
    } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -747,7 +756,11 @@ void process_action(keyrecord_t *record, action_t action) {
 | 
			
		|||
                    get_retro_tapping(get_event_keycode(record->event, false), record) &&
 | 
			
		||||
#        endif
 | 
			
		||||
                    retro_tapping_counter == 2) {
 | 
			
		||||
#        if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)
 | 
			
		||||
                    process_auto_shift(action.layer_tap.code, record);
 | 
			
		||||
#        else
 | 
			
		||||
                    tap_code(action.layer_tap.code);
 | 
			
		||||
#        endif
 | 
			
		||||
                }
 | 
			
		||||
                retro_tapping_counter = 0;
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue