Add oled support

This commit is contained in:
Charlotte 🦝 Delenk 2024-04-04 13:48:57 +01:00
parent 93ed972b5c
commit d7eb01f0b9
4 changed files with 184 additions and 62 deletions

View file

@ -13,6 +13,8 @@
#define UNICODE_SELECTED_MODES UC_LNX, UC_MAC, UC_WINC #define UNICODE_SELECTED_MODES UC_LNX, UC_MAC, UC_WINC
#define OLED_DISPLAY_128X64
/* /*
* Feature disable options * Feature disable options
* These options are also useful to firmware size reduction. * These options are also useful to firmware size reduction.

View file

@ -49,58 +49,58 @@
{ "matrix": [0, 1], "x": 1, "y": 0 }, { "matrix": [0, 1], "x": 1, "y": 0 },
{ "matrix": [0, 2], "x": 2, "y": 0 }, { "matrix": [0, 2], "x": 2, "y": 0 },
{ "matrix": [0, 3], "x": 3, "y": 0 }, { "matrix": [0, 3], "x": 3, "y": 0 },
{ "matrix": [0, 4], "x": 4, "y": 0 }, { "matrix": [0, 4], "x": 4, "y": 0 },
{ "matrix": [0, 5], "x": 5, "y": 0 }, { "matrix": [0, 5], "x": 5, "y": 0 },
{ "matrix": [1, 0], "x": 0, "y": 1 }, { "matrix": [1, 0], "x": 0, "y": 1 },
{ "matrix": [1, 1], "x": 1, "y": 1 }, { "matrix": [1, 1], "x": 1, "y": 1 },
{ "matrix": [1, 2], "x": 2, "y": 1 }, { "matrix": [1, 2], "x": 2, "y": 1 },
{ "matrix": [1, 3], "x": 3, "y": 1 }, { "matrix": [1, 3], "x": 3, "y": 1 },
{ "matrix": [1, 4], "x": 4, "y": 1 }, { "matrix": [1, 4], "x": 4, "y": 1 },
{ "matrix": [1, 5], "x": 5, "y": 1 }, { "matrix": [1, 5], "x": 5, "y": 1 },
{ "matrix": [2, 0], "x": 0, "y": 2 }, { "matrix": [2, 0], "x": 0, "y": 2 },
{ "matrix": [2, 1], "x": 1, "y": 2 }, { "matrix": [2, 1], "x": 1, "y": 2 },
{ "matrix": [2, 2], "x": 2, "y": 2 }, { "matrix": [2, 2], "x": 2, "y": 2 },
{ "matrix": [2, 3], "x": 3, "y": 2 }, { "matrix": [2, 3], "x": 3, "y": 2 },
{ "matrix": [2, 4], "x": 4, "y": 2 }, { "matrix": [2, 4], "x": 4, "y": 2 },
{ "matrix": [2, 5], "x": 5, "y": 2 }, { "matrix": [2, 5], "x": 5, "y": 2 },
{ "matrix": [3, 0], "x": 0, "y": 3 }, { "matrix": [3, 0], "x": 0, "y": 3 },
{ "matrix": [3, 1], "x": 1, "y": 3 }, { "matrix": [3, 1], "x": 1, "y": 3 },
{ "matrix": [3, 2], "x": 2, "y": 3 }, { "matrix": [3, 2], "x": 2, "y": 3 },
{ "matrix": [3, 3], "x": 3, "y": 3 }, { "matrix": [3, 3], "x": 3, "y": 3 },
{ "matrix": [3, 4], "x": 4, "y": 3 }, { "matrix": [3, 4], "x": 4, "y": 3 },
{ "matrix": [3, 5], "x": 5, "y": 3 }, { "matrix": [3, 5], "x": 5, "y": 3 },
{ "matrix": [4, 2], "x": 2, "y": 4 }, { "matrix": [4, 2], "x": 2, "y": 4 },
{ "matrix": [4, 3], "x": 3, "y": 4 }, { "matrix": [4, 3], "x": 3, "y": 4 },
{ "matrix": [4, 4], "x": 4, "y": 4 }, { "matrix": [4, 4], "x": 4, "y": 4 },
{ "matrix": [4, 5], "x": 5, "y": 4 }, { "matrix": [4, 5], "x": 5, "y": 4 },
{ "matrix": [5, 0], "x": 6, "y": 0 }, { "matrix": [5, 0], "x": 6, "y": 0 },
{ "matrix": [5, 1], "x": 7, "y": 0 }, { "matrix": [5, 1], "x": 7, "y": 0 },
{ "matrix": [5, 2], "x": 8, "y": 0 }, { "matrix": [5, 2], "x": 8, "y": 0 },
{ "matrix": [5, 3], "x": 9, "y": 0 }, { "matrix": [5, 3], "x": 9, "y": 0 },
{ "matrix": [5, 4], "x": 10, "y": 0 }, { "matrix": [5, 4], "x": 10, "y": 0 },
{ "matrix": [5, 5], "x": 11, "y": 0 }, { "matrix": [5, 5], "x": 11, "y": 0 },
{ "matrix": [6, 0], "x": 6, "y": 1 }, { "matrix": [6, 0], "x": 6, "y": 1 },
{ "matrix": [6, 1], "x": 7, "y": 1 }, { "matrix": [6, 1], "x": 7, "y": 1 },
{ "matrix": [6, 2], "x": 8, "y": 1 }, { "matrix": [6, 2], "x": 8, "y": 1 },
{ "matrix": [6, 3], "x": 9, "y": 1 }, { "matrix": [6, 3], "x": 9, "y": 1 },
{ "matrix": [6, 4], "x": 10, "y": 1 }, { "matrix": [6, 4], "x": 10, "y": 1 },
{ "matrix": [6, 5], "x": 11, "y": 1 }, { "matrix": [6, 5], "x": 11, "y": 1 },
{ "matrix": [7, 0], "x": 6, "y": 2 }, { "matrix": [7, 0], "x": 6, "y": 2 },
{ "matrix": [7, 1], "x": 7, "y": 2 }, { "matrix": [7, 1], "x": 7, "y": 2 },
{ "matrix": [7, 2], "x": 8, "y": 2 }, { "matrix": [7, 2], "x": 8, "y": 2 },
{ "matrix": [7, 3], "x": 9, "y": 2 }, { "matrix": [7, 3], "x": 9, "y": 2 },
{ "matrix": [7, 4], "x": 10, "y": 2 }, { "matrix": [7, 4], "x": 10, "y": 2 },
{ "matrix": [7, 5], "x": 11, "y": 2 }, { "matrix": [7, 5], "x": 11, "y": 2 },
{ "matrix": [8, 0], "x": 6, "y": 3 }, { "matrix": [8, 0], "x": 6, "y": 3 },
{ "matrix": [8, 1], "x": 7, "y": 3 }, { "matrix": [8, 1], "x": 7, "y": 3 },
{ "matrix": [8, 2], "x": 8, "y": 3 }, { "matrix": [8, 2], "x": 8, "y": 3 },
{ "matrix": [8, 3], "x": 9, "y": 3 }, { "matrix": [8, 3], "x": 9, "y": 3 },
{ "matrix": [8, 4], "x": 10, "y": 3 }, { "matrix": [8, 4], "x": 10, "y": 3 },
{ "matrix": [8, 5], "x": 11, "y": 3 }, { "matrix": [8, 5], "x": 11, "y": 3 },
{ "matrix": [9, 2], "x": 8, "y": 4 }, { "matrix": [9, 3], "x": 8, "y": 4 },
{ "matrix": [9, 3], "x": 9, "y": 4 }, { "matrix": [9, 2], "x": 9, "y": 4 },
{ "matrix": [9, 4], "x": 10, "y": 4 }, { "matrix": [9, 1], "x": 10, "y": 4 },
{ "matrix": [9, 5], "x": 11, "y": 4 } { "matrix": [9, 0], "x": 11, "y": 4 }
] ]
} }
}, },

View file

@ -302,7 +302,7 @@ enum custom_keycodes {
COMPOSE, COMPOSE,
PASTHRU, PASTHRU,
LLOCK, OLEDON,
NEO2, NEO2,
QWERTZ, QWERTZ,
QWERTY, QWERTY,
@ -473,7 +473,7 @@ static void tap_on_layer(uint16_t key, uint8_t layer) {
} }
} }
enum layers { _L1, _L2, _L3, _L4, _L5, _L6, _L7, _L8, _L9, FN, KP1, KP2, KP3, STN }; enum layers { _L1, _L2, _L3, _L4, _L5, _L6, _L7, _L8, _L9, KP1, KP2, KP3, STN, FN };
#define LSHCTL S(KC_LCTL) #define LSHCTL S(KC_LCTL)
#define LSHGUI S(KC_LGUI) #define LSHGUI S(KC_LGUI)
@ -493,111 +493,112 @@ enum layers { _L1, _L2, _L3, _L4, _L5, _L6, _L7, _L8, _L9, FN, KP1, KP2, KP3, ST
#define STN_PLS STN_NB #define STN_PLS STN_NB
#define STN_HAT STN_NC #define STN_HAT STN_NC
#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)
// clang-format off // clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_L1] = LAYOUT_ortho_4x6_2x2uc( [_L1] = LAYOUT(
COMPOSE, X, V, L, C, W, K, H, G, F, Q, SZLIG, COMPOSE, X, V, L, C, W, K, H, G, F, Q, SZLIG,
CIRCUM, U, I, A, E, O, S, N, R, T, D, Y, 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, 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), LLOCK, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, 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 TT(_L6), TT(_L2), TT(_L3), KC_SPC, TT(_L7), TT(_L4), TT(_L5), KC_SPC
), ),
[_L2] = LAYOUT_ortho_4x6_2x2uc( [_L2] = LAYOUT(
COMPOSE, CX, CV, CL, CC, CW, CK, CH, CG, CF, CQ, CSZLIG, COMPOSE, CX, CV, CL, CC, CW, CK, CH, CG, CF, CQ, CSZLIG,
HACEK, CU, CI, CA, CE, CO, CS, CN, CR, CT, CD, CY, 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, 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), LLOCK, RSHALT, RSHGUI, SHAPP, RSHCTL, 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 TT(_L6), TT(_L2), TT(_L6), KC_SPC, XXXXXXX, XXXXXXX, TT(_L8), KC_SPC
), ),
[_L3] = LAYOUT_ortho_4x6_2x2uc( [_L3] = LAYOUT(
COMPOSE, ELLIPS, LOWLINE, LBRACKT, RBRACKT, ACIRCUM, EXCLAM, LESSTHN, GREATER, EQUALS, AMPSAND, LONG_S, 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, DOTABVE, BSLASH, FSLASH, LBRACE, RBRACE, ASTERSK, QUESTN, LPARENS, RPARENS, HYPHMIN, COLON, AT,
ACUTE, NUMBER, DOLLAR, VRTLINE, ATILDE, AGRAVE, PLUS, PERCENT, QUOT, AAPOSTR, SEMCOL, XXXXXXX, 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), LLOCK, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, 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 TT(_L6), TT(_L6), TT(_L3), KC_SPC, TT(_L7), TT(_L7), XXXXXXX, KC_SPC
), ),
[_L4] = LAYOUT_ortho_4x6_2x2uc( [_L4] = LAYOUT(
COMPOSE, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, INVEXCL, SEVEN, EIGHT, NINE, PLUS, MINUS, 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, 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, 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), LLOCK, KC_RALT, RLTRGUI, RLTAPP, RLTRCTL, 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 XXXXXXX, XXXXXXX, TT(_L7), ZERO, TT(_L7), TT(_L4), TT(_L9), ZERO
), ),
[_L5] = LAYOUT_ortho_4x6_2x2uc( [_L5] = LAYOUT(
COMPOSE, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, ZERO, HYPHMIN, COMPOSE, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, ZERO, HYPHMIN,
CEDILLE, DEGREE, SECTION, SCRIPTL, RDGUILM, LDGUILM, DOLLAR, EURO, LODQUOT, LDQUOT, RDQUOT, EMDASH, CEDILLE, DEGREE, SECTION, SCRIPTL, RDGUILM, LDGUILM, DOLLAR, EURO, LODQUOT, LDQUOT, RDQUOT, EMDASH,
SPLENIS, SUPONE, SUPTWO, SUPTHRE, RSGUILM, LSGUILM, CENTSGN, YEN, LOSQUOT, LSQUOT, RSQUOT, HYPHMIN, 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), LLOCK, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, 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 XXXXXXX, TT(_L8), XXXXXXX, KC_SPC, TT(_L9), XXXXXXX, TT(_L5), KC_SPC
), ),
[_L6] = LAYOUT_ortho_4x6_2x2uc( [_L6] = LAYOUT(
COMPOSE, XI, XXXXXXX, LAMBDA, CHI, OMEGA, KAPPA, PSI, GAMMA, PHI, VARPHI, FSIGMA, COMPOSE, XI, XXXXXXX, LAMBDA, CHI, OMEGA, KAPPA, PSI, GAMMA, PHI, VARPHI, FSIGMA,
TURNED, XXXXXXX, IOTA, ALPHA, EPSILON, OMICRON, SIGMA, NU, RHO, TAU, DELTA, UPSILON, TURNED, XXXXXXX, IOTA, ALPHA, EPSILON, OMICRON, SIGMA, NU, RHO, TAU, DELTA, UPSILON,
MACRON, XXXXXXX, LUNEPS, ETA, PI, ZETA, BETA, MU, VARRHO, VRTHETA, THETA, XXXXXXX, MACRON, XXXXXXX, LUNEPS, ETA, PI, ZETA, BETA, MU, VARRHO, VRTHETA, THETA, XXXXXXX,
LSHCTL, OSL(FN), LSHGUI, LSHALT, PASTHRU, TG(KP1), TG(STN), LLOCK, RSHALT, RSHGUI, SHAPP, RSHCTL, 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 TT(_L6), TT(_L6), TT(_L6), KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC
), ),
[_L7] = LAYOUT_ortho_4x6_2x2uc( [_L7] = LAYOUT(
COMPOSE, CXI, SQRT, CLAMBDA, COMPLEX, COMEGA, MULTSGN, CPSI, CGAMMA, CPHI, RATIONL, RINGOP, COMPOSE, CXI, SQRT, CLAMBDA, COMPLEX, COMEGA, MULTSGN, CPSI, CGAMMA, CPHI, RATIONL, RINGOP,
HOOK, SUBSET, INTEGRL, FORALL, THREXST, ELEMOF, CSIGMA, NATURAL, REAL, PARTDRV, CDELTA, NABLA, HOOK, SUBSET, INTEGRL, FORALL, THREXST, ELEMOF, CSIGMA, NATURAL, REAL, PARTDRV, CDELTA, NABLA,
TILDE, UNION, INTRSCT, ALEF, CPI, INTEGER, LDBLARR, LRDBARR, RDBLARR, RARRBAR, CTHETA, XXXXXXX, TILDE, UNION, INTRSCT, ALEF, CPI, INTEGER, LDBLARR, LRDBARR, RDBLARR, RARRBAR, CTHETA, XXXXXXX,
RLTCTL, OSL(FN), RLTGUI, RLTALT, PASTHRU, TG(KP1), TG(STN), LLOCK, KC_RALT, RLTRGUI, RLTAPP, RLTRCTL, 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 XXXXXXX, XXXXXXX, TT(_L7), KC_SPC, TT(_L7), TT(_L7), XXXXXXX, KC_SPC
), ),
[_L8] = LAYOUT_ortho_4x6_2x2uc( [_L8] = LAYOUT(
COMPOSE, FEMORD, MASCORD, NUMERO, XXXXXXX, MIDDOT, POUND, CURENCY, KC_TAB, FSLASH, ASTERSK, HYPHMIN, 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, RING, SUBONE, SUBTWO, SUBTHRE, FEMALE, MALE, MALEFEM, VARKPPA, LANGLE, RANGLE, SUBZERO, NBHYP,
BREVE, NOTSIGN, LOR, LAND, UPTACK, MEASANG, PARALLL, RIGHTAR, INFINIT, PROPTO, EMPTYST, SHYPHEN, 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), LLOCK, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, 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 XXXXXXX, TT(_L8), XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, TT(_L8), KC_SPC
), ),
[_L9] = LAYOUT_ortho_4x6_2x2uc( [_L9] = LAYOUT(
COMPOSE, XXXXXXX, KC_BTN1, KC_MS_U, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN3, KC_WH_U, KC_BTN4, XXXXXXX, 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, 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, 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), LLOCK, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, 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 XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, TT(_L9), XXXXXXX, TT(_L9), KC_SPC
), ),
[FN] = LAYOUT_ortho_4x6_2x2uc( [KP1] = LAYOUT(
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NEO2, XXXXXXX, XXXXXXX, XXXXXXX, QWERTY,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QWERTZ, QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
),
[KP1] = LAYOUT_ortho_4x6_2x2uc(
KC_NLCK, KC_TAB, KC_PSLS, KC_PAST, KC_PMNS, XXXXXXX, XXXXXXX, LEFTTAB, FSLASH, ASTERSK, HYPHMIN, XXXXXXX, 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_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_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), XXXXXXX, DIAMOND, HEART, SPADE, PERIOD, 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 TG(KP2), TG(KP3), KC_P0, KC_P0, TG(KP2), TG(KP3), OPNBOX, OPNBOX
), ),
[KP2] = LAYOUT_ortho_4x6_2x2uc( [KP2] = LAYOUT(
XXXXXXX, EQUALS, DIVSGN, DOTOPER, MINUS, XXXXXXX, XXXXXXX, NOTEQAL, FRACTSL, MULTSGN, SETMINS, XXXXXXX, 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, 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, LEFTARR, COLON, RIGHTAR, KC_PENT, XXXXXXX, XXXXXXX, KC_LEFT, XXXXXXX, KC_RGHT, KC_PENT, KC_RSFT,
XXXXXXX, LRARROW, DOWNARR, RLHARPO, COMMA, TG(KP1), XXXXXXX, KC_END, KC_DOWN, KC_PGDN, KC_DEL, XXXXXXX, 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 TG(KP2), TG(KP3), PERCENT, PERCENT, TG(KP2), TG(KP3), KC_PSTE, KC_PSTE
), ),
[KP3] = LAYOUT_ortho_4x6_2x2uc( [KP3] = LAYOUT(
XXXXXXX, ALMSTEQ, DIAMETR, CDOT, CMINUS, XXXXXXX, XXXXXXX, IDENTCL, DIVIDES, CTIMES, DOTMINS, XXXXXXX, 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, 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, SUBSET, ORIGNAL, SUPRSET, KC_PENT, XXXXXXX, XXXXXXX, SUBEQL, IMAGEOF, SUPREQL, KC_PENT, XXXXXXX,
XXXXXXX, LEQUAL, UNION, GEQUAL, PRIME, TG(KP1), XXXXXXX, LFLOOR, NARYUNI, RFLOOR, DPRIME, 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 TG(KP2), TG(KP3), PERMILL, PERMILL, TG(KP2), TG(KP3), WHTSQAR, WHTSQAR
), ),
[STN] = LAYOUT_ortho_4x6_2x2uc( [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_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_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, 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), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TG(STN), OLEDON, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
STN_HAT, STN_HAT, STN_A, STN_O, STN_HAT, STN_HAT, STN_E, STN_U STN_HAT, STN_HAT, STN_A, STN_O, STN_HAT, STN_HAT, STN_E, STN_U
), ),
[FN] = LAYOUT(
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NEO2, XXXXXXX, XXXXXXX, XXXXXXX, QWERTY,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QWERTZ, QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, OLEDON, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
),
}; };
// clang-format on // clang-format on
uint16_t layout = NEO2; uint16_t layout = NEO2;
bool lock_layer_held = false;
#define DECODED_KEY_USE_UNICODE 1 #define DECODED_KEY_USE_UNICODE 1
#define DECODED_KEY_ONESHOT 2 #define DECODED_KEY_ONESHOT 2
@ -684,15 +685,45 @@ static void process_key(uint16_t keycode, keyrecord_t *record) {
} }
} }
#ifdef OLED_ENABLE
static struct {
bool force_on;
uint32_t keep_on_until;
} oled_timer;
static void oled_turn_on(void) {
oled_timer.force_on = true;
}
static void oled_turn_off(void) {
oled_timer.force_on = false;
oled_timer.keep_on_until = 0;
}
static void oled_turn_on_for(uint32_t msec) {
oled_timer.keep_on_until = timer_read32() + msec;
}
static bool oled_is_on(void) {
return oled_timer.force_on || (timer_read32() < oled_timer.keep_on_until);
}
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef OLED_ENABLE
static uint16_t oledon_timer;
#endif
switch (keycode) { switch (keycode) {
case LLOCK: #ifdef OLED_ENABLE
case OLEDON:
if (record->event.pressed) { if (record->event.pressed) {
lock_layer_held = true; oledon_timer = timer_read();
oled_turn_on();
} else { } else {
lock_layer_held = false; oled_turn_off();
if (timer_elapsed(oledon_timer) < 200) {
oled_turn_on_for(30000);
}
} }
break; break;
#endif
case NEO2: case NEO2:
case QWERTY: case QWERTY:
case QWERTZ: case QWERTZ:
@ -714,4 +745,90 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
void matrix_init_user(void) { void matrix_init_user(void) {
steno_set_mode(STENO_MODE_GEMINI); steno_set_mode(STENO_MODE_GEMINI);
#ifdef OLED_ENABLE
oled_turn_on_for(60000);
#endif
} }
#ifdef OLED_ENABLE
bool oled_task_user(void) {
if (!oled_is_on()) {
oled_off();
return false;
}
oled_on();
oled_clear();
oled_write("Layer: ", false);
switch (get_highest_layer(layer_state)) {
case _L1:
oled_write_ln("Lowercase", false);
break;
case _L2:
oled_write_ln("Uppercase", false);
break;
case _L3:
oled_write_ln("Special", false);
break;
case _L4:
oled_write_ln("Navigation", false);
break;
case _L5:
oled_write_ln("Number Row (L1-3)", false);
break;
case _L6:
oled_write_ln("Greek (lower)", false);
break;
case _L7:
oled_write_ln("Math symbols", false);
break;
case _L8:
oled_write_ln("Number Row (L4-6)", false);
break;
case _L9:
oled_write_ln("Mouse", false);
break;
case KP1:
oled_write_ln("Keypad (L1-2)", false);
break;
case KP2:
oled_write_ln("Keypad (L3-4)", false);
break;
case KP3:
oled_write_ln("Keypad (L5-6)", false);
break;
case STN:
oled_write_ln("Stenography", false);
break;
case FN:
oled_write_ln("Function", false);
break;
default:
oled_write_ln("Unknown", false);
break;
}
oled_write("Layout: ", false);
switch (layout) {
case NEO2:
oled_write_ln("Neo 2", false);
break;
case QWERTY:
oled_write_ln("QWERTY", false);
break;
case QWERTZ:
oled_write_ln("QWERTZ", false);
break;
default:
oled_write_ln("Unknown", false);
break;
}
led_t led_state = host_keyboard_led_state();
oled_write(led_state.num_lock ? "NUM " : " ", false);
oled_write(led_state.caps_lock ? "CAP " : " ", false);
oled_write(led_state.scroll_lock ? "SCR " : " ", false);
return false;
}
#endif

View file

@ -1,5 +1,8 @@
UNICODE_ENABLE = yes UNICODE_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
SRC += i2c_slave.c i2c_master.c SRC += i2c_slave.c i2c_master.c
QUANTUM_SRC += $(QUANTUM_DIR)/split_common/transport.c $(QUANTUM_DIR)/split_common/transactions.c QUANTUM_SRC += $(QUANTUM_DIR)/split_common/transport.c $(QUANTUM_DIR)/split_common/transactions.c
OPT_DEFS += -DSPLIT_COMMON_TRANSACTIONS OPT_DEFS += -DSPLIT_COMMON_TRANSACTIONS