[Keymap] Add my personal userspace and update my keymaps (#5128)
* Add billypython userspace and dz60 keymap * Disable Bootmagic in dz60:billypython keymap * Update whitefox:billypython keymap with userspace changes Also remove numpad layer
This commit is contained in:
committed by
Drashna Jaelre
parent
ce465c084b
commit
1e6797b4e7
32
users/billypython/billypython.c
Normal file
32
users/billypython/billypython.c
Normal file
@ -0,0 +1,32 @@
|
||||
#include "billypython.h"
|
||||
|
||||
__attribute__((weak))
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_keymap(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (keycode) {
|
||||
case CLEAR:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE));
|
||||
}
|
||||
return false;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((weak))
|
||||
uint32_t layer_state_set_keymap(uint32_t state) {
|
||||
return state;
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
return layer_state_set_keymap(state);
|
||||
}
|
34
users/billypython/billypython.h
Normal file
34
users/billypython/billypython.h
Normal file
@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
#include "tap_dance.h"
|
||||
#endif
|
||||
|
||||
#ifdef LAYER_FN
|
||||
#define FN MO(L_FN)
|
||||
#define FN_CAPS LT(L_FN, KC_CAPS)
|
||||
#define FN_FNLK TT(L_FN)
|
||||
#endif
|
||||
|
||||
#define TOP LCTL(KC_HOME)
|
||||
#define BOTTOM LCTL(KC_END)
|
||||
|
||||
enum keycodes_user {
|
||||
CLEAR = SAFE_RANGE,
|
||||
|
||||
RANGE_KEYMAP,
|
||||
};
|
||||
|
||||
enum layers_user {
|
||||
L_BASE,
|
||||
#ifdef LAYER_FN
|
||||
L_FN,
|
||||
#endif
|
||||
|
||||
L_RANGE_KEYMAP,
|
||||
};
|
||||
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
|
||||
uint32_t layer_state_set_keymap(uint32_t state);
|
19
users/billypython/config.h
Normal file
19
users/billypython/config.h
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#define FORCE_NKRO
|
||||
|
||||
#define MAGIC_KEY_BOOTLOADER B
|
||||
|
||||
#define MOUSEKEY_DELAY 50
|
||||
#define MOUSEKEY_INTERVAL 15
|
||||
#define MOUSEKEY_MAX_SPEED 4
|
||||
#define MOUSEKEY_TIME_TO_MAX 50
|
||||
#define MOUSEKEY_WHEEL_MAX_SPEED 1
|
||||
#define MOUSEKEY_WHEEL_TIME_TO_MAX 50
|
||||
|
||||
#define NO_ACTION_FUNCTION
|
||||
#define NO_ACTION_MACRO
|
||||
|
||||
#define PERMISSIVE_HOLD
|
||||
#define TAPPING_TERM 200
|
||||
#define TAPPING_TOGGLE 2
|
6
users/billypython/rules.mk
Normal file
6
users/billypython/rules.mk
Normal file
@ -0,0 +1,6 @@
|
||||
SRC += billypython.c
|
||||
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
|
||||
SRC += tap_dance.c
|
||||
endif
|
||||
|
||||
EXTRAFLAGS += -flto
|
33
users/billypython/tap_dance.c
Normal file
33
users/billypython/tap_dance.c
Normal file
@ -0,0 +1,33 @@
|
||||
#include "tap_dance.h"
|
||||
|
||||
#define ACTION_TAP_DANCE_DOUBLE_MODS(mod1, mod2) { \
|
||||
.fn = { td_double_mods_each, NULL, td_double_mods_reset }, \
|
||||
.user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \
|
||||
}
|
||||
|
||||
void td_double_mods_each(qk_tap_dance_state_t *state, void *user_data) {
|
||||
qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data;
|
||||
// Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2
|
||||
if (state->count == 1 || state->count == 3) {
|
||||
register_code(mods->kc1);
|
||||
} else if (state->count == 2) {
|
||||
unregister_code(mods->kc1);
|
||||
register_code(mods->kc2);
|
||||
}
|
||||
// Prevent tap dance from sending kc1 and kc2 as weak mods
|
||||
state->weak_mods &= ~(MOD_BIT(mods->kc1) | MOD_BIT(mods->kc2));
|
||||
}
|
||||
|
||||
void td_double_mods_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data;
|
||||
if (state->count == 1 || state->count >= 3) {
|
||||
unregister_code(mods->kc1);
|
||||
}
|
||||
if (state->count >= 2) {
|
||||
unregister_code(mods->kc2);
|
||||
}
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_RSF_RCT] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RSFT, KC_RCTL),
|
||||
};
|
9
users/billypython/tap_dance.h
Normal file
9
users/billypython/tap_dance.h
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define RSF_RCT TD(TD_RSF_RCT)
|
||||
|
||||
enum tap_dance {
|
||||
TD_RSF_RCT,
|
||||
};
|
Reference in New Issue
Block a user