Re-enabling combos

- implement mouse buttons
- activate certain layers with thumbs
- update readme for clarity
This commit is contained in:
Victor 2024-04-16 22:45:53 -05:00
parent d40809e5a6
commit 8a48499504
Failed to generate hash of commit
5 changed files with 89 additions and 46 deletions

View file

@ -6,6 +6,10 @@ The custom layout optimizes for programming (SQL, Powershell, C) and minimizes h
## Features ## Features
### Build Non-Tree Keyboards
- Extended the [qmk/.github](https://github.com/qmk/.github) userspace build actions to build non-tree qmk keyboards (e.g. Barbellboards Rollow). This works by copying keyboard definitions from the userspace to the qmk_firmware keyboards folder in the container. The list of keyboards to copy are defined in `qmk_nontree.json`
### Layout Wrapper Macros ### Layout Wrapper Macros
A single keymap layout can be shared with multiple keyboards by using C preprocessor macros. These macros are referenced in the keyboard JSON files, and the build process will expand them into a transient keymap.c file during compile time. A single keymap layout can be shared with multiple keyboards by using C preprocessor macros. These macros are referenced in the keyboard JSON files, and the build process will expand them into a transient keymap.c file during compile time.
@ -101,22 +105,19 @@ Additional keys may be mapped if present. Check each keyboard's `keymap.c` for m
├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤
│ z │ x │ c │ v │ b │ │ n │ m │ , ( │ . ) │ - _ │ │ z │ x │ c │ v │ b │ │ n │ m │ , ( │ . ) │ - _ │
╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┴──────╯ ╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┴──────╯
enc: mwheel │ │ num │ mou │ │ spc │ nav │ mute │ enc: volume enc: mwheel │ │ num │ shft │ │ spc │ nav │ mute │ enc: volume
╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯
╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮
│ q │ w │ f │ p │ b │ │ j │ l │ u │ y │ o │ q │ w │ f │ p │ b │ │ j │ l │ u │ y │ ' "
├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤
│ a mou│ r │ s │ t │ g │ colemak │ m │ n │ e │ i │ ' " │ a mou│ r │ s │ t │ g │ colemak │ m │ n │ e │ i │ o
├──────┼──────┼──────┼──────┼──────┤ dh ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ dh ├──────┼──────┼──────┼──────┼──────┤
│ z │ x │ c │ d │ v │ │ k │ h │ , ( │ . ) │ - _ │ │ z │ x │ c │ d │ v │ │ k │ h │ , ( │ . ) │ - _ │
╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┴──────╯ ╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┴──────╯
enc: mwheel │ │ num │ mou │ │ spc │ nav │ mute │ enc: volume enc: mwheel │ │ num │ shft │ │ spc │ nav │ mute │ enc: volume
╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯
Notes:
- swapped o and repeat on this keymap to keep repeat key in the same position across layers
╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮
│ tab │ q │ w │ e │ r │ │ │ │ │ │ │ │ tab │ q │ w │ e │ r │ │ │ │ │ │ │
├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤
@ -128,11 +129,11 @@ Notes:
╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯
╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮
│ esc │ home │ up │ end │ pgup │ │ ins │ │ app │ │ cfg │ │ esc │ home │ up │ end │ pgup │ │ ins │ │ │ │ cfg │
├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤
│ left │ down │ rght │ pgdn │ nav │ bksp │ shft │ ctrl │ alt │ gui │ tab │ left │ down │ rght │ pgdn │ nav │ bksp │ shft │ ctrl │ alt │ gui │
├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤
│ undo │ cut │ copy │ pste │ redo │ │ del │ tab │ vol- │ vol+ │ mute │ │ undo │ cut │ copy │ pste │ redo │ │ del │ app │ vol- │ vol+ │ mute │
╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┴──────┴──────╯ ╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┴──────┴──────╯
enc: zoom │ zrst │ num │ ent │ │ │ nav │ │ enc: none enc: zoom │ zrst │ num │ ent │ │ │ nav │ │ enc: none
╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯
@ -147,7 +148,7 @@ Notes:
├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤
│ undo │ cut │ copy │ pste │ redo │ │ del │ 1 │ 2 │ 3 │ - _ │ │ undo │ cut │ copy │ pste │ redo │ │ del │ 1 │ 2 │ 3 │ - _ │
╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┴──────╯ ╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┴──────╯
enc: none │ │ sym │ │ │ spc │ 0 nav│ │ enc: ← → enc: none │ │ num │ │ │ spc │ 0 nav│ │ enc: ← →
╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯
╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮
@ -157,7 +158,7 @@ Notes:
├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤
│ % ^ │ < <> │ > │ \ │ ! │ │ del │ / │ , () │ . ) │ - _ │ │ % ^ │ < <> │ > │ \ │ ! │ │ del │ / │ , () │ . ) │ - _ │
╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┴──────╯ ╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┴──────╯
enc: none │ │ sym │ │ │ │ nav │ │ enc: none enc: none │ │ num │ │ │ │ nav │ │ enc: none
╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯
Notes: Notes:
@ -170,7 +171,7 @@ Notes:
├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤
│ │ │ │ │ │ │ paus │ F1 │ F2 │ F3 │ F12 │ │ │ │ │ │ │ │ paus │ F1 │ F2 │ F3 │ F12 │
╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┴──────╯ ╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┴──────╯
enc: none │ │ sym │ │ │ mply1│ mrec1│ │ enc: ↑ ↓ enc: none │ │ num │ │ │ mply1│ mrec1│ │ enc: ↑ ↓
╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯
╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮
@ -195,7 +196,7 @@ Notes:
├──────┼──────┼──────┼──────┼──────┤ num ├──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┤ num ├──────┼──────┼──────┼──────┼──────┤
│ │ 5 │ 6 │ 7 │ 8 │ │ │ │ │ │ │ │ │ 5 │ 6 │ 7 │ 8 │ │ │ │ │ │ │
╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┴──────╯ ╰──────┴──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┴──────╯
end: mwheel │ │ alt │ ctr │ │ │ nav │ mute │ enc: volume end: mwheel │ │ alt │ ctrl │ │ │ nav │ mute │ enc: volume
╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯ ╰──────┴──────┴──────╯
╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮ ╭──────┬──────┬──────┬──────┬──────╮

View file

@ -6,28 +6,29 @@
//const uint16_t PROGMEM sniptog_combo[] = {KC_M, 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}; //const uint16_t PROGMEM moubtn4_combo[] = {KC_SPC, NAV, COMBO_END};
combo_t key_combos[COMBO_LENGTH] = {
/* /*
#if defined(POINTING_DEVICE_ENABLE) mouse buttons to map
[DRAGTOGGLE] = COMBO(dragtog_combo, DRG_TOG), - mb1 left 1 df
[SNIPERTOGGLE] = COMBO(sniptog_combo, SNP_TOG), - mb2 right 3 dg
#else - mb3 middle
[DRAGTOGGLE] = COMBO(dragtog_combo, ___x___), - mb4 back 2 cv
[SNIPERTOGGLE] = COMBO(sniptog_combo, ___x___), - mb5 forward
#endif //POINTING_DEVICE_ENABLE
#if defined(MOUSELAYER_ENABLE) bigrams that may work for mouse
[MOUSEBUTTON4] = COMBO(moubtn4_combo, KC_BTN4) - cv
#else - cb
[MOUSEBUTTON4] = COMBO(moubtn4_combo, ___x___) - xc
#endif //MOUSELAYER_ENABLE - cv
*/ */
};
bool get_combo_must_hold(uint16_t index, combo_t *combo) { bool get_combo_must_hold(uint16_t index, combo_t *combo) {
switch (index) { switch (index) {
case LYR_CONFIG:
case LYR_FUNCTION:
return true;
default: default:
return false; return false;
} }
@ -44,6 +45,11 @@ bool get_combo_must_tap(uint16_t index, combo_t *combo) {
return true; return true;
*/ */
case MOUSE_BUTTON1:
case MOUSE_BUTTON2:
case MOUSE_BUTTON4:
case MOUSE_DRGTOG:
default: default:
return false; return false;
} }
@ -53,10 +59,14 @@ bool get_combo_must_press_in_order(uint16_t combo_index, combo_t *combo) {
switch (combo_index) { switch (combo_index) {
/* List combos here that you want to only activate if their keys /* 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 * are pressed in the same order as they are defined in the combo's key
* array. */ * array.
*
* return false means they do not have to be pressed in order
*
* */
default: default:
return false; return true;
} }
} }

