Skip to content

Commit

Permalink
Go back to BRMs and configure auto/retro-tap
Browse files Browse the repository at this point in the history
  • Loading branch information
flmng0 committed Oct 11, 2023
1 parent 625c353 commit 6685a22
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 18 deletions.
5 changes: 5 additions & 0 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

#define COMBO_TERM_PER_COMBO

#define RETRO_SHIFT 500

#define NO_AUTO_SHIFT_NUMBERIC
#define NO_AUTO_SHIFT_SYMBOLS

#ifndef __ASSEMBLER__
#include "layout.h"
#endif
79 changes: 73 additions & 6 deletions flmng0.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
*
* Open on left hand, close on right hand.
*/
const uint16_t PROGMEM c_lparen[] = {HM_T, KC_D, COMBO_END};
const uint16_t PROGMEM c_rparen[] = {HM_N, KC_H, COMBO_END};
const uint16_t PROGMEM c_lparen[] = {CC_T, CC_D, COMBO_END};
const uint16_t PROGMEM c_rparen[] = {CC_N, CC_H, COMBO_END};

const uint16_t PROGMEM c_lbracket[] = {HM_S, KC_C, COMBO_END};
const uint16_t PROGMEM c_rbracket[] = {HM_E, KC_COMM, COMBO_END};
const uint16_t PROGMEM c_lbracket[] = {CC_S, CC_C, COMBO_END};
const uint16_t PROGMEM c_rbracket[] = {CC_E, CC_COMM, COMBO_END};

const uint16_t PROGMEM c_lbrace[] = {KC_G, KC_V, COMBO_END};
const uint16_t PROGMEM c_rbrace[] = {KC_M, KC_K, COMBO_END};

const uint16_t PROGMEM c_langle[] = {HM_R, KC_X, COMBO_END};
const uint16_t PROGMEM c_rangle[] = {HM_I, KC_DOT, COMBO_END};
const uint16_t PROGMEM c_langle[] = {CC_R, CC_X, COMBO_END};
const uint16_t PROGMEM c_rangle[] = {CC_I, CC_DOT, COMBO_END};

/**
* Common symbols.
Expand Down Expand Up @@ -88,6 +88,70 @@ bool caps_word_press_user(uint16_t keycode) {
}
}

/* bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { */
/* switch (keycode) { */
/* #ifdef HOME_ROW_MODS */
/* case HM_A: */
/* case HM_R: */
/* case HM_S: */
/* case HM_T: */
/* case HM_N: */
/* case HM_E: */
/* case HM_I: */
/* case HM_O: */
/* return true; */
/**/
/* #else */
/* case BM_Z: */
/* case BM_X: */
/* case BM_C: */
/* case BM_D: */
/* case BM_H: */
/* case BM_COMM: */
/* case BM_DOT: */
/* case BM_QUOT: */
/* return true; */
/* #endif */
/**/
/* case KC_A ... KC_Z: */
/* case KC_TAB: */
/* return true; */
/* } */
/**/
/* return false; */
/* } */

bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
#ifdef HOME_ROW_MODS
case HM_A:
case HM_R:
case HM_S:
case HM_T:
case HM_N:
case HM_E:
case HM_I:
case HM_O:
return true;

#else
case BM_Z:
case BM_X:
case BM_C:
case BM_D:
case BM_H:
case BM_COMM:
case BM_DOT:
case BM_QUOT:
return true;

#endif
}

return false;
}

#ifdef HOME_ROW_MODS
#define ROLLOVER(kca, kcb, modded_b, mod_a) \
case modded_b: \
if (record->event.pressed && record->tap.count > 0) { \
Expand All @@ -100,8 +164,10 @@ bool caps_word_press_user(uint16_t keycode) {
} \
} \
return true;
#endif

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef HOME_ROW_MODS
uint8_t mods = get_mods();

switch (keycode) {
Expand All @@ -115,6 +181,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
ROLLOVER(KC_I, KC_E, HM_E, KC_LALT);
ROLLOVER(KC_O, KC_I, HM_I, KC_RGUI);
}
#endif

