Skip to content

Commit

Permalink
Reorganizing userspace
Browse files Browse the repository at this point in the history
  • Loading branch information
willdhorn committed May 30, 2022
1 parent f400900 commit 5344cae
Show file tree
Hide file tree
Showing 26 changed files with 64 additions and 48 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
#define IS_OSL_LAYER(kc) ((kc) >= QK_ONE_SHOT_LAYER && (kc) <= QK_ONE_SHOT_LAYER_MAX)
#define IS_CUSTOM_LK(kc) ( \
(kc) == LAYER_FN_DEF || \
(kc) == LAYER_FN_NAV || \
(kc) == LAYER_FN_EXT || \
(kc) == LAYER_FN_SYM \
)

Expand Down Expand Up @@ -123,7 +123,7 @@

#define IS_VOL_KEY(kc) ((kc) == KC_MUTE || (kc) == KC_VOLD || (kc) == KC_VOLU)
#define IS_MED_KEY(kc) ((kc) == KC_MPRV || (kc) == KC_MNXT || (kc) == KC_MPLY || (kc) == KC_MSTP)
#define IS_RGB_KEY(kc) (((kc) >= RGB_TOG && (kc) <= RGB_MODE_RGBTEST) || (kc) == RGB_MODE_TWINKLE || (kc) == TOGGLE_LAYER_COLOR || (kc) == KC_LAYERCOLOR || (kc) == KC_LED_INC_BRGT || (kc) == KC_LED_DCR_BRGT)
#define IS_RGB_KEY(kc) (false) //(((kc) >= RGB_TOG && (kc) <= RGB_MODE_RGBTEST) || (kc) == RGB_MODE_TWINKLE || (kc) == TOGGLE_LAYER_COLOR || (kc) == KC_LAYERCOLOR || (kc) == KC_LED_INC_BRGT || (kc) == KC_LED_DCR_BRGT)

