mirror of
https://github.com/qmk/qmk_userspace.git
synced 2025-05-07 08:04:16 -04:00
Migrating over userspace
- existing repo was not forked. Wanted to make sure I was using the standard, not replicating it - Updated the readme.md for the latest mappings
This commit is contained in:
parent
67fac7803e
commit
089b71d77b
43 changed files with 1762 additions and 44 deletions
43
users/t4corun/config.h
Normal file
43
users/t4corun/config.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Set build options for
|
||||
* - consistent configuration across all keyboards
|
||||
* - enable features specific to certain board (e.g. encoders, rgb, oled)
|
||||
* - a way to save memory on MCU
|
||||
*
|
||||
* feature specific inclusions driven by rules.mk
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
//Turn off settings we won't use to save memory
|
||||
#undef LOCKING_SUPPORT_ENABLE
|
||||
#undef LOCKING_RESYNC_ENABLE
|
||||
|
||||
//Clear variables we plan to use that might be set elsewhere
|
||||
#undef USB_POLLING_INTERVAL_MS
|
||||
|
||||
//Set common configuration for all keyboards
|
||||
#define USB_POLLING_INTERVAL_MS 1
|
||||
|
||||
//#include "_layouts.h"
|
||||
#include "config/tapping_config.h"
|
||||
|
||||
#if defined(CAPS_WORD_ENABLE)
|
||||
# include "config/capsword_config.h"
|
||||
#endif
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE)
|
||||
# include "config/rgbmatrix_config.h"
|
||||
#endif
|
||||
|
||||
#if defined(MOUSEKEY_ENABLE)
|
||||
# include "config/mouse_config.h"
|
||||
#endif
|
||||
|
||||
#if defined(COMBO_ENABLE)
|
||||
# include "config/combo_config.h"
|
||||
#endif
|
||||
|
||||
#if defined(SPLIT_KEYBOARD)
|
||||
# include "config/split_config.h"
|
||||
#endif
|
18
users/t4corun/config/capsword_config.h
Normal file
18
users/t4corun/config/capsword_config.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
/*
|
||||
https://docs.qmk.fm/#/feature_caps_word
|
||||
|
||||
Explore these
|
||||
#undef BOTH_SHIFTS_TURNS_ON_CAPS_WORD
|
||||
#undef CAPS_WORD_INVERT_ON_SHIFT
|
||||
*/
|
||||
|
||||
|
||||
//Clear variables we plan to use that might be set elsewhere
|
||||
#undef DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD
|
||||
#undef CAPS_WORD_IDLE_TIMEOUT
|
||||
|
||||
//Set common configuration for all keyboards
|
||||
#define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD
|
||||
#define CAPS_WORD_IDLE_TIMEOUT 3000
|
35
users/t4corun/config/combo_config.h
Normal file
35
users/t4corun/config/combo_config.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
/*
|
||||
https://docs.qmk.fm/#/feature_combo
|
||||
|
||||
Explore these (there are way more)
|
||||
#undef COMBO_MUST_PRESS_IN_ORDER
|
||||
#undef COMBO_ONLY_FROM_LAYER
|
||||
*/
|
||||
|
||||
//Clear variables we plan to use that might be set elsewhere
|
||||
#undef COMBO_TERM
|
||||
#undef COMBO_TERM_PER_COMBO
|
||||
#undef COMBO_MUST_TAP_PER_COMBO
|
||||
#undef EXTRA_SHORT_COMBOS
|
||||
#undef COMBO_ONLY_FROM_LAYER
|
||||
|
||||
#undef COMBO_HOLD_TERM
|
||||
#undef COMBO_MUST_HOLD_PER_COMBO
|
||||
|
||||
#undef COMBO_MUST_PRESS_IN_ORDER_PER_COMBO
|
||||
|
||||
|
||||
|
||||
//Set common configuration for all keyboards
|
||||
#define COMBO_TERM 50
|
||||
#define COMBO_TERM_PER_COMBO
|
||||
#define COMBO_MUST_TAP_PER_COMBO
|
||||
#define EXTRA_SHORT_COMBOS
|
||||
#define COMBO_ONLY_FROM_LAYER 0 //this will always setup combos based off of QWERTY
|
||||
|
||||
#define COMBO_HOLD_TERM TAPPING_TERM
|
||||
#define COMBO_MUST_HOLD_PER_COMBO
|
||||
|
||||
#define COMBO_MUST_PRESS_IN_ORDER_PER_COMBO
|
46
users/t4corun/config/mouse_config.h
Normal file
46
users/t4corun/config/mouse_config.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
#pragma once
|
||||
|
||||
/*
|
||||
https://docs.qmk.fm/#/feature_mouse_keys
|
||||
|
||||
Notes:
|
||||
I am only putting down settings for accelerated mode
|
||||
|
||||
Explore these:
|
||||
#undef MOUSEKEY_MOVE_DELTA
|
||||
#undef MOUSEKEY_WHEEL_DELAY
|
||||
#undef MOUSEKEY_WHEEL_INTERVAL
|
||||
#undef MOUSEKEY_WHEEL_MAX_SPEED
|
||||
#undef MOUSEKEY_WHEEL_TIME_TO_MAX
|
||||
|
||||
other modes:
|
||||
- Accelerated (default): Holding movement keys accelerates the cursor until it reaches its maximum speed.
|
||||
- Kinetic: Holding movement keys accelerates the cursor with its speed following a quadratic curve until it reaches its maximum speed.
|
||||
- Constant: Holding movement keys moves the cursor at constant speeds.
|
||||
- Combined: Holding movement keys accelerates the cursor until it reaches its maximum speed, but holding acceleration and movement keys simultaneously moves the cursor at constant speeds.
|
||||
- Inertia: Cursor accelerates when key held, and decelerates after key release. Tracks X and Y velocity separately for more nuanced movements. Applies to cursor only, not scrolling.
|
||||
|
||||
|
||||
https://docs.qmk.fm/#/feature_pointing_device
|
||||
|
||||
notes:
|
||||
there are way more settings but I don't want to mess anything that Quentin set for the nano
|
||||
I will only include stuff for auto mouse layer
|
||||
|
||||
Explore These:
|
||||
#undef AUTO_MOUSE_DELAY
|
||||
#undef AUTO_MOUSE_DEBOUNCE
|
||||
#undef AUTO_MOUSE_DEFAULT_LAYER
|
||||
*/
|
||||
|
||||
//Clear variables we plan to use that might be set elsewhere
|
||||
#undef MOUSEKEY_DELAY
|
||||
#undef MOUSEKEY_INTERVAL
|
||||
#undef MOUSEKEY_MAX_SPEED
|
||||
#undef MOUSEKEY_TIME_TO_MAX
|
||||
|
||||
//Set common configuration for all keyboards
|
||||
#define MOUSEKEY_INTERVAL 12
|
||||
#define MOUSEKEY_MAX_SPEED 6
|
||||
#define MOUSEKEY_TIME_TO_MAX 50
|
||||
#define MOUSEKEY_DELAY 20
|
139
users/t4corun/config/rgbmatrix_config.h
Normal file
139
users/t4corun/config/rgbmatrix_config.h
Normal file
|
@ -0,0 +1,139 @@
|
|||
#pragma once
|
||||
|
||||
/*
|
||||
https://docs.qmk.fm/#/feature_rgb_matrix
|
||||
|
||||
My Keyboards:
|
||||
KEYBOARD_bastardkb_charybdis_3x5
|
||||
KEYBOARD_crkbd_rev1
|
||||
KEYBOARD_dztech_dz60rgb_v2_1 ???
|
||||
the planck is RGBLIGHT not RGB MATRIX
|
||||
|
||||
Explore These
|
||||
#undef RGB_MATRIX_TYPING_HEATMAP_SLIM
|
||||
#undef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE
|
||||
#undef RGB_MATRIX_TIMEOUT
|
||||
*/
|
||||
|
||||
|
||||
//Clear variables we plan to use that might be set elsewhere
|
||||
#undef RGB_DISABLE_WHEN_USB_SUSPENDED
|
||||
#undef RGB_MATRIX_DEFAULT_HUE
|
||||
#undef RGB_MATRIX_DEFAULT_SAT
|
||||
#undef RGB_MATRIX_DEFAULT_VAL
|
||||
#undef RGB_MATRIX_DEFAULT_SPD
|
||||
#undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
|
||||
#undef RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
#undef RGB_MATRIX_KEYPRESSES
|
||||
#undef RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS
|
||||
#undef RGB_MATRIX_TYPING_HEATMAP_SPREAD
|
||||
#undef RGB_MATRIX_TYPING_HEATMAP_AREA_LIMIT
|
||||
#undef RGB_MATRIX_TYPING_HEATMAP_INCREASE_STEP
|
||||
#undef RGB_MATRIX_DEFAULT_MODE
|
||||
|
||||
// For full list of effects, see:
|
||||
// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects
|
||||
|
||||
//Then undefine all the RGB Animations
|
||||
#undef ENABLE_RGB_MATRIX_ALPHAS_MODS
|
||||
#undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
#undef ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
|
||||
#undef ENABLE_RGB_MATRIX_BREATHING
|
||||
#undef ENABLE_RGB_MATRIX_BAND_SAT
|
||||
#undef ENABLE_RGB_MATRIX_BAND_VAL
|
||||
#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
|
||||
#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
|
||||
#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
|
||||
#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
|
||||
#undef ENABLE_RGB_MATRIX_CYCLE_ALL
|
||||
#undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
|
||||
#undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
|
||||
#undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
|
||||
#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN
|
||||
#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
|
||||
#undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
|
||||
#undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL
|
||||
#undef ENABLE_RGB_MATRIX_DUAL_BEACON
|
||||
#undef ENABLE_RGB_MATRIX_RAINBOW_BEACON
|
||||
#undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
|
||||
#undef ENABLE_RGB_MATRIX_RAINDROPS
|
||||
#undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
|
||||
#undef ENABLE_RGB_MATRIX_HUE_BREATHING
|
||||
#undef ENABLE_RGB_MATRIX_HUE_PENDULUM
|
||||
#undef ENABLE_RGB_MATRIX_HUE_WAVE
|
||||
#undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL
|
||||
#undef ENABLE_RGB_MATRIX_PIXEL_FLOW
|
||||
#undef ENABLE_RGB_MATRIX_PIXEL_RAIN
|
||||
//These modes also require the RGB_MATRIX_FRAMEBUFFER_EFFECTS define to be available.
|
||||
#undef ENABLE_RGB_MATRIX_TYPING_HEATMAP
|
||||
#undef ENABLE_RGB_MATRIX_DIGITAL_RAIN
|
||||
//These modes also require the RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES define to be available.
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
|
||||
#undef ENABLE_RGB_MATRIX_SPLASH
|
||||
#undef ENABLE_RGB_MATRIX_MULTISPLASH
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_SPLASH
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Set common configuration for all keyboards
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED
|
||||
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
|
||||
#define RGB_MATRIX_DEFAULT_HUE 4
|
||||
#define RGB_MATRIX_DEFAULT_SAT 79
|
||||
#define RGB_MATRIX_DEFAULT_VAL 59
|
||||
#define RGB_MATRIX_DEFAULT_SPD 32
|
||||
|
||||
//Set per keyboard configuration
|
||||
#if defined(KEYBOARD_bastardkb_charybdis_3x5) || defined(KEYBOARD_dztech_dz60rgb_v2_1)
|
||||
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
|
||||
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
# define RGB_MATRIX_KEYPRESSES
|
||||
//no extra defines required
|
||||
# define ENABLE_RGB_MATRIX_BREATHING
|
||||
# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
|
||||
# define ENABLE_RGB_MATRIX_DUAL_BEACON
|
||||
# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
|
||||
# define ENABLE_RGB_MATRIX_HUE_BREATHING
|
||||
//requires RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
# define ENABLE_RGB_MATRIX_TYPING_HEATMAP
|
||||
# define ENABLE_RGB_MATRIX_DIGITAL_RAIN
|
||||
//requires RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES
|
||||
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
|
||||
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
|
||||
# define ENABLE_RGB_MATRIX_SPLASH
|
||||
# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
|
||||
|
||||
# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_TYPING_HEATMAP
|
||||
|
||||
//enable minimal effects to save memory
|
||||
#else
|
||||
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
|
||||
# define ENABLE_RGB_MATRIX_BREATHING
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
|
||||
# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING
|
||||
#endif //defined(KEYBOARD_bastardkb_charybdis_3x5) || defined(KEYBOARD_dztech_dz60rgb_v2_1)
|
||||
|
||||
//heatmap specific settings
|
||||
#if defined(ENABLE_RGB_MATRIX_TYPING_HEATMAP)
|
||||
# define RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS 9 //default 25
|
||||
# define RGB_MATRIX_TYPING_HEATMAP_SPREAD 40 //40
|
||||
# define RGB_MATRIX_TYPING_HEATMAP_AREA_LIMIT 16 //16
|
||||
# define RGB_MATRIX_TYPING_HEATMAP_INCREASE_STEP 20 //32
|
||||
#endif //ENABLE_RGB_MATRIX_TYPING_HEATMAP
|
20
users/t4corun/config/split_config.h
Normal file
20
users/t4corun/config/split_config.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
/*
|
||||
https://docs.qmk.fm/#/feature_split_keyboard
|
||||
|
||||
*/
|
||||
|
||||
#undef SPLIT_TRANSPORT_MIRROR
|
||||
#undef SPLIT_LAYER_STATE_ENABLE
|
||||
#undef SPLIT_LED_STATE_ENABLE
|
||||
#undef SPLIT_MODS_ENABLE
|
||||
#undef SPLIT_USB_DETECT
|
||||
|
||||
#define SPLIT_TRANSPORT_MIRROR
|
||||
#define SPLIT_LAYER_STATE_ENABLE
|
||||
#define SPLIT_LED_STATE_ENABLE
|
||||
#define SPLIT_MODS_ENABLE
|
||||
//# define SPLIT_USB_DETECT
|
||||
|
||||
#define MASTER_RIGHT
|
37
users/t4corun/config/tapping_config.h
Normal file
37
users/t4corun/config/tapping_config.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#pragma once
|
||||
|
||||
/*
|
||||
https://docs.qmk.fm/#/tap_hold
|
||||
https://docs.qmk.fm/#/one_shot_keys
|
||||
*/
|
||||
|
||||
|
||||
//Clear variables we plan to use that might be set elsewhere
|
||||
#undef TAP_CODE_DELAY
|
||||
#undef TAP_HOLD_CAPS_DELAY
|
||||
|
||||
#undef HOLD_ON_OTHER_KEY_PRESS_PER_KEY
|
||||
#undef TAPPING_TERM
|
||||
#undef TAPPING_TERM_PER_KEY
|
||||
#undef QUICK_TAP_TERM
|
||||
#undef QUICK_TAP_TERM_PER_KEY
|
||||
|
||||
#undef ONESHOT_TAP_TOGGLE
|
||||
#undef ONESHOT_TIMEOUT
|
||||
|
||||
|
||||
//Set common configuration for all keyboards
|
||||
#define TAP_CODE_DELAY 5 //time before tap is released
|
||||
#define TAP_HOLD_CAPS_DELAY TAP_CODE_DELAY //turning down delay for caps lock so ploopy can do DPI switching
|
||||
#define WAIT_DELAY 5 //custom variable to configure time between taps
|
||||
|
||||
#define HOLD_ON_OTHER_KEY_PRESS_PER_KEY
|
||||
|
||||
#define TAPPING_TERM 200
|
||||
#define TAPPING_TERM_PER_KEY
|
||||
|
||||
#define QUICK_TAP_TERM 100
|
||||
#define QUICK_TAP_TERM_PER_KEY
|
||||
|
||||
#define ONESHOT_TAP_TOGGLE 3
|
||||
#define ONESHOT_TIMEOUT 2000
|
23
users/t4corun/features/capsword.c
Normal file
23
users/t4corun/features/capsword.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
#include "capsword.h"
|
||||
|
||||
//static bool caps_word_state = false;
|
||||
|
||||
bool caps_word_press_user(uint16_t keycode) {
|
||||
switch (keycode) {
|
||||
// Keycodes that continue Caps Word, with shift applied.
|
||||
case KC_A ... KC_Z:
|
||||
case KC_MINS:
|
||||
add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to next key.
|
||||
return true;
|
||||
|
||||
// Keycodes that continue Caps Word, without shifting.
|
||||
case KC_1 ... KC_0:
|
||||
case KC_BSPC:
|
||||
case KC_DEL:
|
||||
case KC_UNDS:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false; // Deactivate Caps Word.
|
||||
}
|
||||
}
|
2
users/t4corun/features/capsword.h
Normal file
2
users/t4corun/features/capsword.h
Normal file
|
@ -0,0 +1,2 @@
|
|||
#pragma once
|
||||
#include "t4corun.h"
|
75
users/t4corun/features/combo.c
Normal file
75
users/t4corun/features/combo.c
Normal file
|
@ -0,0 +1,75 @@
|
|||
#include "combo.h"
|
||||
|
||||
|
||||
//only need to make it for the qwerty layer
|
||||
//const uint16_t PROGMEM dragtog_combo[] = {TR_COMM, TR_DOT, COMBO_END};
|
||||
//const uint16_t PROGMEM sniptog_combo[] = {KC_M, TR_DOT, COMBO_END};
|
||||
//const uint16_t PROGMEM moubtn4_combo[] = {KC_SPC, NAV, COMBO_END};
|
||||
|
||||
combo_t key_combos[COMBO_LENGTH] = {
|
||||
|
||||
/*
|
||||
#if defined(POINTING_DEVICE_ENABLE)
|
||||
[DRAGTOGGLE] = COMBO(dragtog_combo, DRG_TOG),
|
||||
[SNIPERTOGGLE] = COMBO(sniptog_combo, SNP_TOG),
|
||||
#else
|
||||
[DRAGTOGGLE] = COMBO(dragtog_combo, ___x___),
|
||||
[SNIPERTOGGLE] = COMBO(sniptog_combo, ___x___),
|
||||
#endif //POINTING_DEVICE_ENABLE
|
||||
|
||||
#if defined(MOUSELAYER_ENABLE)
|
||||
[MOUSEBUTTON4] = COMBO(moubtn4_combo, KC_BTN4)
|
||||
#else
|
||||
[MOUSEBUTTON4] = COMBO(moubtn4_combo, ___x___)
|
||||
#endif //MOUSELAYER_ENABLE
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
bool get_combo_must_hold(uint16_t index, combo_t *combo) {
|
||||
switch (index) {
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool get_combo_must_tap(uint16_t index, combo_t *combo) {
|
||||
|
||||
switch (index) {
|
||||
|
||||
/*
|
||||
case DRAGTOGGLE:
|
||||
case SNIPERTOGGLE:
|
||||
case MOUSEBUTTON4:
|
||||
return true;
|
||||
*/
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool get_combo_must_press_in_order(uint16_t combo_index, combo_t *combo) {
|
||||
switch (combo_index) {
|
||||
/* List combos here that you want to only activate if their keys
|
||||
* are pressed in the same order as they are defined in the combo's key
|
||||
* array. */
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t get_combo_term(uint16_t index, combo_t *combo) {
|
||||
// or with combo index, i.e. its name from enum.
|
||||
switch (index) {
|
||||
/*
|
||||
case CONFIGLAYER:
|
||||
return COMBO_HOLD_TERM + 150;
|
||||
*/
|
||||
|
||||
default:
|
||||
return COMBO_TERM;
|
||||
|
||||
}
|
||||
}
|
12
users/t4corun/features/combo.h
Normal file
12
users/t4corun/features/combo.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#pragma once
|
||||
#include "t4corun.h"
|
||||
|
||||
enum combos {
|
||||
//DRAGTOGGLE,
|
||||
//SNIPERTOGGLE,
|
||||
//MOUSEBUTTON4,
|
||||
COMBO_LENGTH
|
||||
};
|
||||
|
||||
//their documentation is so confusing because you don't use COMBO_LEN defining the actions
|
||||
uint16_t COMBO_LEN = COMBO_LENGTH;
|
1
users/t4corun/features/mouse.c
Normal file
1
users/t4corun/features/mouse.c
Normal file
|
@ -0,0 +1 @@
|
|||
#include "mouse.h"
|
2
users/t4corun/features/mouse.h
Normal file
2
users/t4corun/features/mouse.h
Normal file
|
@ -0,0 +1,2 @@
|
|||
#pragma once
|
||||
#include "t4corun.h"
|
105
users/t4corun/features/oled.c
Normal file
105
users/t4corun/features/oled.c
Normal file
|
@ -0,0 +1,105 @@
|
|||
#include "oled.h"
|
||||
|
||||
void render_crkbd_logo(void) {
|
||||
static const char PROGMEM crkbd_logo[] = {
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94,
|
||||
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
|
||||
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,
|
||||
0};
|
||||
oled_write_P(crkbd_logo, false);
|
||||
}
|
||||
|
||||
|
||||
void render_default_layer_state(void) {
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false);
|
||||
switch (get_highest_layer(default_layer_state)) {
|
||||
|
||||
case _QWERTY:
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYOUT_QWERTY), false);
|
||||
break;
|
||||
|
||||
case _COLEMAK_DH:
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYOUT_COLEMAK_DH), false);
|
||||
break;
|
||||
|
||||
case _GAME:
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYOUT_GAME), false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void render_layer_state(void) {
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_NAME), false);
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_BASE), get_highest_layer(layer_state) == FIRST_DEFAULT_LAYER);
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_NAVIGATION), get_highest_layer(layer_state) == _NAVIGATION);
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_NUMBER), get_highest_layer(layer_state) == _NUMBER);
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_SYMBOL), get_highest_layer(layer_state) == _SYMBOL);
|
||||
|
||||
#if defined(MOUSEKEY_ENABLE)
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_MOUSE), get_highest_layer(layer_state) == _MOUSE);
|
||||
#endif //MOUSEKEY_ENABLE
|
||||
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_GAME_NUM), get_highest_layer(layer_state) == _GAME_NUM);
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_CONFIG), get_highest_layer(layer_state) == _CONFIG);
|
||||
}
|
||||
|
||||
|
||||
void render_keylock_status(void) {
|
||||
oled_write_P(PSTR(OLED_RENDER_KEYLOCK_NAME), false);
|
||||
oled_write_P(PSTR(" "), false);
|
||||
oled_write_P(PSTR("N"), host_keyboard_led_state().num_lock);
|
||||
oled_write_P(PSTR("C"), host_keyboard_led_state().caps_lock || is_caps_word_on() );
|
||||
oled_write_ln_P(PSTR("S"), host_keyboard_led_state().scroll_lock );
|
||||
}
|
||||
|
||||
|
||||
void render_mod_status(void) {
|
||||
|
||||
uint8_t current_mod = get_mods();
|
||||
uint8_t current_osm = get_oneshot_mods();
|
||||
|
||||
oled_write_P(PSTR(OLED_RENDER_MODS_NAME), false);
|
||||
oled_write_P(PSTR(" "), false);
|
||||
|
||||
bool isShift = (current_mod | current_osm) & MOD_MASK_SHIFT;
|
||||
bool isCtrl = (current_mod | current_osm) & MOD_MASK_CTRL;
|
||||
bool isAlt = (current_mod | current_osm) & MOD_MASK_ALT;
|
||||
bool isGUI = (current_mod | current_osm) & MOD_MASK_GUI;
|
||||
|
||||
oled_write_P(PSTR("S"), isShift );
|
||||
oled_write_P(PSTR("C"), isCtrl );
|
||||
oled_write_P(PSTR("A"), isAlt );
|
||||
oled_write_P(PSTR("G"), isGUI );
|
||||
}
|
||||
|
||||
|
||||
void render_oled_main(void) {
|
||||
|
||||
render_default_layer_state();
|
||||
render_keylock_status();
|
||||
render_mod_status();
|
||||
render_layer_state();
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool oled_task_user(void) {
|
||||
|
||||
if (is_keyboard_master()) {
|
||||
render_oled_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||
} else {
|
||||
render_crkbd_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (is_keyboard_master()) {
|
||||
return OLED_ROTATION_270;
|
||||
} else {
|
||||
return OLED_ROTATION_270;
|
||||
}
|
||||
}
|
||||
|
33
users/t4corun/features/oled.h
Normal file
33
users/t4corun/features/oled.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
#include "t4corun.h"
|
||||
#include "oled_driver.h"
|
||||
|
||||
#define OLED_RENDER_KEYLOCK_NAME "Lock:"
|
||||
#define OLED_RENDER_MODS_NAME "Mods:"
|
||||
|
||||
#define OLED_RENDER_LAYOUT_NAME "Lyout"
|
||||
#define OLED_RENDER_LAYOUT_QWERTY " QRTY"
|
||||
#define OLED_RENDER_LAYOUT_COLEMAK_DH " cmDH"
|
||||
#define OLED_RENDER_LAYOUT_GAME " Game"
|
||||
|
||||
#define OLED_RENDER_LAYER_NAME "Layer"
|
||||
#define OLED_RENDER_LAYER_BASE " Def "
|
||||
#define OLED_RENDER_LAYER_NUMBER " Num "
|
||||
#define OLED_RENDER_LAYER_NAVIGATION " Nav "
|
||||
#define OLED_RENDER_LAYER_SYMBOL " Sym "
|
||||
#define OLED_RENDER_LAYER_GAME_NUM " gNum"
|
||||
#define OLED_RENDER_LAYER_CONFIG " Cfg "
|
||||
|
||||
#if defined(MOUSEKEY_ENABLE)
|
||||
# define OLED_RENDER_LAYER_MOUSE " Mou "
|
||||
#endif //MOUSEKEY_ENABLE
|
||||
|
||||
void render_crkbd_logo(void);
|
||||
void render_default_layer_state(void);
|
||||
void render_layer_state(void);
|
||||
void render_keylock_status(void);
|
||||
void render_mod_status(void);
|
||||
void render_oled_main(void);
|
||||
bool oled_task_user(void);
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation);
|
101
users/t4corun/features/rgbmatrix.c
Normal file
101
users/t4corun/features/rgbmatrix.c
Normal file
|
@ -0,0 +1,101 @@
|
|||
#include "rgbmatrix.h"
|
||||
|
||||
/*
|
||||
Achieves the following
|
||||
- layer tap key indicator when we are in layer
|
||||
- Caps lock and scroll lock indicators when activated
|
||||
- mouse button backlight when in mouse layer
|
||||
- modifier indicators when activated
|
||||
- default layer indicator
|
||||
|
||||
Really only for the charybdis nano, and even then I don't really look down at the
|
||||
RGB
|
||||
*/
|
||||
|
||||
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max){
|
||||
|
||||
/*
|
||||
uint8_t current_layer = get_highest_layer(layer_state);
|
||||
uint8_t current_default_layer = get_highest_layer(default_layer_state);
|
||||
uint8_t current_mod = get_mods();
|
||||
uint8_t current_osm = get_oneshot_mods();
|
||||
|
||||
switch(current_layer) {
|
||||
|
||||
case _NAVIGATION:
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_NAVIGATION, KEY_LAYER_COLOR);
|
||||
break;
|
||||
|
||||
case _NUMBER:
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_NUMBER, KEY_LAYER_COLOR);
|
||||
break;
|
||||
|
||||
case _SYMBOL:
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_SYMBOL_L, KEY_TRILAYER_COLOR);
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_SYMBOL_R, KEY_TRILAYER_COLOR);
|
||||
break;
|
||||
|
||||
case _FUNCTION:
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_FUNCTION, KEY_TRILAYER_COLOR);
|
||||
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_DMACRO_R1, KEY_MACROREC_COLOR);
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_DMACRO_P1, KEY_MACROPLY_COLOR);
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_DMACRO_R2, KEY_MACROREC_COLOR);
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_DMACRO_P2, KEY_MACROPLY_COLOR);
|
||||
break;
|
||||
|
||||
case _MOUSE:
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_MOUSE, KEY_LAYER_COLOR);
|
||||
break;
|
||||
|
||||
case _CONFIG:
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_CONFIG, KEY_LAYER_COLOR);
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_RESET, KEY_RESET_COLOR);
|
||||
|
||||
switch (current_default_layer) {
|
||||
|
||||
case _DEFAULT_LAYER_1:
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_QWERTY, KEY_DEFAULTLAYER_COLOR);
|
||||
break;
|
||||
|
||||
case _DEFAULT_LAYER_2:
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_COLEMAKDH, KEY_DEFAULTLAYER_COLOR);
|
||||
break;
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( (current_mod | current_osm) & MOD_MASK_SHIFT ) {
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_SHIFT_T, MOD_SHIFT_COLOR);
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_SHIFT_L, MOD_SHIFT_COLOR);
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_SHIFT_R, MOD_SHIFT_COLOR);
|
||||
}
|
||||
|
||||
if ( (current_mod | current_osm) & MOD_MASK_CTRL ) {
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_CTRL_L, MOD_CTRL_COLOR);
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_CTRL_R, MOD_CTRL_COLOR);
|
||||
}
|
||||
|
||||
if ( (current_mod | current_osm) & MOD_MASK_ALT ) {
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_ALT_L, MOD_ALT_COLOR);
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_ALT_R, MOD_ALT_COLOR);
|
||||
}
|
||||
|
||||
if ( (current_mod | current_osm) & MOD_MASK_GUI ) {
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_GUI_L, MOD_GUI_COLOR);
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_GUI_R, MOD_GUI_COLOR);
|
||||
}
|
||||
|
||||
if ( host_keyboard_led_state().caps_lock || is_caps_word_on() ) {
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_CAPSLOCK, CAPSLOCK_COLOR);
|
||||
}
|
||||
|
||||
if ( host_keyboard_led_state().scroll_lock) {
|
||||
RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(LED_SCRLOCK, SCROLLOCK_COLOR);
|
||||
}
|
||||
|
||||
*/
|
||||
return false;
|
||||
|
||||
}
|
111
users/t4corun/features/rgbmatrix.h
Normal file
111
users/t4corun/features/rgbmatrix.h
Normal file
|
@ -0,0 +1,111 @@
|
|||
#pragma once
|
||||
#include "t4corun.h"
|
||||
|
||||
/*
|
||||
Color preview
|
||||
|
||||
( 0, RGB_AZURE);
|
||||
( 1, RGB_BLACK);
|
||||
( 2, RGB_BLUE);
|
||||
( 3, RGB_CHARTREUSE);
|
||||
( 4, RGB_CORAL);
|
||||
( 5, RGB_CYAN);
|
||||
( 6, RGB_GOLD);
|
||||
( 7, RGB_GOLDENROD);
|
||||
( 8, RGB_GREEN);
|
||||
( 9, RGB_MAGENTA);
|
||||
( 10, RGB_ORANGE);
|
||||
( 11, RGB_PINK);
|
||||
( 14, RGB_PURPLE);
|
||||
( 13, RGB_RED);
|
||||
( 12, RGB_SPRINGGREEN);
|
||||
( 32, RGB_TEAL);
|
||||
( 29, RGB_TURQUOISE);
|
||||
( 24, RGB_WHITE);
|
||||
( 23, RGB_YELLOW);
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#define LAYER_NAVIGATION_COLOR RGB_AZURE
|
||||
#define LAYER_SYMBOL_COLOR RGB_CYAN
|
||||
#define LAYER_NUMBER_COLOR RGB_PURPLE
|
||||
#define LAYER_MOUSE_COLOR RGB_CORAL
|
||||
#define LAYER_CONFIG_COLOR RGB_GOLDENROD
|
||||
|
||||
#define KEY_LAYER_COLOR RGB_AZURE
|
||||
#define KEY_TRILAYER_COLOR RGB_PURPLE
|
||||
#define KEY_DEFAULTLAYER_COLOR RGB_PURPLE
|
||||
#define KEY_RESET_COLOR RGB_MAGENTA
|
||||
#define KEY_MACROREC_COLOR RGB_PINK
|
||||
#define KEY_MACROPLY_COLOR RGB_TURQUOISE
|
||||
|
||||
|
||||
#define MOD_SHIFT_COLOR RGB_WHITE
|
||||
#define MOD_CTRL_COLOR RGB_CORAL
|
||||
#define MOD_ALT_COLOR RGB_PINK
|
||||
#define MOD_GUI_COLOR RGB_GOLDENROD
|
||||
|
||||
#define CAPSLOCK_COLOR RGB_WHITE
|
||||
#define SCROLLOCK_COLOR RGB_WHITE
|
||||
|
||||
//so we can send the predefined RGB colors without requiring separate RGB values
|
||||
#define RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(...) RGB_MATRIX_INDICATOR_SET_COLOR(__VA_ARGS__)
|
||||
|
||||
/* qmk_firmware\keyboards\bastardkb\charybdis\3x5\3x5.c
|
||||
* ╭────────────────────╮ ╭────────────────────╮
|
||||
* 2 3 8 9 12 30 27 26 21 20
|
||||
* ├────────────────────┤ ├────────────────────┤
|
||||
* 1 4 7 10 13 31 28 25 22 19
|
||||
* ├────────────────────┤ ├────────────────────┤
|
||||
* 0 5 6 11 14 32 29 24 23 18
|
||||
* ╰────────────────────╯ ╰────────────────────╯
|
||||
* 15 16 17 33 34 XX
|
||||
* ╰────────────╯ ╰────────────╯
|
||||
*/
|
||||
|
||||
#if defined(KEYBOARD_bastardkb_charybdis_3x5)
|
||||
//layers
|
||||
# define LED_NUMBER 16
|
||||
# define LED_NAVIGATION 34
|
||||
# define LED_MOUSE 6
|
||||
# define LED_SYMBOL_L 16
|
||||
# define LED_SYMBOL_R 34
|
||||
# define LED_CONFIG 20
|
||||
# define LED_FUNCTION 9
|
||||
|
||||
//base layers
|
||||
# define LED_QWERTY 17
|
||||
# define LED_COLEMAKDH 16
|
||||
|
||||
//indicators
|
||||
# define LED_CAPSLOCK 31
|
||||
# define LED_SCRLOCK 13
|
||||
|
||||
//dynamic macros
|
||||
# define LED_DMACRO_R1 34
|
||||
# define LED_DMACRO_P1 33
|
||||
# define LED_DMACRO_R2 3
|
||||
# define LED_DMACRO_P2 2
|
||||
|
||||
//shift keys
|
||||
# define LED_SHIFT_T 17
|
||||
# define LED_SHIFT_L 10
|
||||
# define LED_SHIFT_R 28
|
||||
|
||||
//control keys
|
||||
# define LED_CTRL_L 7
|
||||
# define LED_CTRL_R 25
|
||||
|
||||
//alt keys
|
||||
# define LED_ALT_L 4
|
||||
# define LED_ALT_R 22
|
||||
|
||||
//GUI keys
|
||||
# define LED_GUI_L 1
|
||||
# define LED_GUI_R 19
|
||||
|
||||
//Reset LED
|
||||
# define LED_RESET 26
|
||||
|
||||
#endif
|
129
users/t4corun/features/taphold.c
Normal file
129
users/t4corun/features/taphold.c
Normal file
|
@ -0,0 +1,129 @@
|
|||
#include "taphold.h"
|
||||
|
||||
void insert_brackets(uint16_t left, uint16_t right) {
|
||||
tap_code16(left);
|
||||
tap_code16(right);
|
||||
tap_code16(KC_LEFT);
|
||||
}
|
||||
|
||||
void double_tap(uint16_t keycode, uint32_t ms) {
|
||||
tap_code16(keycode);
|
||||
wait_ms(ms);
|
||||
tap_code16(keycode);
|
||||
}
|
||||
|
||||
|
||||
//here we can have the holds be more complex, like sending "" when you hold "
|
||||
bool process_tap_hold_key(keyrecord_t* record, uint16_t keycode) {
|
||||
|
||||
//tap is record->tap.count && record->event.pressed
|
||||
//hold is record->event.pressed
|
||||
|
||||
//bool isShift = ( (get_mods() & MOD_BIT(KC_LSFT)) || (get_oneshot_mods() & MOD_BIT(KC_LSFT)) );
|
||||
uint16_t key = KC_NO;
|
||||
uint16_t altkey = KC_NO;
|
||||
|
||||
switch(keycode) {
|
||||
|
||||
//Brackets
|
||||
//open and close brackets and put the cursor inside
|
||||
case TR_LCBR:
|
||||
key = KC_LCBR;
|
||||
altkey = KC_RCBR;
|
||||
break;
|
||||
case TR_LABK:
|
||||
key = KC_LABK;
|
||||
altkey = KC_RABK;
|
||||
break;
|
||||
case TR_LBRC:
|
||||
key = KC_LBRC;
|
||||
altkey = KC_RBRC;
|
||||
break;
|
||||
case TR_SQUO:
|
||||
key = KC_QUOT;
|
||||
altkey = KC_QUOT;
|
||||
break;
|
||||
case TR_DQUO:
|
||||
key = KC_DQUO;
|
||||
altkey = KC_DQUO;
|
||||
break;
|
||||
|
||||
//Custom
|
||||
case TR_LPRN: //tap for comma, hold for bracket parenthesis
|
||||
case TR_COMM: //tap for comma, hold for left parenthesis
|
||||
key = KC_COMM;
|
||||
altkey = KC_LPRN;
|
||||
break;
|
||||
case TR_DOT: //tap for dot, hold for right parenthesis
|
||||
key = KC_DOT;
|
||||
altkey = KC_RPRN;
|
||||
break;
|
||||
case TR_PERC: //tap for percent, hold for carat. for saving room on symbols layer
|
||||
key = KC_PERC;
|
||||
altkey = KC_CIRC;
|
||||
break;
|
||||
|
||||
//faux auto-shift
|
||||
case TR_EQL: //tap for equal, hold for plus
|
||||
key = KC_EQL;
|
||||
altkey = KC_PLUS;
|
||||
break;
|
||||
case TR_MINS: //tap for minus, hold for underscore
|
||||
key = KC_MINS;
|
||||
altkey = KC_UNDS;
|
||||
break;
|
||||
case TR_GRV: //tap for grave, hold for tilde
|
||||
key = KC_GRV;
|
||||
altkey = KC_TILDE;
|
||||
break;
|
||||
case TR_SCLN: //tap for semicolon, hold for colon
|
||||
key = KC_SCLN;
|
||||
altkey = KC_COLN;
|
||||
break;
|
||||
case TR_QUOT: //tap for single quote, hold for double quote
|
||||
key = KC_QUOT;
|
||||
altkey = KC_DQUO;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (record->tap.count && record->event.pressed) {
|
||||
|
||||
tap_code16(key);
|
||||
return false;
|
||||
|
||||
} else if (record->tap.count == 0 && record->event.pressed) {
|
||||
|
||||
switch(keycode) {
|
||||
|
||||
//Brackets
|
||||
case TR_LCBR:
|
||||
case TR_LABK:
|
||||
case TR_LBRC:
|
||||
case TR_SQUO:
|
||||
case TR_DQUO:
|
||||
//isShift ? insert_brackets(LSFT(key), LSFT(altkey)) : insert_brackets(key, altkey);
|
||||
insert_brackets(key, altkey);
|
||||
break;
|
||||
|
||||
//custom and faux auto-shift
|
||||
case TR_LPRN:
|
||||
insert_brackets(KC_LPRN, KC_RPRN);
|
||||
break;
|
||||
case TR_COMM:
|
||||
case TR_DOT:
|
||||
case TR_PERC:
|
||||
case TR_EQL:
|
||||
case TR_MINS:
|
||||
case TR_GRV:
|
||||
case TR_SCLN:
|
||||
case TR_QUOT:
|
||||
tap_code16(altkey);
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true; // Continue default handling.
|
||||
}
|
6
users/t4corun/features/taphold.h
Normal file
6
users/t4corun/features/taphold.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#pragma once
|
||||
#include "t4corun.h"
|
||||
|
||||
void insert_brackets(uint16_t left, uint16_t right);
|
||||
void double_tap(uint16_t keycode, uint32_t ms);
|
||||
bool process_tap_hold_key(keyrecord_t* record, uint16_t keycode);
|
28
users/t4corun/features/tapping.c
Normal file
28
users/t4corun/features/tapping.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include "tapping.h"
|
||||
|
||||
bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
|
||||
//This is effective for all dual role keys (e.g. Mod-Taps, Layer-Taps, etc)
|
||||
switch(keycode) {
|
||||
default:
|
||||
//Disable HOLD_ON_OTHER_KEY_PRESS aka enable IGNORE_MOD_TAP_INTERRUPT
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
default:
|
||||
return QUICK_TAP_TERM;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case NAV:
|
||||
return TAPPING_TERM - 60;
|
||||
|
||||
default:
|
||||
//uprintf("tapping term: %d \n", TAPPING_TERM);
|
||||
return TAPPING_TERM;
|
||||
}
|
||||
}
|
2
users/t4corun/features/tapping.h
Normal file
2
users/t4corun/features/tapping.h
Normal file
|
@ -0,0 +1,2 @@
|
|||
#pragma once
|
||||
#include "t4corun.h"
|
65
users/t4corun/rules.mk
Normal file
65
users/t4corun/rules.mk
Normal file
|
@ -0,0 +1,65 @@
|
|||
# Set build options for
|
||||
# - consistent configuration across all keyboards
|
||||
# - enable features specific to certain board (e.g. encoders, rgb, oled)
|
||||
# - a way to save memory on MCU
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# set defaults on these qmk features if not defined
|
||||
# in the individual keyboard rules.mk
|
||||
#
|
||||
# ?= means set the value if its not defined elsewhere
|
||||
|
||||
LTO_ENABLE ?= yes
|
||||
MAGIC_ENABLE ?= no
|
||||
CONSOLE_ENABLE ?= no
|
||||
UNICODE_ENABLE ?= no
|
||||
SPACE_CADET_ENABLE ?= no
|
||||
GRAVE_ESC_ENABLE ?= no
|
||||
|
||||
COMBO_ENABLE ?= no
|
||||
DYNAMIC_MACRO_ENABLE ?= yes
|
||||
RGB_MATRIX_ENABLE ?= no
|
||||
RGBLIGHT_ENABLE ?= no
|
||||
POINTING_DEVICE_ENABLE ?= no
|
||||
OLED_ENABLE ?= no
|
||||
|
||||
# qmk features we will force
|
||||
AUDIO_ENABLE = no
|
||||
CAPS_WORD_ENABLE = yes
|
||||
MOUSEKEY_ENABLE = yes
|
||||
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# include my code that will be common across all my keyboards
|
||||
|
||||
SRC += \
|
||||
t4corun.c \
|
||||
features/tapping.c \
|
||||
features/taphold.c
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# include my code for enabled features for each keyboard
|
||||
|
||||
ifeq ($(strip $(CAPS_WORD_ENABLE)), yes)
|
||||
SRC += features/capsword.c
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
|
||||
SRC += features/rgbmatrix.c
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(strip $(MOUSEKEY_ENABLE)), yes)
|
||||
SRC += features/mouse.c
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(strip $(OLED_ENABLE)), yes)
|
||||
SRC += features/oled.c
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(strip $(COMBO_ENABLE)), yes)
|
||||
INTROSPECTION_KEYMAP_C += features/combo.c
|
||||
endif
|
60
users/t4corun/t4corun.c
Normal file
60
users/t4corun/t4corun.c
Normal file
|
@ -0,0 +1,60 @@
|
|||
#include "t4corun.h"
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
|
||||
state = update_tri_layer_state(state, _NAVIGATION, _NUMBER, _SYMBOL);
|
||||
return state;
|
||||
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
switch (keycode) {
|
||||
|
||||
case QWERTY:
|
||||
if (record->event.pressed) { set_single_persistent_default_layer(_QWERTY); } //default_layer_set(1UL<<_QWERTY); }
|
||||
return false;
|
||||
|
||||
case CLMAKDH:
|
||||
if (record->event.pressed) { set_single_persistent_default_layer(_COLEMAK_DH); } //default_layer_set(1UL<<_COLEMAK_DH); }
|
||||
return false;
|
||||
|
||||
case GAME:
|
||||
if (record->event.pressed) { set_single_persistent_default_layer(_GAME); } //default_layer_set(1UL<<_COLEMAK_DH); }
|
||||
return false;
|
||||
|
||||
case PN_DRGS:
|
||||
if (record->event.pressed) {
|
||||
double_tap(KC_NUM, WAIT_DELAY);
|
||||
}
|
||||
return false;
|
||||
|
||||
case PN_PDPI:
|
||||
if (record->event.pressed) {
|
||||
double_tap(KC_CAPS, WAIT_DELAY);
|
||||
}
|
||||
return false;
|
||||
|
||||
//https://docs.qmk.fm/#/mod_tap?id=changing-both-tasp-and-hold
|
||||
//https://getreuer.info/posts/keyboards/triggers/index.html#tap-vs.-long-press
|
||||
//https://www.jonashietala.se/series/t-34/ he focuses on a keymap for programming/VIM
|
||||
case TR_LCBR:
|
||||
case TR_LABK:
|
||||
case TR_LBRC:
|
||||
case TR_SQUO:
|
||||
case TR_DQUO:
|
||||
case TR_LPRN:
|
||||
case TR_COMM:
|
||||
case TR_DOT:
|
||||
case TR_PERC:
|
||||
case TR_EQL:
|
||||
case TR_MINS:
|
||||
case TR_GRV:
|
||||
case TR_SCLN:
|
||||
case TR_QUOT:
|
||||
return process_tap_hold_key(record, keycode);
|
||||
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
288
users/t4corun/t4corun.h
Normal file
288
users/t4corun/t4corun.h
Normal file
|
@ -0,0 +1,288 @@
|
|||
#pragma once
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "features/taphold.h"
|
||||
|
||||
|
||||
enum layers {
|
||||
_QWERTY = 0,
|
||||
FIRST_DEFAULT_LAYER = 0,
|
||||
_COLEMAK_DH,
|
||||
_GAME,
|
||||
_NAVIGATION,
|
||||
_NUMBER,
|
||||
_SYMBOL,
|
||||
_FUNCTION,
|
||||
_MOUSE,
|
||||
_GAME_NUM,
|
||||
_CONFIG
|
||||
};
|
||||
|
||||
enum keycodes {
|
||||
QWERTY = QK_USER,
|
||||
CLMAKDH,
|
||||
GAME,
|
||||
|
||||
//These are only here to make the case statements unique in taphold.c
|
||||
TH_LCBR,
|
||||
TH_LABK,
|
||||
TH_LBRC,
|
||||
TH_SQUO,
|
||||
TH_DQUO,
|
||||
TH_LPRN,
|
||||
TH_COMM,
|
||||
TH_DOT,
|
||||
TH_PERC,
|
||||
TH_EQL,
|
||||
TH_MINS,
|
||||
TH_GRV,
|
||||
TH_SCLN,
|
||||
TH_QUOT,
|
||||
|
||||
PN_DRGS,
|
||||
PN_PDPI
|
||||
};
|
||||
|
||||
#define ___x___ KC_NO
|
||||
|
||||
// momentary layer
|
||||
#define NAV LT(_NAVIGATION, KC_0)
|
||||
#define NUM MO(_NUMBER)
|
||||
#define CONFIG MO(_CONFIG)
|
||||
#define FUNC MO(_FUNCTION)
|
||||
#define GAMENUM MO(_GAME_NUM)
|
||||
|
||||
// Windows Shortcuts
|
||||
#define SC_COPY LCTL(KC_C)
|
||||
#define SC_CUT LCTL(KC_X)
|
||||
#define SC_UNDO LCTL(KC_Z)
|
||||
#define SC_PAST LCTL(KC_V)
|
||||
#define SC_REDO LCTL(KC_Y)
|
||||
#define SC_SNIP LGUI(LSFT(KC_S))
|
||||
#define SC_FILE LGUI(KC_E)
|
||||
|
||||
// Visual Studio Code
|
||||
|
||||
#define VS_FOLD LCTL(LSFT(KC_7))
|
||||
#define VS_UFLD LCTL(LSFT(KC_9))
|
||||
|
||||
/*
|
||||
- Any keycodes with prefix TR has behavior dependent on if the feature is enabled.
|
||||
- If the feature is disabled then the key is just the normal key
|
||||
- We will only define things that are used across different layers. Entire layers are turned off in the keymap
|
||||
*/
|
||||
|
||||
|
||||
// one shot mods
|
||||
#define TR_LSFT OSM(MOD_LSFT)
|
||||
#define TR_LCTL OSM(MOD_LCTL)
|
||||
#define TR_LALT OSM(MOD_LALT)
|
||||
#define TR_LGUI OSM(MOD_LGUI)
|
||||
|
||||
|
||||
//tap hoLd
|
||||
#define TR_LCBR LT(_DEFAULT_LAYER_1, TH_LCBR) // bracket behvavior
|
||||
#define TR_LABK LT(_DEFAULT_LAYER_1, TH_LABK)
|
||||
#define TR_LBRC LT(_DEFAULT_LAYER_1, TH_LBRC)
|
||||
#define TR_SQUO LT(_DEFAULT_LAYER_1, TH_SQUO)
|
||||
#define TR_DQUO LT(_DEFAULT_LAYER_1, TH_DQUO)
|
||||
|
||||
#define TR_LPRN LT(_DEFAULT_LAYER_1, TH_LPRN) // custom behavior0'
|
||||
#define TR_COMM LT(_DEFAULT_LAYER_1, TH_COMM)
|
||||
#define TR_DOT LT(_DEFAULT_LAYER_1, TH_DOT)
|
||||
#define TR_PERC LT(_DEFAULT_LAYER_1, TH_PERC)
|
||||
|
||||
#define TR_EQL LT(_DEFAULT_LAYER_1, TH_EQL) // auto shift
|
||||
#define TR_MINS LT(_DEFAULT_LAYER_1, TH_MINS)
|
||||
#define TR_GRV LT(_DEFAULT_LAYER_1, TH_GRV)
|
||||
#define TR_SCLN LT(_DEFAULT_LAYER_1, TH_SCLN)
|
||||
#define TR_QUOT LT(_DEFAULT_LAYER_1, TH_QUOT)
|
||||
|
||||
|
||||
#if defined(MOUSEKEY_ENABLE)
|
||||
# define TR_MOUA LT(_MOUSE, KC_A)
|
||||
|
||||
# define TR_MOUU KC_MS_U
|
||||
# define TR_MOUD KC_MS_D
|
||||
# define TR_MOUL KC_MS_L
|
||||
# define TR_MOUR KC_MS_R
|
||||
|
||||
# define TR_MWHU KC_WH_U //Mouse wheel keys are not needed unless the board has no encoders
|
||||
# define TR_MWHD KC_WH_D
|
||||
|
||||
# define TR_BTN1 KC_BTN1
|
||||
# define TR_BTN2 KC_BTN2
|
||||
# define TR_BTN3 KC_BTN3
|
||||
# define TR_BTN4 KC_BTN4
|
||||
# define TR_BTN5 KC_BTN5
|
||||
|
||||
# if defined(KEYBOARD_bastardkb_charybdis_3x5)
|
||||
//these codes are defined in charybdis.h
|
||||
# define TR_SNIP SNIPING
|
||||
# define TR_DRGS DRGSCRL
|
||||
# define TR_SDPI S_D_MOD //sniping dpi
|
||||
# define TR_PDPI DPI_MOD //pointer dpi
|
||||
# else
|
||||
# define TR_SNIP ___x___
|
||||
# define TR_DRGS PN_DRGS //use host status for ploopy nano drag scroll
|
||||
# define TR_SDPI ___x___
|
||||
# define TR_PDPI PN_PDPI //use host status for ploopy nano dpi switch
|
||||
# endif //KEYBOARD_bastardkb_charybdis_3x5
|
||||
|
||||
#else
|
||||
# define TR_MOUA KC_A
|
||||
|
||||
# define TR_MOUU ___x___
|
||||
# define TR_MOUD ___x___
|
||||
# define TR_MOUL ___x___
|
||||
# define TR_MOUR ___x___
|
||||
|
||||
# define TR_MWHU ___x___
|
||||
# define TR_MWHD ___x___
|
||||
|
||||
# define TR_BTN1 ___x___
|
||||
# define TR_BTN2 ___x___
|
||||
# define TR_BTN3 ___x___
|
||||
# define TR_BTN4 ___x___
|
||||
# define TR_BTN5 ___x___
|
||||
|
||||
# define TR_SNIP ___x___
|
||||
# define TR_DRGS ___x___
|
||||
# define TR_SDPI ___x___
|
||||
# define TR_PDPI ___x___
|
||||
|
||||
#endif //MOUSEKEY_ENABLE
|
||||
|
||||
|
||||
#if defined(DYNAMIC_MACRO_ENABLE)
|
||||
# define TR_DMR1 DM_REC1
|
||||
# define TR_DMP1 DM_PLY1
|
||||
# define TR_DMR2 DM_REC2
|
||||
# define TR_DMP2 DM_PLY2
|
||||
#else
|
||||
# define TR_DMR1 ___x___
|
||||
# define TR_DMP1 ___x___
|
||||
# define TR_DMR2 ___x___
|
||||
# define TR_DMP2 ___x___
|
||||
#endif //DYNAMIC_MACRO_ENABLE
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE)
|
||||
# define TR_RHUI RGB_HUI
|
||||
# define TR_RSAI RGB_SAI
|
||||
# define TR_RVAI RGB_VAI
|
||||
# define TR_RSPI RGB_SPI
|
||||
# define TR_RTOG RGB_TOG
|
||||
# define TR_RMOD RGB_MOD
|
||||
#else
|
||||
# define TR_RHUI ___x___
|
||||
# define TR_RSAI ___x___
|
||||
# define TR_RVAI ___x___
|
||||
# define TR_RSPI ___x___
|
||||
# define TR_RTOG ___x___
|
||||
# define TR_RMOD ___x___
|
||||
#endif //RGB_MATRIX_ENABLE || RGBLIGHT_ENABLE
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define _DEFAULT_LAYER_1 FIRST_DEFAULT_LAYER
|
||||
#define _DEFAULT_LAYER_2 (FIRST_DEFAULT_LAYER + 1)
|
||||
#define _DEFAULT_LAYER_3 (FIRST_DEFAULT_LAYER + 2)
|
||||
|
||||
#define _NONE_3__________________ ___x___, ___x___, ___x___
|
||||
#define _NONE_5____________________________________ ___x___, ___x___, ___x___, ___x___, ___x___
|
||||
#define _GACS_MODS________________________ TR_LGUI, TR_LALT, TR_LCTL, TR_LSFT
|
||||
#define _GACS_MOUSE_MODS_________ TR_LALT, TR_LCTL, TR_LSFT
|
||||
#define _SCAG_MODS________________________ TR_LSFT, TR_LCTL, TR_LALT, TR_LGUI
|
||||
#define _UCCPR_L___________________________________ SC_UNDO, SC_CUT, SC_COPY, SC_PAST, SC_REDO
|
||||
|
||||
#define _BASE_L4________ NUM, TR_LSFT
|
||||
#define _BASE_R4________ KC_SPC, NAV
|
||||
#define _LAYER_TRANS_L__ _______, ___x___
|
||||
#define _LAYER_TRANS_R__ ___x___, _______
|
||||
|
||||
|
||||
//___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___,
|
||||
|
||||
#define BASETEST \
|
||||
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \
|
||||
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, \
|
||||
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \
|
||||
KC_ESC, KC_LSFT, KC_SPC, KC_ENT
|
||||
|
||||
|
||||
#define LAYER_QWERTY \
|
||||
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \
|
||||
TR_MOUA, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TR_QUOT, \
|
||||
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, TR_COMM, TR_DOT, TR_MINS, \
|
||||
_BASE_L4________, _BASE_R4________
|
||||
|
||||
|
||||
#define LAYER_COLEMAK_DH \
|
||||
KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, TR_QUOT, \
|
||||
TR_MOUA, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, \
|
||||
KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, TR_COMM, TR_DOT, TR_MINS, \
|
||||
_BASE_L4________, _BASE_R4________
|
||||
|
||||
|
||||
#define LAYER_GAME \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, _NONE_5____________________________________, \
|
||||
GAMENUM, KC_A, KC_S, KC_D, KC_F, _NONE_5____________________________________, \
|
||||
KC_Z, KC_X, KC_C, KC_V, KC_B, _NONE_5____________________________________, \
|
||||
KC_LSFT, KC_SPC, _BASE_R4________
|
||||
|
||||
|
||||
#define LAYER_NAVIGATION \
|
||||
KC_ESC, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_INS, VS_FOLD, KC_APP, VS_UFLD, CONFIG, \
|
||||
___x___, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_BSPC, _SCAG_MODS________________________, \
|
||||
_UCCPR_L___________________________________, KC_DEL, KC_TAB, KC_VOLD, KC_VOLU, KC_MUTE, \
|
||||
_______, KC_ENT, _LAYER_TRANS_R__
|
||||
|
||||
|
||||
#define LAYER_NUMBER \
|
||||
KC_ESC, SC_SNIP, SC_FILE, FUNC, TR_GRV, KC_ENT, KC_7, KC_8, KC_9, KC_TAB, \
|
||||
_GACS_MODS________________________, TR_SCLN, KC_BSPC, KC_4, KC_5, KC_6, KC_DOT, \
|
||||
_UCCPR_L___________________________________, KC_DEL, KC_1, KC_2, KC_3, TR_MINS, \
|
||||
_LAYER_TRANS_L__, _BASE_R4________
|
||||
|
||||
|
||||
#define LAYER_SYMBOL \
|
||||
KC_ESC, ___x___, KC_AT, KC_DLR, TR_GRV, TR_EQL, KC_HASH, KC_ASTR, ___x___, TR_DQUO, \
|
||||
KC_AMPR, TR_LCBR, KC_RCBR, KC_PIPE, TR_SCLN, KC_BSPC, KC_QUES, TR_LBRC, KC_RBRC, TR_SQUO, \
|
||||
TR_PERC, TR_LABK, KC_RABK, KC_BSLS, KC_EXLM, KC_DEL, KC_SLSH, TR_LPRN, TR_DOT, TR_MINS, \
|
||||
_LAYER_TRANS_L__, _LAYER_TRANS_R__
|
||||
|
||||
|
||||
#define LAYER_FUNCTION \
|
||||
TR_DMP2, TR_DMR2, ___x___, _______, ___x___, KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F10, \
|
||||
___x___, ___x___, ___x___, ___x___, KC_SCRL, KC_CAPS, KC_F4, KC_F5, KC_F6, KC_F11, \
|
||||
_NONE_5____________________________________, KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F12, \
|
||||
_LAYER_TRANS_L__, TR_DMP1, TR_DMR1
|
||||
|
||||
|
||||
#define LAYER_MOUSE \
|
||||
___x___, TR_BTN5, TR_BTN4, TR_BTN3, ___x___, TR_MWHU, ___x___, TR_MOUU, ___x___, ___x___, \
|
||||
_______, _GACS_MOUSE_MODS_________, ___x___, TR_MWHD, TR_MOUL, TR_MOUD, TR_MOUR, ___x___, \
|
||||
___x___, ___x___, ___x___, TR_DRGS, TR_SNIP, TR_SDPI, TR_PDPI, ___x___, ___x___, ___x___, \
|
||||
TR_BTN1, TR_BTN2, ___x___, ___x___
|
||||
|
||||
|
||||
#define LAYER_GAME_NUM \
|
||||
___x___, KC_ESC, KC_TILD, KC_G, KC_T, _NONE_5____________________________________, \
|
||||
_______, KC_1, KC_2, KC_3, KC_4, _NONE_5____________________________________, \
|
||||
___x___, KC_5, KC_6, KC_7, KC_8, _NONE_5____________________________________, \
|
||||
KC_LALT, KC_LCTL, _LAYER_TRANS_R__
|
||||
|
||||
|
||||
#define LAYER_CONFIG \
|
||||
___x___, ___x___, ___x___, ___x___, ___x___, EE_CLR, QK_RBT, QK_BOOT, ___x___, _______, \
|
||||
TR_RTOG, TR_RMOD, ___x___, ___x___, ___x___, ___x___, _SCAG_MODS________________________, \
|
||||
TR_RHUI, TR_RSAI, TR_RVAI, TR_RSPI, GAME, _NONE_5____________________________________, \
|
||||
CLMAKDH, QWERTY, _LAYER_TRANS_R__
|
Loading…
Add table
Add a link
Reference in a new issue