View file

@ -3,10 +3,49 @@
enum combos { enum combos {
//DRAGTOGGLE, //DRAGTOGGLE,
//SNIPERTOGGLE, //SNIPERTOGGLE,c
//MOUSEBUTTON4, //MOUSEBUTTON4,
#if defined(MOUSELAYER_ENABLE)
MOUSE_BUTTON1,
MOUSE_BUTTON2,
MOUSE_BUTTON4,
MOUSE_DRGTOG,
#endif //MOUSELAYER_ENABLE
KB_TAB,
KB_BSPC,
LYR_CONFIG,
LYR_FUNCTION,
COMBO_LENGTH COMBO_LENGTH
}; };
#if defined(MOUSELAYER_ENABLE)
const uint16_t PROGMEM mou_btn1_combo[] = { KC_D, KC_F, COMBO_END };
const uint16_t PROGMEM mou_btn2_combo[] = { KC_D, KC_G, COMBO_END };
const uint16_t PROGMEM mou_btn4_combo[] = { KC_C, KC_V, COMBO_END };
const uint16_t PROGMEM mou_drg_combo[] = { TR_COMM, TR_DOT, COMBO_END };
#endif //MOUSELAYER_ENABLE
const uint16_t PROGMEM kb_tab_combo[] = { KC_S, KC_F, COMBO_END };
const uint16_t PROGMEM kb_bspc_combo[] = { KC_J, KC_L, COMBO_END };
const uint16_t PROGMEM lyr_cfg_combo[] = { KC_SPC, NAV, COMBO_END };
const uint16_t PROGMEM lyr_fun_combo[] = { NUM, TR_LSFT, COMBO_END };
combo_t key_combos[COMBO_LENGTH] = {
#if defined(MOUSELAYER_ENABLE)
[MOUSE_BUTTON1] = COMBO(mou_btn1_combo, TR_BTN1),
[MOUSE_BUTTON2] = COMBO(mou_btn2_combo, TR_BTN2),
[MOUSE_BUTTON4] = COMBO(mou_btn4_combo, TR_BTN4),
[MOUSE_BUTTON4] = COMBO(mou_drg_combo, TR_DRGS),
#endif //MOUSELAYER_ENABLE
[KB_TAB] = COMBO(kb_tab_combo, KC_TAB),
[KB_BSPC] = COMBO(kb_bspc_combo, KC_BSPC),
[LYR_CONFIG] = COMBO(lyr_cfg_combo, CONFIG),
[LYR_FUNCTION] = COMBO(lyr_fun_combo, FUNC)
};
//their documentation is so confusing because you don't use COMBO_LEN defining the actions //their documentation is so confusing because you don't use COMBO_LEN defining the actions
uint16_t COMBO_LEN = COMBO_LENGTH; uint16_t COMBO_LEN = COMBO_LENGTH;

View file

