Skip to content

Commit

Permalink
feat: replace key override with custom shift key
Browse files Browse the repository at this point in the history
  • Loading branch information
Diaoul committed Dec 7, 2024
1 parent 513e088 commit 7616b6b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
5 changes: 5 additions & 0 deletions qmk/users/diaoul/diaoul.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 17,11 @@ uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) {

// Process record
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef CUSTOM_SHIFT_KEYS_ENABLE
if (!process_custom_shift_keys(keycode, record)) {
return false;
}
#endif
#ifdef ACHORDION_ENABLE
if (!process_achordion(keycode, record)) {
return false;
Expand Down
3 changes: 3 additions & 0 deletions qmk/users/diaoul/diaoul.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 10,9 @@
#ifdef KEY_OVERRIDE_ENABLE
# include "features/overrides.h"
#endif
#ifdef CUSTOM_SHIFT_KEYS_ENABLE
# include "features/custom_shift_keys.h"
#endif
#ifdef COMBO_ENABLE
# include "features/combos.h"
#endif
Expand Down
10 changes: 10 additions & 0 deletions qmk/users/diaoul/features/custom_shift_keys.c
Original file line number Diff line number Diff line change
@@ -0,0 1,10 @@
#include "custom_shift_keys.h"

const custom_shift_key_t custom_shift_keys[] = {
[BSPC_DEL] = {KC_BSPC, KC_DEL},
[DOT_COLN] = {KC_DOT, KC_COLN},
[COMM_SCLN] = {KC_COMM, KC_SCLN},
[QUES_EXLM] = {KC_QUES, KC_EXLM},
};

uint8_t NUM_CUSTOM_SHIFT_KEYS = CUSTOM_SHIFT_KEYS_COUNT;
11 changes: 11 additions & 0 deletions qmk/users/diaoul/features/custom_shift_keys.h
Original file line number Diff line number Diff line change
@@ -0,0 1,11 @@
#pragma once

#include "getreuer/features/custom_shift_keys.h"

enum {
BSPC_DEL,
DOT_COLN,
COMM_SCLN,
QUES_EXLM,
CUSTOM_SHIFT_KEYS_COUNT,
};
7 changes: 6 additions & 1 deletion qmk/users/diaoul/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 6,8 @@ SPACE_CADET_ENABLE = no
# Extra features
REPEAT_KEY_ENABLE ?= yes
CAPS_WORD_ENABLE ?= yes
KEY_OVERRIDE_ENABLE ?= yes
KEY_OVERRIDE_ENABLE ?= no
CUSTOM_SHIFT_KEYS_ENABLE ?= yes
COMBO_ENABLE ?= yes
ACHORDION_ENABLE ?= yes
# AUTOCORRECT_ENABLE ?= yes
Expand All @@ -19,6 20,10 @@ endif
ifeq ($(strip $(KEY_OVERRIDE_ENABLE)), yes)
SRC = features/overrides.c
endif
ifeq ($(strip $(CUSTOM_SHIFT_KEYS_ENABLE)), yes)
SRC = features/getreuer/custom_shift_keys.c features/custom_shift_keys.c
OPT_DEFS = -DCUSTOM_SHIFT_KEYS_ENABLE
endif
ifeq ($(strip $(COMBO_ENABLE)), yes)
SRC = features/combos.c
endif
Expand Down

0 comments on commit 7616b6b

Please sign in to comment.