From e4635ddc2d652db5146c8125be9a9dbf19fbe1ce Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Fri, 28 Mar 2025 00:06:54 -0400 Subject: [PATCH] Init --- .clang-format | 30 ---------- .editorconfig | 32 ---------- README.md | 59 ------------------- .../v1/ansi_encoder/keymaps/default/rules.mk | 1 - .../ansi_encoder/keymaps/default/keymap.c | 58 ++++++++++-------- .../ansi_encoder/keymaps/default/rules.mk | 1 + qmk.json | 8 +-- 7 files changed, 38 insertions(+), 151 deletions(-) delete mode 100644 .clang-format delete mode 100644 .editorconfig delete mode 100644 README.md delete mode 100644 keyboards/keychron/v1/ansi_encoder/keymaps/default/rules.mk rename keyboards/keychron/{v1 => v1_max}/ansi_encoder/keymaps/default/keymap.c (59%) create mode 100644 keyboards/keychron/v1_max/ansi_encoder/keymaps/default/rules.mk diff --git a/.clang-format b/.clang-format deleted file mode 100644 index ce145e299c..0000000000 --- a/.clang-format +++ /dev/null @@ -1,30 +0,0 @@ ---- -BasedOnStyle: Google -AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: 'true' -AlignConsecutiveDeclarations: 'true' -AlignOperands: 'true' -AllowAllParametersOfDeclarationOnNextLine: 'false' -AllowShortCaseLabelsOnASingleLine: 'false' -AllowShortFunctionsOnASingleLine: Empty -AllowShortLoopsOnASingleLine: 'false' -AlwaysBreakAfterDefinitionReturnType: None -AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: 'false' -BinPackArguments: 'true' -BinPackParameters: 'true' -ColumnLimit: '1000' -IndentCaseLabels: 'true' -IndentPPDirectives: AfterHash -IndentWidth: '4' -MaxEmptyLinesToKeep: '1' -PointerAlignment: Right -SortIncludes: 'false' -SpaceBeforeAssignmentOperators: 'true' -SpaceBeforeParens: ControlStatements -SpaceInEmptyParentheses: 'false' -SpacesBeforeTrailingComments: 1 -TabWidth: '4' -UseTab: Never - -... diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index e06a225638..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,32 +0,0 @@ -# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs -# editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 4 - -# We recommend you to keep these unchanged -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false -indent_size = 4 - -[{qmk,*.py}] -charset = utf-8 -max_line_length = 200 - -# Make these match what we have in .gitattributes -[*.mk] -end_of_line = lf -indent_style = tab - -[Makefile] -end_of_line = lf -indent_style = tab - -[*.sh] -end_of_line = lf diff --git a/README.md b/README.md deleted file mode 100644 index 2520899774..0000000000 --- a/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# QMK Userspace - -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. - -## Howto configure your build targets - -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 -``` - -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. - -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. - -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 diff --git a/keyboards/keychron/v1/ansi_encoder/keymaps/default/rules.mk b/keyboards/keychron/v1/ansi_encoder/keymaps/default/rules.mk deleted file mode 100644 index ee32568148..0000000000 --- a/keyboards/keychron/v1/ansi_encoder/keymaps/default/rules.mk +++ /dev/null @@ -1 +0,0 @@ -ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/v1/ansi_encoder/keymaps/default/keymap.c b/keyboards/keychron/v1_max/ansi_encoder/keymaps/default/keymap.c similarity index 59% rename from keyboards/keychron/v1/ansi_encoder/keymaps/default/keymap.c rename to keyboards/keychron/v1_max/ansi_encoder/keymaps/default/keymap.c index 3a352dce43..e622ce99f6 100644 --- a/keyboards/keychron/v1/ansi_encoder/keymaps/default/keymap.c +++ b/keyboards/keychron/v1_max/ansi_encoder/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2021 @ Keychron (https://www.keychron.com) +/* Copyright 2023 @ Keychron (https://www.keychron.com) * * 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 @@ -15,36 +15,46 @@ */ #include QMK_KEYBOARD_H +#include "keychron_common.h" -// clang-format off - -enum layers{ +enum layers { + MAC_BASE, + MAC_FN, WIN_BASE, - WIN_FN + WIN_FN, }; - -#define KC_TASK LGUI(KC_TAB) -#define KC_FLXP LGUI(KC_E) - +// clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [WIN_BASE] = LAYOUT_ansi_82( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_SLEP, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PSCR, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LCMD, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_SLEP, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [WIN_FN] = LAYOUT_ansi_82( - _______, _______, _______, KC_TASK, KC_FLXP, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, _______, _______, _______, QK_BOOT, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + _______, _______, _______, KC_TASK, KC_FILE, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, _______, _______, _______, QK_BOOT, + _______, BT_HST1, BT_HST2, BT_HST3, P2P4G, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, + _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) }; -const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { - [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, - [WIN_FN] = { ENCODER_CCW_CW(RM_VALD, RM_VALU)} +// clang-format on +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_FN] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, }; +#endif // ENCODER_MAP_ENABLE + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_keychron_common(keycode, record)) { + return false; + } + return true; +} diff --git a/keyboards/keychron/v1_max/ansi_encoder/keymaps/default/rules.mk b/keyboards/keychron/v1_max/ansi_encoder/keymaps/default/rules.mk new file mode 100644 index 0000000000..f845616741 --- /dev/null +++ b/keyboards/keychron/v1_max/ansi_encoder/keymaps/default/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = no \ No newline at end of file diff --git a/qmk.json b/qmk.json index 5f8ed2df66..6b75a408cc 100644 --- a/qmk.json +++ b/qmk.json @@ -1,6 +1,4 @@ { - "userspace_version": "1.1", - "build_targets": [ - ["keychron/v1/ansi_encoder", "default"] - ] -} \ No newline at end of file + "userspace_version": "1.0", + "build_targets": [["keychron/v1_max/ansi_encoder", "default"]] +}