VIA Protocol 12 + fixes (#19916)
Co-authored-by: Wilba <wilba@wilba.tech> Co-authored-by: zvecr <git@zvecr.com>
This commit is contained in:
		
							parent
							
								
									403b0addea
								
							
						
					
					
						commit
						7f805cc779
					
				
					 135 changed files with 761 additions and 572 deletions
				
			
		| 
						 | 
				
			
			@ -29,7 +29,7 @@ enum layer_names {
 | 
			
		|||
#define KC_DISC_DEAF KC_F24
 | 
			
		||||
 | 
			
		||||
enum custom_keycodes {
 | 
			
		||||
  PROG = USER00,
 | 
			
		||||
  PROG = QK_KB_0,
 | 
			
		||||
  DISC_MUTE,
 | 
			
		||||
  DISC_DEAF,
 | 
			
		||||
  SUPER_ALT_TAB,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,11 +24,9 @@ enum layer_names {
 | 
			
		|||
 | 
			
		||||
#define KC_DISC_MUTE KC_F23
 | 
			
		||||
#define KC_DISC_DEAF KC_F24
 | 
			
		||||
#define NUM_CUST_KEYCODES (_NUM_CUST_KCS - SAFE_RANGE)
 | 
			
		||||
#define VIA_KEYCODE_RANGE USER00
 | 
			
		||||
 | 
			
		||||
enum custom_keycodes {
 | 
			
		||||
  PROG = SAFE_RANGE,
 | 
			
		||||
  PROG = QK_KB_0,
 | 
			
		||||
  DISC_MUTE,
 | 
			
		||||
  DISC_DEAF,
 | 
			
		||||
  SUPER_ALT_TAB,
 | 
			
		||||
| 
						 | 
				
			
			@ -76,17 +74,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 | 
			
		|||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void map_via_keycode(uint16_t * keycode) {
 | 
			
		||||
  if (abs(*keycode - VIA_KEYCODE_RANGE) < NUM_CUST_KEYCODES) { //make into macro?
 | 
			
		||||
    dprintf("VIA custom keycode found, mapping to QMK keycode.\n");
 | 
			
		||||
    uint16_t new_keycode = (*keycode - VIA_KEYCODE_RANGE) + SAFE_RANGE;
 | 
			
		||||
    dprintf("VIA KC: %u QMK KC: %u\n", *keycode, new_keycode);
 | 
			
		||||
    *keycode = new_keycode;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
 | 
			
		||||
  map_via_keycode(&keycode);
 | 
			
		||||
  // Send keystrokes to host keyboard, if connected (see readme)
 | 
			
		||||
  process_record_remote_kb(keycode, record);
 | 
			
		||||
  switch(keycode) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue