From 39707a2aa32b4296e85403222fbc555fffaec45c Mon Sep 17 00:00:00 2001 From: Var Bhat Date: Sat, 29 Jun 2024 18:25:28 +0530 Subject: [PATCH] ft: first commit --- .clang-format | 30 ++ .clangd | 4 + .editorconfig | 32 ++ .github/generate_keymap_drawer.sh | 40 +++ .github/workflows/build_binaries.yaml | 69 ++++ .gitignore | 11 + LICENSE | 339 ++++++++++++++++++ README.md | 106 ++++++ keyboards/.keep | 0 keyboards/crkbd/keymaps/vbt/combos.c | 9 + keyboards/crkbd/keymaps/vbt/config.h | 21 ++ keyboards/crkbd/keymaps/vbt/glcdfont.c | 18 + keyboards/crkbd/keymaps/vbt/keymap.c | 122 +++++++ keyboards/crkbd/keymaps/vbt/layers.h | 8 + keyboards/crkbd/keymaps/vbt/oled.c | 61 ++++ keyboards/crkbd/keymaps/vbt/rules.mk | 26 ++ .../ploopyco/madromys/keymaps/vbt/combos.c | 7 + .../ploopyco/madromys/keymaps/vbt/config.h | 5 + .../ploopyco/madromys/keymaps/vbt/keymap.c | 12 + .../ploopyco/madromys/keymaps/vbt/layers.h | 5 + .../ploopyco/madromys/keymaps/vbt/rules.mk | 19 + qmk.json | 7 + 22 files changed, 951 insertions(+) create mode 100644 .clang-format create mode 100644 .clangd create mode 100644 .editorconfig create mode 100755 .github/generate_keymap_drawer.sh create mode 100755 .github/workflows/build_binaries.yaml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 keyboards/.keep create mode 100644 keyboards/crkbd/keymaps/vbt/combos.c create mode 100644 keyboards/crkbd/keymaps/vbt/config.h create mode 100644 keyboards/crkbd/keymaps/vbt/glcdfont.c create mode 100644 keyboards/crkbd/keymaps/vbt/keymap.c create mode 100644 keyboards/crkbd/keymaps/vbt/layers.h create mode 100644 keyboards/crkbd/keymaps/vbt/oled.c create mode 100644 keyboards/crkbd/keymaps/vbt/rules.mk create mode 100644 keyboards/ploopyco/madromys/keymaps/vbt/combos.c create mode 100644 keyboards/ploopyco/madromys/keymaps/vbt/config.h create mode 100644 keyboards/ploopyco/madromys/keymaps/vbt/keymap.c create mode 100644 keyboards/ploopyco/madromys/keymaps/vbt/layers.h create mode 100644 keyboards/ploopyco/madromys/keymaps/vbt/rules.mk create mode 100644 qmk.json diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..ce145e2 --- /dev/null +++ b/.clang-format @@ -0,0 +1,30 @@ +--- +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/.clangd b/.clangd new file mode 100644 index 0000000..6133ae7 --- /dev/null +++ b/.clangd @@ -0,0 +1,4 @@ +CompileFlags: + Add: [-Wno-unknown-attributes, -Wno-maybe-uninitialized, -Wno-unknown-warning-option] + Remove: [-W*, -mmcu=*, -mcpu=*, -mfpu=*, -mfloat-abi=*, -mno-unaligned-access, -mno-thumb-interwork, -mcall-prologues] + Compiler: clang diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e06a225 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,32 @@ +# 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/.github/generate_keymap_drawer.sh b/.github/generate_keymap_drawer.sh new file mode 100755 index 0000000..54c398d --- /dev/null +++ b/.github/generate_keymap_drawer.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +generate_keymap_svg() { + if [ "$#" -ne 3 ]; then + echo "Usage: $0 " + return 1 + fi + + local THEME=$1 + local QMK_KEYMAP_JSON=$2 + local OUTPUT_FILE_NAME=$3 + + local DARK_CONFIG=$( + cat <"${OUTPUT_FILE_NAME}_${THEME}.svg" +} + +for theme in "dark" "light"; do + generate_keymap_svg "${theme}" "$1" "$2" +done diff --git a/.github/workflows/build_binaries.yaml b/.github/workflows/build_binaries.yaml new file mode 100755 index 0000000..d670b47 --- /dev/null +++ b/.github/workflows/build_binaries.yaml @@ -0,0 +1,69 @@ +name: Build QMK firmware + +on: [push, workflow_dispatch] + +permissions: + contents: write + +jobs: + build: + name: "QMK Userspace Build" + uses: qmk/.github/.github/workflows/qmk_userspace_build.yml@main + with: + qmk_repo: qmk/qmk_firmware + qmk_ref: master + preparation_command: | + qmk c2json -kb crkbd -km vbt > keyboard_layout.bin # A Hack + qmk c2json -kb ploopyco/madromys -km vbt > trackpad_layout.bin # A Hack + + publish: + name: "Generate layout images and publish the firmware" + needs: build + permissions: write-all + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Download artifacts + if: always() && !cancelled() + uses: actions/download-artifact@v4 + with: + name: Firmware + + - run: mv keyboard_layout.bin crkbd_rev1_vbt_keymap.json + + - run: mv trackpad_layout.bin ploopyco_madromys_rev1_001_vbt.json + + - name: Install keymap-drawer (pypi) + run: python3 -m pip install keymap-drawer + + - name: Generate Keyboard Keymap Layout SVG using keymap-drawer + run: ./.github/generate_keymap_drawer.sh ./crkbd_rev1_vbt_keymap.json crkbd_rev1_vbt + + - name: Generate Trackpad Keymap Layout SVG using keymap-drawer + run: ./.github/generate_keymap_drawer.sh ploopyco_madromys_rev1_001_vbt.json ploopyco_madromys_rev1_001_vbt + + - name: Install Inkscape + run: sudo apt install -y inkscape + + - run: sudo apt install -y gsfonts gsfonts-other + + - name: Generate Keymap Layout PNGs from Generated SVGs + run: | + inkscape --export-background-opacity=0 ./crkbd_rev1_vbt_dark.svg -o crkbd_rev1_vbt_dark.png + inkscape --export-background-opacity=0 ./crkbd_rev1_vbt_light.svg -o crkbd_rev1_vbt_light.png + inkscape --export-background-opacity=0 ./ploopyco_madromys_rev1_001_vbt_dark.svg -o ploopyco_madromys_rev1_001_vbt_dark.png + inkscape --export-background-opacity=0 ./ploopyco_madromys_rev1_001_vbt_light.svg -o ploopyco_madromys_rev1_001_vbt_light.png + + - name: Publish Releases + continue-on-error: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh config set prompt disabled + gh release create $(date +%s) --latest --generate-notes *.uf2 *.svg *.png crkbd_rev1_vbt_keymap.json ploopyco_madromys_rev1_001_vbt.json + + - uses: geekyeggo/delete-artifact@v5 + with: + name: Firmware diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ec5cfa2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# Junk files +*.bak +*.swp +*~ +.DS_Store +._* + +# Firmware files +*.hex +*.bin +*.uf2 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d165683 --- /dev/null +++ b/README.md @@ -0,0 +1,106 @@ +# *qmk_userspace* ⌨️ 🖲️ +## 🔱 My [QMK](https://qmk.fm) [Userspace](https://github.com/qmk/qmk_userspace) currently used for my [crkbd/corne](https://github.com/foostan/crkbd/tree/v3-final) and [adept/madromys](https://github.com/ploopyco/adept-trackball). + +![QMK](https://img.shields.io/badge/qmk-%23000000.svg?logo=qmk) +![GitHub License](https://img.shields.io/github/license/varbhat/qmk_userspace) + +## Features +- [Github Actions](https://github.com/features/actions) to build Firmware for my `corne` keyboard and `adept` trackball. +- Visualization of Keymaps using [Keymap-drawer](https://github.com/caksoylar/keymap-drawer). Note that the layer names are not present in the visualization. Look into [keymap.c](keyboards/crkbd/keymaps/vbt/keymap.c) for the correct information. + +
+Layout Visualization using keymap-drawer (Appearance of Layout is Dark themed) + +![crkbd_rev1_vbt_dark.png](https://github.com/varbhat/qmk_userspace/releases/latest/download/crkbd_rev1_vbt_dark.png?raw=true) + +![ploopyco_madromys_rev1_001_vbt_dark.png](https://github.com/varbhat/qmk_userspace/releases/latest/download/ploopyco_madromys_rev1_001_vbt_dark.png?raw=true) + +
+ +
+Layout Visualization using keymap-drawer (Appearance of Layout is Light themed) + +![crkbd_rev1_vbt_light.png](https://github.com/varbhat/qmk_userspace/releases/latest/download/crkbd_rev1_vbt_light.png?raw=true) + + +![ploopyco_madromys_rev1_001_vbt_light.png](https://github.com/varbhat/qmk_userspace/releases/latest/download/ploopyco_madromys_rev1_001_vbt_light.png?raw=true) + +
+ +## Setup the QMK Workspace +- This Repository is a `QMK Userspace` Repository. Instructions listed [here](https://github.com/qmk/qmk_userspace) can be followed to setup `QMK Userspace`. Or follow the following: + - Install `qmk` using `pipx` or your package manager. + - Setup `qmk` using `qmk setup` + - Clone this repository + - In the cloned repository, execute `qmk config user.overlay_dir="$(realpath .)"` + + +## Features of my `corne` keymap +- `DVORAK` Layout (Alternating between the Hands is one of the main benefit of Dvorak) +- 5 Layers: `DVORAK`,`QWERTY`, `NUM`, `SYM`, `NAV` +- `VBUS` Detection using `GPIO19` for (My MCU is [Splinky](https://github.com/Bastardkb/Splinky). Using `VBUS` detection instead of USB Data channel detection, the keyboard can work without replugging and can be used to enter the BIOS) +- Vertically Aligned OLED Display/Indicator. It displays Layer Names, Modifier Status(Super,Ctrl,Alt,Shift), Lock Status(CAPS Lock, Num Lock, Scr Lock) and `corne` logo. Distracting/Animating elements such as `WPM` indicators, pets(luna/bongocat/etc.), Keyloggers are disabled and not supported. +- Utilizes Combos and One Shot Keys. +- No `via` or `vial` support. I don't want any security loopholes. Let this Repository be the source of truth and everytime you make the changes, you reflash the keyboard with the new firmware. +- `NUM` and `SYM` layer keys on the right thumb cluster will toggle to respective layers on double tap and will momentarily switch otherwise. It's achieved using `TAPPING_TOGGLE` feature of QMK (`TT`) set to 2. + +
+Combo + +`Escape` + `Backspace` => `DEL` + +`Space` + `Enter` => Move to Base `Dvorak` Layer. Turns off all other layers + +
+ + +## Usage for `corne` +`.uf2` firmware for the `corne` is required. You can compile the `.uf2` firmware locally or can obtain the precompiled `.uf2` firmware (Compiled using Github Actions). Then, it needs to be flashed to the `corne`. + +#### Github Actions +- Go to [Github Releases](https://github.com/varbhat/qmk_userspace/releases) and download the latest [.uf2](https://github.com/microsoft/uf2) file, or get here: [crkbd_rev1_vbt_promicro_rp2040.uf2](https://github.com/varbhat/qmk_userspace/releases/latest/download/crkbd_rev1_vbt_promicro_rp2040.uf2) + +#### Local +- Setup the QMK Workspace. +- Compile the Firmware using `qmk compile --clean -kb crkbd -km vbt` + +### Flashing the `corne` +- Disconnect TRRS/TRS cable between the `corne` splits. +- For both of `corne` splits, do: + - Connect your `corne` split to the computer using `USB`. + - Press spst switch (also called as reset switch) of the split two times consequently so that your [RP2040](https://www.raspberrypi.com/documentation/microcontrollers/rp2040.html) based MCU will go to `Bootloader` Mode. + - You must see `Raspberry PI Boot Device` in the output of `lsusb`. It's also detected as Mass Storage Device. + - Drag and Drop (`cp` or `copy`) the `.uf2` file to the `RP2040` Mass Storage Device. + - After the firmware is copied, you will see that the MCU exits `Bootloader` mode and Mass Storage Device is no longer present. It means that the firmware is flashed! + +## Features of my `adept` keymap +- `via` is disabled. +- Has 2 layers (which are mirrored copies of one another) which facilitates Ambidexterity. +- Combo to switch between `RIGHT_HAND` and `LEFT_HAND` layer (Press btn4 and btn5 together). +- Look into [keymap.c](keyboards/ploopyco/madromys/keymaps/vbt/keymap.c) for the more information. + + +
+Combo + + +`BTN4` + `BTN5` => Toggle `LEFT_HAND` layer on and off. + +
+ + +## Usage for `adept` +`.uf2` firmware for the `adept` is required. You can compile the `.uf2` firmware locally or can obtain the precompiled `.uf2` firmware (Compiled using Github Actions). Then, it needs to be flashed to the `adept`. + +#### Github Actions +- Go to [Github Releases](https://github.com/varbhat/qmk_userspace/releases) and download the latest [.uf2](https://github.com/microsoft/uf2) file, or get here: [ploopyco_madromys_rev1_001_vbt.uf2](https://github.com/varbhat/qmk_userspace/releases/latest/download/ploopyco_madromys_rev1_001_vbt.uf2) + +#### Local +- Setup the QMK Userspace. +- Compile the Firmware using `qmk compile --clean -kb ploopyco/madromys -km vbt` + +### Flashing the `adept` +- Follow the official instructions: [Adept Trackball Wiki](https://github.com/ploopyco/adept-trackball/wiki/Appendix-D%3A-QMK-Firmware-Programming#putting-the-ploopy-device-into-bootloader-mode) + +## License +[GPL-v2](LICENSE) diff --git a/keyboards/.keep b/keyboards/.keep new file mode 100644 index 0000000..e69de29 diff --git a/keyboards/crkbd/keymaps/vbt/combos.c b/keyboards/crkbd/keymaps/vbt/combos.c new file mode 100644 index 0000000..48d59f7 --- /dev/null +++ b/keyboards/crkbd/keymaps/vbt/combos.c @@ -0,0 +1,9 @@ +const uint16_t PROGMEM del_combo[] = {KC_ESC, KC_BSPC, COMBO_END}; +const uint16_t PROGMEM spc_ent_combo[] = {KC_SPC, KC_ENT, COMBO_END}; + +// clang-format off +combo_t key_combos[] = { + COMBO(del_combo, KC_DEL), + COMBO(spc_ent_combo, TO(_DVORAK)), +}; +// clang-format on diff --git a/keyboards/crkbd/keymaps/vbt/config.h b/keyboards/crkbd/keymaps/vbt/config.h new file mode 100644 index 0000000..356f249 --- /dev/null +++ b/keyboards/crkbd/keymaps/vbt/config.h @@ -0,0 +1,21 @@ +#pragma once + +// #define USE_MATRIX_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +// #define QUICK_TAP_TERM 0 +// #define TAPPING_TERM 100 + +#define OLED_FONT_H "keyboards/crkbd/keymaps/vbt/glcdfont.c" + +#undef SPLIT_USB_DETECT +#define USB_VBUS_PIN 19U + +#define OLED_BRIGHTNESS 10 +#define SPLIT_OLED_ENABLE + +#define TAPPING_TOGGLE 2 diff --git a/keyboards/crkbd/keymaps/vbt/glcdfont.c b/keyboards/crkbd/keymaps/vbt/glcdfont.c new file mode 100644 index 0000000..c301ff4 --- /dev/null +++ b/keyboards/crkbd/keymaps/vbt/glcdfont.c @@ -0,0 +1,18 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. +// https://helixfonteditor.netlify.com/ + +#include "progmem.h" + +// Standard ASCII 5x7 fontstatic +const unsigned char PROGMEM font[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x60, 0x30, 0x18, 0xF8, 0x18, 0x00, 0xC0, 0x70, 0x1C, 0x06, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0xC3, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08, 0x18, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x08, 0x18, 0x20, 0x40, 0x40, 0x40, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x30, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x10, 0x30, 0x40, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x0C, 0x06, 0x07, 0xFC, 0x00, 0xFF, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x80, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x1C, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x06, 0x01, 0x00, 0x00, 0x08, 0x00, 0x00, 0x20, 0x40, 0x40, 0x30, 0x40, 0x40, 0x20, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0xF8, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0C, 0x02, 0x01, 0x00, 0x10, 0x00, 0x00, 0x40, 0x80, 0x80, 0x60, 0x80, 0x80, 0x40, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0C, 0xF0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0E, 0x18, 0x30, 0x21, 0x21, 0x31, 0x18, 0x10, 0x30, 0x20, 0x60, 0x41, 0x60, 0x20, 0x30, 0x18, 0x30, 0x60, 0x40, 0x40, 0x47, 0x4C, 0x48, 0x68, 0x38, 0x1C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x20, 0x60, 0x60, 0x20, 0x20, 0x40, 0x40, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x60, 0x60, 0x20, 0x20, 0x40, 0x40, 0x30, 0x0E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x10, 0x20, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x1C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/crkbd/keymaps/vbt/keymap.c b/keyboards/crkbd/keymaps/vbt/keymap.c new file mode 100644 index 0000000..8a69342 --- /dev/null +++ b/keyboards/crkbd/keymaps/vbt/keymap.c @@ -0,0 +1,122 @@ +#include QMK_KEYBOARD_H +#include "layers.h" +#include "combos.c" +#include "oled.c" + +/* Corne + * https://github.com/foostan/crkbd + * Corne keyboard, a split keyboard with 3x6 column staggered keys and 3 thumb keys. + * ,-----------------------------------------------, ,-----------------------------------------------, + * | | | | | | | | | | | | | | + * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + * | | | | | | | | | | | | | | + * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + * | | | | | | | | | | | | | | + * '-----------------------------------------------' '-----------------------------------------------' + * ,-----------------------, ,-----------------------, + * | | | | | | | | + * '-----------------------' '-----------------------' + * + */ + +// [_LAYER] = LAYOUT_split_3x6_3( +// KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, /**/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, +// KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, /**/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, +// KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, /**/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, +// KC_TRNS, KC_TRNS, KC_TRNS, /**/ KC_TRNS, KC_TRNS, KC_TRNS +// ), + +// clang-format off +// Keymap +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* dvorak + * ,-----------------------------------------------, ,-----------------------------------------------, + * | alt | tab | , < | . > | p | y | | f | g | c | r | l | /? | + * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + * | esc | a | o | e | u | i | | d | h | t | n | s | bkspc | + * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + * | shift | nav | q | j | k | x | | b | m | w | v | z | shift | + * '-----------------------------------------------' '-----------------------------------------------' + * ,-----------------------, ,-----------------------, + * | gui | ctrl | space | | ent | num | sym | + * '-----------------------' '-----------------------' + */ + [_DVORAK] = LAYOUT_split_3x6_3( + KC_LALT, KC_TAB, KC_COMM, KC_DOT, KC_P, KC_Y, /**/ KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, /**/ KC_D, KC_H, KC_T, KC_N, KC_S, KC_BSPC, + KC_LSFT, TT(_NAV), KC_Q, KC_J, KC_K, KC_X, /**/ KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_LGUI, KC_LCTL, KC_SPC, /**/ KC_ENT, TT(_NUM), TT(_SYM) + ), + + /* qwerty + * ,-----------------------------------------------, ,-----------------------------------------------, + * | alt | q | w | e | r | t | | y | u | i | o | p | /? | + * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + * | esc | a | s | d | f | g | | h | j | k | l | nav | bkspc | + * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + * | shift | z | x | c | v | b | | n | m | , < | . > | tab | shift | + * '-----------------------------------------------' '-----------------------------------------------' + */ + [_QWERTY] = LAYOUT_split_3x6_3( + KC_LALT, KC_Q, KC_W, KC_E, KC_R, KC_T, /**/ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_SLASH, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, /**/ KC_H, KC_J, KC_K, KC_L, TT(_NAV), KC_BSPC, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, /**/ KC_N, KC_M, KC_COMM, KC_DOT, KC_TAB, KC_RSFT, + KC_TRNS, KC_TRNS, KC_TRNS, /**/ KC_TRNS, KC_TRNS, KC_TRNS + ), + + /* numbers + * ,-----------------------------------------------, ,-----------------------------------------------, + * | alt | ! | @ | # | % | + | | - | & | * | = | / | . | + * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + * | esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | bkspc | + * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + * | CAPS | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | shift | + * '-----------------------------------------------' '-----------------------------------------------' + * ,-----------------------, ,-----------------------, + * | nav | | | | | | | + * '-----------------------' '-----------------------' + */ + [_NUM] = LAYOUT_split_3x6_3( + KC_LALT, KC_EXLM, KC_AT, KC_HASH, KC_PERC, KC_PLUS,/**/ KC_MINUS, KC_AMPR, KC_ASTR, KC_EQUAL, KC_SLASH, KC_DOT, + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, /**/ KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, /**/ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_RSFT, + TG(_NAV), KC_TRNS, KC_TRNS, /**/ KC_TRNS, KC_TRNS, KC_TRNS + ), + + /* symbols + * ,-----------------------------------------------, ,-----------------------------------------------, + * | alt | find | ~ | ; | < | / | | - | > | ' | " | \ |os:ralt| + * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + * | esc | ^ | [ | { | ( | $ | | _ | ) | } | ] | | | bkspc | + * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + * |ctl+sft| undo | qwerty| : | ` | ? | | F11 | F12 | cut | copy | paste | shift | + * '-----------------------------------------------' '-----------------------------------------------' + * ,-----------------------, ,-----------------------, + * | nav | | | | | | | + * '-----------------------' '-----------------------' + */ + [_SYM] = LAYOUT_split_3x6_3( + KC_LALT, KC_FIND, KC_TILD, KC_SCLN, KC_LT, KC_SLASH, /**/ KC_MINUS, KC_GT, KC_QUOT, KC_DQT, KC_BSLS, OSM(MOD_RALT), + KC_ESC, KC_CIRC, KC_LBRC, KC_LCBR, KC_LPRN, KC_DLR, /**/ KC_UNDS, KC_RPRN, KC_RCBR, KC_RBRC, KC_PIPE, KC_BSPC, + OSM(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT)), KC_UNDO, TG(_QWERTY), KC_COLN, KC_GRV, KC_QUES, /**/ KC_F11, KC_F12, KC_CUT, KC_COPY, KC_PASTE, KC_RSFT, + TT(_NAV), KC_TRNS, KC_TRNS, /**/ KC_TRNS, KC_TRNS, KC_TRNS + ), + + /* navigation + * ,-----------------------------------------------, ,-----------------------------------------------, + * | alt | F13 | PAUS | BRID | BRIU | PSCR | | home | pgup | ↑ | pgdown| end | wsch | + * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + * | esc | F14 | MUTE | VOLD | VOLU | ins | | del | ← | ↓ | → | wref | bkspc | + * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + * | shift | nav | MSTP | MPRV | MNXT | MPLY | | whom | home | ↓ | end | wbak | wfwd | + * '-----------------------------------------------' '-----------------------------------------------' + */ + [_NAV] = LAYOUT_split_3x6_3( + KC_LALT, KC_F13, KC_PAUS, KC_BRID, KC_BRIU, KC_PSCR, /**/ KC_HOME, KC_PGUP, KC_UP, KC_PGDN, KC_END, KC_WSCH, + KC_ESC, KC_F14, KC_MUTE, KC_VOLD, KC_VOLU, KC_INS, /**/ KC_DEL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_WREF, KC_BSPC, + KC_LSFT, TG(_NAV),KC_MSTP, KC_MPRV, KC_MNXT, KC_MPLY, /**/ KC_WHOM, KC_HOME, KC_DOWN, KC_END, KC_WBAK, KC_WFWD, + KC_TRNS, KC_TRNS, KC_TRNS, /**/ KC_TRNS, KC_TRNS, KC_TRNS + ), + +}; +// clang-format on diff --git a/keyboards/crkbd/keymaps/vbt/layers.h b/keyboards/crkbd/keymaps/vbt/layers.h new file mode 100644 index 0000000..39c60a4 --- /dev/null +++ b/keyboards/crkbd/keymaps/vbt/layers.h @@ -0,0 +1,8 @@ +#ifndef _LAYERS_DEFINED +#define _LAYERS_DEFINED +#define _DVORAK 0 +#define _QWERTY 1 +#define _NUM 2 +#define _SYM 3 +#define _NAV 4 +#endif diff --git a/keyboards/crkbd/keymaps/vbt/oled.c b/keyboards/crkbd/keymaps/vbt/oled.c new file mode 100644 index 0000000..c0acf99 --- /dev/null +++ b/keyboards/crkbd/keymaps/vbt/oled.c @@ -0,0 +1,61 @@ +// OLED +// #define OLED_ENABLE +#ifdef OLED_ENABLE + +static const char PROGMEM font_logo[16] = {0x80, 0x81, 0x82, 0x83, 0x84, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0}; + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_270; +} + +void render_mod_status(uint8_t modifiers) { + oled_write_P((modifiers & MOD_MASK_SHIFT) ? PSTR("Shift\n") : PSTR(" \n"), false); + oled_write_P((modifiers & MOD_MASK_CTRL) ? PSTR("Ctrl\n") : PSTR(" \n"), false); + oled_write_P((modifiers & MOD_MASK_ALT) ? PSTR("Alt \n") : PSTR(" \n"), false); + oled_write_P((modifiers & MOD_MASK_GUI) ? PSTR("Super\n") : PSTR(" \n"), false); +} + +void render_lock_status(led_t led_state) { + oled_write_P(led_state.caps_lock ? PSTR("CAPS\n") : PSTR(" \n"), false); +} + +void render_layer_status(void) { + switch (get_highest_layer(layer_state)) { + case _DVORAK: + oled_write("DVK", false); + break; + case _NUM: + oled_write("NUM", false); + break; + case _SYM: + oled_write("SYM", false); + break; + case _NAV: + oled_write("NAV", false); + break; + case _QWERTY: + oled_write("QWR", false); + break; + default: + oled_write("UNK", false); + } +} + +bool oled_task_user(void) { + if (is_keyboard_master()) { + render_lock_status(host_keyboard_led_state()); + render_mod_status(get_mods() | get_oneshot_mods()); + oled_set_cursor(0, 15); + render_layer_status(); + } else { + oled_write_P(font_logo, false); + oled_write("corne", false); + oled_set_cursor(0, 14); + oled_write("crkbd", false); + oled_set_cursor(0, 15); + oled_write("vbt", false); + } + return false; +} + +#endif diff --git a/keyboards/crkbd/keymaps/vbt/rules.mk b/keyboards/crkbd/keymaps/vbt/rules.mk new file mode 100644 index 0000000..66d13ed --- /dev/null +++ b/keyboards/crkbd/keymaps/vbt/rules.mk @@ -0,0 +1,26 @@ +MCU = RP2040 +BOOTLOADER = rp2040 +CONVERT_TO = promicro_rp2040 + +VIA_ENABLE = no +MOUSEKEY_ENABLE = no +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +SLEEP_LED_ENABLE = no +BACKLIGHT_ENABLE = no +AUDIO_SUPPORTED = no +RGB_MATRIX_SUPPORTED = no +RGBLIGHT_SUPPORTED = no +RGB_MATRIX_ENABLE = no +WPM_ENABLE = no +MIDI_ENABLE = no +DYNAMIC_TAPPING_TERM_ENABLE = no +SPACE_CADET_ENABLE = no +GRAVE_ESC_ENABLE = no +MAGIC_ENABLE = no +TAP_DANCE_ENABLE = no +DYNAMIC_MACRO_ENABLE = no + +OLED_ENABLE = yes +LTO_ENABLE = yes +COMBO_ENABLE = yes diff --git a/keyboards/ploopyco/madromys/keymaps/vbt/combos.c b/keyboards/ploopyco/madromys/keymaps/vbt/combos.c new file mode 100644 index 0000000..e7e77f5 --- /dev/null +++ b/keyboards/ploopyco/madromys/keymaps/vbt/combos.c @@ -0,0 +1,7 @@ +const uint16_t PROGMEM btn4_btn5_combo[] = {KC_BTN4, KC_BTN5, COMBO_END}; + +// clang-format off +combo_t key_combos[] = { + COMBO(btn4_btn5_combo, TG(_LEFTHAND)), +}; +// clang-format on diff --git a/keyboards/ploopyco/madromys/keymaps/vbt/config.h b/keyboards/ploopyco/madromys/keymaps/vbt/config.h new file mode 100644 index 0000000..6c510cd --- /dev/null +++ b/keyboards/ploopyco/madromys/keymaps/vbt/config.h @@ -0,0 +1,5 @@ +#pragma once + +// Checkout https://github.com/qmk/qmk_firmware/tree/master/keyboards/ploopyco#drag-scroll +#define PLOOPY_DRAGSCROLL_MOMENTARY +#define PLOOPY_DRAGSCROLL_INVERT diff --git a/keyboards/ploopyco/madromys/keymaps/vbt/keymap.c b/keyboards/ploopyco/madromys/keymaps/vbt/keymap.c new file mode 100644 index 0000000..5ab7f5c --- /dev/null +++ b/keyboards/ploopyco/madromys/keymaps/vbt/keymap.c @@ -0,0 +1,12 @@ +#include QMK_KEYBOARD_H +#include "layers.h" +#include "combos.c" + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_RIGHTHAND] = LAYOUT(KC_BTN4, KC_BTN5, DRAG_SCROLL, KC_BTN2, + KC_BTN1, KC_BTN3), + [_LEFTHAND] = LAYOUT(KC_BTN2, DRAG_SCROLL, KC_BTN4, KC_BTN5, + KC_BTN3, KC_BTN1) +}; +// clang-format on diff --git a/keyboards/ploopyco/madromys/keymaps/vbt/layers.h b/keyboards/ploopyco/madromys/keymaps/vbt/layers.h new file mode 100644 index 0000000..c55688f --- /dev/null +++ b/keyboards/ploopyco/madromys/keymaps/vbt/layers.h @@ -0,0 +1,5 @@ +#ifndef _LAYERS_DEFINED +#define _LAYERS_DEFINED +#define _RIGHTHAND 0 +#define _LEFTHAND 1 +#endif diff --git a/keyboards/ploopyco/madromys/keymaps/vbt/rules.mk b/keyboards/ploopyco/madromys/keymaps/vbt/rules.mk new file mode 100644 index 0000000..ac97843 --- /dev/null +++ b/keyboards/ploopyco/madromys/keymaps/vbt/rules.mk @@ -0,0 +1,19 @@ +VIA_ENABLE = no +COMBO_ENABLE = yes +LTO_ENABLE = yes + +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +SLEEP_LED_ENABLE = no +BACKLIGHT_ENABLE = no +AUDIO_SUPPORTED = no +RGB_MATRIX_SUPPORTED = no +RGBLIGHT_SUPPORTED = no +RGB_MATRIX_ENABLE = no +OLED_ENABLE = no +WPM_ENABLE = no +MIDI_ENABLE = no +DYNAMIC_TAPPING_TERM_ENABLE = no +SPACE_CADET_ENABLE = no +GRAVE_ESC_ENABLE = no +MAGIC_ENABLE = no diff --git a/qmk.json b/qmk.json new file mode 100644 index 0000000..d298e88 --- /dev/null +++ b/qmk.json @@ -0,0 +1,7 @@ +{ + "userspace_version": "1.0", + "build_targets": [ + ["crkbd/rev1", "vbt"], + ["ploopyco/madromys","vbt"] + ] +}