/* === VSCODE === */
#define IS_VSC_KEY(kc) (IS_VSC_CURSOR(kc) || IS_VSC_SELECT(kc) || IS_VSC_SIDEBAR(kc) || IS_VSC_PROBLEM(kc) || IS_VSC_FNDSRCH(kc) || IS_VSC_GOTO(kc) || IS_VSC_DEBUG(kc) || IS_VSC_REFNCE(kc) || IS_VSC_REFAC(kc) || IS_VSC_EDTFCS(kc) || IS_VSC_EDTSPLT(kc))
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ enum user_layers {
#define EXT_THUMB DEFAULT_THUMB

// SYM
#define SYM_L1 KC_AT, KC_TILD, KC_ASTR, ___, ___
#define SYM_L2 lk_Num, KC_SLSH, KC_MINS, KC_PLUS, ___
#define SYM_L1 KC_AT, TH(thkoTilde), KC_ASTR, ___, ___
#define SYM_L2 lk_Num, TH(thkoSlash), KC_MINS, KC_PLUS, ___
#define SYM_L3 ___, KC_PIPE, KC_AMPR, KC_UNDS, ___

#define SYM_R1 ___, KC_HASH, KC_LBRC, KC_RBRC, ___
#define SYM_R2 ___, KC_EQL, KC_LPRN, KC_RPRN, kEnter
#define SYM_R2 ___, TH(thkoEqual), KC_LPRN, KC_RPRN, kEnter
#define SYM_R3 ___, KC_BSLS, ___, ___, ___

#define SYM_THUMB SYMBOL_THUMB
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,19 @@

#include "willdhorn.h"

/* === KEY OVERRIDES === */

// Generate key_override_t structs
#undef KO_SFT
#undef KO_MEH
#define KO_SFT SFT_KO_DATA
#define KO_MEH MEH_KO_DATA
#include "dicts/key_overrides.def"
#include "key_override.def"

// Fill key overrides array
#undef KO_SFT
#undef KO_MEH
#define KO_SFT KO_ENTRY
#define KO_MEH KO_ENTRY
const key_override_t **key_overrides = (const key_override_t *[]){
#include "dicts/key_overrides.def"
#include "key_override.def"
NULL // Null terminate the array of overrides!
};

/* === TAP HOLD === */

// Fill tap-hold actions array
#undef TH_DEF
#define TH_DEF TH_ACTION
// DON'T MAKE THIS CONST
tap_hold_action_t tap_hold_actions[] = {
#include "dicts/tap_hold.def"
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ KO_SFT(kosft_PeriodExclam, kPeriod, KC_EXLM)
KO_SFT(kosft_ColonSemicolon, KC_COLN, KC_SCLN)
KO_SFT(kosft_SpaceUnderscore, KC_SPACE, KC_UNDS)

KO_SFT(kosft_EqualMacro_NotEqual, KC_EQL, MCR_NEQL)
KO_SFT(kosft_LParenBrace, KC_LPRN, KC_LCBR)
KO_SFT(kosft_RParenBrace, KC_RPRN, KC_RCBR)
KO_SFT(kosft_LBracketAnglebrk, KC_LBRC, KC_LABK)
Expand All @@ -12,5 +11,4 @@ KO_SFT(kosft_HashGrave, KC_HASH, KC_GRV)
KO_SFT(kosft_BackslashPercent, KC_BSLS, KC_PERC)
KO_SFT(kosft_PipeCarrot, KC_PIPE, KC_CRRT)
KO_SFT(kosft_AmpersandDollar, KC_AMPR, KC_DLR)
KO_SFT(kosft_SlashMacro_DirUp, KC_SLSH, MCR_SLUP)
KO_SFT(kosft_TildeMacro_HomeDir, KC_TILDE, MCR_TILD)

File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions users/willdhorn/multikey/tap_hold.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include QMK_KEYBOARD_H

#include "willdhorn.h"

// Fill tap-hold actions array
#undef TH_DEF
#define TH_DEF TH_ACTION
// Unlike combo or key override arrays, this cannot be const since the
// the tap_hold actions contain state information for each tap hold
tap_hold_action_t tap_hold_actions[] = {
#include "tap_hold.def"
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ TAP_HOLD_CMD(thLeft, KC_LEFT)
TAP_HOLD_CMD(thRight, KC_RGHT)
TAP_HOLD_CMD(thAltLeft, ALT(KC_LEFT))
TAP_HOLD_CMD(thAltRight, ALT(KC_RGHT))

// TH_SFT_OVR(name, key, sft)
TH_SFT_OVR(thkoEqual, KC_EQL, MCR_NEQL)
TH_SFT_OVR(thkoTilde, KC_TILDE, MCR_TILD)
TH_SFT_OVR(thkoSlash, KC_SLSH, MCR_SLUP)

Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@
#define TAP_HOLD(name, key, hold) TH_DEF(name, key, LSFT(key), hold, LSFT(hold))
#define TAP_HOLD_CMD(name, key) TH_DEF(name, key, LSFT(key), LCMD(key), LSFT(LCMD(key)))

// replacement for key overrides with custom keycodes
#define TH_SFT_OVR(name, key, sft) TH_DEF(name, key, sft, key, sft)

/*** GENERATE ***/

// Generate enum values for tap-hold actions
#undef TH_DEF
#define TH_DEF TH_ENUM
enum tap_hold_action_keys {
#include "dicts/tap_hold.def"
#include "tap_hold.def"
TAP_HOLD_KEY_MAX
};

1 change: 1 addition & 0 deletions users/willdhorn/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO: This
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include QMK_KEYBOARD_H
#include "print.h"

#include "willdhorn.h"
#include "rgb_stuff.h"

// clang-format off
const HSV layer_colors[] = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#include <stdint.h>

#include "quantum.h"
#include "willdhorn.h"
#include "color.h"

// 16 COLORS THAT ARE VISUALLY DISTINCT
#define H_RED 0
Expand Down
16 changes: 10 additions & 6 deletions users/willdhorn/rules.mk
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
SRC += willdhorn.c
SRC += $(USER_PATH)/quantum/process_tap_hold.c
SRC += $(USER_PATH)/key_behavior/process_record.c
SRC += $(USER_PATH)/key_config/dict_helper.c

SRC += $(USER_PATH)/base/process_record.c

SRC += $(USER_PATH)/multikey/tap_hold.c
SRC += $(USER_PATH)/multikey/process_tap_hold.c

ifeq ($(strip $(KEY_OVERRIDE_ENABLE)), yes)
SRC += $(USER_PATH)/key_override/key_override.c
endif

ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
SRC += $(USER_PATH)/key_behavior/tap_dances.c
SRC += $(USER_PATH)/tap_dance/tap_dances.c
endif

ifeq ($(strip $(RGB_ENABLE)), yes)
SRC += $(USER_PATH)/whistle_bells/rgb/rgb_stuff.c
SRC += $(USER_PATH)/rgb/rgb_stuff.c
endif

# AUDIO NOT TESTED FROM USERSPACE
ifeq ($(strip $(AUDIO_ENABLE)), yes)
SRC += $(USER_PATH)/whistle_bells/audio/audio.c
SRC += $(USER_PATH)/unused/audio/audio.c
endif

File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 18 additions & 15 deletions users/willdhorn/willdhorn.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,29 @@

#include "quantum.h"

#include "quantum/process_tap_hold.h"
#include "quantum/callum_mods.h"
#include "multikey/process_tap_hold.h"
#include "multikey/tap_hold.h"

#include "key_behavior/process_record.h"
#ifdef TAP_DANCE_ENABLE
# include "key_behavior/tap_dances.h"
#endif
#include "base/process_record.h"
#include "base/layers.h"
#include "base/layout.h"
#include "base/keycodes/custom.h"
#include "base/keycodes/key_defines.h"
#include "base/keycodes/mods.h"
#include "base/keycodes/key_tests.h"

//#include "callum_mods/callum_mods.h"

#include "key_config/layers.h"
#include "key_config/layout.h"
#include "key_config/key_override.h"
#include "key_config/tap_hold.h"
#include "key_config/key_tests.h"
#ifdef KEY_OVERRIDE_ENABLE
# include "key_override/key_override.h"
#endif

#include "key_config/keycodes/custom.h"
#include "key_config/keycodes/key_defines.h"
#include "key_config/keycodes/mods.h"
#ifdef TAP_DANCE_ENABLE
# include "tap_dance/tap_dances.h"
#endif

#ifdef RGB_ENABLE
# include "whistle_bells/rgb/rgb_stuff.h"
# include "rgb/rgb_stuff.h"
#endif
// #include "print.h"

Expand Down

0 comments on commit 5344cae

Please sign in to comment.