@ -18,7 +18,6 @@ UNICODE_ENABLE ?= no
SPACE_CADET_ENABLE ?= no SPACE_CADET_ENABLE ?= no
GRAVE_ESC_ENABLE ?= no GRAVE_ESC_ENABLE ?= no
COMBO_ENABLE ?= no
DYNAMIC_MACRO_ENABLE ?= yes DYNAMIC_MACRO_ENABLE ?= yes
RGB_MATRIX_ENABLE ?= no RGB_MATRIX_ENABLE ?= no
RGBLIGHT_ENABLE ?= no RGBLIGHT_ENABLE ?= no
@ -32,7 +31,7 @@ EXTRAKEY_ENABLE = yes
AUDIO_ENABLE = no AUDIO_ENABLE = no
CAPS_WORD_ENABLE = yes CAPS_WORD_ENABLE = yes
MOUSEKEY_ENABLE = yes MOUSEKEY_ENABLE = yes
COMBO_ENABLE = yes
# --------------------------------------------------------- # ---------------------------------------------------------
# include my code that will be common across all my keyboards # include my code that will be common across all my keyboards
@ -49,7 +48,6 @@ ifeq ($(strip $(CAPS_WORD_ENABLE)), yes)
SRC += features/capsword.c SRC += features/capsword.c
endif endif
ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
SRC += features/rgbmatrix.c SRC += features/rgbmatrix.c
endif endif
@ -58,12 +56,10 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), ws2812)
SRC += features/rgbmatrix.c SRC += features/rgbmatrix.c
endif endif
ifeq ($(strip $(MOUSEKEY_ENABLE)), yes) ifeq ($(strip $(MOUSEKEY_ENABLE)), yes)
SRC += features/mouse.c SRC += features/mouse.c
endif endif
ifeq ($(strip $(OLED_ENABLE)), yes) ifeq ($(strip $(OLED_ENABLE)), yes)
SRC += features/oled.c SRC += features/oled.c
endif endif

View file

@ -114,12 +114,10 @@ enum keycodes {
# define TR_BTN4 KC_BTN4 # define TR_BTN4 KC_BTN4
# define TR_BTN5 KC_BTN5 # define TR_BTN5 KC_BTN5
# define TR_NUM1 LT(_NUMBER, KC_BTN1)
# if defined(KEYBOARD_bastardkb_charybdis_3x5) # if defined(KEYBOARD_bastardkb_charybdis_3x5)
//these codes are defined in charybdis.h //these codes are defined in charybdis.h
# define TR_SNIP SNIPING # define TR_SNIP SNIPING
# define TR_DRGS DRGSCRL # define TR_DRGS DRG_TOG
# define TR_SDPI S_D_MOD //sniping dpi # define TR_SDPI S_D_MOD //sniping dpi
# define TR_PDPI DPI_MOD //pointer dpi # define TR_PDPI DPI_MOD //pointer dpi
# else # else
@ -151,7 +149,6 @@ enum keycodes {
# define TR_SDPI ___x___ # define TR_SDPI ___x___
# define TR_PDPI ___x___ # define TR_PDPI ___x___
# define TR_NUM1 MO(_NUMBER)
#endif //MOUSEKEY_ENABLE #endif //MOUSEKEY_ENABLE
@ -197,7 +194,7 @@ enum keycodes {
#define _SCAG_MODS________________________ TR_LSFT, TR_LCTL, TR_LALT, TR_LGUI #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 _UCCPR_L___________________________________ SC_UNDO, SC_CUT, SC_COPY, SC_PAST, SC_REDO
#define _BASE_L4_________________ ___x___, TR_NUM1, TR_LSFT #define _BASE_L4_________________ ___x___, NUM, TR_LSFT
#define _BASE_R4_________________ KC_SPC, NAV, KC_MUTE #define _BASE_R4_________________ KC_SPC, NAV, KC_MUTE
#define _LAYER_TRANS_____________ ___x___, _______, ___x___ #define _LAYER_TRANS_____________ ___x___, _______, ___x___
@ -233,10 +230,10 @@ enum keycodes {
#define LAYER_NAVIGATION \ #define LAYER_NAVIGATION \
KC_ESC, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_INS, ___x___, KC_APP, ___x___, CONFIG, \ KC_ESC, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_INS, ___x___, ___x___, ___x___, CONFIG, \
___x___, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_BSPC, _SCAG_MODS________________________, \ KC_TAB, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_BSPC, _SCAG_MODS________________________, \
_UCCPR_L___________________________________, KC_DEL, KC_TAB, KC_VOLD, KC_VOLU, KC_MUTE, \ _UCCPR_L___________________________________, KC_DEL, KC_APP, KC_VOLD, KC_VOLU, KC_MUTE, \
ZOOMRST, NUM, KC_ENT, _LAYER_TRANS_____________ ZOOMRST, _______, KC_ENT, _LAYER_TRANS_____________
#define LAYER_NUMBER \ #define LAYER_NUMBER \