[Keymap] add "ridingqwerty" user and keymap for atreus keyboard (#6533)
* add userspace and atreus keymap * cleaning up notes/comments * Update keyboards/atreus/keymaps/ridingqwerty/atreus.c Co-Authored-By: Joel Challis <git@zvecr.com> * Update keyboards/atreus/keymaps/ridingqwerty/atreus.c Co-Authored-By: Joel Challis <git@zvecr.com> * Create readme.md * remove reference to matrix_init_kb from atreus.c * correct atreus.c * remove unnecessary defines * merge register/unregister sequence into single tapcode * move 'LAYOUT to keymap.c; remove atreus.h * remove TAPPING_TERM from keyboard-level config.h
This commit is contained in:
		
							parent
							
								
									36dd261d06
								
							
						
					
					
						commit
						0c03811d6a
					
				
					 10 changed files with 258 additions and 0 deletions
				
			
		
							
								
								
									
										3
									
								
								users/ridingqwerty/config.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								users/ridingqwerty/config.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,3 @@
 | 
			
		|||
#pragma once
 | 
			
		||||
#define TAPPING_TERM 175
 | 
			
		||||
#define MACRO_TIMER 5
 | 
			
		||||
							
								
								
									
										33
									
								
								users/ridingqwerty/process_records.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								users/ridingqwerty/process_records.c
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,33 @@
 | 
			
		|||
#include "ridingqwerty.h"
 | 
			
		||||
 | 
			
		||||
__attribute__ ((weak))
 | 
			
		||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
__attribute__ ((weak))
 | 
			
		||||
bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint16_t user_key_timer;
 | 
			
		||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
 | 
			
		||||
  switch(keycode) {
 | 
			
		||||
    case RG_QUOT:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        user_key_timer = timer_read();
 | 
			
		||||
        layer_on(_NUMBER);
 | 
			
		||||
        register_mods(MOD_BIT(KC_RGUI));
 | 
			
		||||
      } else {
 | 
			
		||||
        unregister_mods(MOD_BIT(KC_RGUI));
 | 
			
		||||
        layer_off(_NUMBER);
 | 
			
		||||
	if (timer_elapsed(user_key_timer) < TAPPING_TERM) {
 | 
			
		||||
          register_code(KC_QUOT);
 | 
			
		||||
	  unregister_code(KC_QUOT);
 | 
			
		||||
	}
 | 
			
		||||
      }
 | 
			
		||||
      return false; break;
 | 
			
		||||
  }
 | 
			
		||||
  return process_record_keymap(keycode, record) &&
 | 
			
		||||
    process_record_secrets(keycode, record);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								users/ridingqwerty/process_records.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								users/ridingqwerty/process_records.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
#pragma once
 | 
			
		||||
#include "ridingqwerty.h"
 | 
			
		||||
 | 
			
		||||
#if defined(KEYMAP_SAFE_RANGE)
 | 
			
		||||
  #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE
 | 
			
		||||
#else
 | 
			
		||||
  #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
 | 
			
		||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
 | 
			
		||||
 | 
			
		||||
enum userspace_custom_keycodes {
 | 
			
		||||
    FIRST = PLACEHOLDER_SAFE_RANGE,
 | 
			
		||||
    RUSTY,
 | 
			
		||||
    FUEL,
 | 
			
		||||
    C0RE,
 | 
			
		||||
    MUNKY,
 | 
			
		||||
    AR1ST,
 | 
			
		||||
    VAXIS,
 | 
			
		||||
    OS_LAB,
 | 
			
		||||
    CDLOCAL,
 | 
			
		||||
    SYSNOC,
 | 
			
		||||
    RG_QUOT,
 | 
			
		||||
    LAST
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
 | 
			
		||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
 | 
			
		||||
							
								
								
									
										1
									
								
								users/ridingqwerty/ridingqwerty.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								users/ridingqwerty/ridingqwerty.c
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
#include "ridingqwerty.h"
 | 
			
		||||
							
								
								
									
										37
									
								
								users/ridingqwerty/ridingqwerty.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								users/ridingqwerty/ridingqwerty.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,37 @@
 | 
			
		|||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "quantum.h"
 | 
			
		||||
#include "process_records.h"
 | 
			
		||||
 | 
			
		||||
enum userspace_layers
 | 
			
		||||
{
 | 
			
		||||
    _QWERTY = 0,
 | 
			
		||||
    _EDITOR,
 | 
			
		||||
    _NUMBER,
 | 
			
		||||
    _SYMBOL,
 | 
			
		||||
    _F_KEYS,
 | 
			
		||||
    _DEBUG,
 | 
			
		||||
    _SECRET,
 | 
			
		||||
    _FINAL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// modtaps
 | 
			
		||||
#define LS_Z MT(MOD_LSFT, KC_Z)
 | 
			
		||||
#define LC_ESC MT(MOD_LCTL, KC_ESC)
 | 
			
		||||
#define LG_TAB MT(MOD_LGUI, KC_TAB)
 | 
			
		||||
#define LA_LBRC MT(MOD_LALT, KC_LBRC)
 | 
			
		||||
#define LS_RBRC MT(MOD_LSFT, KC_RBRC)
 | 
			
		||||
#define RS_MINS MT(MOD_RSFT, KC_MINS)
 | 
			
		||||
#define RA_EQL MT(MOD_RALT, KC_EQL)
 | 
			
		||||
//RG_LMOT defined in process_records.h
 | 
			
		||||
#define RC_ENT MT(MOD_RCTL, KC_ENT)
 | 
			
		||||
#define RS_SLSH MT(MOD_RSFT, KC_SLSH)
 | 
			
		||||
// layertaps
 | 
			
		||||
#define ED_A LT(_EDITOR, KC_A)
 | 
			
		||||
#define ED_ESC LT(_EDITOR, KC_ESC)
 | 
			
		||||
#define NM_SCLN LT(_NUMBER, KC_SCLN)
 | 
			
		||||
#define NM_BSPC LT(_NUMBER, KC_BSPC)
 | 
			
		||||
#define SM_SPC LT(_SYMBOL, KC_SPC)
 | 
			
		||||
#define SC_TAB LT(_SECRET, KC_TAB)
 | 
			
		||||
#define FK_DOT LT(_F_KEYS, KC_DOT)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										8
									
								
								users/ridingqwerty/rules.mk
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								users/ridingqwerty/rules.mk
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
#LEADER_ENABLE = yes
 | 
			
		||||
 | 
			
		||||
SRC += ridingqwerty.c \
 | 
			
		||||
       process_records.c
 | 
			
		||||
 | 
			
		||||
ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
 | 
			
		||||
  SRC += secrets.c
 | 
			
		||||
endif
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue