Use TAP_CODE_DELAY for encoder mapping by default (#18098)
				
					
				
			This commit is contained in:
		
							parent
							
								
									7ef6c179e4
								
							
						
					
					
						commit
						d910e8df77
					
				
					 2 changed files with 18 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -24,7 +24,8 @@
 | 
			
		|||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#ifndef ENCODER_MAP_KEY_DELAY
 | 
			
		||||
#    define ENCODER_MAP_KEY_DELAY 2
 | 
			
		||||
#    include "action.h"
 | 
			
		||||
#    define ENCODER_MAP_KEY_DELAY TAP_CODE_DELAY
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(ENCODER_RESOLUTIONS) && !defined(ENCODER_RESOLUTION)
 | 
			
		||||
| 
						 | 
				
			
			@ -143,9 +144,14 @@ void encoder_init(void) {
 | 
			
		|||
static void encoder_exec_mapping(uint8_t index, bool clockwise) {
 | 
			
		||||
    // The delays below cater for Windows and its wonderful requirements.
 | 
			
		||||
    action_exec(clockwise ? ENCODER_CW_EVENT(index, true) : ENCODER_CCW_EVENT(index, true));
 | 
			
		||||
#    if ENCODER_MAP_KEY_DELAY > 0
 | 
			
		||||
    wait_ms(ENCODER_MAP_KEY_DELAY);
 | 
			
		||||
#    endif // ENCODER_MAP_KEY_DELAY > 0
 | 
			
		||||
 | 
			
		||||
    action_exec(clockwise ? ENCODER_CW_EVENT(index, false) : ENCODER_CCW_EVENT(index, false));
 | 
			
		||||
#    if ENCODER_MAP_KEY_DELAY > 0
 | 
			
		||||
    wait_ms(ENCODER_MAP_KEY_DELAY);
 | 
			
		||||
#    endif // ENCODER_MAP_KEY_DELAY > 0
 | 
			
		||||
}
 | 
			
		||||
#endif // ENCODER_MAP_ENABLE
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue