init, separate crkbd config from qmk tree

This commit is contained in:
ProgramSnail 2025-06-15 13:24:57 +03:00
commit f211e4a793
18 changed files with 1856 additions and 0 deletions

339
LICENSE Normal file
View file

@ -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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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.
<signature of Ty Coon>, 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.

12
config.h Normal file
View file

@ -0,0 +1,12 @@
#define NO_AUTO_SHIFT_TAB
// #define NO_AUTO_SHIFT_SYMBOLS
#define NO_AUTO_SHIFT_NUMERIC
#define TAPPING_TOGGLE 2
#define MOUSEKEY_INTERVAL 16
#define MOUSEKEY_MAX_SPEED 5
#define MOUSEKEY_TIME_TO_MAX 40
#define TAPPING_TERM 170
#define AUTO_SHIFT_TIMEOUT 170

176
crkbd.c Normal file
View file

@ -0,0 +1,176 @@
/*
Copyright 2019 @foostan
Copyright 2020 Drashna Jaelre <@drashna>
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, see <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"
#ifdef SWAP_HANDS_ENABLE
__attribute__((weak)) const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
// Left
{{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}},
{{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}},
{{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}},
{{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}},
// Right
{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}},
{{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}},
{{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}},
{{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}}
};
#endif
#ifdef OLED_ENABLE
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
if (!is_keyboard_master()) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
}
return rotation;
}
static void oled_render_layer_state(void) {
oled_write_P(PSTR("Layer: "), false);
switch (get_highest_layer(layer_state)) {
case 0:
oled_write_ln_P(PSTR("Default TD"), false);
break;
case 1:
oled_write_ln_P(PSTR("Default"), false);
break;
case 2:
oled_write_ln_P(PSTR("Qwerty"), false);
break;
case 3:
oled_write_ln_P(PSTR("Russian"), false);
break;
case 4:
oled_write_ln_P(PSTR("Numbers"), false);
break;
case 5:
oled_write_ln_P(PSTR("Symbols"), false);
break;
case 6:
oled_write_ln_P(PSTR("Adjust"), false);
break;
case 7:
oled_write_ln_P(PSTR("Mouse"), false);
break;
default:
oled_write_ln_P(PSTR("Undef"), false);
break;
}
}
char key_name = ' ';
uint16_t last_keycode;
uint8_t last_row;
uint8_t last_col;
static const char PROGMEM code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};
static void set_keylog(uint16_t keycode, keyrecord_t *record) {
// save the row and column (useful even if we can't find a keycode to show)
last_row = record->event.key.row;
last_col = record->event.key.col;
key_name = ' ';
last_keycode = keycode;
if (IS_QK_MOD_TAP(keycode)) {
if (record->tap.count) {
keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode);
} else {
keycode = 0xE0 + biton(QK_MOD_TAP_GET_MODS(keycode) & 0xF) + biton(QK_MOD_TAP_GET_MODS(keycode) & 0x10);
}
} else if (IS_QK_LAYER_TAP(keycode) && record->tap.count) {
keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode);
} else if (IS_QK_MODS(keycode)) {
keycode = QK_MODS_GET_BASIC_KEYCODE(keycode);
} else if (IS_QK_ONE_SHOT_MOD(keycode)) {
keycode = 0xE0 + biton(QK_ONE_SHOT_MOD_GET_MODS(keycode) & 0xF) + biton(QK_ONE_SHOT_MOD_GET_MODS(keycode) & 0x10);
}
if (keycode > ARRAY_SIZE(code_to_name)) {
return;
}
// update keylog
key_name = pgm_read_byte(&code_to_name[keycode]);
}
static const char *depad_str(const char *depad_str, char depad_char) {
while (*depad_str == depad_char)
++depad_str;
return depad_str;
}
static void oled_render_keylog(void) {
oled_write_char('0' + last_row, false);
oled_write_P(PSTR("x"), false);
oled_write_char('0' + last_col, false);
oled_write_P(PSTR(", k"), false);
const char *last_keycode_str = get_u16_str(last_keycode, ' ');
oled_write(depad_str(last_keycode_str, ' '), false);
oled_write_P(PSTR(":"), false);
oled_write_char(key_name, false);
oled_advance_page(true);
}
// static void render_bootmagic_status(bool status) {
// /* Show Ctrl-Gui Swap options */
// static const char PROGMEM logo[][2][3] = {
// {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}},
// {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}},
// };
// if (status) {
// oled_write_ln_P(logo[0][0], false);
// oled_write_ln_P(logo[0][1], false);
// } else {
// oled_write_ln_P(logo[1][0], false);
// oled_write_ln_P(logo[1][1], false);
// }
// }
__attribute__((weak)) void oled_render_logo(void) {
// clang-format off
static const char PROGMEM crkbd_logo[] = {
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94,
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,
0};
// clang-format on
oled_write_P(crkbd_logo, false);
}
bool oled_task_kb(void) {
if (!oled_task_user()) {
return false;
}
if (is_keyboard_master()) {
oled_render_layer_state();
oled_render_keylog();
} else {
oled_render_logo();
}
return false;
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
set_keylog(keycode, record);
}
return process_record_user(keycode, record);
}
#endif // OLED_ENABLE

138
info.json Normal file
View file

@ -0,0 +1,138 @@
{
"manufacturer": "foostan",
"url": "https://github.com/foostan/crkbd",
"maintainer": "qmk",
"usb": {
"vid": "0x4653"
},
"features": {
"bootmagic": true,
"extrakey": true,
"nkro": true,
"oled": true,
"rgblight": false,
"rgb_matrix": true
},
"bootmagic": {
"matrix": [0, 1]
},
"split": {
"enabled": true,
"bootmagic": {
"matrix": [4, 1]
}
},
"layout_aliases": {
"LAYOUT": "LAYOUT_split_3x6_3"
},
"community_layouts": [ "split_3x5_3", "split_3x6_3" ],
"layouts": {
"LAYOUT_split_3x5_3": {
"layout": [
{"matrix": [0, 1], "x": 0, "y": 0.3},
{"matrix": [0, 2], "x": 1, "y": 0.1},
{"matrix": [0, 3], "x": 2, "y": 0},
{"matrix": [0, 4], "x": 3, "y": 0.1},
{"matrix": [0, 5], "x": 4, "y": 0.2},
{"matrix": [4, 5], "x": 8, "y": 0.2},
{"matrix": [4, 4], "x": 9, "y": 0.1},
{"matrix": [4, 3], "x": 10, "y": 0},
{"matrix": [4, 2], "x": 11, "y": 0.1},
{"matrix": [4, 1], "x": 12, "y": 0.3},
{"matrix": [1, 1], "x": 0, "y": 1.3},
{"matrix": [1, 2], "x": 1, "y": 1.1},
{"matrix": [1, 3], "x": 2, "y": 1},
{"matrix": [1, 4], "x": 3, "y": 1.1},
{"matrix": [1, 5], "x": 4, "y": 1.2},
{"matrix": [5, 5], "x": 8, "y": 1.2},
{"matrix": [5, 4], "x": 9, "y": 1.1},
{"matrix": [5, 3], "x": 10, "y": 1},
{"matrix": [5, 2], "x": 11, "y": 1.1},
{"matrix": [5, 1], "x": 12, "y": 1.3},
{"matrix": [2, 1], "x": 0, "y": 2.3},
{"matrix": [2, 2], "x": 1, "y": 2.1},
{"matrix": [2, 3], "x": 2, "y": 2},
{"matrix": [2, 4], "x": 3, "y": 2.1},
{"matrix": [2, 5], "x": 4, "y": 2.2},
{"matrix": [6, 5], "x": 8, "y": 2.2},
{"matrix": [6, 4], "x": 9, "y": 2.1},
{"matrix": [6, 3], "x": 10, "y": 2},
{"matrix": [6, 2], "x": 11, "y": 2.1},
{"matrix": [6, 1], "x": 12, "y": 2.3},
{"matrix": [3, 3], "x": 3, "y": 3.7},
{"matrix": [3, 4], "x": 4, "y": 3.7},
{"matrix": [3, 5], "x": 5, "y": 3.2, "h": 1.5},
{"matrix": [7, 5], "x": 7, "y": 3.2, "h": 1.5},
{"matrix": [7, 4], "x": 8, "y": 3.7},
{"matrix": [7, 3], "x": 9, "y": 3.7}
]
},
"LAYOUT_split_3x6_3": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0.3},
{"matrix": [0, 1], "x": 1, "y": 0.3},
{"matrix": [0, 2], "x": 2, "y": 0.1},
{"matrix": [0, 3], "x": 3, "y": 0},
{"matrix": [0, 4], "x": 4, "y": 0.1},
{"matrix": [0, 5], "x": 5, "y": 0.2},
{"matrix": [4, 5], "x": 9, "y": 0.2},
{"matrix": [4, 4], "x": 10, "y": 0.1},
{"matrix": [4, 3], "x": 11, "y": 0},
{"matrix": [4, 2], "x": 12, "y": 0.1},
{"matrix": [4, 1], "x": 13, "y": 0.3},
{"matrix": [4, 0], "x": 14, "y": 0.3},
{"matrix": [1, 0], "x": 0, "y": 1.3},
{"matrix": [1, 1], "x": 1, "y": 1.3},
{"matrix": [1, 2], "x": 2, "y": 1.1},
{"matrix": [1, 3], "x": 3, "y": 1},
{"matrix": [1, 4], "x": 4, "y": 1.1},
{"matrix": [1, 5], "x": 5, "y": 1.2},
{"matrix": [5, 5], "x": 9, "y": 1.2},
{"matrix": [5, 4], "x": 10, "y": 1.1},
{"matrix": [5, 3], "x": 11, "y": 1},
{"matrix": [5, 2], "x": 12, "y": 1.1},
{"matrix": [5, 1], "x": 13, "y": 1.3},
{"matrix": [5, 0], "x": 14, "y": 1.3},
{"matrix": [2, 0], "x": 0, "y": 2.3},
{"matrix": [2, 1], "x": 1, "y": 2.3},
{"matrix": [2, 2], "x": 2, "y": 2.1},
{"matrix": [2, 3], "x": 3, "y": 2},
{"matrix": [2, 4], "x": 4, "y": 2.1},
{"matrix": [2, 5], "x": 5, "y": 2.2},
{"matrix": [6, 5], "x": 9, "y": 2.2},
{"matrix": [6, 4], "x": 10, "y": 2.1},
{"matrix": [6, 3], "x": 11, "y": 2},
{"matrix": [6, 2], "x": 12, "y": 2.1},
{"matrix": [6, 1], "x": 13, "y": 2.3},
{"matrix": [6, 0], "x": 14, "y": 2.3},
{"matrix": [3, 3], "x": 4, "y": 3.7},
{"matrix": [3, 4], "x": 5, "y": 3.7},
{"matrix": [3, 5], "x": 6, "y": 3.2, "h": 1.5},
{"matrix": [7, 5], "x": 8, "y": 3.2, "h": 1.5},
{"matrix": [7, 4], "x": 9, "y": 3.7},
{"matrix": [7, 3], "x": 10, "y": 3.7}
]
}
},
"rgb_matrix": {
"driver": "ws2812",
"max_brightness": 120
},
"rgblight": {
"max_brightness": 120
}
}

43
keymaps/default/config.h Normal file
View file

@ -0,0 +1,43 @@
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
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, see <http://www.gnu.org/licenses/>.
*/
#pragma once
//#define USE_MATRIX_I2C
//#define QUICK_TAP_TERM 0
//#define TAPPING_TERM 100
#ifdef RGBLIGHT_ENABLE
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
#define RGBLIGHT_EFFECT_SNAKE
#define RGBLIGHT_EFFECT_KNIGHT
#define RGBLIGHT_EFFECT_CHRISTMAS
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
#define RGBLIGHT_EFFECT_RGB_TEST
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE
#define RGBLIGHT_LIMIT_VAL 120
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
#endif

526
keymaps/default/keymap.c Normal file
View file