return true;
}
2 changes: 1 addition & 1 deletion keymaps/combo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"keymap": "flmng0",
"layout": "LAYOUT_a_dux_wrap",
"layers": [
[ "_BASE_HRM" ],
[ "_BASE" ],
[ "_NAV" ],
[ "_SYM" ],
[ "_NUM" ],
Expand Down
69 changes: 58 additions & 11 deletions layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,8 @@

/* #define S_TAB LSFT_T(KC_TAB) */

#define BM_Z LGUI_T(KC_Z)
#define BM_X LALT_T(KC_X)
#define BM_C LSFT_T(KC_C)
#define BM_D LCTL_T(KC_D)

#define BM_H RCTL_T(KC_H)
#define BM_COMM RSFT_T(KC_COMM)
#define BM_DOT LALT_T(KC_DOT)
#define BM_QUOT RGUI_T(KC_QUOT)

#ifdef HOME_ROW_MODS

#define HM_A LGUI_T(KC_A)
#define HM_R LALT_T(KC_R)
Expand All @@ -40,19 +32,70 @@
#define HM_I LALT_T(KC_I)
#define HM_O RGUI_T(KC_O)

#define CC_T HM_T
#define CC_D KC_D

#define _BASE_HRM \
#define CC_N HM_N
#define CC_H KC_H

#define CC_S HM_S
#define CC_C KC_C

#define CC_E HM_E
#define CC_COMM KC_COMM

#define CC_R HM_R
#define CC_X KC_X

#define CC_I HM_I
#define CC_DOT KC_DOT


#define _BASE \
KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN, \
HM_A , HM_R , HM_S , HM_T , KC_G , KC_M , HM_N , HM_E , HM_I , HM_O , \
KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM, KC_DOT , KC_QUOT, \
L_NUM , L_NAV , L_SYM , KC_BSPC

#define _BASE_BRM \
#else

#define BM_Z LGUI_T(KC_Z)
#define BM_X LALT_T(KC_X)
#define BM_C LSFT_T(KC_C)
#define BM_D LCTL_T(KC_D)

#define BM_H RCTL_T(KC_H)
#define BM_COMM RSFT_T(KC_COMM)
#define BM_DOT LALT_T(KC_DOT)
#define BM_QUOT RGUI_T(KC_QUOT)

#define CC_T KC_T
#define CC_D BM_D

#define CC_N KC_N
#define CC_H BM_H

#define CC_S KC_S
#define CC_C BM_C

#define CC_E KC_E
#define CC_COMM BM_COMM

#define CC_R KC_R
#define CC_X BM_X

#define CC_I KC_I
#define CC_DOT BM_DOT


#define _BASE \
KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN, \
KC_A , KC_R , KC_S , KC_T , KC_G , KC_M , KC_N , KC_E , KC_I , KC_O , \
BM_Z , BM_X , BM_C , BM_D , KC_V , KC_K , BM_H , BM_COMM, BM_DOT , BM_QUOT, \
L_NUM , L_NAV , L_SYM , KC_BSPC

#endif

#define _NAV \
KC_ESC , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_HOME, KC_PGDN, KC_PGUP, KC_END , \
CW_TOGG, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, \
Expand All @@ -77,5 +120,9 @@
KC_LCTL, KC_Z , KC_S , KC_X , KC_C , KC_V , KC_B , KC_NO , KC_NO , KC_NO , \
KC_LALT, KC_SPC , KC_NO , KC_NO

// TODO: finish off the gaming alternate layer
/* #define _GAME_ALT \ */
/* KC_ESC , KC_5 , KC_6 , KC_7 , KC_8 , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , \ */


#define LAYOUT_a_dux_wrap(...) LAYOUT_split_3x5_2(__VA_ARGS__)
4 changes: 4 additions & 0 deletions rules.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
COMBO_ENABLE = yes
CAPS_WORD_ENABLE = yes
AUTO_SHIFT_ENABLE = yes

INTROSPECTION_KEYMAP_C = flmng0.c


# OPT_DEFS += -DHOME_ROW_MODS

0 comments on commit 6685a22

Please sign in to comment.