From 79ee8df0359251ae5f352448ee3eb6c473bd8c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Mon, 25 Jul 2022 10:25:12 +0100 Subject: [PATCH] use one-shot layers --- keyboards/rkb1/config.h | 2 + keyboards/rkb1/keymaps/default/keymap.c | 52 +++++++++++++------------ 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/keyboards/rkb1/config.h b/keyboards/rkb1/config.h index a162a5c2d9..04087bcf77 100644 --- a/keyboards/rkb1/config.h +++ b/keyboards/rkb1/config.h @@ -15,6 +15,8 @@ #define OLED_DISPLAY_128X64 +#define ONESHOT_TAP_TOGGLE 2 + /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/rkb1/keymaps/default/keymap.c b/keyboards/rkb1/keymaps/default/keymap.c index 89a20ee5ec..ae1d3b4560 100644 --- a/keyboards/rkb1/keymaps/default/keymap.c +++ b/keyboards/rkb1/keymaps/default/keymap.c @@ -56,97 +56,99 @@ static void tap_on_layer(uint16_t key, uint8_t layer) { #define LAYOUT(k0A, k0B, k0C, k0D, k0E, k0F, k5A, k5B, k5C, k5D, k5E, k5F, k1A, k1B, k1C, k1D, k1E, k1F, k6A, k6B, k6C, k6D, k6E, k6F, k2A, k2B, k2C, k2D, k2E, k2F, k7A, k7B, k7C, k7D, k7E, k7F, k3A, k3B, k3C, k3D, k3E, k3F, k8A, k8B, k8C, k8D, k8E, k8F, k4C, k4D, k4E, k4F, k9C, k9D, k9E, k9F) LAYOUT_ortho_4x6_2x2uc(k0A, k0B, k0C, k0D, k0E, k0F, k1A, k1B, k1C, k1D, k1E, k1F, k2A, k2B, k2C, k2D, k2E, k2F, k3A, k3B, k3C, k3D, k3E, k3F, k4C, k4D, k4E, k4F, k5A, k5B, k5C, k5D, k5E, k5F, k6A, k6B, k6C, k6D, k6E, k6F, k7A, k7B, k7C, k7D, k7E, k7F, k8A, k8B, k8C, k8D, k8E, k8F, k9C, k9D, k9E, k9F) +#define LS(layer) OSL(layer) + // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_L1] = LAYOUT( COMPOSE, X, V, L, C, W, K, H, G, F, Q, SZLIG, CIRCUM, U, I, A, E, O, S, N, R, T, D, Y, DIARESS, U_DIA, O_DIA, A_DIA, P, Z, B, M, COMMA, PERIOD, J, XXXXXXX, - KC_LCTL, OSL(FN), KC_LGUI, KC_LALT, PASTHRU, TG(KP1), TG(STN), OLEDON, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, - TT(_L6), TT(_L2), TT(_L3), KC_SPC, TT(_L7), TT(_L4), TT(_L5), KC_SPC + KC_LCTL, LS(FN), KC_LGUI, KC_LALT, PASTHRU, LS(KP1), LS(STN), OLEDON, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, + LS(_L6), LS(_L2), LS(_L3), KC_SPC, LS(_L7), LS(_L4), LS(_L5), KC_SPC ), [_L2] = LAYOUT( COMPOSE, CX, CV, CL, CC, CW, CK, CH, CG, CF, CQ, CSZLIG, HACEK, CU, CI, CA, CE, CO, CS, CN, CR, CT, CD, CY, SPASPER, CU_DIA, CO_DIA, CA_DIA, CP, CZ, CB, CM, ENDASH, BULLET, CJ, XXXXXXX, - LSHCTL, OSL(FN), LSHGUI, LSHALT, PASTHRU, TG(KP1), TG(STN), OLEDON, RSHALT, RSHGUI, SHAPP, RSHCTL, - TT(_L6), TT(_L2), TT(_L6), KC_SPC, XXXXXXX, XXXXXXX, TT(_L8), KC_SPC + LSHCTL, LS(FN), LSHGUI, LSHALT, PASTHRU, LS(KP1), LS(STN), OLEDON, RSHALT, RSHGUI, SHAPP, RSHCTL, + LS(_L6), LS(_L2), LS(_L6), KC_SPC, XXXXXXX, XXXXXXX, LS(_L8), KC_SPC ), [_L3] = LAYOUT( COMPOSE, ELLIPS, LOWLINE, LBRACKT, RBRACKT, ACIRCUM, EXCLAM, LESSTHN, GREATER, EQUALS, AMPSAND, LONG_S, DOTABVE, BSLASH, FSLASH, LBRACE, RBRACE, ASTERSK, QUESTN, LPARENS, RPARENS, HYPHMIN, COLON, AT, ACUTE, NUMBER, DOLLAR, VRTLINE, ATILDE, AGRAVE, PLUS, PERCENT, QUOT, AAPOSTR, SEMCOL, XXXXXXX, - KC_LCTL, OSL(FN), KC_LGUI, KC_LALT, PASTHRU, TG(KP1), TG(STN), OLEDON, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, - TT(_L6), TT(_L6), TT(_L3), KC_SPC, TT(_L7), TT(_L7), XXXXXXX, KC_SPC + KC_LCTL, LS(FN), KC_LGUI, KC_LALT, PASTHRU, LS(KP1), LS(STN), OLEDON, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, + LS(_L6), LS(_L6), LS(_L3), KC_SPC, LS(_L7), LS(_L7), XXXXXXX, KC_SPC ), [_L4] = LAYOUT( COMPOSE, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, INVEXCL, SEVEN, EIGHT, NINE, PLUS, MINUS, DOTBLOW, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, INVQMRK, FOUR, FIVE, SIX, COMMA, PERIOD, SOLIDUS, KC_ESC, KC_TAB, KC_PSTE, KC_ENT, KC_UNDO, COLON, ONE, TWO, THREE, SEMCOL, KC_RSFT, - RLTCTL, OSL(FN), RLTGUI, RLTALT, PASTHRU, TG(KP1), TG(STN), OLEDON, KC_RALT, RLTRGUI, RLTAPP, RLTRCTL, - XXXXXXX, XXXXXXX, TT(_L7), ZERO, TT(_L7), TT(_L4), TT(_L9), ZERO + RLTCTL, LS(FN), RLTGUI, RLTALT, PASTHRU, LS(KP1), LS(STN), OLEDON, KC_RALT, RLTRGUI, RLTAPP, RLTRCTL, + XXXXXXX, XXXXXXX, LS(_L7), ZERO, LS(_L7), LS(_L4), LS(_L9), ZERO ), [_L5] = LAYOUT( COMPOSE, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, ZERO, HYPHMIN, CEDILLE, DEGREE, SECTION, SCRIPTL, RDGUILM, LDGUILM, DOLLAR, EURO, LODQUOT, LDQUOT, RDQUOT, EMDASH, SPLENIS, SUPONE, SUPTWO, SUPTHRE, RSGUILM, LSGUILM, CENTSGN, YEN, LOSQUOT, LSQUOT, RSQUOT, HYPHMIN, - KC_LCTL, OSL(FN), KC_LGUI, KC_LALT, PASTHRU, TG(KP1), TG(STN), OLEDON, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, - XXXXXXX, TT(_L8), XXXXXXX, KC_SPC, TT(_L9), XXXXXXX, TT(_L5), KC_SPC + KC_LCTL, LS(FN), KC_LGUI, KC_LALT, PASTHRU, LS(KP1), LS(STN), OLEDON, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, + XXXXXXX, LS(_L8), XXXXXXX, KC_SPC, LS(_L9), XXXXXXX, LS(_L5), KC_SPC ), [_L6] = LAYOUT( COMPOSE, XI, XXXXXXX, LAMBDA, CHI, OMEGA, KAPPA, PSI, GAMMA, PHI, VARPHI, FSIGMA, TURNED, XXXXXXX, IOTA, ALPHA, EPSILON, OMICRON, SIGMA, NU, RHO, TAU, DELTA, UPSILON, MACRON, XXXXXXX, LUNEPS, ETA, PI, ZETA, BETA, MU, VARRHO, VRTHETA, THETA, XXXXXXX, - LSHCTL, OSL(FN), LSHGUI, LSHALT, PASTHRU, TG(KP1), TG(STN), OLEDON, RSHALT, RSHGUI, SHAPP, RSHCTL, - TT(_L6), TT(_L6), TT(_L6), KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC + LSHCTL, LS(FN), LSHGUI, LSHALT, PASTHRU, LS(KP1), LS(STN), OLEDON, RSHALT, RSHGUI, SHAPP, RSHCTL, + LS(_L6), LS(_L6), LS(_L6), KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC ), [_L7] = LAYOUT( COMPOSE, CXI, SQRT, CLAMBDA, COMPLEX, COMEGA, MULTSGN, CPSI, CGAMMA, CPHI, RATIONL, RINGOP, HOOK, SUBSET, INTEGRL, FORALL, THREXST, ELEMOF, CSIGMA, NATURAL, REAL, PARTDRV, CDELTA, NABLA, TILDE, UNION, INTRSCT, ALEF, CPI, INTEGER, LDBLARR, LRDBARR, RDBLARR, RARRBAR, CTHETA, XXXXXXX, - RLTCTL, OSL(FN), RLTGUI, RLTALT, PASTHRU, TG(KP1), TG(STN), OLEDON, KC_RALT, RLTRGUI, RLTAPP, RLTRCTL, - XXXXXXX, XXXXXXX, TT(_L7), KC_SPC, TT(_L7), TT(_L7), XXXXXXX, KC_SPC + RLTCTL, LS(FN), RLTGUI, RLTALT, PASTHRU, LS(KP1), LS(STN), OLEDON, KC_RALT, RLTRGUI, RLTAPP, RLTRCTL, + XXXXXXX, XXXXXXX, LS(_L7), KC_SPC, LS(_L7), LS(_L7), XXXXXXX, KC_SPC ), [_L8] = LAYOUT( COMPOSE, FEMORD, MASCORD, NUMERO, XXXXXXX, MIDDOT, POUND, CURENCY, KC_TAB, FSLASH, ASTERSK, HYPHMIN, RING, SUBONE, SUBTWO, SUBTHRE, FEMALE, MALE, MALEFEM, VARKPPA, LANGLE, RANGLE, SUBZERO, NBHYP, BREVE, NOTSIGN, LOR, LAND, UPTACK, MEASANG, PARALLL, RIGHTAR, INFINIT, PROPTO, EMPTYST, SHYPHEN, - KC_LCTL, OSL(FN), KC_LGUI, KC_LALT, PASTHRU, TG(KP1), TG(STN), OLEDON, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, - XXXXXXX, TT(_L8), XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, TT(_L8), KC_SPC + KC_LCTL, LS(FN), KC_LGUI, KC_LALT, PASTHRU, LS(KP1), LS(STN), OLEDON, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, + XXXXXXX, LS(_L8), XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, LS(_L8), KC_SPC ), [_L9] = LAYOUT( COMPOSE, XXXXXXX, KC_BTN1, KC_MS_U, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN3, KC_WH_U, KC_BTN4, XXXXXXX, GRAVE, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN6, KC_WH_D, KC_BTN5, XXXXXXX, DBLACUT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_LCTL, OSL(FN), KC_LGUI, KC_LALT, PASTHRU, TG(KP1), TG(STN), OLEDON, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, - XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, TT(_L9), XXXXXXX, TT(_L9), KC_SPC + KC_LCTL, LS(FN), KC_LGUI, KC_LALT, PASTHRU, LS(KP1), LS(STN), OLEDON, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, + XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, LS(_L9), XXXXXXX, LS(_L9), KC_SPC ), [KP1] = LAYOUT( KC_NLCK, KC_TAB, KC_PSLS, KC_PAST, KC_PMNS, XXXXXXX, XXXXXXX, LEFTTAB, FSLASH, ASTERSK, HYPHMIN, XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PPLS, XXXXXXX, XXXXXXX, CHECKMK, XBALLOT, DAGGER, PLUS, XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PENT, XXXXXXX, XXXXXXX, CLUBS, EURO, TRIBLLT, KC_PENT, XXXXXXX, - XXXXXXX, KC_P1, KC_P2, KC_P7, KC_PDOT, TG(KP1), OLEDON, DIAMOND, HEART, SPADE, PERIOD, XXXXXXX, - TG(KP2), TG(KP3), KC_P0, KC_P0, TG(KP2), TG(KP3), OPNBOX, OPNBOX + XXXXXXX, KC_P1, KC_P2, KC_P7, KC_PDOT, LS(KP1), OLEDON, DIAMOND, HEART, SPADE, PERIOD, XXXXXXX, + LS(KP2), LS(KP3), KC_P0, KC_P0, LS(KP2), LS(KP3), OPNBOX, OPNBOX ), [KP2] = LAYOUT( XXXXXXX, EQUALS, DIVSGN, DOTOPER, MINUS, XXXXXXX, XXXXXXX, NOTEQAL, FRACTSL, MULTSGN, SETMINS, XXXXXXX, XXXXXXX, UDARROW, UPARROW, VECTARR, PLSMNS, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_PGUP, MINPLS, XXXXXXX, XXXXXXX, LEFTARR, COLON, RIGHTAR, KC_PENT, XXXXXXX, XXXXXXX, KC_LEFT, XXXXXXX, KC_RGHT, KC_PENT, KC_RSFT, - XXXXXXX, LRARROW, DOWNARR, RLHARPO, COMMA, TG(KP1), OLEDON, KC_END, KC_DOWN, KC_PGDN, KC_DEL, XXXXXXX, - TG(KP2), TG(KP3), PERCENT, PERCENT, TG(KP2), TG(KP3), KC_PSTE, KC_PSTE + XXXXXXX, LRARROW, DOWNARR, RLHARPO, COMMA, LS(KP1), OLEDON, KC_END, KC_DOWN, KC_PGDN, KC_DEL, XXXXXXX, + LS(KP2), LS(KP3), PERCENT, PERCENT, LS(KP2), LS(KP3), KC_PSTE, KC_PSTE ), [KP3] = LAYOUT( XXXXXXX, ALMSTEQ, DIAMETR, CDOT, CMINUS, XXXXXXX, XXXXXXX, IDENTCL, DIVIDES, CTIMES, DOTMINS, XXXXXXX, XXXXXXX, MCHLESS, INTRSCT, MCHGRTR, CPLUS, XXXXXXX, XXXXXXX, LCEILNG, NARYINT, RCEILNG, DOTPLUS, XXXXXXX, XXXXXXX, SUBSET, ORIGNAL, SUPRSET, KC_PENT, XXXXXXX, XXXXXXX, SUBEQL, IMAGEOF, SUPREQL, KC_PENT, XXXXXXX, - XXXXXXX, LEQUAL, UNION, GEQUAL, PRIME, TG(KP1), OLEDON, LFLOOR, NARYUNI, RFLOOR, DPRIME, XXXXXXX, - TG(KP2), TG(KP3), PERMILL, PERMILL, TG(KP2), TG(KP3), WHTSQAR, WHTSQAR + XXXXXXX, LEQUAL, UNION, GEQUAL, PRIME, LS(KP1), OLEDON, LFLOOR, NARYUNI, RFLOOR, DPRIME, XXXXXXX, + LS(KP2), LS(KP3), PERMILL, PERMILL, LS(KP2), LS(KP3), WHTSQAR, WHTSQAR ), [STN] = LAYOUT( STN_N1, STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NA, STN_PLS, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, STN_PLS, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TG(STN), OLEDON, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LS(STN), OLEDON, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, STN_HAT, STN_HAT, STN_A, STN_O, STN_HAT, STN_HAT, STN_E, STN_U ), [FN] = LAYOUT(