@ -0,0 +1,526 @@
#include QMK_KEYBOARD_H
#if __has_include("keymap.h")
# include "keymap.h"
#endif
// --- tap dance definitions ---
// taken from https://docs.qmk.fm/features/tap_dance
typedef enum {
TD_NONE,
TD_UNKNOWN,
TD_SINGLE_TAP,
TD_SINGLE_HOLD,
TD_DOUBLE_TAP,
TD_DOUBLE_HOLD,
TD_DOUBLE_SINGLE_TAP, // Send two single taps
TD_TRIPLE_TAP,
TD_TRIPLE_HOLD
} td_state_t;
typedef struct {
bool is_press_action;
td_state_t state;
} td_tap_t;
// Tap dance enums
// enum {
// // X_RMAIN,
// // X_CHECK
// };
td_state_t cur_dance(tap_dance_state_t *state);
// For the x tap dance. Put it here so it can be used in any keymap
void x_finished(tap_dance_state_t *state, void *user_data);
void x_reset(tap_dance_state_t *state, void *user_data);
// --- keymap ---
/* THIS FILE WAS GENERATED!
*
* This file was generated by qmk json2c. You may or may not want to
* edit it directly.
*/
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*DEFAULT WITH TAP DANCES*/
[0] = LAYOUT_split_3x6_3(SH_TOGG/*TD(0)*/, KC_NO/*TD(1)*/, TD(2), TD(3), TD(4), KC_NO/*TD(5)*/, /**/ KC_NO/*TD(6)*/, TD(7), TD(8), TD(9), KC_NO/*TD(10)*/, SH_TOGG/*TD(11)*/,
QK_AREP/*TD(12)*/, KC_A/*TD(13)*/, TD(14), TD(15), TD(16), TD(17), /**/ TD(18), TD(19), TD(20), TD(21), KC_SCLN/*TD(22)*/, QK_REP/*TD(23)*/,
KC_NO/*TD(24)*/, KC_Z/*TD(25)*/, KC_X/*TD(26)*/, TD(27), TD(28), TD(29), /**/ TD(30), TD(31), TD(32), TD(33), KC_Q/*TD(34)*/, KC_NO/*TD(35)*/,
/**/ LGUI_T(KC_TAB), TT(4), LSFT_T(KC_SPC), /**/ LCTL_T(KC_ENT), LT(5, KC_ESC), TG(7) /**/),
/*DEFAULT*/
[1] = LAYOUT_split_3x6_3(
SH_TOGG, KC_NO, KC_W, KC_E, KC_R, KC_NO, /**/ KC_NO, KC_U, KC_I, KC_O, KC_NO, SH_TOGG,
KC_GRV, KC_A, KC_S, KC_D, KC_F, KC_G, /**/ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, /**/ KC_N, KC_M, KC_T, KC_Y, KC_Q, KC_NO,
/**/ LGUI_T(KC_TAB), TT(4), LSFT_T(KC_SPC), /**/ LCTL_T(KC_ENT), LT(5,KC_ESC), TG(7) /**/),
/*QWERTY*/
[2] = LAYOUT_split_3x6_3(
TG(3), KC_NO, KC_W, KC_F, KC_P, KC_TRNS, /**/ KC_TRNS, KC_L, KC_U, KC_Y, KC_NO, KC_NO,
KC_TRNS, KC_A, KC_R, KC_S, KC_T, KC_D, /**/ KC_H, KC_N, KC_E, KC_I, KC_O, KC_TRNS,
TG(2), KC_Z, KC_X, KC_C, KC_V, KC_B, /**/ KC_K, KC_M, KC_G, KC_J, KC_Q, KC_NO,
/**/ KC_TRNS, KC_TRNS, KC_TRNS, /**/ KC_TRNS, KC_TRNS, KC_TRNS /**/),
/*RUSSIAN*/
[3] = LAYOUT_split_3x6_3(
TG(3), KC_NO, KC_SCLN, KC_A, KC_G, KC_TRNS, /**/ KC_TRNS, KC_K, KC_E, KC_S, KC_DOT, KC_NO,
KC_TRNS, KC_F, KC_H, KC_C, KC_N, KC_L, /**/ KC_X, KC_Y, KC_T, KC_B, KC_J, KC_TRNS,
KC_NO, KC_P, KC_LBRC, KC_C, KC_D, KC_COMM, /**/ KC_R, KC_V, KC_U, KC_Q, KC_Z, KC_NO,
/**/ KC_TRNS, KC_TRNS, KC_TRNS, /**/ KC_TRNS, KC_TRNS, KC_TRNS /**/),
/*NUMBERS*/
[4] = LAYOUT_split_3x6_3(
KC_NO, OSM(MOD_LSFT), KC_2, KC_3, KC_4, KC_TRNS, /**/ KC_TRNS, KC_7, KC_8, KC_9, KC_DEL, KC_NO,
OSM(MOD_LALT), KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_1, /**/ KC_0, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PSCR,
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_5, /**/ KC_6, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
/**/ KC_NO, KC_TRNS, KC_TRNS, /**/ KC_BSPC, MO(6), KC_NO /**/),
/*SYMBOLS*/
[5] = LAYOUT_split_3x6_3(
KC_NO, KC_NO, LSFT(KC_COMM), LSFT(KC_DOT), KC_DLR, KC_NO, /**/ KC_NO, KC_BSLS, KC_AMPR, KC_NO, KC_NO, KC_NO,
KC_NO, KC_ASTR, KC_COMM/*KC_LPRN*/, KC_DOT/*KC_RPRN*/, KC_MINS, KC_SLSH, /**/ KC_EXLM, KC_EQL, KC_LBRC, KC_RBRC, KC_P, RALT(KC_QUOT),
KC_NO, KC_NO, KC_NO, KC_CIRC, LALT(KC_LEFT), LALT(KC_RGHT), /**/ LSFT(KC_LEFT), LSFT(KC_RGHT), KC_AT, RALT(KC_QUOT), KC_NO, KC_NO,
/**/ KC_NO, MO(6), KC_DEL, /**/ KC_TRNS, KC_TRNS, KC_NO /**/),
/*ADJUST*/
[6] = LAYOUT_split_3x6_3(
KC_NO, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, KC_NO, /**/ KC_NO, KC_MUTE, KC_BRID, KC_BRIU, KC_NO, KC_NO,
KC_MPLY, LALT(KC_C), KC_NO, LSFT(KC_LALT), LALT(KC_TAB), LALT(KC_SPC), /**/ KC_NO, LSFT(KC_LEFT), LSFT(KC_DOWN), LSFT(KC_UP), LSFT(KC_RGHT), KC_NO,
TG(2), KC_NO, KC_NO, KC_NO, LCA(KC_LEFT), LCA(KC_RGHT), /**/ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, TG(1),
/**/ KC_NO, KC_TRNS, KC_NO, /**/ KC_NO, KC_TRNS, KC_NO /**/),
/*MOUSE*/
[7] = LAYOUT_split_3x6_3(
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, /**/ KC_NO, MS_WHLL, MS_WHLD, MS_WHLU, MS_WHLR, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, /**/ KC_NO, MS_LEFT, MS_DOWN, MS_UP, MS_RGHT, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, /**/ KC_NO, MS_ACL0, MS_ACL1, MS_ACL2, KC_NO, KC_NO,
/**/ KC_NO, KC_NO, KC_NO, /**/ MS_BTN1, MS_BTN2, TG(7) /**/ ),
// /*TAP DANCES*/
// [7] = LAYOUT_split_3x6_3(TD(0), TD(1), TD(2), TD(3), TD(4), TD(5), /**/ TD(6), TD(7), TD(8), TD(9), TD(10), TD(11),
// TD(12), TD(13), TD(14), TD(15), TD(16), TD(17), /**/ TD(18), TD(19), TD(20), TD(21), TD(22), TD(23),
// TD(24), TD(25), TD(26), TD(27), TD(28), TD(29), /**/ TD(30), TD(31), TD(32), TD(33), TD(34), TD(35),
// /**/ KC_TRNS, KC_TRNS, KC_TRNS, /**/ KC_TRNS, KC_TRNS, KC_TRNS /**/ )
};
#ifdef OTHER_KEYMAP_C
# include OTHER_KEYMAP_C
#endif // OTHER_KEYMAP_C
// --- custom auto shift ---
bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case KC_LPRN:
case KC_RPRN:
case KC_COMM:
case KC_DOT:
case KC_ASTR:
case KC_EXLM:
return true;
default:
return false;
}
}
void autoshift_press_user(uint16_t keycode, bool shifted, keyrecord_t *record) {
switch(keycode) {
case KC_LPRN:
register_code16((!shifted) ? KC_LPRN : KC_COMM);
break;
case KC_RPRN:
register_code16((!shifted) ? KC_RPRN : KC_DOT);
break;
case KC_COMM:
register_code16((!shifted) ? KC_COMM : KC_LPRN);
break;
case KC_DOT:
register_code16((!shifted) ? KC_DOT : KC_RPRN);
break;
case KC_ASTR:
register_code16((!shifted) ? KC_ASTR : KC_PERC);
break;
case KC_EXLM:
register_code16((!shifted) ? KC_EXLM : KC_HASH);
break;
default:
if (shifted) {
add_weak_mods(MOD_BIT(KC_LSFT));
}
// & 0xFF gets the Tap key for Tap Holds, required when using Retro Shift
register_code16((IS_RETRO(keycode)) ? keycode & 0xFF : keycode);
}
}
void autoshift_release_user(uint16_t keycode, bool shifted, keyrecord_t *record) {
switch(keycode) {
case KC_LPRN:
unregister_code16((!shifted) ? KC_LPRN : KC_COMM);
break;
case KC_RPRN:
unregister_code16((!shifted) ? KC_RPRN : KC_DOT);
break;
case KC_COMM:
unregister_code16((!shifted) ? KC_COMM : KC_LPRN);
break;
case KC_DOT:
unregister_code16((!shifted) ? KC_DOT : KC_RPRN);
break;
case KC_ASTR:
unregister_code16((!shifted) ? KC_ASTR : KC_PERC);
break;
case KC_EXLM:
unregister_code16((!shifted) ? KC_EXLM : KC_HASH);
break;
default:
// & 0xFF gets the Tap key for Tap Holds, required when using Retro Shift
// The IS_RETRO check isn't really necessary here, always using
// keycode & 0xFF would be fine.
unregister_code16((IS_RETRO(keycode)) ? keycode & 0xFF : keycode);
}
}
// --- key overrides ---
const key_override_t bspc_key_override = ko_make_basic(MOD_MASK_SHIFT, KC_BSPC, KC_DEL);
// This globally defines all key overrides to be used
const key_override_t *key_overrides[] = {
&bspc_key_override,
};
// --- tap dance ---
// taken from https://docs.qmk.fm/features/tap_dance
/* Return an integer that corresponds to what kind of tap dance should be executed.
*
* How to figure out tap dance state: interrupted and pressed.
*
* Interrupted: If the state of a dance is "interrupted", that means that another key has been hit
* under the tapping term. This is typically indicative that you are trying to "tap" the key.
*
* Pressed: Whether or not the key is still being pressed. If this value is true, that means the tapping term
* has ended, but the key is still being pressed down. This generally means the key is being "held".
*
* One thing that is currently not possible with qmk software in regards to tap dance is to mimic the "permissive hold"
* feature. In general, advanced tap dances do not work well if they are used with commonly typed letters.
* For example "A". Tap dances are best used on non-letter keys that are not hit while typing letters.
*
* Good places to put an advanced tap dance:
* z,q,x,j,k,v,b, any function key, home/end, comma, semi-colon
*
* Criteria for "good placement" of a tap dance key:
* Not a key that is hit frequently in a sentence
* Not a key that is used frequently to double tap, for example 'tab' is often double tapped in a terminal, or
* in a web form. So 'tab' would be a poor choice for a tap dance.
* Letters used in common words as a double. For example 'p' in 'pepper'. If a tap dance function existed on the
* letter 'p', the word 'pepper' would be quite frustrating to type.
*
* For the third point, there does exist the 'TD_DOUBLE_SINGLE_TAP', however this is not fully tested
*
*/
td_state_t cur_dance(tap_dance_state_t *state) {
if (state->count == 1) {
if (state->interrupted || !state->pressed) return TD_SINGLE_TAP;
// Key has not been interrupted, but the key is still held. Means you want to send a 'HOLD'.
else return TD_SINGLE_HOLD;
} else if (state->count == 2) {
// TD_DOUBLE_SINGLE_TAP is to distinguish between typing "pepper", and actually wanting a double tap
// action when hitting 'pp'. Suggested use case for this return value is when you want to send two
// keystrokes of the key, and not the 'double tap' action/macro.
if (state->interrupted) return TD_DOUBLE_SINGLE_TAP;
else if (state->pressed) return TD_DOUBLE_HOLD;
else return TD_DOUBLE_TAP;
}
// Assumes no one is trying to type the same letter three times (at least not quickly).
// If your tap dance key is 'KC_W', and you want to type "www." quickly - then you will need to add
// an exception here to return a 'TD_TRIPLE_SINGLE_TAP', and define that enum just like 'TD_DOUBLE_SINGLE_TAP'
if (state->count == 3) {
if (state->interrupted || !state->pressed) return TD_TRIPLE_TAP;
else return TD_TRIPLE_HOLD;
} else return TD_UNKNOWN;
}
// Create an instance of 'td_tap_t' for the 'x' tap dance.
static td_tap_t xtap_state = {
.is_press_action = true,
.state = TD_NONE
};
uint16_t t_layer[] = {
KC_NO, KC_NO, KC_W, KC_E, KC_R, SH_TOGG, /**/ SH_TOGG, KC_U, KC_I, KC_O, KC_NO, KC_NO,
KC_GRV, KC_A, KC_S, KC_D, KC_F, KC_G, /**/ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, /**/ KC_N, KC_M, KC_T, KC_Y, KC_Q, KC_NO,
// thumb cluster
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
};
uint16_t tt_layer[] = {
KC_NO, KC_NO, LSFT(KC_COMM), LSFT(KC_DOT), KC_DLR, KC_NO, /**/ KC_NO, KC_BSLS, KC_AMPR, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO/*KC_ASTR*//*13*/, KC_COMM/*KC_LPRN*//*14*/, KC_DOT/*KC_RPRN*//*15*/, KC_MINS, KC_SLSH, /**/ KC_EXLM/*18*/, KC_EQL, KC_LBRC, KC_RBRC, KC_NO/*KC_P*/, RALT(KC_QUOT),
KC_NO, KC_NO, KC_NO, KC_CIRC, KC_ASTR/*28*/, KC_GRV, /**/ KC_QUOT, KC_P, KC_AT, RALT(KC_QUOT)/*33*/, KC_NO, KC_NO,
// thumb cluster
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
};
#define TAP_DANCE_FUNC(NAME, KEY_T, KEY_TH, KEY_TT, KEY_TTH) \
void x_finished##NAME (tap_dance_state_t *state, void *user_data) { \
xtap_state.state = cur_dance(state); \
switch (xtap_state.state) { \
case TD_SINGLE_TAP: register_code16(KEY_T); break; \
case TD_SINGLE_HOLD: register_code16(KEY_TH); break; \
case TD_DOUBLE_TAP: register_code16(KEY_TT); break; \
case TD_DOUBLE_HOLD: register_code16(KEY_TTH); break; \
case TD_DOUBLE_SINGLE_TAP: tap_code16(KEY_T); register_code16(KEY_T); break; \
default: break; \
} \
} \
void x_reset##NAME (tap_dance_state_t *state, void *user_data) { \
switch (xtap_state.state) { \
case TD_SINGLE_TAP: unregister_code16(KEY_T); break; \
case TD_SINGLE_HOLD: unregister_code16(KEY_TH); break; \
case TD_DOUBLE_TAP: unregister_code16(KEY_TT); break; \
case TD_DOUBLE_HOLD: unregister_code16(KEY_TTH); break; \
case TD_DOUBLE_SINGLE_TAP: unregister_code16(KEY_T); break; \
default: break; \
} \
xtap_state.state = TD_NONE; \
}
#define TAP_DANCE_LAYER_FUNC_ALT(ID, KEY_TTH) \
void x_finished##ID (tap_dance_state_t *state, void *user_data) { \
xtap_state.state = cur_dance(state); \
switch (xtap_state.state) { \
case TD_SINGLE_TAP: register_code16(t_layer[ID]); break; \
case TD_SINGLE_HOLD: tap_code16(LSFT(t_layer[ID])); break; \
case TD_DOUBLE_TAP: register_code16(tt_layer[ID]); break; \
case TD_DOUBLE_HOLD: tap_code16(KEY_TTH); break; \
case TD_DOUBLE_SINGLE_TAP: register_code16(tt_layer[ID]); break; \
case TD_TRIPLE_TAP: tap_code16(t_layer[ID]); register_code16(t_layer[ID]); break; \
case TD_TRIPLE_HOLD: tap_code16(LSFT(t_layer[ID])); tap_code16(LSFT(t_layer[ID])); break; \
default: break; \
} \
} \
void x_reset##ID (tap_dance_state_t *state, void *user_data) { \
switch (xtap_state.state) { \
case TD_SINGLE_TAP: unregister_code16(t_layer[ID]); break; \
case TD_SINGLE_HOLD: break; \
case TD_DOUBLE_TAP: unregister_code16(tt_layer[ID]); break; \
case TD_DOUBLE_HOLD: break; \
case TD_DOUBLE_SINGLE_TAP: unregister_code16(tt_layer[ID]); break; \
case TD_TRIPLE_TAP: unregister_code16(t_layer[ID]); break; \
case TD_TRIPLE_HOLD: break; \
default: break; \
} \
xtap_state.state = TD_NONE; \
}
#define TAP_DANCE_LAYER_FUNC(ID) \
TAP_DANCE_LAYER_FUNC_ALT(ID, LSFT(tt_layer[ID]))
/*
// void x_finished##ID (tap_dance_state_t *state, void *user_data) { \
// xtap_state.state = cur_dance(state); \
// switch (xtap_state.state) { \
// case TD_SINGLE_TAP: register_code16(t_layer[ID]); break; \
// case TD_SINGLE_HOLD: tap_code16(LSFT(t_layer[ID])); break; \
// case TD_DOUBLE_TAP: register_code16(tt_layer[ID]); break; \
// case TD_DOUBLE_HOLD: tap_code16(LSFT(tt_layer[ID])); break; \
// case TD_DOUBLE_SINGLE_TAP: register_code16(tt_layer[ID]); break; \
// default: break; \
// } \
// } \
// void x_reset##ID (tap_dance_state_t *state, void *user_data) { \
// switch (xtap_state.state) { \
// case TD_SINGLE_TAP: unregister_code16(t_layer[ID]); break; \
// case TD_SINGLE_HOLD: break; \
// case TD_DOUBLE_TAP: unregister_code16(tt_layer[ID]); break; \
// case TD_DOUBLE_HOLD: break; \
// case TD_DOUBLE_SINGLE_TAP: unregister_code16(tt_layer[ID]); break; \
// default: break; \
// } \
// xtap_state.state = TD_NONE; \
// }
*/
#define TAP_DANCE_ENT(NAME) \
[NAME] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished##NAME, x_reset##NAME),
// void x_finished(tap_dance_state_t *state, void *user_data) {
// xtap_state.state = cur_dance(state);
// switch (xtap_state.state) {
// case TD_SINGLE_TAP: register_code(KC_BSPC); break;
// case TD_SINGLE_HOLD: register_code(KC_BSPC); break;
// case TD_DOUBLE_TAP: register_code(KC_ENT); break;
// case TD_DOUBLE_HOLD: register_code(KC_LCTL); break;
// // Last case is for fast typing. Assuming your key is `f`:
// // For example, when typing the word `buffer`, and you want to make sure that you send `ff` and not `Esc`.
// // In order to type `ff` when typing fast, the next character will have to be hit within the `TAPPING_TERM`, which by default is 200ms.
// case TD_DOUBLE_SINGLE_TAP: tap_code(KC_BSPC); register_code(KC_BSPC); break;
// default: break;
// }
// }
// void x_reset(tap_dance_state_t *state, void *user_data) {
// switch (xtap_state.state) {
// case TD_SINGLE_TAP: unregister_code(KC_BSPC); break;
// case TD_SINGLE_HOLD: unregister_code(KC_BSPC); break;
// case TD_DOUBLE_TAP: unregister_code(KC_ENT); break;
// case TD_DOUBLE_HOLD: unregister_code(KC_LCTL); break;
// case TD_DOUBLE_SINGLE_TAP: unregister_code(KC_BSPC); break;
// default: break;
// }
// xtap_state.state = TD_NONE;
// }
// ------- mods -------
void x_finished37 (tap_dance_state_t *state, void *user_data) {
xtap_state.state = cur_dance(state);
switch (xtap_state.state) {
case TD_SINGLE_TAP: tap_code16(get_last_keycode()); break;
case TD_SINGLE_HOLD: layer_on(4); break;
default: break;
}
}
void x_reset37 (tap_dance_state_t *state, void *user_data) {
switch (xtap_state.state) {
case TD_SINGLE_TAP: /*unregister_code16(QK_REP);*/ break;
case TD_SINGLE_HOLD: layer_off(4); break;
default: break;
}
xtap_state.state = TD_NONE;
}
void x_finished40 (tap_dance_state_t *state, void *user_data) {
xtap_state.state = cur_dance(state);
switch (xtap_state.state) {
case TD_SINGLE_TAP: register_code16(QK_REP); break;
case TD_SINGLE_HOLD: layer_on(5); break;
default: break;
}
}
void x_reset40 (tap_dance_state_t *state, void *user_data) {
switch (xtap_state.state) {
case TD_SINGLE_TAP: unregister_code16(QK_REP); break;
case TD_SINGLE_HOLD: layer_off(5); break;
default: break;
}
xtap_state.state = TD_NONE;
}
// -------
// TAP_DANCE_FUNC(X_RMAIN, KC_BSPC, KC_BSPC, KC_ENT, KC_LCTL)
TAP_DANCE_LAYER_FUNC(0)
TAP_DANCE_LAYER_FUNC(1)
TAP_DANCE_LAYER_FUNC(2)
TAP_DANCE_LAYER_FUNC(3)
TAP_DANCE_LAYER_FUNC(4)
TAP_DANCE_LAYER_FUNC(5)
TAP_DANCE_LAYER_FUNC(6)
TAP_DANCE_LAYER_FUNC(7)
TAP_DANCE_LAYER_FUNC(8)
TAP_DANCE_LAYER_FUNC(9)
TAP_DANCE_LAYER_FUNC(10)
TAP_DANCE_LAYER_FUNC(11)
TAP_DANCE_LAYER_FUNC(12)
TAP_DANCE_LAYER_FUNC_ALT(13, KC_PERC)
TAP_DANCE_LAYER_FUNC_ALT(14, KC_LPRN) //KC_COMM)
TAP_DANCE_LAYER_FUNC_ALT(15, KC_RPRN) //KC_DOT)
TAP_DANCE_LAYER_FUNC(16)
TAP_DANCE_LAYER_FUNC(17)
TAP_DANCE_LAYER_FUNC_ALT(18, KC_HASH)
TAP_DANCE_LAYER_FUNC(19)
TAP_DANCE_LAYER_FUNC(20)
TAP_DANCE_LAYER_FUNC(21)
TAP_DANCE_LAYER_FUNC(22)
TAP_DANCE_LAYER_FUNC(23)
TAP_DANCE_LAYER_FUNC(24)
TAP_DANCE_LAYER_FUNC(25)
TAP_DANCE_LAYER_FUNC(26)
TAP_DANCE_LAYER_FUNC(27)
TAP_DANCE_LAYER_FUNC_ALT(28, KC_PERC)
TAP_DANCE_LAYER_FUNC(29)
TAP_DANCE_LAYER_FUNC(30)
TAP_DANCE_LAYER_FUNC(31)
TAP_DANCE_LAYER_FUNC(32)
TAP_DANCE_LAYER_FUNC_ALT(33, RALT(KC_QUOT))
TAP_DANCE_LAYER_FUNC(34)
TAP_DANCE_LAYER_FUNC(35)
TAP_DANCE_LAYER_FUNC(36)
// TAP_DANCE_FUNC(37, QK_AREP, MO(4), QK_AREP, MO(4)) //TAP_DANCE_LAYER_FUNC(37)
TAP_DANCE_LAYER_FUNC(38)
TAP_DANCE_LAYER_FUNC(39)
// TAP_DANCE_FUNC(40, QK_REP, MO(5), QK_REP, MO(5)) //TAP_DANCE_LAYER_FUNC(40)
TAP_DANCE_LAYER_FUNC(41)
tap_dance_action_t tap_dance_actions[] = {
TAP_DANCE_ENT(0)
TAP_DANCE_ENT(1)
TAP_DANCE_ENT(2)
TAP_DANCE_ENT(3)
TAP_DANCE_ENT(4)
TAP_DANCE_ENT(5)
TAP_DANCE_ENT(6)
TAP_DANCE_ENT(7)
TAP_DANCE_ENT(8)
TAP_DANCE_ENT(9)
TAP_DANCE_ENT(10)
TAP_DANCE_ENT(11)
TAP_DANCE_ENT(12)
TAP_DANCE_ENT(13)
TAP_DANCE_ENT(14)
TAP_DANCE_ENT(15)
TAP_DANCE_ENT(16)
TAP_DANCE_ENT(17)
TAP_DANCE_ENT(18)
TAP_DANCE_ENT(19)
TAP_DANCE_ENT(20)
TAP_DANCE_ENT(21)
TAP_DANCE_ENT(22)
TAP_DANCE_ENT(23)
TAP_DANCE_ENT(24)
TAP_DANCE_ENT(25)
TAP_DANCE_ENT(26)
TAP_DANCE_ENT(27)
TAP_DANCE_ENT(28)
TAP_DANCE_ENT(29)
TAP_DANCE_ENT(30)
TAP_DANCE_ENT(31)
TAP_DANCE_ENT(32)
TAP_DANCE_ENT(33)
TAP_DANCE_ENT(34)
TAP_DANCE_ENT(35)
// thumb keys
TAP_DANCE_ENT(36)
TAP_DANCE_ENT(37)
TAP_DANCE_ENT(38)
TAP_DANCE_ENT(39)
TAP_DANCE_ENT(40)
TAP_DANCE_ENT(41)
// TAP_DANCE_ENT(X_RMAIN)
// [X_RMAIN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished, x_reset),
// [X_CHECK] = ACTION_TAP_DANCE_DOUBLE(KC_X, LSFT(KC_MINS))
};

