Skip to content

Commit

Permalink
Use Tri layer feature, remove unnecessary config
Browse files Browse the repository at this point in the history
  • Loading branch information
Janat Taerakul committed Jul 28, 2023
1 parent f64917a commit 9aa8117
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
21 changes: 14 additions & 7 deletions keyboards/planck/keymaps/janat-t/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@

#define MIDI_BASIC

// Most tactile encoders have detents every 4 stages
#define ENCODER_RESOLUTION 4

// Configure the global tapping term (default: 200ms)
#define TAPPING_TERM 180

// Prevent normal rollover on alphas from accidentally triggering mods.
#define PERMISSIVE_HOLD

#define MOUSEKEY_DELAY 100

#define USB_POLLING_INTERVAL_MS 1
#ifndef MOUSEKEY_INTERVAL
#define MOUSEKEY_INTERVAL 10
#endif
#ifndef MOUSEKEY_MAX_SPEED
#define MOUSEKEY_MAX_SPEED 3
#endif
#ifndef MOUSEKEY_TIME_TO_MAX
#define MOUSEKEY_TIME_TO_MAX 100
#endif

// Enable rapid switch from tap to hold, disables double tap hold auto-repeat.
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0

#define TRI_LAYER_LOWER_LAYER 3
#define TRI_LAYER_UPPER_LAYER 4
#define TRI_LAYER_ADJUST_LAYER 7
18 changes: 3 additions & 15 deletions keyboards/planck/keymaps/janat-t/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ enum planck_keycodes {
NOMOD
};

#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
#define MOU_Z LT(_MOUSE, KC_Z)
#define MOU_SCLN LT(_MOUSE, KC_SCLN)
#define NAV_SLSH LT(_NAV, KC_SLSH)
Expand Down Expand Up @@ -89,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
CT_ESC, CTL_A, ALT_S, GUI_D, SFT_F, KC_G, KC_H, SFT_J, GUI_K, ALT_L, CTL_SCLN,KC_QUOT,
CW_TOGG, MOU_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, NAV_SLSH,KC_ENT,
HYPER, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
HYPER, KC_LCTL, KC_LALT, KC_LGUI, TL_LOWR, KC_SPC, KC_SPC, TL_UPPR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),

/* Colemak
Expand All @@ -107,7 +105,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
CT_ESC, CTL_A, ALT_R, GUI_S, SHFT_T, KC_G, KC_M, SFT_N, GUI_E, ALT_I, CTL_O, KC_QUOT,
CW_TOGG, MOU_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, NAV_SLSH,KC_ENT,
HYPER, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
HYPER, KC_LCTL, KC_LALT, KC_LGUI, TL_LOWR, KC_SPC, KC_SPC, TL_UPPR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
/* Qwerty without home row mod
* ,-----------------------------------------------------------------------------------.
Expand All @@ -124,7 +122,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
CT_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
HYPER, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
HYPER, KC_LCTL, KC_LALT, KC_LGUI, TL_LOWR, KC_SPC, KC_SPC, TL_UPPR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),

/* Lower
Expand Down Expand Up @@ -328,13 +326,3 @@ void matrix_scan_user(void) {
}
#endif
}

bool music_mask_user(uint16_t keycode) {
switch (keycode) {
case RAISE:
case LOWER:
return false;
default:
return true;
}
}
1 change: 1 addition & 0 deletions keyboards/planck/keymaps/janat-t/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ endif

MIDI_ENABLE = yes
CAPS_WORD_ENABLE = yes
TRI_LAYER_ENABLE = yes

0 comments on commit 9aa8117

Please sign in to comment.