[Keymap] reflects current rick's keymap (#14169)
parent
bdd0a6c097
commit
6f5428687c
@ -0,0 +1,17 @@ |
|||||||
|
/* Copyright 2021 Ibnu D. Aji
|
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU General Public License as published by |
||||||
|
* the Free Software Foundation, either version 2 of the License, or |
||||||
|
* (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
#include "abstraction.h" |
@ -0,0 +1,117 @@ |
|||||||
|
/* Copyright 2021 Ibnu D. Aji
|
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU General Public License as published by |
||||||
|
* the Free Software Foundation, either version 2 of the License, or |
||||||
|
* (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
#pragma once |
||||||
|
#include "quantum.h" |
||||||
|
|
||||||
|
enum { |
||||||
|
_BASE, |
||||||
|
_LOWER, |
||||||
|
_RAISE, |
||||||
|
_ADJUST, |
||||||
|
}; |
||||||
|
|
||||||
|
// keycode abstraction
|
||||||
|
// ABC:
|
||||||
|
// A: L = left
|
||||||
|
// R = right
|
||||||
|
// B: U = upper row
|
||||||
|
// M = middle row
|
||||||
|
// L = lower row
|
||||||
|
// C: P = pinky finger
|
||||||
|
// R = ring finger
|
||||||
|
// M = middle finger
|
||||||
|
// I = index finger
|
||||||
|
// II = inner index finger
|
||||||
|
#define LUP KC_Q |
||||||
|
#define LUR KC_V |
||||||
|
#define LUM KC_C |
||||||
|
#define LUI KC_P |
||||||
|
#define LUII KC_B |
||||||
|
#define LMP KC_R |
||||||
|
#define LMR KC_S |
||||||
|
#define LMM KC_T |
||||||
|
#define LMI KC_H |
||||||
|
#define LMII KC_D |
||||||
|
#define LLP KC_QUOT |
||||||
|
#define LLR KC_J |
||||||
|
#define LLM KC_G |
||||||
|
#define LLI KC_K |
||||||
|
#define LLII KC_X |
||||||
|
|
||||||
|
#define RUP KC_Z |
||||||
|
#define RUR KC_Y |
||||||
|
#define RUM KC_U |
||||||
|
#define RUI KC_L |
||||||
|
#define RUII KC_DOT |
||||||
|
#define RMP KC_O |
||||||
|
#define RMR KC_I |
||||||
|
#define RMM KC_A |
||||||
|
#define RMI KC_N |
||||||
|
#define RMII KC_F |
||||||
|
#define RLP KC_SLSH |
||||||
|
#define RLR KC_SCLN |
||||||
|
#define RLM KC_W |
||||||
|
#define RLI KC_M |
||||||
|
#define RLII KC_COMM |
||||||
|
|
||||||
|
|
||||||
|
// thumb keys.
|
||||||
|
#define TRAISE TG(_RAISE) |
||||||
|
#define AL_ENT ALT_T(KC_ENT) |
||||||
|
#define SF_BSPC SFT_T(KC_BSPC) |
||||||
|
#define CT_ESC CTL_T(KC_ESC) |
||||||
|
|
||||||
|
// home row mods.
|
||||||
|
#define CTLR LCTL_T(LMR) |
||||||
|
#define CTRR RCTL_T(RMR) |
||||||
|
#define CT_LEFT LCTL_T(KC_LEFT) |
||||||
|
#define CT_SIX RCTL_T(KC_6) |
||||||
|
|
||||||
|
#define SHLP LSFT_T(LMP) |
||||||
|
#define SHRP RSFT_T(RMP) |
||||||
|
#define SH_HASH LSFT_T(KC_HASH) |
||||||
|
#define SH_ZERO RSFT_T(KC_0) |
||||||
|
|
||||||
|
#define ALLM LALT_T(LMM) |
||||||
|
#define ALRM RALT_T(RMM) |
||||||
|
#define AL_DOWN LALT_T(KC_DOWN) |
||||||
|
#define AL_FIVE RALT_T(KC_5) |
||||||
|
|
||||||
|
#define GULII RGUI_T(LMII) |
||||||
|
#define GURII LGUI_T(RMII) |
||||||
|
#define GU_DLR RGUI_T(KC_DLR) |
||||||
|
#define GU_EQL LGUI_T(KC_EQL) |
||||||
|
|
||||||
|
// layer toggle.
|
||||||
|
#define LW_E LT(_LOWER, KC_E) |
||||||
|
#define RS_SPC LT(_RAISE, KC_SPC) |
||||||
|
|
||||||
|
#define ADDDD MO(_ADJUST) |
||||||
|
|
||||||
|
// common shortcuts for windows and linux that i use.
|
||||||
|
#define NXTTAB LCTL(KC_PGDN) |
||||||
|
#define PRVTAB LCTL(KC_PGUP) |
||||||
|
#define UPTAB LCTL(LSFT(KC_PGUP)) |
||||||
|
#define DNTAB LCTL(LSFT(KC_PGDN)) |
||||||
|
#define NXTWIN LALT(KC_TAB) |
||||||
|
#define PRVWIN LALT(LSFT(KC_TAB)) |
||||||
|
#define CALDL LCTL(LALT(KC_DELT)) |
||||||
|
#define TSKMGR LCTL(LSFT(KC_ESC)) |
||||||
|
#define EXPLR LGUI(KC_E) |
||||||
|
#define LCKGUI LGUI(KC_L) |
||||||
|
#define CONPST LSFT(KC_INS) |
||||||
|
#define CLSGUI LALT(KC_F4) |
@ -1,61 +1,96 @@ |
|||||||
#pragma once |
#pragma once |
||||||
#include "quantum.h" |
#include "quantum.h" |
||||||
|
|
||||||
|
#include "abstraction.h" |
||||||
|
|
||||||
// enum for combos.
|
// enum for combos.
|
||||||
enum combos { |
enum combos { |
||||||
// left hand combinations.
|
// left hand combinations.
|
||||||
COLON_COMMA, |
R_U_PINKY_RING, |
||||||
COMMA_DOT, |
R_U_RING_MIDDLE, |
||||||
DOT_P, |
R_U_RING_INDEX, |
||||||
QUOT_Q, |
R_U_MIDDLE_INDEX, |
||||||
Q_J, |
R_U_MIDDLE_INNER_INDEX, |
||||||
J_K, |
R_U_INDEX_INNER_INDEX, |
||||||
|
R_L_PINKY_RING, |
||||||
|
R_L_RING_MIDDLE, |
||||||
|
R_L_RING_INDEX, |
||||||
|
R_L_MIDDLE_INDEX, |
||||||
|
R_L_INDEX_INNER_INDEX, |
||||||
|
|
||||||
// right hand combinations.
|
// right hand combinations.
|
||||||
L_R, |
L_U_PINKY_RING, |
||||||
R_C, |
L_U_RING_MIDDLE, |
||||||
C_G, |
L_U_RING_INDEX, |
||||||
V_W, |
L_U_MIDDLE_INDEX, |
||||||
W_M, |
L_U_MIDDLE_INNER_INDEX, |
||||||
|
L_U_INNER_INNER_INDEX, |
||||||
|
L_L_PINKY_RING, |
||||||
|
L_L_RING_MIDDLE, |
||||||
|
L_L_MIDDLE_INDEX, |
||||||
|
L_L_RING_INDEX, |
||||||
|
L_L_INDEX_INNER_INDEX, |
||||||
|
|
||||||
// both hands combinations.
|
// both hands combinations.
|
||||||
J_W, |
B_L_MIDDLE_MIDDLE, |
||||||
}; |
}; |
||||||
|
|
||||||
// left hand combinations.
|
// left hand combinations.
|
||||||
const uint16_t PROGMEM colon_comma_combo[] = {KC_SCLN, KC_COMM, COMBO_END}; |
const uint16_t PROGMEM lu_p_r_combo[] = {LUP, LUR, COMBO_END}; |
||||||
const uint16_t PROGMEM comma_dot_combo[] = {KC_COMM, KC_DOT, COMBO_END}; |
const uint16_t PROGMEM lu_r_m_combo[] = {LUR, LUM, COMBO_END}; |
||||||
const uint16_t PROGMEM dot_p_combo[] = {KC_DOT, KC_P, COMBO_END}; |
const uint16_t PROGMEM lu_r_i_combo[] = {LUR, LUI, COMBO_END}; |
||||||
const uint16_t PROGMEM quot_q_combo[] = {KC_QUOT, KC_Q, COMBO_END}; |
const uint16_t PROGMEM lu_m_i_combo[] = {LUM, LUI, COMBO_END}; |
||||||
const uint16_t PROGMEM q_j_combo[] = {KC_Q, KC_J, COMBO_END}; |
const uint16_t PROGMEM lu_m_ii_combo[] = {LUM, LUII, COMBO_END}; |
||||||
const uint16_t PROGMEM j_k_combo[] = {KC_J, KC_K, COMBO_END}; |
const uint16_t PROGMEM lu_i_ii_combo[] = {LUI, LUII, COMBO_END}; |
||||||
|
const uint16_t PROGMEM ll_p_r_combo[] = {LLP, LLR, COMBO_END}; |
||||||
|
const uint16_t PROGMEM ll_r_m_combo[] = {LLR, LLM, COMBO_END}; |
||||||
|
const uint16_t PROGMEM ll_r_i_combo[] = {LLR, LLI, COMBO_END}; |
||||||
|
const uint16_t PROGMEM ll_m_i_combo[] = {LLM, LLI, COMBO_END}; |
||||||
|
const uint16_t PROGMEM ll_i_ii_combo[] = {LLI, LLII, COMBO_END}; |
||||||
|
|
||||||
// right hand combinations.
|
// right hand combinations.
|
||||||
const uint16_t PROGMEM l_r_combo[] = {KC_L, KC_R, COMBO_END}; |
const uint16_t PROGMEM ru_p_r_combo[] = {RUP, RUR, COMBO_END}; |
||||||
const uint16_t PROGMEM r_c_combo[] = {KC_R, KC_C, COMBO_END}; |
const uint16_t PROGMEM ru_r_m_combo[] = {RUR, RUM, COMBO_END}; |
||||||
const uint16_t PROGMEM c_g_combo[] = {KC_C, KC_G, COMBO_END}; |
const uint16_t PROGMEM ru_r_i_combo[] = {RUR, RUI, COMBO_END}; |
||||||
const uint16_t PROGMEM v_w_combo[] = {KC_V, KC_W, COMBO_END}; |
const uint16_t PROGMEM ru_m_i_combo[] = {RUM, RUI, COMBO_END}; |
||||||
const uint16_t PROGMEM w_m_combo[] = {KC_W, KC_M, COMBO_END}; |
const uint16_t PROGMEM ru_m_ii_combo[] = {RUM, RUII, COMBO_END}; |
||||||
|
const uint16_t PROGMEM ru_i_ii_combo[] = {RUI, RUII, COMBO_END}; |
||||||
|
const uint16_t PROGMEM rl_p_r_combo[] = {RLP, RLR, COMBO_END}; |
||||||
|
const uint16_t PROGMEM rl_r_m_combo[] = {RLR, RLM, COMBO_END}; |
||||||
|
const uint16_t PROGMEM rl_r_i_combo[] = {RLR, RLI, COMBO_END}; |
||||||
|
const uint16_t PROGMEM rl_m_i_combo[] = {RLM, RLI, COMBO_END}; |
||||||
|
const uint16_t PROGMEM rl_i_ii_combo[] = {RLI, RLII, COMBO_END}; |
||||||
|
|
||||||
// both hand combinations.
|
// both hand combinations.
|
||||||
const uint16_t PROGMEM j_w_combo[] = {KC_J, KC_W, COMBO_END}; |
const uint16_t PROGMEM bl_m_m_combo[] = {LLM, RLM, COMBO_END}; |
||||||
|
|
||||||
combo_t key_combos[COMBO_COUNT] = { |
combo_t key_combos[COMBO_COUNT] = { |
||||||
// left hand combinations.
|
// left hand combinations.
|
||||||
[COLON_COMMA] = COMBO(colon_comma_combo, KC_TAB), |
[R_U_PINKY_RING] = COMBO(lu_p_r_combo, KC_TAB), |
||||||
[COMMA_DOT] = COMBO(comma_dot_combo, KC_QUES), |
[R_U_RING_MIDDLE] = COMBO(lu_r_m_combo, KC_QUES), |
||||||
[DOT_P] = COMBO(dot_p_combo, KC_UNDS), |
[R_U_RING_INDEX] = COMBO(lu_r_i_combo, PRVTAB), |
||||||
[QUOT_Q] = COMBO(quot_q_combo, KC_ENT), |
[R_U_MIDDLE_INDEX] = COMBO(lu_m_i_combo, KC_UNDS), |
||||||
[Q_J] = COMBO(q_j_combo, LCTL(KC_W)), |
[R_U_MIDDLE_INNER_INDEX] = COMBO(lu_m_ii_combo, KC_ENT), |
||||||
[J_K] = COMBO(j_k_combo, KC_DELT), |
[R_U_INDEX_INNER_INDEX] = COMBO(lu_i_ii_combo, KC_PIPE), |
||||||
|
[R_L_PINKY_RING] = COMBO(ll_p_r_combo, KC_ENT), |
||||||
|
[R_L_RING_MIDDLE] = COMBO(ll_r_m_combo, LCTL(KC_W)), |
||||||
|
[R_L_RING_INDEX] = COMBO(ll_r_i_combo, KC_TAB), |
||||||
|
[R_L_MIDDLE_INDEX] = COMBO(ll_m_i_combo, KC_DELT), |
||||||
|
[R_L_INDEX_INNER_INDEX] = COMBO(ll_i_ii_combo, KC_TILD), |
||||||
|
|
||||||
// right hand combinations.
|
// right hand combinations.
|
||||||
[L_R] = COMBO(l_r_combo, KC_BSPC), |
[L_U_PINKY_RING] = COMBO(ru_p_r_combo, KC_BSPC), |
||||||
[R_C] = COMBO(r_c_combo, KC_SLSH), |
[L_U_RING_MIDDLE] = COMBO(ru_r_m_combo, KC_SLSH), |
||||||
[C_G] = COMBO(c_g_combo, KC_MINS), |
[L_U_RING_INDEX] = COMBO(ru_r_i_combo, NXTTAB), |
||||||
[V_W] = COMBO(v_w_combo, KC_APP), |
[L_U_MIDDLE_INDEX] = COMBO(ru_m_i_combo, KC_MINS), |
||||||
[W_M] = COMBO(w_m_combo, KC_DELT), |
[L_U_MIDDLE_INNER_INDEX] = COMBO(ru_m_ii_combo, KC_ENT), |
||||||
|
[L_U_INNER_INNER_INDEX] = COMBO(ru_i_ii_combo, KC_BSLS), |
||||||
|
[L_L_PINKY_RING] = COMBO(rl_p_r_combo, KC_BSLS), |
||||||
|
[L_L_RING_MIDDLE] = COMBO(rl_r_m_combo, KC_APP), |
||||||
|
[L_L_RING_INDEX] = COMBO(rl_r_i_combo, LSFT(KC_TAB)), |
||||||
|
[L_L_MIDDLE_INDEX] = COMBO(rl_m_i_combo, KC_DELT), |
||||||
|
[L_L_INDEX_INNER_INDEX] = COMBO(rl_i_ii_combo, KC_GRV), |
||||||
|
|
||||||
// both hand combinations.
|
// both hand combinations.
|
||||||
[J_W] = COMBO(j_w_combo, KC_ENT), |
[B_L_MIDDLE_MIDDLE] = COMBO(bl_m_m_combo, KC_ENT), |
||||||
}; |
}; |
@ -1,9 +1,7 @@ |
|||||||
#pragma once |
#pragma once |
||||||
|
|
||||||
#define COMBO_COUNT 18 |
#define COMBO_TERM 50 |
||||||
#define COMBO_TERM 100 |
#define COMBO_COUNT 50 |
||||||
|
|
||||||
#define IGNORE_MOD_TAP_INTERRUPT |
#define IGNORE_MOD_TAP_INTERRUPT |
||||||
#define PERMISSIVE_HOLD |
#define PERMISSIVE_HOLD |
||||||
|
|
||||||
#define TAPPING_TERM 200 |
|
@ -1,14 +1,8 @@ |
|||||||
COMBO_ENABLE = yes
|
COMBO_ENABLE = yes
|
||||||
COMMAND_ENABLE = yes
|
|
||||||
CONSOLE_ENABLE = yes
|
CONSOLE_ENABLE = yes
|
||||||
TAP_DANCE_ENABLE = yes
|
|
||||||
|
|
||||||
SRC += ibnuda.c
|
SRC += ibnuda.c
|
||||||
|
|
||||||
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) |
|
||||||
SRC += tapdance.c
|
|
||||||
endif |
|
||||||
|
|
||||||
ifeq ($(strip $(COMBO_ENABLE)), yes) |
ifeq ($(strip $(COMBO_ENABLE)), yes) |
||||||
SRC += combo.c
|
SRC += combo.c
|
||||||
endif |
endif |
||||||
|
@ -1,83 +0,0 @@ |
|||||||
#include "tapdance.h" |
|
||||||
|
|
||||||
static td_state_t td_state; |
|
||||||
|
|
||||||
void dance_dlt_finished(qk_tap_dance_state_t *state, void *user_data) { |
|
||||||
if (state->count == 1) { |
|
||||||
register_code16(KC_DELT); |
|
||||||
} else { |
|
||||||
register_code16(C(KC_DELT)); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
void dance_dlt_reset(qk_tap_dance_state_t *state, void *user_data) { |
|
||||||
if (state->count == 1) { |
|
||||||
unregister_code16(KC_DELT); |
|
||||||
} else { |
|
||||||
unregister_code16(C(KC_DELT)); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
void dance_cln_finished(qk_tap_dance_state_t *state, void *user_data) { |
|
||||||
if (state->count == 1) { |
|
||||||
register_code(KC_LSFT); |
|
||||||
} |
|
||||||
register_code(KC_SCLN); |
|
||||||
} |
|
||||||
|
|
||||||
void dance_cln_reset(qk_tap_dance_state_t *state, void *user_data) { |
|
||||||
if (state->count == 1) { |
|
||||||
unregister_code(KC_LSFT); |
|
||||||
} |
|
||||||
unregister_code(KC_SCLN); |
|
||||||
} |
|
||||||
|
|
||||||
int current_dance(qk_tap_dance_state_t *state) { |
|
||||||
if (state->count == 1) { |
|
||||||
if (state->interrupted || !state->pressed) { |
|
||||||
return SINGLE_TAP; |
|
||||||
} else { |
|
||||||
return SINGLE_HOLD; |
|
||||||
} |
|
||||||
} |
|
||||||
if (state->count == 2) { |
|
||||||
return DOUBLE_TAP; |
|
||||||
} else { |
|
||||||
return 3; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
void dance_tmb_finished(qk_tap_dance_state_t *state, void *user_data) { |
|
||||||
td_state = current_dance(state); |
|
||||||
switch (td_state) { |
|
||||||
case SINGLE_TAP: |
|
||||||
register_code16(KC_ESC); |
|
||||||
break; |
|
||||||
case SINGLE_HOLD: |
|
||||||
register_mods(MOD_BIT(KC_LSFT)); |
|
||||||
break; |
|
||||||
case DOUBLE_TAP: |
|
||||||
register_code16(KC_DELT); |
|
||||||
break; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
void dance_tmb_reset(qk_tap_dance_state_t *state, void *user_data) { |
|
||||||
switch (td_state) { |
|
||||||
case SINGLE_TAP: |
|
||||||
unregister_code16(KC_ESC); |
|
||||||
break; |
|
||||||
case SINGLE_HOLD: |
|
||||||
unregister_mods(MOD_BIT(KC_LSFT)); |
|
||||||
break; |
|
||||||
case DOUBLE_TAP: |
|
||||||
unregister_code16(KC_DELT); |
|
||||||
break; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = { |
|
||||||
[TD_DLT_CTLDLT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_dlt_finished, dance_dlt_reset), |
|
||||||
[TD_SCLN_CLN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_cln_finished, dance_cln_reset), |
|
||||||
[TD_LEFT_THUMB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_tmb_finished, dance_tmb_reset), |
|
||||||
}; |
|
@ -1,23 +0,0 @@ |
|||||||
#pragma once |
|
||||||
#include "ibnuda.h" |
|
||||||
|
|
||||||
#ifdef TAP_DANCE_ENABLE |
|
||||||
typedef enum { |
|
||||||
SINGLE_TAP, |
|
||||||
SINGLE_HOLD, |
|
||||||
DOUBLE_TAP, |
|
||||||
} td_state_t; |
|
||||||
|
|
||||||
int current_dance(qk_tap_dance_state_t *state); |
|
||||||
|
|
||||||
void dance_tmb_finished(qk_tap_dance_state_t *state, void *user_data); |
|
||||||
void dance_tmb_reset(qk_tap_dance_state_t *state, void *user_data); |
|
||||||
|
|
||||||
// enum for tap dances.
|
|
||||||
enum { |
|
||||||
TD_DLT_CTLDLT = 0, |
|
||||||
TD_SCLN_CLN, |
|
||||||
TD_LEFT_THUMB, |
|
||||||
}; |
|
||||||
|
|
||||||
#endif // TAP_DANCE_ENABLE
|
|
Loading…
Reference in new issue