232
lib/glcdfont.c Normal file
View file

@ -0,0 +1,232 @@
// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0.
// See gfxfont.h for newer custom bitmap font info.
#include "progmem.h"
// Standard ASCII 5x7 font
const unsigned char font[] PROGMEM = {
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, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0,
0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0,
0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0,
0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0,
0xC0, 0x80, 0x00, 0x00, 0x00, 0x00,
0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0,
0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80,
0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0,
0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00,
0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0,
0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80,
0x00, 0x00, 0x00, 0x00, 0x80, 0xC0,
0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0,
0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC,
0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00,
0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E,
0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00,
0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B,
0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00,
0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE,
0xDE, 0xD7, 0xDC, 0x00, 0xC0, 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, 0xFC, 0xFE,
0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x81,
0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF,
0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00,
0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF,
0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C,
0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F,
0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00,
0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F,
0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00,
0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20,
0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00,
0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F,
0x0F, 0x7F, 0x0F, 0x00, 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, 0x03, 0x0F, 0x1F,
0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F,
0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F,
0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F,
0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C,
0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x03, 0x07, 0x07,
0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
0x03, 0x01, 0x00, 0x00, 0x00, 0x00,
0x01, 0x03, 0x07, 0x07, 0x07, 0x07,
0x07, 0x07, 0x07, 0x07, 0x03, 0x01,
0x00, 0x00, 0x00, 0x07, 0x07, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x07, 0x07, 0x07, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x07, 0x07,
0x07, 0x00, 0x00, 0x00, 0x01, 0x03,
0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
0x07, 0x07, 0x03, 0x01, 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,
};

