Skip to content

Commit

Permalink
fix swedish specials with HRM
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperhellberg committed Jul 30, 2023
1 parent be17355 commit 973c52a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
19 changes: 14 additions & 5 deletions keyboards/crkbd/keymaps/jesperSwedish/keycode_aliases.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@
#define OSM_SHIFT OSM(MOD_RSFT)
#define GUI_ENT GUI_T(KC_ENT)
#define OSM_ALT OSM(MOD_LALT)
#define GUI_SCL GUI_T(KC_SCLN)

// ***** base layer modifiers
#define NUM_DEL LT(NUMBER,KC_DEL)
#define NUM_BSPC LT(NUMBER,KC_BSPC)
#define SYM_DEL LT(SYMBOL,KC_DEL)
#define SYM_BSPC LT(SYMBOL,KC_BSPC)

// ***** home row mod *****
#define GUI_A LGUI_T(KC_A)
#define ALT_O LALT_T(KC_O)
#define CTRL_E LCTL_T(KC_E)
#define SFT_U LSFT_T(KC_U)
#define SFT_H LSFT_T(KC_H)
#define CTRL_T RCTL_T(KC_T)
#define ALT_N LALT_T(KC_N)
#define GUI_S RGUI_T(KC_S)


// ***** IDEA
#define IDEBUG A(S(KC_F9))
Expand Down Expand Up @@ -70,25 +79,25 @@ return false;
// Always shifted
#define SHIFT_ALL(kc1, kc2) \
if (record->event.pressed) { \
register_code(KC_LSFT); \
if (lshift || rshift) { \
if (get_mods() & MOD_MASK_SHIFT) { \
unregister_code(kc2); \
register_code(kc2); \
} else { \
register_code(KC_LSFT); \
unregister_code(kc1); \
register_code(kc1); \
unregister_code(KC_LSFT); \
} \
} else { \
unregister_code(kc1); \
unregister_code(kc2); \
if (lshift || rshift) \
if (get_mods() & MOD_MASK_SHIFT) \
register_code(KC_LSFT); \
else \
unregister_code(KC_LSFT); \
} \
return false;


// Shift on kc1, AltGr on kc2
// this needs to unregister it's pressed button
#define SHIFT_ALGR(kc1, kc2) \
Expand Down
9 changes: 6 additions & 3 deletions keyboards/crkbd/keymaps/jesperSwedish/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ enum jesper_custom_keycodes {
JH_COMM,
JH_QUOT,
JH_SLSH,
JH_GRV
JH_GRV,
JH_SCLN
};

enum combos {
Expand All @@ -55,9 +56,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//,-----------------------------------------------------. ,-----------------------------------------------------.
KC_TAB, JH_QUOT, JH_COMM, JH_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, JH_SLSH,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LSFT, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, SE_MINS,
KC_LSFT, GUI_A, ALT_O, CTRL_E, SFT_U, KC_I, KC_D, SFT_H, CTRL_T, ALT_N, KC_S, SE_MINS,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LCTL, GUI_SCL, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z,OSM_SHIFT,
KC_LCTL, JH_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z,OSM_SHIFT,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
KC_LALT, KC_SPC,NUM_BSPC, SYM_DEL, KC_ENT, MO(IDEA)
//`--------------------------' `--------------------------'
Expand Down Expand Up @@ -373,6 +374,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
SHIFT_ALL(SE_7,SE_PLUS);
case JH_GRV:
SHIFT_ALGR(SE_ACUT,SE_DIAE);
case JH_SCLN:
SHIFT_ALL(SE_COMM,SE_DOT);
default:
return true;
}
Expand Down

0 comments on commit 973c52a

Please sign in to comment.