diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..b32cc20f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "qmk_firmware"] + path = qmk_firmware + url = https://github.com/Keebart/vial-qmk-corne-choc-pro.git diff --git a/README.md b/README.md index df8d84e3..55a38834 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,24 @@ -# QMK Userspace +# QMK Userspace — Keebart Corne Choc Pro -This is a template repository which allows for an external set of QMK keymaps to be defined and compiled. This is useful for users who want to maintain their own keymaps without having to fork the [main QMK repository](https://github.com/qmk/qmk_firmware). You must still fork the main QMK repository if writing firmware for a *new* keyboard. +## Setup -## Howto configure your build targets +1. Use [qmk/qmk_userspace](https://github.com/qmk/qmk_userspace) as a template to create your repo +2. Clone your new repo +3. Unzip this into it +4. Add the Keebart fork as a submodule: -1. Run the normal `qmk setup` procedure if you haven't already done so -- see [QMK Docs](https://docs.qmk.fm/#/newbs) for details. -1. Fork this repository -1. Clone your fork to your local machine -1. Enable userspace in QMK config using `qmk config user.overlay_dir="$(realpath qmk_userspace)"` -1. Add a new keymap for your board using `qmk new-keymap` - * This will create a new keymap in the `keyboards` directory, in the same location that would normally be used in the main QMK repository. For example, if you wanted to add a keymap for the Planck, it will be created in `keyboards/planck/keymaps/` - * You can also create a new keymap using `qmk new-keymap -kb -km ` - * Alternatively, add your keymap manually by placing it in the location specified above. - * `layouts///keymap.*` is also supported if you prefer the layout system -1. Add your keymap(s) to the build by running `qmk userspace-add -kb -km ` - * This will automatically update your `qmk.json` file - * Corresponding `qmk userspace-remove -kb -km ` will delete it - * Listing the build targets can be done with `qmk userspace-list` -1. Commit your changes - -## Howto build with GitHub - -1. In the GitHub Actions tab, enable workflows -1. Push your changes above to your forked GitHub repository -1. Look at the GitHub Actions for a new actions run -1. Wait for the actions run to complete -1. Inspect the Releases tab on your repository for the latest firmware build - -## Howto build locally - -1. Run the normal `qmk setup` procedure if you haven't already done so -- see [QMK Docs](https://docs.qmk.fm/#/newbs) for details. -1. Fork this repository -1. Clone your fork to your local machine -1. `cd` into this repository's clone directory -1. Set global userspace path: `qmk config user.overlay_dir="$(realpath .)"` -- you MUST be located in the cloned userspace location for this to work correctly - * This will be automatically detected if you've `cd`ed into your userspace repository, but the above makes your userspace available regardless of your shell location. -1. Compile normally: `qmk compile -kb your_keyboard -km your_keymap` or `make your_keyboard:your_keymap` - -Alternatively, if you configured your build targets above, you can use `qmk userspace-compile` to build all of your userspace targets at once. - -## Extra info - -If you wish to point GitHub actions to a different repository, a different branch, or even a different keymap name, you can modify `.github/workflows/build_binaries.yml` to suit your needs. - -To override the `build` job, you can change the following parameters to use a different QMK repository or branch: -``` - with: - qmk_repo: qmk/qmk_firmware - qmk_ref: master +```bash +git submodule add https://github.com/Keebart/vial-qmk-corne-choc-pro.git qmk_firmware +git submodule update --init --recursive ``` -If you wish to manually manage `qmk_firmware` using git within the userspace repository, you can add `qmk_firmware` as a submodule in the userspace directory instead. GitHub Actions will automatically use the submodule at the pinned revision if it exists, otherwise it will use the default latest revision of `qmk_firmware` from the main repository. +5. Commit and push: -This can also be used to control which fork is used, though only upstream `qmk_firmware` will have support for external userspace until other manufacturers update their forks. +```bash +git add . +git commit -m "Initial keymap" +git push +``` -1. (First time only) `git submodule add https://github.com/qmk/qmk_firmware.git` -1. (To update) `git submodule update --init --recursive` -1. Commit your changes to your userspace repository +6. GitHub Actions builds the .uf2 — download from the Releases tab +7. Flash: hold Q while plugging in left half, drag .uf2 onto RPI-RP2. Repeat with P for right. diff --git a/keyboards/keebart/corne_choc_pro/keymaps/timfee/keymap.c b/keyboards/keebart/corne_choc_pro/keymaps/timfee/keymap.c new file mode 100644 index 00000000..0675d293 --- /dev/null +++ b/keyboards/keebart/corne_choc_pro/keymaps/timfee/keymap.c @@ -0,0 +1,25 @@ +#include "timfee.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_split_3x6_3( + ESC_L1, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, MIN_L2, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_EQL, + KC_LSFT, Z_L2, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, SL_L1, KC_QUOT, + CT_GRV, AL_DEL, GU_BSP, GU_SPC, AL_ENT, KC_RCTL + ), + + [1] = LAYOUT_split_3x6_3( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, LALT(KC_LEFT), LALT(KC_DOWN), LALT(KC_UP), LALT(KC_RGHT), KC_PGUP, _______, + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, _______, _______, _______, KC_F11, KC_F12, LGUI(KC_LEFT), LGUI(KC_DOWN), LGUI(KC_UP), RGUI(KC_RGHT), KC_PGDN, _______, + _______, _______, _______, _______, _______, _______ + ), + + [2] = LAYOUT_split_3x6_3( + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_7, KC_8, KC_9, _______, _______, _______, + _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_4, KC_5, KC_6, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, _______, + _______, _______, KC_DOT, KC_COMM, KC_0, KC_DOT + ), +}; diff --git a/qmk.json b/qmk.json index 3afc389f..793de885 100644 --- a/qmk.json +++ b/qmk.json @@ -1,4 +1,6 @@ { "userspace_version": "1.0", - "build_targets": [] -} \ No newline at end of file + "build_targets": [ + ["keebart/corne_choc_pro/standard", "timfee"] + ] +} diff --git a/qmk_firmware b/qmk_firmware new file mode 160000 index 00000000..4649f864 --- /dev/null +++ b/qmk_firmware @@ -0,0 +1 @@ +Subproject commit 4649f864f15ba9f540ee83d66b50cb9fcd4f7e59 diff --git a/users/timfee/config.h b/users/timfee/config.h new file mode 100644 index 00000000..5ce6c48c --- /dev/null +++ b/users/timfee/config.h @@ -0,0 +1,16 @@ +#pragma once + +// ── Tap-hold ── +#define TAPPING_TERM 150 +#define TAPPING_TERM_PER_KEY +#define QUICK_TAP_TERM 90 +#define QUICK_TAP_TERM_PER_KEY +#define PERMISSIVE_HOLD_PER_KEY +#define HOLD_ON_OTHER_KEY_PRESS_PER_KEY +#define RETRO_TAPPING +#define RETRO_TAPPING_PER_KEY + +// ── Combos ── +#define COMBO_COUNT 8 +#define COMBO_TERM 40 +#define COMBO_ONLY_FROM_LAYER 0 diff --git a/users/timfee/rules.mk b/users/timfee/rules.mk new file mode 100644 index 00000000..5e04c048 --- /dev/null +++ b/users/timfee/rules.mk @@ -0,0 +1,2 @@ +SRC += timfee.c +COMBO_ENABLE = yes diff --git a/users/timfee/timfee.c b/users/timfee/timfee.c new file mode 100644 index 00000000..19863955 --- /dev/null +++ b/users/timfee/timfee.c @@ -0,0 +1,126 @@ +#include "timfee.h" + +// ── State for require-prior-idle ── +static uint16_t last_key_time = 0; + +// ── Combos ── +const uint16_t PROGMEM lparen_combo[] = {KC_R, KC_T, COMBO_END}; +const uint16_t PROGMEM rparen_combo[] = {KC_Y, KC_U, COMBO_END}; +const uint16_t PROGMEM lbrace_combo[] = {KC_F, KC_G, COMBO_END}; +const uint16_t PROGMEM rbrace_combo[] = {KC_H, KC_J, COMBO_END}; +const uint16_t PROGMEM lbkt_combo[] = {KC_V, KC_B, COMBO_END}; +const uint16_t PROGMEM rbkt_combo[] = {KC_N, KC_M, COMBO_END}; +const uint16_t PROGMEM pipe_combo[] = {Z_L2, KC_X, COMBO_END}; +const uint16_t PROGMEM bslh_combo[] = {SL_L1, KC_QUOT, COMBO_END}; + +combo_t key_combos[COMBO_COUNT] = { + COMBO(lparen_combo, KC_LPRN), + COMBO(rparen_combo, KC_RPRN), + COMBO(lbrace_combo, KC_LCBR), + COMBO(rbrace_combo, KC_RCBR), + COMBO(lbkt_combo, KC_LBRC), + COMBO(rbkt_combo, KC_RBRC), + COMBO(pipe_combo, KC_PIPE), + COMBO(bslh_combo, KC_BSLS), +}; + +// ── Require-prior-idle: bypass hold-tap during typing ── +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + uint16_t elapsed = timer_elapsed(last_key_time); + + switch (keycode) { + case GU_SPC: + if (elapsed < RPI_SPACE) { + tap_code(KC_SPC); + return false; + } + break; + case GU_BSP: + if (elapsed < RPI_BKSP) { + tap_code(KC_BSPC); + return false; + } + break; + case Z_L2: + if (elapsed < RPI_Z) { + tap_code(KC_Z); + return false; + } + break; + case SL_L1: + if (elapsed < RPI_SLASH) { + tap_code(KC_SLSH); + return false; + } + break; + case ESC_L1: + if (elapsed < RPI_ESC) { + tap_code(KC_ESC); + return false; + } + break; + case MIN_L2: + if (elapsed < RPI_MINUS) { + tap_code(KC_MINS); + return false; + } + break; + } + + last_key_time = timer_read(); + } + return true; +} + +// ── Per-key tapping term ── +uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case GU_BSP: return 100; + case GU_SPC: return 150; + case Z_L2: + case SL_L1: return 120; + case AL_DEL: + case AL_ENT: return 130; + default: return TAPPING_TERM; + } +} + +// ── Per-key permissive hold (pinky layer-taps only) ── +bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case ESC_L1: + case Z_L2: + case MIN_L2: + case SL_L1: + return true; + default: + return false; + } +} + +// ── Per-key hold on other key press (yeet only) ── +bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case GU_BSP: return true; + default: return false; + } +} + +// ── Per-key retro tapping (yeet only) ── +bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case GU_BSP: return true; + default: return false; + } +} + +// ── Per-key quick tap term ── +uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case GU_SPC: return 90; + case Z_L2: + case SL_L1: return 80; + default: return QUICK_TAP_TERM; + } +} diff --git a/users/timfee/timfee.h b/users/timfee/timfee.h new file mode 100644 index 00000000..2f46ca3a --- /dev/null +++ b/users/timfee/timfee.h @@ -0,0 +1,21 @@ +#pragma once +#include QMK_KEYBOARD_H + +// ── Key aliases ── +#define ESC_L1 LT(1, KC_ESC) +#define Z_L2 LT(2, KC_Z) +#define MIN_L2 LT(2, KC_MINS) +#define SL_L1 LT(1, KC_SLSH) +#define CT_GRV LCTL_T(KC_GRV) +#define AL_DEL LALT_T(KC_DEL) +#define GU_BSP LGUI_T(KC_BSPC) +#define GU_SPC RGUI_T(KC_SPC) +#define AL_ENT RALT_T(KC_ENT) + +// ── Require-prior-idle thresholds (ms) ── +#define RPI_SPACE 150 +#define RPI_Z 125 +#define RPI_SLASH 150 +#define RPI_ESC 125 +#define RPI_MINUS 150 +#define RPI_BKSP 150