View file

@ -0,0 +1,16 @@
#include <stdio.h>
#include "led.h"
#include "host.h"
char host_led_state_str[24];
const char *read_host_led_state(void)
{
led_t led_state = host_keyboard_led_state();
snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s",
(led_state.num_lock) ? "on" : "- ",
(led_state.caps_lock) ? "on" : "- ",
(led_state.scroll_lock) ? "on" : "- ");
return host_led_state_str;
}

46
lib/keylogger.c Normal file
View file

@ -0,0 +1,46 @@
#include <stdio.h>
#include <stdint.h>
#include "action.h"
char keylog_str[24] = {};
char keylogs_str[21] = {};
int keylogs_str_idx = 0;
const char code_to_name[60] = {
' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
'R', 'E', 'B', 'T', ' ', ' ', ' ', ' ', ' ', ' ',
' ', ';', '\'', ' ', ',', '.', '/', ' ', ' ', ' '};
void set_keylog(uint16_t keycode, keyrecord_t *record) {
char name = ' ';
if (keycode < 60) {
name = code_to_name[keycode];
}
// update keylog
snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c",
record->event.key.row, record->event.key.col,
keycode, name);
// update keylogs
if (keylogs_str_idx == sizeof(keylogs_str) - 1) {
keylogs_str_idx = 0;
for (int i = 0; i < sizeof(keylogs_str) - 1; i++) {
keylogs_str[i] = ' ';
}
}
keylogs_str[keylogs_str_idx] = name;
keylogs_str_idx++;
}
const char *read_keylog(void) {
return keylog_str;
}
const char *read_keylogs(void) {
return keylogs_str;
}

38
lib/layer_state_reader.c Normal file
View file

@ -0,0 +1,38 @@
#include <stdio.h>
#include "action_layer.h"
// in the future, should use (1U<<_LAYER_NAME) instead, but needs to be moved to keymap,c
#define L_BASE 0
#define L_LOWER 2
#define L_RAISE 4
#define L_ADJUST 8
#define L_ADJUST_TRI 14
char layer_state_str[24];
const char *read_layer_state(void) {
switch (layer_state)
{
case L_BASE:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Default");
break;
case L_RAISE:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise");
break;
case L_LOWER:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower");
break;
case L_ADJUST:
case L_ADJUST_TRI:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust");
break;
default:
#if defined (LAYER_STATE_32BIT)
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state);
#else
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%d", layer_state);
#endif
}
return layer_state_str;
}

9
lib/logo_reader.c Normal file
View file

@ -0,0 +1,9 @@
const char *read_logo(void) {
static char logo[] = {
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94,
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,
0};
return logo;
}

14
lib/mode_icon_reader.c Normal file
View file

@ -0,0 +1,14 @@
#include <stdio.h>
char mode_icon[24];
const char *read_mode_icon(bool swap) {
static char logo[][2][3] = {{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}};
if (swap == false) {
snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[0][0], logo[0][1]);
} else {
snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[1][0], logo[1][1]);
}
return mode_icon;
}

15
lib/rgb_state_reader.c Normal file
View file

@ -0,0 +1,15 @@
#ifdef RGBLIGHT_ENABLE
#include <stdio.h>
#include "rgblight.h"
extern rgblight_config_t rgblight_config;
char rbf_info_str[24];
const char *read_rgb_info(void) {
snprintf(rbf_info_str, sizeof(rbf_info_str), "%s %2d h%3d s%3d v%3d",
rgblight_config.enable ? "on" : "- ", rgblight_config.mode,
rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
return rbf_info_str;
}
#endif

16
lib/timelogger.c Normal file
View file

@ -0,0 +1,16 @@
#include <stdio.h>
#include "timer.h"
char timelog_str[24] = {};
int last_time = 0;
int elapsed_time = 0;
void set_timelog(void) {
elapsed_time = timer_elapsed(last_time);
last_time = timer_read();
snprintf(timelog_str, sizeof(timelog_str), "lt:%5d, et:%5d", last_time, elapsed_time);
}
const char *read_timelog(void) {
return timelog_str;
}

21
post_config.h Normal file
View file

@ -0,0 +1,21 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.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
* 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, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef OLED_FONT_H
# define OLED_FONT_H "keyboards/crkbd/lib/glcdfont.c"
#endif

114
readme.md Normal file
View file

@ -0,0 +1,114 @@
# Corne Keyboard (CRKBD)
![Crkbd](https://user-images.githubusercontent.com/736191/40575636-6fba63a4-6123-11e8-9ca0-3f990f1f9f4c.jpg)
![Crkbd](https://user-images.githubusercontent.com/736191/40887871-0eead5dc-678a-11e8-9518-e3ad9e5d2bac.png)
A split keyboard with 3x6 vertically staggered keys and 3 thumb keys.
Also, it has the option that use extension keys and rotary encoders.
Keyboard Maintainer: [foostan](https://github.com/foostan/) [@foostan](https://twitter.com/foostan)
Hardware Supported: Corne PCB
Hardware Availability: [PCB & Case Data](https://github.com/foostan/crkbd)
Flash example for this keyboard of v1 - v3:
```sh
qmk flash -kb crkbd/rev1 -km default
```
Flash example for this keyboard of v4:
```sh
qmk flash -kb crkbd/rev4 -km default
```
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
## Bootloader
The Corne PCBs have a reset and boot buttons next to the TRRS jack to enter in to the bootloader.
Additionally, if you hold down the "Q" or "P" buttons when plugging in that half of the keyboard (per the default QWERTY layout), this will jump to the bootloader and reset the EEPROM (persistent storage). This would normally be the very top corner-most position, but due to the breakaway column, it's left at Q and P for compatibility.
## RGB Matrix
The Corne Keyboard also supports using the RGB Matrix feature, in place of RGB Light. This provides a better experience when using the keyboard, as it supports a number of per key effects properly. If you're not using the in switch LEDs, then you may want to pass on doing this.
In your keymap's `rules.mk` file, add the following:
```make
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = yes
```
And in your `config.h` file, add the following:
```c
#ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
# define RGB_MATRIX_SLEEP // turn off effects when suspended
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
// # define RGB_MATRIX_LED_PROCESS_LIMIT (RGB_MATRIX_LED_COUNT + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
# define RGB_MATRIX_HUE_STEP 8
# define RGB_MATRIX_SAT_STEP 8
# define RGB_MATRIX_VAL_STEP 8
# define RGB_MATRIX_SPD_STEP 10
/* Enable the animations you want/need. You may need to enable only a small number of these because *
* they take up a lot of space. Enable and confirm that you can still successfully compile your firmware. */
// RGB Matrix Animation modes. Explicitly enabled
// For full list of effects, see:
// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects
# define ENABLE_RGB_MATRIX_ALPHAS_MODS
# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
# define ENABLE_RGB_MATRIX_BREATHING
# define ENABLE_RGB_MATRIX_BAND_SAT
# define ENABLE_RGB_MATRIX_BAND_VAL
# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
# define ENABLE_RGB_MATRIX_CYCLE_ALL
# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
# define ENABLE_RGB_MATRIX_DUAL_BEACON
# define ENABLE_RGB_MATRIX_RAINBOW_BEACON
# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
# define ENABLE_RGB_MATRIX_RAINDROPS
# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
# define ENABLE_RGB_MATRIX_HUE_BREATHING
# define ENABLE_RGB_MATRIX_HUE_PENDULUM
# define ENABLE_RGB_MATRIX_HUE_WAVE
# define ENABLE_RGB_MATRIX_PIXEL_RAIN
# define ENABLE_RGB_MATRIX_PIXEL_FLOW
# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined
# define ENABLE_RGB_MATRIX_TYPING_HEATMAP
# define ENABLE_RGB_MATRIX_DIGITAL_RAIN
// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
# define ENABLE_RGB_MATRIX_SPLASH
# define ENABLE_RGB_MATRIX_MULTISPLASH
# define ENABLE_RGB_MATRIX_SOLID_SPLASH
# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
#endif
```
After this is done, you should be able to use the normal RGB keycodes, but you'll see the RGB Matrix effects in use, giving a much better experience.

95
rev1/keyboard.json Normal file
View file

@ -0,0 +1,95 @@
{
"keyboard_name": "Corne",
"usb": {
"pid": "0x0001",
"device_version": "0.0.1"
},
"features": {
"rgblight": true
},
"build": {
"lto": true
},
"matrix_pins": {
"cols": [ "F4", "F5", "F6", "F7", "B1", "B3" ],
"rows": [ "D4", "C6", "D7", "E6" ]
},
"diode_direction": "COL2ROW",
"split": {
"serial": {
"pin": "D2"
},
"transport": {
"sync": {
"matrix_state": true
}
}
},
"rgblight": {
"led_count": 54,
"split_count": [27, 27]
},
"ws2812": {
"pin": "D3"
},
"rgb_matrix": {
"split_count": [27, 27],
"layout": [
{"x": 85, "y": 16, "flags": 2},
{"x": 50, "y": 13, "flags": 2},
{"x": 16, "y": 20, "flags": 2},
{"x": 16, "y": 38, "flags": 2},
{"x": 50, "y": 48, "flags": 2},
{"x": 85, "y": 52, "flags": 2},
{"matrix": [3, 5], "x": 95, "y": 63, "flags": 1},
{"matrix": [2, 5], "x": 85, "y": 39, "flags": 4},
{"matrix": [1, 5], "x": 85, "y": 21, "flags": 4},
{"matrix": [0, 5], "x": 85, "y": 4, "flags": 4},
{"matrix": [0, 4], "x": 68, "y": 2, "flags": 4},
{"matrix": [1, 4], "x": 68, "y": 19, "flags": 4},
{"matrix": [2, 4], "x": 68, "y": 37, "flags": 4},
{"matrix": [3, 4], "x": 80, "y": 58, "flags": 1},
{"matrix": [3, 3], "x": 60, "y": 55, "flags": 1},
{"matrix": [2, 3], "x": 50, "y": 35, "flags": 4},
{"matrix": [1, 3], "x": 50, "y": 13, "flags": 4},
{"matrix": [0, 3], "x": 50, "y": 0, "flags": 4},
{"matrix": [0, 2], "x": 33, "y": 3, "flags": 4},
{"matrix": [1, 2], "x": 33, "y": 20, "flags": 4},
{"matrix": [2, 2], "x": 33, "y": 37, "flags": 4},
{"matrix": [2, 1], "x": 16, "y": 42, "flags": 4},
{"matrix": [1, 1], "x": 16, "y": 24, "flags": 4},
{"matrix": [0, 1], "x": 16, "y": 7, "flags": 4},
{"matrix": [0, 0], "x": 0, "y": 7, "flags": 1},
{"matrix": [1, 0], "x": 0, "y": 24, "flags": 1},
{"matrix": [2, 0], "x": 0, "y": 41, "flags": 1},
{"x": 139, "y": 16, "flags": 2},
{"x": 174, "y": 13, "flags": 2},
{"x": 208, "y": 20, "flags": 2},
{"x": 208, "y": 38, "flags": 2},
{"x": 174, "y": 48, "flags": 2},
{"x": 139, "y": 52, "flags": 2},
{"matrix": [7, 5], "x": 129, "y": 63, "flags": 1},
{"matrix": [6, 5], "x": 139, "y": 39, "flags": 4},
{"matrix": [5, 5], "x": 139, "y": 21, "flags": 4},
{"matrix": [4, 5], "x": 139, "y": 4, "flags": 4},
{"matrix": [4, 4], "x": 156, "y": 2, "flags": 4},
{"matrix": [5, 4], "x": 156, "y": 19, "flags": 4},
{"matrix": [6, 4], "x": 156, "y": 37, "flags": 4},
{"matrix": [7, 4], "x": 144, "y": 58, "flags": 1},
{"matrix": [7, 3], "x": 164, "y": 55, "flags": 1},
{"matrix": [6, 3], "x": 174, "y": 35, "flags": 4},
{"matrix": [5, 3], "x": 174, "y": 13, "flags": 4},
{"matrix": [4, 3], "x": 174, "y": 0, "flags": 4},
{"matrix": [4, 2], "x": 191, "y": 3, "flags": 4},
{"matrix": [5, 2], "x": 191, "y": 20, "flags": 4},
{"matrix": [6, 2], "x": 191, "y": 37, "flags": 4},
{"matrix": [6, 1], "x": 208, "y": 42, "flags": 4},
{"matrix": [5, 1], "x": 208, "y": 24, "flags": 4},
{"matrix": [4, 1], "x": 208, "y": 7, "flags": 4},
{"matrix": [4, 0], "x": 224, "y": 7, "flags": 1},
{"matrix": [5, 0], "x": 224, "y": 24, "flags": 1},
{"matrix": [6, 0], "x": 224, "y": 41, "flags": 1}
]
},
"development_board": "promicro"
}

6
rules.mk Normal file
View file

@ -0,0 +1,6 @@
REPEAT_KEY_ENABLE = yes
AUTO_SHIFT_ENABLE = yes
MOUSEKEY_ENABLE = yes
SWAP_HANDS_ENABLE = yes
TAP_DANCE_ENABLE = yes
KEY_OVERRIDE_ENABLE = yes