Skip to content

Commit

Permalink
feat: migrate to qmk 0.26, avoid relying on instrospection
Browse files Browse the repository at this point in the history
  • Loading branch information
Diaoul committed Oct 4, 2024
1 parent 42f5bb3 commit 38cec29
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 20 deletions.
2 changes: 1 addition & 1 deletion qmk/qmk_firmware
Submodule qmk_firmware updated 7341 files
6 changes: 6 additions & 0 deletions qmk/users/diaoul/diaoul.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
#ifdef OLED_ENABLE
# include "features/oled.h"
#endif
#ifdef KEY_OVERRIDE_ENABLE
# include "features/overrides.h"
#endif
#ifdef COMBO_ENABLE
# include "features/combos.h"
#endif
#ifdef ACHORDION_ENABLE
# include "features/getreuer/achordion.h"
#endif
Expand Down
28 changes: 14 additions & 14 deletions qmk/users/diaoul/features/combos.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

// top row
// left
const uint16_t PROGMEM f_p_combo[] = {KC_F, KC_P, COMBO_END};
const uint16_t PROGMEM f_w_combo[] = {KC_F, KC_W, COMBO_END};
const uint16_t PROGMEM w_p_combo[] = {KC_W, KC_P, COMBO_END};
const uint16_t PROGMEM fp_combo[] = {KC_F, KC_P, COMBO_END};
const uint16_t PROGMEM fw_combo[] = {KC_F, KC_W, COMBO_END};
const uint16_t PROGMEM wp_combo[] = {KC_W, KC_P, COMBO_END};
// right
const uint16_t PROGMEM l_u_combo[] = {KC_L, KC_U, COMBO_END};
const uint16_t PROGMEM u_y_combo[] = {KC_U, KC_Y, COMBO_END};
const uint16_t PROGMEM l_y_combo[] = {KC_L, KC_Y, COMBO_END};
const uint16_t PROGMEM lu_combo[] = {KC_L, KC_U, COMBO_END};
const uint16_t PROGMEM uy_combo[] = {KC_U, KC_Y, COMBO_END};
const uint16_t PROGMEM ly_combo[] = {KC_L, KC_Y, COMBO_END};
// home row
// mixed
const uint16_t PROGMEM s_e_combo[] = {HR_S, HR_E, COMBO_END};
const uint16_t PROGMEM se_combo[] = {HR_S, HR_E, COMBO_END};

combo_t key_combos[] = {
// top row
COMBO(f_p_combo, KC_LPRN),
COMBO(f_w_combo, KC_LBRC),
COMBO(w_p_combo, KC_LCBR),
COMBO(l_u_combo, KC_RPRN),
COMBO(u_y_combo, KC_RBRC),
COMBO(l_y_combo, KC_RCBR),
[FP_LPRN] = COMBO(fp_combo, KC_LPRN),
[FW_LBRC] = COMBO(fw_combo, KC_LBRC),
[WP_LCBR] = COMBO(wp_combo, KC_LCBR),
[LU_RPRN] = COMBO(lu_combo, KC_RPRN),
[UY_RBRC] = COMBO(uy_combo, KC_RBRC),
[LY_RCBR] = COMBO(ly_combo, KC_RCBR),
// home row
COMBO(s_e_combo, CW_TOGG),
[SE_CW] = COMBO(se_combo, CW_TOGG),
};
14 changes: 14 additions & 0 deletions qmk/users/diaoul/features/combos.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#pragma once

#include QMK_KEYBOARD_H
#include "process_combo.h"

#include "../definitions/keycodes.h"

enum combos {
FP_LPRN,
FW_LBRC,
WP_LCBR,
LU_RPRN,
UY_RBRC,
LY_RCBR,
SE_CW,
COMBO_COUNT,
};

extern combo_t key_combos[COMBO_COUNT];
7 changes: 5 additions & 2 deletions qmk/users/diaoul/features/overrides.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const key_override_t dot_key_override = ko_make_basic(MOD_MASK_SHIFT, KC_DOT, K
const key_override_t comm_key_override = ko_make_basic(MOD_MASK_SHIFT, KC_COMM, KC_SCLN);
const key_override_t ques_key_override = ko_make_basic(MOD_MASK_SHIFT, KC_QUES, KC_EXLM);

const key_override_t **key_overrides = (const key_override_t *[]){
&del_key_override, &dot_key_override, &comm_key_override, &ques_key_override, NULL,
const key_override_t *key_overrides[] = {
[BSPC_DEL] = &del_key_override,
[DOT_COLN] = &dot_key_override,
[COMM_SCLN] = &comm_key_override,
[QUES_EXLM] = &ques_key_override,
};
11 changes: 11 additions & 0 deletions qmk/users/diaoul/features/overrides.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#pragma once

#include QMK_KEYBOARD_H
#include "process_key_override.h"

enum {
BSPC_DEL,
DOT_COLN,
COMM_SCLN,
QUES_EXLM,
KEY_OVERRIDE_COUNT,
};

extern const key_override_t *key_overrides[KEY_OVERRIDE_COUNT];
6 changes: 3 additions & 3 deletions qmk/users/diaoul/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ endif
ifeq ($(strip $(KEY_OVERRIDE_ENABLE)), yes)
SRC += features/overrides.c
endif
ifeq ($(strip $(COMBO_ENABLE)), yes)
SRC += features/combos.c
endif
ifeq ($(strip $(ACHORDION_ENABLE)), yes)
SRC += features/getreuer/achordion.c
OPT_DEFS += -DACHORDION_ENABLE
endif
ifeq ($(strip $(COMBO_ENABLE)), yes)
INTROSPECTION_KEYMAP_C = features/combos.c
endif

0 comments on commit 38cec29

Please sign in to comment.