Keymap introspection for combos. (#19670)
This commit is contained in:
		
							parent
							
								
									433dc60686
								
							
						
					
					
						commit
						5faa23d54c
					
				
					 226 changed files with 533 additions and 729 deletions
				
			
		| 
						 | 
				
			
			@ -2,3 +2,5 @@
 | 
			
		|||
# SPDX-License-Identifier: GPL-2.0-or-later
 | 
			
		||||
 | 
			
		||||
COMBO_ENABLE = yes
 | 
			
		||||
 | 
			
		||||
INTROSPECTION_KEYMAP_C = test_combos.c
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,21 +10,6 @@
 | 
			
		|||
#include "test_fixture.hpp"
 | 
			
		||||
#include "test_keymap_key.hpp"
 | 
			
		||||
 | 
			
		||||
extern "C" {
 | 
			
		||||
enum combos { modtest, osmshift, COMBO_LENGTH };
 | 
			
		||||
uint16_t COMBO_LEN = COMBO_LENGTH;
 | 
			
		||||
 | 
			
		||||
uint16_t const modtest_combo[]  = {KC_Y, KC_U, COMBO_END};
 | 
			
		||||
uint16_t const osmshift_combo[] = {KC_Z, KC_X, COMBO_END};
 | 
			
		||||
 | 
			
		||||
// clang-format off
 | 
			
		||||
combo_t key_combos[] = {
 | 
			
		||||
    [modtest]  = COMBO(modtest_combo, RSFT_T(KC_SPACE)),
 | 
			
		||||
    [osmshift] = COMBO(osmshift_combo, OSM(MOD_LSFT))
 | 
			
		||||
};
 | 
			
		||||
// clang-format on
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
using testing::_;
 | 
			
		||||
using testing::InSequence;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										17
									
								
								tests/combo/test_combos.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								tests/combo/test_combos.c
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
// Copyright 2023 Stefan Kerkmann (@KarlK90)
 | 
			
		||||
// Copyright 2023 @filterpaper
 | 
			
		||||
// Copyright 2023 Nick Brassel (@tzarc)
 | 
			
		||||
// SPDX-License-Identifier: GPL-2.0-or-later
 | 
			
		||||
#include "quantum.h"
 | 
			
		||||
 | 
			
		||||
enum combos { modtest, osmshift };
 | 
			
		||||
 | 
			
		||||
uint16_t const modtest_combo[]  = {KC_Y, KC_U, COMBO_END};
 | 
			
		||||
uint16_t const osmshift_combo[] = {KC_Z, KC_X, COMBO_END};
 | 
			
		||||
 | 
			
		||||
// clang-format off
 | 
			
		||||
combo_t key_combos[] = {
 | 
			
		||||
    [modtest]  = COMBO(modtest_combo, RSFT_T(KC_SPACE)),
 | 
			
		||||
    [osmshift] = COMBO(osmshift_combo, OSM(MOD_LSFT))
 | 
			
		||||
};
 | 
			
		||||
// clang-format on
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue