Skip to content

Commit

Permalink
Add the upper row symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
flmng0 committed Jan 4, 2024
1 parent 2974255 commit 4d45a43
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 17 deletions.
52 changes: 39 additions & 13 deletions flmng0.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,63 @@
# include "hrm.h"
#endif

/**
* Num row symbols.
*/
#define COMBO_DEF(var, ...) \
const uint16_t PROGMEM var[] = {__VA_ARGS__, COMBO_END}

COMBO_DEF(c_at, KC_W, CC_R);
COMBO_DEF(c_pound, KC_F, CC_S);
COMBO_DEF(c_dollar, KC_P, CC_T);
COMBO_DEF(c_percent, KC_B, KC_G);

COMBO_DEF(c_carat, KC_J, KC_M);
COMBO_DEF(c_and, KC_L, CC_N);
COMBO_DEF(c_star, KC_U, CC_E);
COMBO_DEF(c_slash, KC_Y, CC_I);

/**
* Parenthesis.
*
* Open on left hand, close on right hand.
*/
const uint16_t PROGMEM c_lparen[] = {CC_T, CC_D, COMBO_END};
const uint16_t PROGMEM c_rparen[] = {CC_N, CC_H, COMBO_END};
COMBO_DEF(c_lparen, CC_T, CC_S);
COMBO_DEF(c_rparen, CC_N, CC_E);

const uint16_t PROGMEM c_lbracket[] = {CC_S, CC_C, COMBO_END};
const uint16_t PROGMEM c_rbracket[] = {CC_E, CC_COMM, COMBO_END};
COMBO_DEF(c_lbracket, CC_T, CC_R);
COMBO_DEF(c_rbracket, CC_N, CC_I);

const uint16_t PROGMEM c_lbrace[] = {KC_G, KC_V, COMBO_END};
const uint16_t PROGMEM c_rbrace[] = {KC_M, KC_K, COMBO_END};
COMBO_DEF(c_lbrace, CC_S, CC_R);
COMBO_DEF(c_rbrace, CC_N, CC_E);

const uint16_t PROGMEM c_langle[] = {CC_R, CC_X, COMBO_END};
const uint16_t PROGMEM c_rangle[] = {CC_I, CC_DOT, COMBO_END};
COMBO_DEF(c_langle, CC_T, CC_S, CC_R);
COMBO_DEF(c_rangle, CC_N, CC_E, CC_I);

/**
* Common symbols.
*/
const uint16_t PROGMEM c_hyphen[] = {KC_B, KC_J, COMBO_END};
const uint16_t PROGMEM c_equals[] = {KC_G, KC_M, COMBO_END};
const uint16_t PROGMEM c_underscore[] = {KC_V, KC_K, COMBO_END};
COMBO_DEF(c_hyphen, KC_B, KC_J);
COMBO_DEF(c_equals, KC_G, KC_M);
COMBO_DEF(c_underscore, KC_V, KC_K);

/**
* Functional keys.
*/
const uint16_t PROGMEM c_backspace[] = {KC_L, KC_U, COMBO_END};
const uint16_t PROGMEM c_delete[] = {KC_U, KC_Y, COMBO_END};
COMBO_DEF(c_backspace, KC_L, KC_U);
COMBO_DEF(c_delete, KC_U, KC_Y);

combo_t key_combos[] = {
// Upper Symbols
COMBO(c_at, LSFT(KC_2)),
COMBO(c_pound, LSFT(KC_3)),
COMBO(c_dollar, LSFT(KC_4)),
COMBO(c_percent, LSFT(KC_5)),
COMBO(c_carat, LSFT(KC_6)),
COMBO(c_and, LSFT(KC_7)),
COMBO(c_star, LSFT(KC_8)),
COMBO(c_slash, LSFT(KC_9)),

// Parenthesis
COMBO(c_lparen, LSFT(KC_9)),
COMBO(c_rparen, LSFT(KC_0)),
Expand Down
5 changes: 4 additions & 1 deletion hrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ bool process_hrm(uint16_t keycode, keyrecord_t *record) {
break;

default:
idle_timer = timer_read32();
if (!record->event.pressed)
idle_timer = timer_read32();
}

return true;
}

#define IS_IDLE (timer_elapsed32(idle_timer) >= HRM_IDLE_DELAY)

#endif // HRM_LAYOUT_ONLY
6 changes: 3 additions & 3 deletions layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#define L_SYM LT_SYM(KC_ENTER)
#define L_NUM LT_NUM(KC_TAB)

#define TH_LA LT_NUM(KC_ENTER)
#define TH_LA LT_NUM(KC_TAB)
#define TH_LH LT_NAV(KC_SPACE)

#define TH_RH OSM(MOD_LSFT)
#define TH_RA KC_BACKSPACE
#define TH_RH LT_SYM(KC_ENTER)
#define TH_RA OSM(MOD_LSFT)

#ifdef HOME_ROW_MODS

Expand Down

0 comments on commit 4d45a43

Please sign in to comment.