commit 67ab0fde304e585403f10f10831c3aae08993bd8
parent f0776f1b60c0fafaa519f389764079104332e97c
Author: Jack Sangdahl <jack@pngu.org>
Date: Fri, 26 Dec 2025 08:47:39 -0700
Add some more macros to layout
Diffstat:
4 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/users/jack/jack.c b/users/jack/jack.c
@@ -99,10 +99,12 @@ bool remember_last_key_user(uint16_t keycode, keyrecord_t *record,
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!process_record_keymap(keycode, record))
return false;
+ const mod_t mods = get_mod_state();
+ bool shifted = mods.left_shift || mods.right_shift;
switch (keycode) {
case KC_MINS:
#ifdef UNICODE_COMMON_ENABLE
- if (get_mods() & MOD_MASK_SHIFT) {
+ if (shifted) {
if (record->event.pressed)
register_unicode(0x2014);
return false;
@@ -138,14 +140,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed)
SEND_STRING("$_");
break;
+ case PM_ASGN:
+ if (record->event.pressed) {
+ tap_code16(shifted ? KC_MINS : KC_PLUS);
+ tap_code(KC_EQL);
+ }
+ break;
case REP_L2:
if (record->tap.count) {
repeat_key_invoke(&record->event);
return false;
}
break;
- INTERCEPT_MOD_TAP(LALT_T, KC_EXLM)
- INTERCEPT_MOD_TAP(LGUI_T, KC_ASTR)
INTERCEPT_MOD_TAP(RSFT_T, KC_LPRN)
INTERCEPT_MOD_TAP(RCTL_T, KC_RPRN)
INTERCEPT_MOD_TAP(RALT_T, KC_DQUO)
diff --git a/users/jack/jack.h b/users/jack/jack.h
@@ -7,7 +7,15 @@ enum layers { LAYER0, LAYER1, LAYER2, LAYER3 };
enum tapdances { PLY_NXT_PRV };
-enum custom_keycodes { UPDIR = QK_USER, REMOVE, USRNME, GEQ, LEQ, RECALL };
+enum custom_keycodes {
+ UPDIR = QK_USER,
+ REMOVE,
+ USRNME,
+ GEQ,
+ LEQ,
+ RECALL,
+ PM_ASGN
+};
void keyboard_post_init_keymap(void);
layer_state_t layer_state_set_keymap(layer_state_t state);
@@ -72,7 +80,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
#define ___LAYER13___ _______, _______, _______, _______
#define ___LAYER20___ KC_GRV, LEQ, GEQ, KC_MINS, KC_PIPE, KC_CIRC, KC_LCBR, KC_RCBR, KC_DLR, KC_BSLS
-#define ___LAYER21___ HRML(KC_EXLM, KC_ASTR, KC_SLSH, KC_EQL), KC_AMPR, KC_HASH, HRMR(KC_LPRN, KC_RPRN, KC_QUOT, KC_DQUO)
+#define ___LAYER21___ KC_EXLM, KC_ASTR, PM_ASGN, KC_EQL, KC_AMPR, KC_HASH, HRMR(KC_LPRN, KC_RPRN, KC_QUOT, KC_DQUO)
#define ___LAYER22___ KC_TILD, KC_PLUS, KC_LBRC, KC_RBRC, KC_PERC, KC_AT, KC_COLN, _______, _______, _______
#define ___LAYER23___ _______, _______, _______, _______
diff --git a/util/keymap.yaml b/util/keymap.yaml
@@ -56,7 +56,7 @@ layers:
- {type: ghost}
LAYER2:
- ["`", $$mdi:less-than-or-equal$$, $$mdi:greater-than-or-equal$$, "-", "|", "^", "{", "}", "$", "\\"]
- - ["!", "*", "/", "=", "&", "#", "(", ")", "'", "\""]
+ - ["!", "*", {t: "+=", s: "-="}, "=", "&", "#", "(", ")", "'", "\""]
- ["~", "+", "[", "]", "%", "@", ":", null, null, null]
- {type: ghost}
- {t: "▽", type: trans}
diff --git a/util/layout.svg b/util/layout.svg
@@ -558,7 +558,8 @@ path.combo {
</g>
<g transform="translate(140, 84)" class="key keypos-12">
<rect rx="6" ry="6" x="-26" y="-26" width="52" height="52" class="key"/>
-<text x="0" y="0" class="key tap">/</text>
+<text x="0" y="0" class="key tap">+=</text>
+<text x="0" y="-24" class="key shifted">-=</text>
</g>
<g transform="translate(196, 91)" class="key keypos-13">
<rect rx="6" ry="6" x="-26" y="-26" width="52" height="52" class="key"/>