Compare commits
10 Commits
master
...
rgb_matrix
Author | SHA1 | Date |
---|---|---|
Jack Humbert | ea7b1b389d | 7 years ago |
Jack Humbert | 142661db53 | 7 years ago |
Jack Humbert | 824c80ffa8 | 7 years ago |
Jack Humbert | cd07b64263 | 7 years ago |
Jack Humbert | 8c5ae8d6c7 | 7 years ago |
Jack Humbert | ced0c52eac | 7 years ago |
Jack Humbert | b3e36c734a | 7 years ago |
Jack Humbert | 33c6f74528 | 7 years ago |
Jack Humbert | 06a3b5784c | 7 years ago |
Jack Humbert | 16de11fbc5 | 7 years ago |
@ -1,24 +0,0 @@
|
||||
|
||||
-I.
|
||||
-I./drivers
|
||||
-I./drivers/avr
|
||||
-I./keyboards/ergodox_ez
|
||||
-I./keyboards/ergodox_ez/keymaps/vim
|
||||
-I./lib
|
||||
-I./lib/lufa
|
||||
-I./quantum
|
||||
-I./quantum/api
|
||||
-I./quantum/audio
|
||||
-I./quantum/keymap_extras
|
||||
-I./quantum/process_keycode
|
||||
-I./quantum/serial_link
|
||||
-I./quantum/template
|
||||
-I./quantum/tools
|
||||
-I./quantum/visualizer
|
||||
-I./tmk_core
|
||||
-I./tmk_core/common
|
||||
-I./tmk_core/common/debug.h
|
||||
-I./tmk_core/protocol
|
||||
-I./tmk_core/protocol/lufa
|
||||
-I./util
|
||||
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
|
@ -1,36 +0,0 @@
|
||||
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# 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
|
||||
|
||||
# Make these match what we have in .gitattributes
|
||||
[*.mk]
|
||||
end_of_line = lf
|
||||
|
||||
[Makefile]
|
||||
end_of_line = lf
|
||||
|
||||
[*.sh]
|
||||
end_of_line = lf
|
||||
|
||||
# The gitattributes file will handle the line endings conversion properly according to the operating system settings for other files
|
||||
|
||||
|
||||
# We don't have gitattributes properly for these
|
||||
# So if the user have for example core.autocrlf set to true
|
||||
# the line endings would be wrong.
|
||||
[lib/**]
|
||||
end_of_line = unset
|
@ -1,6 +0,0 @@
|
||||
// Suggested extensions
|
||||
{
|
||||
"recommendations": [
|
||||
"EditorConfig.EditorConfig"
|
||||
]
|
||||
}
|
@ -1,266 +0,0 @@
|
||||
# Doxyfile 1.8.14
|
||||
|
||||
# This file describes the settings to be used by the documentation system
|
||||
# doxygen (www.doxygen.org) for qmk_firmware (github.com/qmk/qmk_firmware)
|
||||
#
|
||||
# All text after a double hash (##) is considered a comment and is placed in
|
||||
# front of the TAG it is preceding.
|
||||
#
|
||||
# All text after a single hash (#) is considered a comment and will be ignored.
|
||||
# The format is:
|
||||
# TAG = value [value, ...]
|
||||
# For lists, items can also be appended using:
|
||||
# TAG += value [value, ...]
|
||||
# Values that contain spaces should be placed between quotes (\" \").
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = "QMK Firmware"
|
||||
PROJECT_NUMBER = https://github.com/qmk/qmk_firmware
|
||||
PROJECT_BRIEF = "Keyboard controller firmware for Atmel AVR and ARM USB families"
|
||||
OUTPUT_DIRECTORY = doxygen
|
||||
ALLOW_UNICODE_NAMES = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH =
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
QT_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 4
|
||||
ALIASES =
|
||||
TCL_SUBST =
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
OPTIMIZE_FOR_FORTRAN = NO
|
||||
OPTIMIZE_OUTPUT_VHDL = NO
|
||||
EXTENSION_MAPPING =
|
||||
MARKDOWN_SUPPORT = YES
|
||||
TOC_INCLUDE_HEADINGS = 2
|
||||
AUTOLINK_SUPPORT = YES
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
CPP_CLI_SUPPORT = NO
|
||||
SIP_SUPPORT = NO
|
||||
IDL_PROPERTY_SUPPORT = YES
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
GROUP_NESTED_COMPOUNDS = NO
|
||||
SUBGROUPING = YES
|
||||
INLINE_GROUPED_CLASSES = NO
|
||||
INLINE_SIMPLE_STRUCTS = NO
|
||||
TYPEDEF_HIDES_STRUCT = NO
|
||||
LOOKUP_CACHE_SIZE = 0
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
EXTRACT_ALL = NO
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_PACKAGE = NO
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
EXTRACT_ANON_NSPACES = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = NO
|
||||
HIDE_SCOPE_NAMES = YES
|
||||
HIDE_COMPOUND_REFERENCE= NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
SHOW_GROUPED_MEMB_INC = NO
|
||||
FORCE_LOCAL_INCLUDES = NO
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_MEMBERS_CTORS_1ST = NO
|
||||
SORT_GROUP_NAMES = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
STRICT_PROTO_MATCHING = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_FILES = YES
|
||||
SHOW_NAMESPACES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
LAYOUT_FILE =
|
||||
CITE_BIB_FILES =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_AS_ERROR = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
INPUT = tmk_core quantum drivers
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *.c \
|
||||
*.cc \
|
||||
*.cxx \
|
||||
*.cpp \
|
||||
*.c++ \
|
||||
*.h \
|
||||
*.hh \
|
||||
*.hxx \
|
||||
*.hpp \
|
||||
*.h++
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
FILTER_SOURCE_PATTERNS =
|
||||
USE_MDFILE_AS_MAINPAGE =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
SOURCE_BROWSER = YES
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = NO
|
||||
REFERENCES_RELATION = NO
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
SOURCE_TOOLTIPS = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
ALPHABETICAL_INDEX = YES
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to disabled outputs
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_HTML = NO
|
||||
GENERATE_LATEX = NO
|
||||
GENERATE_RTF = NO
|
||||
GENERATE_MAN = NO
|
||||
GENERATE_DOCBOOK = NO
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
GENERATE_PERLMOD = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_XML = YES
|
||||
XML_OUTPUT = xml
|
||||
XML_PROGRAMLISTING = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
EXTERNAL_PAGES = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
CLASS_DIAGRAMS = YES
|
||||
MSCGEN_PATH =
|
||||
DIA_PATH =
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = NO
|
||||
DOT_NUM_THREADS = 0
|
||||
DOT_FONTNAME = Helvetica
|
||||
DOT_FONTSIZE = 10
|
||||
DOT_FONTPATH =
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
UML_LIMIT_NUM_FIELDS = 10
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
CALLER_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
INTERACTIVE_SVG = NO
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MSCFILE_DIRS =
|
||||
DIAFILE_DIRS =
|
||||
PLANTUML_JAR_PATH =
|
||||
PLANTUML_CFG_FILE =
|
||||
PLANTUML_INCLUDE_PATH =
|
||||
DOT_GRAPH_MAX_NODES = 50
|
||||
MAX_DOT_GRAPH_DEPTH = 0
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
@ -1,339 +0,0 @@
|
||||
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.
|
@ -1,62 +0,0 @@
|
||||
# Copyright 2017 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/>.
|
||||
|
||||
# If it's possible that multiple bootloaders can be used for one project,
|
||||
# you can leave this unset, and the correct size will be selected
|
||||
# automatically.
|
||||
#
|
||||
# Sets the bootloader defined in the keyboard's/keymap's rules.mk
|
||||
# Current options:
|
||||
# atmel-dfu
|
||||
# lufa-dfu
|
||||
# qmk-dfu
|
||||
# halfkay
|
||||
# caterina
|
||||
# bootloadHID
|
||||
#
|
||||
# BOOTLOADER_SIZE can still be defined manually, but it's recommended
|
||||
# you add any possible configuration to this list
|
||||
|
||||
ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
|
||||
OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
|
||||
OPT_DEFS += -DBOOTLOADER_DFU
|
||||
BOOTLOADER_SIZE = 4096
|
||||
endif
|
||||
ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
|
||||
OPT_DEFS += -DBOOTLOADER_LUFA_DFU
|
||||
OPT_DEFS += -DBOOTLOADER_DFU
|
||||
BOOTLOADER_SIZE = 4096
|
||||
endif
|
||||
ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
|
||||
OPT_DEFS += -DBOOTLOADER_QMK_DFU
|
||||
OPT_DEFS += -DBOOTLOADER_DFU
|
||||
BOOTLOADER_SIZE = 4096
|
||||
endif
|
||||
ifeq ($(strip $(BOOTLOADER)), halfkay)
|
||||
OPT_DEFS += -DBOOTLOADER_HALFKAY
|
||||
BOOTLOADER_SIZE = 512
|
||||
endif
|
||||
ifeq ($(strip $(BOOTLOADER)), caterina)
|
||||
OPT_DEFS += -DBOOTLOADER_CATERINA
|
||||
BOOTLOADER_SIZE = 4096
|
||||
endif
|
||||
ifeq ($(strip $(BOOTLOADER)), bootloadHID)
|
||||
OPT_DEFS += -DBOOTLOADER_BOOTLOADHID
|
||||
BOOTLOADER_SIZE = 4096
|
||||
endif
|
||||
|
||||
ifdef BOOTLOADER_SIZE
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
|
||||
endif
|
@ -0,0 +1,35 @@
|
||||
# Adding your keyboard to QMK
|
||||
|
||||
We welcome all keyboard projects into QMK, but ask that you try to stick to a couple guidelines that help us keep things organised and consistent.
|
||||
|
||||
## Naming your directory/project
|
||||
|
||||
All names should be lowercase alphanumeric, and separated by an underscore (`_`), but not begin with one. Your directory and your `.h` and `.c` files should have exactly the same name. All folders should follow the same format.
|
||||
|
||||
## `readme.md`
|
||||
|
||||
All projects need to have a `readme.md` file that explains what the keyboard is, who made it, where it is available, and links to move information (template coming).
|
||||
|
||||
## Image/Hardware files
|
||||
|
||||
In an effort to keep the repo size down, we're no longer accepting images of any format in the repo, with few exceptions. Hosting them elsewhere (imgur) and linking them in the readme.md is the preferred method.
|
||||
|
||||
Any sort of hardware file (plate, case, pcb) can't be stored in qmk_firmware, but we have the [qmk.fm repo](https://github.com/qmk/qmk.fm) where such files (as well as in-depth info) can be store, and viewed on [qmk.fm](http://qmk.fm). Downloadable files are stored in `/<keyboard>/` (name follows the same format as above) which are served at `http://qmk.fm/<keyboard>/`, and pages are generated from `/_pages/<keyboard>/` which are served at the same location (.md files are generated into .html files through Jekyll). Check out the `lets_split` directory for an example.
|
||||
|
||||
## Non-production/handwired projects
|
||||
|
||||
We're happy to accept any project that uses QMK, including prototypes and handwired ones, but we have a separate `/keyboards/handwired/` folder for them, so the main `/keyboards/` folder doesn't get overcrowded. If a prototype project becomes a production project at some point in the future, we'd be happy to move it to the main `/keyboards/` folder!
|
||||
|
||||
## Warnings as errors
|
||||
|
||||
When developing your keyboard, keep in mind that all warnings will be treated as errors - these small warnings can build-up and cause larger errors down the road (and keeping them is generally a bad practice).
|
||||
|
||||
## Licenses
|
||||
|
||||
If you're adapting your keyboard's setup from another project, but not using the same code, but sure to update the copyright header at the top of the files to show your name, in this format:
|
||||
|
||||
Copyright 2017 Your Name <your@email.com>
|
||||
|
||||
## Technical details
|
||||
|
||||
If you're looking for more information on making your keyboard work with QMK, [check out this guide](porting_your_keyboard_to_qmk.md)!
|
@ -1,226 +1,129 @@
|
||||
# Configuring QMK
|
||||
# The `config.h` file
|
||||
|
||||
QMK is nearly infinitely configurable. Wherever possible we err on the side of allowing users to customize their keyboard, even at the expense of code size. That level of flexibility makes for a daunting configuration experience, however.
|
||||
This is a c header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere (namely keymaps). This file can exist at a couple different levels:
|
||||
|
||||
There are two main types of configuration files in QMK- `config.h` and `rules.mk`. These files exist at various levels in QMK and all files of the same type are combined to build the final configuration. The levels, from lowest priority to highest priority, are:
|
||||
## Keyboard
|
||||
|
||||
* QMK Default
|
||||
* Keyboard
|
||||
* Folders (Up to 5 levels deep)
|
||||
* Keymap
|
||||
```c
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
## QMK Default
|
||||
#include "config_common.h"
|
||||
|
||||
Every available setting in QMK has a default. If that setting is not set at the Keyboard, Folder, or Keymap level this is the setting that will be used.
|
||||
// config options
|
||||
|
||||
## Keyboard
|
||||
#endif
|
||||
```
|
||||
|
||||
This file contains config options that should apply to the whole keyboard, and won't change in revisions, or most keymaps. The revision block here only applies to keyboards with revisions.
|
||||
|
||||
## Revisions
|
||||
|
||||
This level contains config options that should apply to the whole keyboard. Some settings won't change in revisions, or most keymaps. Other settings are merely defaults for this keyboard and can be overridden by folders and/or keymaps.
|
||||
```c
|
||||
#ifndef <revision>_CONFIG_H
|
||||
#define <revision>_CONFIG_H
|
||||
|
||||
## Folders
|
||||
#include "config_common.h"
|
||||
|
||||
Some keyboards have folders and sub-folders to allow for different hardware configurations. Most keyboards only go 1 folder deep, but QMK supports structures up to 5 folders deep. Each folder can have its own `config.h` and `rules.mk` files that are incorporated into the final configuration.
|
||||
// config options
|
||||
|
||||
#endif
|
||||
```
|
||||
|
||||
For keyboards that have revisions, this file contains config options that should apply to only that revisions, and won't change in most keymaps.
|
||||
|
||||
## Keymap
|
||||
|
||||
This level contains all of the options for that particular keymap. If you wish to override a previous declaration, you can use `#undef <variable>` to undefine it, where you can then redefine it without an error.
|
||||
|
||||
# The `config.h` File
|
||||
|
||||
This is a C header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere. The `config.h` file shouldn't be including other `config.h` files, or anything besides this:
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
|
||||
## Hardware Options
|
||||
* `#define VENDOR_ID 0x1234`
|
||||
* defines your VID, and for most DIY projects, can be whatever you want
|
||||
* `#define PRODUCT_ID 0x5678`
|
||||
* defines your PID, and for most DIY projects, can be whatever you want
|
||||
* `#define DEVICE_VER 0`
|
||||
* defines the device version (often used for revisions)
|
||||
* `#define MANUFACTURER Me`
|
||||
* generally who/whatever brand produced the board
|
||||
* `#define PRODUCT Board`
|
||||
* the name of the keyboard
|
||||
* `#define DESCRIPTION a keyboard`
|
||||
* a short description of what the keyboard is
|
||||
* `#define MATRIX_ROWS 5`
|
||||
* the number of rows in your keyboard's matrix
|
||||
* `#define MATRIX_COLS 15`
|
||||
* the number of columns in your keyboard's matrix
|
||||
* `#define MATRIX_ROW_PINS { D0, D5, B5, B6 }`
|
||||
* pins of the rows, from top to bottom
|
||||
* `#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }`
|
||||
* pins of the columns, from left to right
|
||||
* `#define UNUSED_PINS { D1, D2, D3, B1, B2, B3 }`
|
||||
* pins unused by the keyboard for reference
|
||||
* `#define MATRIX_HAS_GHOST`
|
||||
* define is matrix has ghost (unlikely)
|
||||
* `#define DIODE_DIRECTION COL2ROW`
|
||||
* COL2ROW or ROW2COL - how your matrix is configured. COL2ROW means the black mark on your diode is facing to the rows, and between the switch and the rows.
|
||||
* `#define AUDIO_VOICES`
|
||||
* turns on the alternate audio voices (to cycle through)
|
||||
* `#define C4_AUDIO`
|
||||
* enables audio on pin C4
|
||||
* `#define C5_AUDIO`
|
||||
* enables audio on pin C5
|
||||
* `#define C6_AUDIO`
|
||||
* enables audio on pin C6
|
||||
* `#define B5_AUDIO`
|
||||
* enables audio on pin B5 (duophony is enables if one of B[5-7]_AUDIO is enabled along with one of C[4-6]_AUDIO)
|
||||
* `#define B6_AUDIO`
|
||||
* enables audio on pin B6 (duophony is enables if one of B[5-7]_AUDIO is enabled along with one of C[4-6]_AUDIO)
|
||||
* `#define B7_AUDIO`
|
||||
* enables audio on pin B7 (duophony is enables if one of B[5-7]_AUDIO is enabled along with one of C[4-6]_AUDIO)
|
||||
* `#define BACKLIGHT_PIN B7`
|
||||
* pin of the backlight - B5, B6, B7 use PWM, others use softPWM
|
||||
* `#define BACKLIGHT_LEVELS 3`
|
||||
* number of levels your backlight will have (maximum 15 excluding off)
|
||||
* `#define BACKLIGHT_BREATHING`
|
||||
* enables backlight breathing (only works with backlight pins B5, B6 and B7)
|
||||
* `#define BREATHING_PERIOD 6`
|
||||
* the length of one backlight "breath" in seconds
|
||||
* `#define DEBOUNCING_DELAY 5`
|
||||
* the delay when reading the value of the pin (5 is default)
|
||||
* `#define LOCKING_SUPPORT_ENABLE`
|
||||
* mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap
|
||||
* `#define LOCKING_RESYNC_ENABLE`
|
||||
* tries to keep switch state consistent with keyboard LED state
|
||||
* `#define IS_COMMAND() ( keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) )`
|
||||
* key combination that allows the use of magic commands (useful for debugging)
|
||||
|
||||
## Features That Can Be Disabled
|
||||
|
||||
If you define these options you will disable the associated feature, which can save on code size.
|
||||
|
||||
* `#define NO_DEBUG`
|
||||
* disable debugging
|
||||
* `#define NO_PRINT`
|
||||
* disable printing/debugging using hid_listen
|
||||
* `#define NO_ACTION_LAYER`
|
||||
* disable layers
|
||||
* `#define NO_ACTION_TAPPING`
|
||||
* disable tap dance and other tapping features
|
||||
* `#define NO_ACTION_ONESHOT`
|
||||
* disable one-shot modifiers
|
||||
* `#define NO_ACTION_MACRO`
|
||||
* disable all macro handling
|
||||
* `#define NO_ACTION_FUNCTION`
|
||||
* disable the action function (deprecated)
|
||||
|
||||
## Features That Can Be Enabled
|
||||
|
||||
If you define these options you will enable the associated feature, which may increase your code size.
|
||||
|
||||
* `#define FORCE_NKRO`
|
||||
* NKRO by default requires to be turned on, this forces it on during keyboard startup regardless of EEPROM setting. NKRO can still be turned off but will be turned on again if the keyboard reboots.
|
||||
* `#define PREVENT_STUCK_MODIFIERS`
|
||||
* stores the layer a key press came from so the same layer is used when the key is released, regardless of which layers are enabled
|
||||
|
||||
## Behaviors That Can Be Configured
|
||||
|
||||
* `#define TAPPING_TERM 200`
|
||||
* how long before a tap becomes a hold
|
||||
* `#define RETRO_TAPPING`
|
||||
* tap anyway, even after TAPPING_TERM, if there was no other key interruption between press and release
|
||||
* `#define TAPPING_TOGGLE 2`
|
||||
* how many taps before triggering the toggle
|
||||
* `#define PERMISSIVE_HOLD`
|
||||
* makes tap and hold keys work better for fast typers who don't want tapping term set above 500
|
||||
* `#define LEADER_TIMEOUT 300`
|
||||
* how long before the leader key times out
|
||||
* `#define ONESHOT_TIMEOUT 300`
|
||||
* how long before oneshot times out
|
||||
* `#define ONESHOT_TAP_TOGGLE 2`
|
||||
* how many taps before oneshot toggle is triggered
|
||||
* `#define IGNORE_MOD_TAP_INTERRUPT`
|
||||
* makes it possible to do rolling combos (zx) with keys that convert to other keys on hold
|
||||
* `#define QMK_KEYS_PER_SCAN 4`
|
||||
* Allows sending more than one key per scan. By default, only one key event gets
|
||||
sent via `process_record()` per scan. This has little impact on most typing, but
|
||||
if you're doing a lot of chords, or your scan rate is slow to begin with, you can
|
||||
have some delay in processing key events. Each press and release is a separate
|
||||
event. For a keyboard with 1ms or so scan times, even a very fast typist isn't
|
||||
going to produce the 500 keystrokes a second needed to actually get more than a
|
||||
few ms of delay from this. But if you're doing chording on something with 3-4ms
|
||||
scan times? You probably want this.
|
||||
|
||||
## RGB Light Configuration
|
||||
|
||||
* `#define RGB_DI_PIN D7`
|
||||
* pin the DI on the ws2812 is hooked-up to
|
||||
* `#define RGBLIGHT_ANIMATIONS`
|
||||
* run RGB animations
|
||||
* `#define RGBLED_NUM 15`
|
||||
* number of LEDs
|
||||
* `#define RGBLIGHT_HUE_STEP 12`
|
||||
* units to step when in/decreasing hue
|
||||
* `#define RGBLIGHT_SAT_STEP 25`
|
||||
* units to step when in/decreasing saturation
|
||||
* `#define RGBLIGHT_VAL_STEP 12`
|
||||
* units to step when in/decreasing value (brightness)
|
||||
* `#define RGBW_BB_TWI`
|
||||
* bit-bangs TWI to EZ RGBW LEDs (only required for Ergodox EZ)
|
||||
|
||||
## Mouse Key Options
|
||||
|
||||
* `#define MOUSEKEY_INTERVAL 20`
|
||||
* `#define MOUSEKEY_DELAY 0`
|
||||
* `#define MOUSEKEY_TIME_TO_MAX 60`
|
||||
* `#define MOUSEKEY_MAX_SPEED 7`
|
||||
* `#define MOUSEKEY_WHEEL_DELAY 0`
|
||||
|
||||
# The `rules.mk` File
|
||||
|
||||
This is a [make](https://www.gnu.org/software/make/manual/make.html) file that is included by the top-level `Makefile`. It is used to set some information about the MCU that we will be compiling for as well as enabling and disabling certain features.
|
||||
|
||||
## Build Options
|
||||
|
||||
* `DEFAULT_FOLDER`
|
||||
* Used to specify a default folder when a keyboard has more than one sub-folder.
|
||||
* `SRC`
|
||||
* Used to add files to the compilation/linking list.
|
||||
* `LAYOUTS`
|
||||
* A list of [layouts](feature_layouts.md) this keyboard supports.
|
||||
|
||||
## AVR MCU Options
|
||||
* `MCU = atmega32u4`
|
||||
* `F_CPU = 16000000`
|
||||
* `ARCH = AVR8`
|
||||
* `F_USB = $(F_CPU)`
|
||||
* `OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT`
|
||||
* `BOOTLOADER = atmel-dfu` with the following options:
|
||||
* `atmel-dfu`
|
||||
* `lufa-dfu`
|
||||
* `qmk-dfu`
|
||||
* `halfkay`
|
||||
* `caterina`
|
||||
* `bootloadHID`
|
||||
|
||||
## Feature Options
|
||||
|
||||
Use these to enable or disable building certain features. The more you have enabled the bigger your firmware will be, and you run the risk of building a firmware too large for your MCU.
|
||||
|
||||
* `BOOTMAGIC_ENABLE`
|
||||
* Virtual DIP switch configuration(+1000)
|
||||
* `MOUSEKEY_ENABLE`
|
||||
* Mouse keys(+4700)
|
||||
* `EXTRAKEY_ENABLE`
|
||||
* Audio control and System control(+450)
|
||||
* `CONSOLE_ENABLE`
|
||||
* Console for debug(+400)
|
||||
* `COMMAND_ENABLE`
|
||||
* Commands for debug and configuration
|
||||
* `NKRO_ENABLE`
|
||||
* USB N-Key Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
* `AUDIO_ENABLE`
|
||||
* Enable the audio subsystem.
|
||||
* `RGBLIGHT_ENABLE`
|
||||
* Enable keyboard underlight functionality
|
||||
* `MIDI_ENABLE`
|
||||
* MIDI controls
|
||||
* `UNICODE_ENABLE`
|
||||
* Unicode
|
||||
* `BLUETOOTH_ENABLE`
|
||||
* Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
```c
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
// config options
|
||||
|
||||
#endif
|
||||
```
|
||||
|
||||
This file contains all of the options for that particular keymap. If you wish to override a previous declaration, you can use `#undef <variable>` to undefine it, where you can then redefine it without an error.
|
||||
|
||||
# Config Options
|
||||
|
||||
```c
|
||||
#define VENDOR_ID 0x1234 // defines your VID, and for most DIY projects, can be whatever you want
|
||||
#define PRODUCT_ID 0x5678 // defines your PID, and for most DIY projects, can be whatever you want
|
||||
#define DEVICE_VER 0 // defines the device version (often used for revisions)
|
||||
|
||||
#define MANUFACTURER Me // generally who/whatever brand produced the board
|
||||
#define PRODUCT Board // the name of the keyboard
|
||||
#define DESCRIPTION a keyboard // a short description of what the keyboard is
|
||||
|
||||
#define MATRIX_ROWS 5 // the number of rows in your keyboard's matrix
|
||||
#define MATRIX_COLS 15 // the number of columns in your keyboard's matrix
|
||||
|
||||
#define MATRIX_ROW_PINS { D0, D5, B5, B6 } // pins of the rows, from top to bottom
|
||||
#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } // pins of the columns, from left to right
|
||||
#define UNUSED_PINS { D1, D2, D3, B1, B2, B3 } // pins unused by the keyboard for reference
|
||||
#define MATRIX_HAS_GHOST // define is matrix has ghost (unlikely)
|
||||
#define DIODE_DIRECTION COL2ROW // COL2ROW or ROW2COL - how your matrix is configured
|
||||
// COL2ROW means the black mark on your diode is facing to the rows, and between the switch and the rows
|
||||
|
||||
#define AUDIO_VOICES // turns on the alternate audio voices (to cycle through)
|
||||
#define C6_AUDIO // enables audio on pin C6
|
||||
#define B5_AUDIO // enables audio on pin B5 (duophony is enable if both are enabled)
|
||||
|
||||
#define BACKLIGHT_PIN B7 // pin of the backlight - B5, B6, B7 use PWM, others use softPWM
|
||||
#define BACKLIGHT_LEVELS 3 // number of levels your backlight will have (not including off)
|
||||
|
||||
#define DEBOUNCING_DELAY 5 // the delay when reading the value of the pin (5 is default)
|
||||
|
||||
#define LOCKING_SUPPORT_ENABLE // mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap
|
||||
#define LOCKING_RESYNC_ENABLE // tries to keep switch state consistent with keyboard LED state
|
||||
|
||||
#define IS_COMMAND() ( \ // key combination that allows the use of magic commands (useful for debugging)
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
// the following options can save on file size at the expense of that feature
|
||||
#define NO_DEBUG // disable debuging (saves on file size)
|
||||
#define NO_PRINT // disable printing (saves of file size)
|
||||
#define NO_ACTION_LAYER // no layers
|
||||
#define NO_ACTION_TAPPING // no tapping for layers/mods
|
||||
#define NO_ACTION_ONESHOT // no oneshot for layers/mods
|
||||
#define NO_ACTION_MACRO // no macros
|
||||
#define NO_ACTION_FUNCTION // no functions
|
||||
|
||||
#define FORCE_NKRO // NKRO by default requires to be turned on, this forces it to be on always
|
||||
|
||||
#define PREVENT_STUCK_MODIFIERS // when switching layers, this will release all mods
|
||||
|
||||
#define TAPPING_TERM 200 // how long before a tap becomes a hold
|
||||
#define TAPPING_TOGGLE 2 // how many taps before triggering the toggle
|
||||
|
||||
#define PERMISSIVE_HOLD // makes tap and hold keys work better for fast typers who don't want tapping term set above 500
|
||||
|
||||
#define LEADER_TIMEOUT 300 // how long before the leader key times out
|
||||
|
||||
#define ONESHOT_TIMEOUT 300 // how long before oneshot times out
|
||||
#define ONESHOT_TAP_TOGGLE 2 // how many taps before oneshot toggle is triggered
|
||||
|
||||
#define IGNORE_MOD_TAP_INTERRUPT // makes it possible to do rolling combos (zx) with keys that convert to other keys on hold
|
||||
|
||||
// ws2812 options
|
||||
#define RGB_DI_PIN D7 // pin the DI on the ws2812 is hooked-up to
|
||||
#define RGBLIGHT_ANIMATIONS // run RGB animations
|
||||
#define RGBLED_NUM 15 // number of LEDs
|
||||
#define RGBLIGHT_HUE_STEP 12 // units to step when in/decreasing hue
|
||||
#define RGBLIGHT_SAT_STEP 25 // units to step when in/decresing saturation
|
||||
#define RGBLIGHT_VAL_STEP 12 // units to step when in/decreasing value (brightness)
|
||||
|
||||
#define RGBW_BB_TWI // bit-bangs twi to EZ RGBW LEDs (only required for Ergodox EZ)
|
||||
|
||||
// mousekey options (self-describing)
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#define MOUSEKEY_TIME_TO_MAX 60
|
||||
#define MOUSEKEY_MAX_SPEED 7
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
|
||||
```
|
@ -0,0 +1,63 @@
|
||||
# Dynamic macros: record and replay macros in runtime
|
||||
|
||||
QMK supports temporarily macros created on the fly. We call these Dynamic Macros. They are defined by the user from the keyboard and are lost when the keyboard is unplugged or otherwise rebooted.
|
||||
|
||||
You can store one or two macros and they may have a combined total of 128 keypresses. You can increase this size at the cost of RAM.
|
||||
|
||||
To enable them, first add a new element to the `planck_keycodes` enum — `DYNAMIC_MACRO_RANGE`:
|
||||
|
||||
```c
|
||||
enum planck_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
DVORAK,
|
||||
PLOVER,
|
||||
LOWER,
|
||||
RAISE,
|
||||
BACKLIT,
|
||||
EXT_PLV,
|
||||
DYNAMIC_MACRO_RANGE,
|
||||
};
|
||||
```
|
||||
|
||||
It must be the last element because `dynamic_macros.h` will add some more keycodes after it.
|
||||
|
||||
Below it include the `dynamic_macro.h` header:
|
||||
|
||||
```c
|
||||
#include "dynamic_macro.h"`
|
||||
```
|
||||
|
||||
Add the following keys to your keymap:
|
||||
|
||||
* `DYN_REC_START1` — start recording the macro 1,
|
||||
* `DYN_REC_START2` — start recording the macro 2,
|
||||
* `DYN_MACRO_PLAY1` — replay the macro 1,
|
||||
* `DYN_MACRO_PLAY2` — replay the macro 2,
|
||||
* `DYN_REC_STOP` — finish the macro that is currently being recorded.
|
||||
|
||||
Add the following code to the very beginning of your `process_record_user()` function:
|
||||
|
||||
```c
|
||||
if (!process_record_dynamic_macro(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
```
|
||||
|
||||
That should be everything necessary. To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. To finish the recording, press the `DYN_REC_STOP` layer button. To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`.
|
||||
|
||||
Note that it's possible to replay a macro as part of a macro. It's ok to replay macro 2 while recording macro 1 and vice versa but never create recursive macros i.e. macro 1 that replays macro 1. If you do so and the keyboard will get unresponsive, unplug the keyboard and plug it again.
|
||||
|
||||
For users of the earlier versions of dynamic macros: It is still possible to finish the macro recording using just the layer modifier used to access the dynamic macro keys, without a dedicated `DYN_REC_STOP` key. If you want this behavior back, use the following snippet instead of the one above:
|
||||
|
||||
```c
|
||||
uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode);
|
||||
|
||||
if (!process_record_dynamic_macro(macro_kc, record)) {
|
||||
return false;
|
||||
}
|
||||
```
|
||||
|
||||
If the LED's start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 128; please read the comments for it in the header).
|
||||
|
||||
For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header.
|
@ -1,179 +0,0 @@
|
||||
# Advanced Keycodes
|
||||
|
||||
Your keymap can include keycodes that are more advanced than normal, for example shifted keys. This page documents the functions that are available to you.
|
||||
|
||||
### Assigning Custom Names
|
||||
|
||||
People often define custom names using `#define`. For example:
|
||||
|
||||
```c
|
||||
#define FN_CAPS LT(_FL, KC_CAPSLOCK)
|
||||
#define ALT_TAB LALT(KC_TAB)
|
||||
```
|
||||
|
||||
This will allow you to use `FN_CAPS` and `ALT_TAB` in your `KEYMAP()`, keeping it more readable.
|
||||
|
||||
### Limits of These Aliases
|
||||
|
||||
Currently, the keycodes able to used with these functions are limited to the [Basic Keycodes](keycodes_basic.md), meaning you can't use keycodes like `KC_TILD`, or anything greater than 0xFF. For a full list of the keycodes able to be used see [Basic Keycodes](keycodes_basic.md).
|
||||
|
||||
# Switching and Toggling Layers
|
||||
|
||||
These functions allow you to activate layers in various ways. Note that layers are not generally independent layouts -- multiple layers can be activated at once, and it's typical for layers to use `KC_TRNS` to allow keypresses to pass through to lower layers. For a detailed explanation of layers, see [Keymap Overview](keymap.md#keymap-and-layers)
|
||||
|
||||
* `DF(layer)` - switches the default layer. The default layer is the always-active base layer that other layers stack on top of. See below for more about the default layer. This might be used to switch from QWERTY to Dvorak layout. (Note that this is a temporary switch that only persists until the keyboard loses power. To modify the default layer in a persistent way requires deeper customization, such as calling the `set_single_persistent_default_layer` function inside of [process_record_user](custom_quantum_functions.md#programming-the-behavior-of-any-keycode).)
|
||||
* `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated.
|
||||
* `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15 and the left modifiers.
|
||||
* `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped.
|
||||
* `TG(layer)` - toggles *layer*, activating it if it's inactive and vice versa
|
||||
* `TO(layer)` - activates *layer* and de-activates all other layers (except your default layer). This function is special, because instead of just adding/removing one layer to your active layer stack, it will completely replace your current active layers, uniquely allowing you to replace higher layers with a lower one. This is activated on keydown (as soon as the key is pressed).
|
||||
* `TT(layer)` - Layer Tap-Toggle. If you hold the key down, *layer* is activated, and then is de-activated when you let go (like `MO`). If you repeatedly tap it, the layer will be toggled on or off (like `TG`). It needs 5 taps by default, but you can change this by defining `TAPPING_TOGGLE` -- for example, `#define TAPPING_TOGGLE 2` to toggle on just two taps.
|
||||
|
||||
# Working with Layers
|
||||
|
||||
Care must be taken when switching layers, it's possible to lock yourself into a layer with no way to deactivate that layer (without unplugging your keyboard.) We've created some guidelines to help users avoid the most common problems.
|
||||
|
||||
### Beginners
|
||||
|
||||
If you are just getting started with QMK you will want to keep everything simple. Follow these guidelines when setting up your layers:
|
||||
|
||||
* Setup layer 0 as your default, "base" layer. This is your normal typing layer, and could be whatever layout you want (qwerty, dvorak, colemak, etc.). It's important to set this as the lowest layer since it will typically have most or all of the keyboard's keys defined, so would block other layers from having any effect if it were above them (i.e., had a higher layer number).
|
||||
* Arrange your layers in a "tree" layout, with layer 0 as the root. Do not try to enter the same layer from more than one other layer.
|
||||
* In a layer's keymap, only reference higher-numbered layers. Because layers are processed from the highest-numbered (topmost) active layer down, modifying the state of lower layers can be tricky and error-prone.
|
||||
|
||||
### Intermediate Users
|
||||
|
||||
Sometimes you need more than one base layer. For example, if you want to switch between QWERTY and Dvorak, switch between layouts for different countries, or switch your layout for different videogames. Your base layers should always be the lowest numbered layers. When you have multiple base layers you should always treat them as mutually exclusive. When one base layer is on the others are off.
|
||||
|
||||
### Advanced Users
|
||||
|
||||
Once you have a good feel for how layers work and what you can do, you can get more creative. The rules listed in the beginner section will help you be successful by avoiding some of the tricker details but they can be constraining, especially for ultra-compact keyboard users. Understanding how layers work will allow you to use them in more advanced ways.
|
||||
|
||||
Layers stack on top of each other in numerical order. When determining what a keypress does, QMK scans the layers from the top down, stopping when it reaches the first active layer that is not set to `KC_TRNS`. As a result if you activate a layer that is numerically lower than your current layer, and your current layer (or another layer that is active and higher than your target layer) has something other than `KC_TRNS`, that is the key that will be sent, not the key on the layer you just activated. This is the cause of most people's "why doesn't my layer get switched" problem.
|
||||
|
||||
Sometimes, you might want to switch between layers in a macro or as part of a tap dance routine. `layer_on` activates a layer, and `layer_off` deactivates it. More layer-related functions can be found in [action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action_layer.h).
|
||||
|
||||
# Modifier Keys
|
||||
|
||||
These functions allow you to combine a mod with a keycode. When pressed the keydown for the mod will be sent first, and then *kc* will be sent. When released the keyup for *kc* will be sent and then the mod will be sent.
|
||||
|
||||
* `LSFT(kc)` or `S(kc)` - applies left Shift to *kc* (keycode)
|
||||
* `RSFT(kc)` - applies right Shift to *kc*
|
||||
* `LCTL(kc)` - applies left Control to *kc*
|
||||
* `RCTL(kc)` - applies right Control to *kc*
|
||||
* `LALT(kc)` - applies left Alt to *kc*
|
||||
* `RALT(kc)` - applies right Alt to *kc*
|
||||
* `LGUI(kc)` - applies left GUI (command/win) to *kc*
|
||||
* `RGUI(kc)` - applies right GUI (command/win) to *kc*
|
||||
* `HYPR(kc)` - applies Hyper (all modifiers) to *kc*
|
||||
* `MEH(kc)` - applies Meh (all modifiers except Win/Cmd) to *kc*
|
||||
* `LCAG(kc)` - applies CtrlAltGui to *kc*
|
||||
|
||||
You can also chain these, like this:
|
||||
|
||||
LALT(LCTL(KC_DEL)) -- this makes a key that sends Alt, Control, and Delete in a single keypress.
|
||||
|
||||
# Shifted Keycodes
|
||||
|
||||
The following shortcuts automatically add `LSFT()` to keycodes to get commonly used symbols.
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|------------------------|------------------|-------------------|
|
||||
|`KC_TILDE` |`KC_TILD` |`~` |
|
||||
|`KC_EXCLAIM` |`KC_EXLM` |`!` |
|
||||
|`KC_AT` | |`@` |
|
||||
|`KC_HASH` | |`#` |
|
||||
|`KC_DOLLAR` |`KC_DLR` |`$` |
|
||||
|`KC_PERCENT` |`KC_PERC` |`%` |
|
||||
|`KC_CIRCUMFLEX` |`KC_CIRC` |`^` |
|
||||
|`KC_AMPERSAND` |`KC_AMPR` |`&` |
|
||||
|`KC_ASTERISK` |`KC_ASTR` |`*` |
|
||||
|`KC_LEFT_PAREN` |`KC_LPRN` |`(` |
|
||||
|`KC_RIGHT_PAREN` |`KC_RPRN` |`)` |
|
||||
|`KC_UNDERSCORE` |`KC_UNDS` |`_` |
|
||||
|`KC_PLUS` | |`+` |
|
||||
|`KC_LEFT_CURLY_BRACE` |`KC_LCBR` |`{` |
|
||||
|`KC_RIGHT_CURLY_BRACE` |`KC_RCBR` |`}` |
|
||||
|`KC_PIPE` | |<code>|</code>|
|
||||
|`KC_COLON` |`KC_COLN` |`:` |
|
||||
|`KC_DOUBLE_QUOTE` |`KC_DQT`/`KC_DQUO`|`"` |
|
||||
|`KC_LEFT_ANGLE_BRACKET` |`KC_LT`/`KC_LABK` |`<` |
|
||||
|`KC_RIGHT_ANGLE_BRACKET`|`KC_GT`/`KC_RABK` |`>` |
|
||||
|`KC_QUESTION` |`KC_QUES` |`?` |
|
||||
|
||||
# Mod Tap
|
||||
|
||||
`MT(mod, kc)` - is *mod* (modifier key - MOD_LCTL, MOD_LSFT) when held, and *kc* when tapped. In other words, you can have a key that sends Esc (or the letter O or whatever) when you tap it, but works as a Control key or a Shift key when you hold it down.
|
||||
|
||||
These are the values you can use for the `mod` in `MT()` and `OSM()`:
|
||||
|
||||
* MOD_LCTL
|
||||
* MOD_LSFT
|
||||
* MOD_LALT
|
||||
* MOD_LGUI
|
||||
* MOD_RCTL
|
||||
* MOD_RSFT
|
||||
* MOD_RALT
|
||||
* MOD_RGUI
|
||||
* MOD_HYPR
|
||||
* MOD_MEH
|
||||
|
||||
These can also be combined like `MOD_LCTL | MOD_LSFT` e.g. `MT(MOD_LCTL | MOD_LSFT, KC_ESC)` which would activate Control and Shift when held, and send Escape when tapped.
|
||||
|
||||
We've added shortcuts to make common modifier/tap (mod-tap) mappings more compact:
|
||||
|
||||
* `CTL_T(kc)` - is LCTL when held and *kc* when tapped
|
||||
* `SFT_T(kc)` - is LSFT when held and *kc* when tapped
|
||||
* `ALT_T(kc)` - is LALT when held and *kc* when tapped
|
||||
* `ALGR_T(kc)` - is AltGr when held and *kc* when tapped
|
||||
* `GUI_T(kc)` - is LGUI when held and *kc* when tapped
|
||||
* `ALL_T(kc)` - is Hyper (all mods) when held and *kc* when tapped. To read more about what you can do with a Hyper key, see [this blog post by Brett Terpstra](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)
|
||||
* `LCAG_T(kc)` - is CtrlAltGui when held and *kc* when tapped
|
||||
* `MEH_T(kc)` - is like Hyper, but not as cool -- does not include the Cmd/Win key, so just sends Alt+Ctrl+Shift.
|
||||
|
||||
{% hint style='info' %}
|
||||
Due to the way that keycodes are structured, any modifiers specified as part of `kc`, such as `LCTL()` or `KC_LPRN`, will only activate when held instead of tapped.
|
||||
|
||||
Additionally, if there is at least one right modifier, any other modifiers will turn into their right equivalents, so it is not possible to "mix and match" the two.
|
||||
{% endhint %}
|
||||
|
||||
# One Shot Keys
|
||||
|
||||
One shot keys are keys that remain active until the next key is pressed, and then are released. This allows you to type keyboard combinations without pressing more than one key at a time. These keys are usually called "Sticky keys" or "Dead keys".
|
||||
|
||||
For example, if you define a key as `OSM(MOD_LSFT)`, you can type a capital A character by first pressing and releasing shift, and then pressing and releasing A. Your computer will see the shift key being held the moment shift is pressed, and it will see the shift key being released immediately after A is released.
|
||||
|
||||
One shot keys also work as normal modifiers. If you hold down a one shot key and type other keys, your one shot will be released immediately after you let go of the key.
|
||||
|
||||
You can control the behavior of one shot keys by defining these in `config.h`:
|
||||
|
||||
```c
|
||||
#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */
|
||||
#define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */
|
||||
```
|
||||
|
||||
* `OSM(mod)` - Momentarily hold down *mod*. You must use the `MOD_*` keycodes as shown in [Mod Tap](#mod-tap), not the `KC_*` codes.
|
||||
* `OSL(layer)` - momentary switch to *layer*.
|
||||
|
||||
Sometimes, you want to activate a one-shot layer as part of a macro or tap dance routine. To do this, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`. For more complicated actions, take a look at the oneshot implementation in [`process_record`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action.c#L429).
|
||||
|
||||
If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop.
|
||||
|
||||
# Permissive Hold
|
||||
|
||||
As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option:
|
||||
|
||||
```
|
||||
#define PERMISSIVE_HOLD
|
||||
```
|
||||
|
||||
This makes it easier for fast typists to use dual-function keys. Without this, if you let go of a held key inside the tapping term, it won't register.
|
||||
|
||||
Example: (Tapping Term = 200ms)
|
||||
|
||||
- SHFT_T(KC_A) Down
|
||||
- KC_X Down
|
||||
- KC_X Up
|
||||
- SHFT_T(KC_A) Up
|
||||
|
||||
With defaults, if above is typed within tapping term, this will emit `ax`. With permissive hold, if above is typed within tapping term, this will emit `X` (so, Shift+X).
|
@ -1,89 +1,29 @@
|
||||
# Bootmagic and Magic Keycodes
|
||||
|
||||
There are 3 separate but related features that allow you to change the behavior of your keyboard without reflashing. While each of them have similar functionality you access that functionality in different ways depending on how your keyboard is configured.
|
||||
|
||||
Bootmagic is a system for configuring your keyboard while it initializes. To trigger a Bootmagic command you hold down the bootmagic key (`KC_SPACE` on most keyboards) and one or more command keys.
|
||||
|
||||
Bootmagic Keycodes allow you to access the Bootmagic functionality after your keyboard has initialized. To use Bootmagic Keycodes you assign keycodes starting with `MAGIC_`, much in the same way you define any other key.
|
||||
|
||||
Command is a feature that allows you to control different aspects of your keyboard. Command used to be called Magic. Command is typically accessed by holding Left and Right Shift at the same time, although that can be customized. While it shares some functionality with Bootmagic it also allows you to access functionality that Bootmagic does not. For more information see the [Command](feature_command.md) documentation page.
|
||||
|
||||
## Enabling Bootmagic
|
||||
|
||||
Bootmagic is disabled by default. To use Bootmagic you need to enable it in your `rules.mk` file:
|
||||
|
||||
BOOTMAGIC_ENABLE = yes
|
||||
|
||||
## Bootmagic Hotkeys and Keycodes
|
||||
|
||||
This table describes the default Hotkeys for Bootmagic and the Keycodes for Magic. These may be overriden at the Keyboard or Keymap level. Some functionality is not available in both methods.
|
||||
|
||||
To use the Hotkey hold down `BOOTMAGIC_KEY_SALT` (`KC_SPACE` by default) and the Hotkey while plugging in your keyboard. To use the Keycode assign that keycode to a layer. For example, if you hold down Space+B while plugging in most keyboards, you will enter bootloader mode.
|
||||
|
||||
|Hotkey |Keycode |Description |
|
||||
|-----------|----------------------------------|--------------------------------------------------------|
|
||||
|`ESC` | |Skip bootmagic and saved eeprom configuration |
|
||||
|`B` |`RESET` |Enter bootloader instead of firmware |
|
||||
|`D` |`DEBUG` |Enable debugging (writes messages to serial) |
|
||||
|`X` | |Enable matrix debugging |
|
||||
|`K` | |Enable keyboard debugging |
|
||||
|`M` | |Enable mouse debugging |
|
||||
|`BACKSPACE`| |Clear the saved settings from flash |
|
||||
|`CAPSLOCK` |`MAGIC_CAPSLOCK_TO_CONTROL` |Treat `Capslock` as `Control` |
|
||||
| |`MAGIC_UNCAPSLOCK_TO_CONTROL` |Stop treating CapsLock as Control |
|
||||
|`LCTRL` |`MAGIC_SWAP_CONTROL_CAPSLOCK` |Swap `Control` and `Capslock` |
|
||||
| |`MAGIC_UNSWAP_CONTROL_CAPSLOCK` |Unswap Left Control and Caps Lock |
|
||||
| |`MAGIC_SWAP_ALT_GUI` |Swap Alt and GUI on both sides |
|
||||
| |`MAGIC_UNSWAP_ALT_GUI` |Unswap Left Alt and GUI |
|
||||
|`LALT` |`MAGIC_SWAP_LALT_LGUI` |Swap Left `Alt` and `GUI`, e.g. for OSX Opt and Cmd |
|
||||
| |`MAGIC_UNSWAP_LALT_LGUI` |Unswap Left Alt and GUI |
|
||||
|`RALT` |`MAGIC_SWAP_RALT_RGUI` |Swap Right `Alt` and `GUI` |
|
||||
| |`MAGIC_UNSWAP_RALT_RGUI` |Unswap Right Alt and GUI |
|
||||
|`LGUI` |`MAGIC_NO_GUI` |Disable GUI key - e.g. disable Windows key during gaming|
|
||||
| |`MAGIC_UNNO_GUI` |Enable the GUI key |
|
||||
|`GRAVE` |`MAGIC_SWAP_GRAVE_ESC` |Swap `\`~` and `ESC` |
|
||||
| |`MAGIC_UNSWAP_GRAVE_ESC` |Unswap `\`~` and Escape |
|
||||
|`BACKSLASH`|`MAGIC_SWAP_BACKSLASH_BACKSPACE` |Swap Blackslash and Backspace |
|
||||
| |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`|Unswap Backslash and Backspace |
|
||||
|`N` |`MAGIC_HOST_NKRO` |Force N-Key Rollover (NKRO) on |
|
||||
| |`MAGIC_UNHOST_NKRO` |Force NKRO off |
|
||||
| |`MAGIC_TOGGLE_NKRO` |Toggle NKRO on or off |
|
||||
|`0` |`DF(0)` |Make Layer 0 the default layer at bootup |
|
||||
|`1` |`DF(1)` |Make Layer 1 the default layer at bootup |
|
||||
|`2` |`DF(2)` |Make Layer 2 the default layer at bootup |
|
||||
|`3` |`DF(3)` |Make Layer 3 the default layer at bootup |
|
||||
|`4` |`DF(4)` |Make Layer 4 the default layer at bootup |
|
||||
|`5` |`DF(5)` |Make Layer 5 the default layer at bootup |
|
||||
|`6` |`DF(6)` |Make Layer 6 the default layer at bootup |
|
||||
|`7` |`DF(7)` |Make Layer 7 the default layer at bootup |
|
||||
|
||||
## Bootmagic Configuration
|
||||
|
||||
When setting up your keyboard and/or keymap there are a number of `#define`s that control the behavior of Bootmagic. To use these put them in your `config.h`, either at the keyboard or keymap level.
|
||||
|
||||
|Define |Default|Description |
|
||||
|-------|-------|------------|
|
||||
|`BOOTMAGIC_KEY_SALT`|`KC_SPACE`|The key to hold down to trigger Bootmagic during initialization.|
|
||||
|`BOOTMAGIC_KEY_SKIP`|`KC_ESC`|The Hotkey to ignore saved eeprom configuration.|
|
||||
|`BOOTMAGIC_KEY_EEPROM_CLEAR`|`KC_BSPACE`|The hotkey to clear the saved eeprom configuration.|
|
||||
|`BOOTMAGIC_KEY_BOOTLOADER`|`KC_B`|The hotkey to enter the bootloader.|
|
||||
|`BOOTMAGIC_KEY_DEBUG_ENABLE`|`KC_D`|The hotkey to enable debug mode.|
|
||||
|`BOOTMAGIC_KEY_DEBUG_MATRIX`|`KC_X`|The hotkey to enable matrix debugging mode.|
|
||||
|`BOOTMAGIC_KEY_DEBUG_KEYBOARD`|`KC_K`|The hotkey to enable keyboard debugging mode.|
|
||||
|`BOOTMAGIC_KEY_DEBUG_MOUSE`|`KC_M`|The hotkey to enable mouse debugging mode.|
|
||||
|`BOOTMAGIC_KEY_SWAP_CONTROL_CAPSLOCK`|`KC_LCTRL`||
|
||||
|`BOOTMAGIC_KEY_CAPSLOCK_TO_CONTROL`|`KC_CAPSLOCK`||
|
||||
|`BOOTMAGIC_KEY_SWAP_LALT_LGUI`|`KC_LALT`||
|
||||
|`BOOTMAGIC_KEY_SWAP_RALT_RGUI`|`KC_RALT`||
|
||||
|`BOOTMAGIC_KEY_NO_GUI`|`KC_LGUI`||
|
||||
|`BOOTMAGIC_KEY_SWAP_GRAVE_ESC`|`KC_GRAVE`||
|
||||
|`BOOTMAGIC_KEY_SWAP_BACKSLASH_BACKSPACE`|`KC_BSLASH`||
|
||||
|`BOOTMAGIC_HOST_NKRO`|`KC_N`||
|
||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_0`|`KC_0`|Hotkey to set Layer 0 as the default layer|
|
||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_1`|`KC_1`|Hotkey to set Layer 1 as the default layer|
|
||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_2`|`KC_2`|Hotkey to set Layer 2 as the default layer|
|
||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_3`|`KC_3`|Hotkey to set Layer 3 as the default layer|
|
||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_4`|`KC_4`|Hotkey to set Layer 4 as the default layer|
|
||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_5`|`KC_5`|Hotkey to set Layer 5 as the default layer|
|
||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_6`|`KC_6`|Hotkey to set Layer 6 as the default layer|
|
||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_7`|`KC_7`|Hotkey to set Layer 7 as the default layer|
|
||||
# Bootmagic
|
||||
|
||||
<!-- FIXME: Describe the bootmagic feature here. -->
|
||||
|
||||
## Bootmagic Keycodes
|
||||
|
||||
Shortcuts for bootmagic options. You can use these even when bootmagic is off.
|
||||
|
||||
|Name|Description|
|
||||
|----|-----------|
|
||||
|`MAGIC_SWAP_CONTROL_CAPSLOCK`|Swap Capslock and Left Control|
|
||||
|`MAGIC_CAPSLOCK_TO_CONTROL`|Treat Capslock like a Control Key|
|
||||
|`MAGIC_SWAP_LALT_LGUI`|Swap the left Alt and GUI keys|
|
||||
|`MAGIC_SWAP_RALT_RGUI`|Swap the right Alt and GUI keys|
|
||||
|`MAGIC_NO_GUI`|Disable the GUI key|
|
||||
|`MAGIC_SWAP_GRAVE_ESC`|Swap the Grave and Esc key.|
|
||||
|`MAGIC_SWAP_BACKSLASH_BACKSPACE`|Swap backslash and backspace|
|
||||
|`MAGIC_HOST_NKRO`|Force NKRO on|
|
||||
|`MAGIC_SWAP_ALT_GUI`/`AG_SWAP`|Swap Alt and Gui on both sides|
|
||||
|`MAGIC_UNSWAP_CONTROL_CAPSLOCK`|Disable the Control/Capslock swap|
|
||||
|`MAGIC_UNCAPSLOCK_TO_CONTROL`|Disable treating Capslock like Control |
|
||||
|`MAGIC_UNSWAP_LALT_LGUI`|Disable Left Alt and GUI switching|
|
||||
|`MAGIC_UNSWAP_RALT_RGUI`|Disable Right Alt and GUI switching|
|
||||
|`MAGIC_UNNO_GUI`|Enable the GUI key |
|
||||
|`MAGIC_UNSWAP_GRAVE_ESC`|Disable the Grave/Esc swap |
|
||||
|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`|Disable the backslash/backspace swap|
|
||||
|`MAGIC_UNHOST_NKRO`|Force NKRO off|
|
||||
|`MAGIC_UNSWAP_ALT_GUI`/`AG_NORM`|Disable the Alt/GUI switching|
|
||||
|`MAGIC_TOGGLE_NKRO`|Turn NKRO on or off|
|
||||
|
@ -1,52 +0,0 @@
|
||||
# Command (Formerly known as Magic)
|
||||
|
||||
Command is a way to change your keyboard's behavior without having to flash or unplug it to use [Bootmagic](feature_bootmagic.md). There is a lot of overlap between this functionality and the [Bootmagic Keycodes](feature_bootmagic.md). Whenever possible we encourage you to use that functionality instead of Command.
|
||||
|
||||
## Enabling Command
|
||||
|
||||
By default Command is disabled. You can enable it in your `rules.mk` file:
|
||||
|
||||
COMMAND_ENABLE = yes
|
||||
|
||||
## Usage
|
||||
|
||||
To use Command you hold down the key combination defined by `IS_COMMAND`. By default that combination is both shift keys. While holding the key combination press the key corresponding to the command you want.
|
||||
|
||||
For example, to write the current QMK version to the QMK Toolbox console, you can press `Left Shift`+`Right Shift`+`V`.
|
||||
|
||||
## Configuration
|
||||
|
||||
The following values can be defined in `config.h` to control the behavior of Command.
|
||||
|
||||
|Define |Default | Description |
|
||||
|-------|--------|-------------|
|
||||
|`IS_COMMAND()` |`(keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))`|Key combination to activate Command|
|
||||
|`MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS` |`true` |Do layer switching with Function row|
|
||||
|`MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS` |`true` |Do layer switching with number keys.|
|
||||
|`MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM`|`false` |Do layer switching with custom keys (`MAGIC_KEY_LAYER0..9` below.)|
|
||||
|`MAGIC_KEY_HELP1` |`H` |Show help.|
|
||||
|`MAGIC_KEY_HELP2` |`SLASH` |Show help.|
|
||||
|`MAGIC_KEY_DEBUG` |`D` |Turn on debug mode.|
|
||||
|`MAGIC_KEY_DEBUG_MATRIX` |`X` |Turn on matrix debugging.|
|
||||
|`MAGIC_KEY_DEBUG_KBD` |`K` |Turn on keyboard debugging.|
|
||||
|`MAGIC_KEY_DEBUG_MOUSE` |`M` |Turn on mouse debugging.|
|
||||
|`MAGIC_KEY_VERSION` |`V` |Write the QMK version to the console|
|
||||
|`MAGIC_KEY_STATUS` |`S` |Show the current keyboard status|
|
||||
|`MAGIC_KEY_CONSOLE` |`C` |Enable the Command Console|
|
||||
|`MAGIC_KEY_LAYER0_ALT1` |`ESC` |Alternate access to layer 0|
|
||||
|`MAGIC_KEY_LAYER0_ALT2` |`GRAVE` |Alternate access to layer 0|
|
||||
|`MAGIC_KEY_LAYER0` |`0` |Change default layer to 0|
|
||||
|`MAGIC_KEY_LAYER1` |`1` |Change default layer to 1|
|
||||
|`MAGIC_KEY_LAYER2` |`2` |Change default layer to 2|
|
||||
|`MAGIC_KEY_LAYER3` |`3` |Change default layer to 3|
|
||||
|`MAGIC_KEY_LAYER4` |`4` |Change default layer to 4|
|
||||
|`MAGIC_KEY_LAYER5` |`5` |Change default layer to 5|
|
||||
|`MAGIC_KEY_LAYER6` |`6` |Change default layer to 6|
|
||||
|`MAGIC_KEY_LAYER7` |`7` |Change default layer to 7|
|
||||
|`MAGIC_KEY_LAYER8` |`8` |Change default layer to 8|
|
||||
|`MAGIC_KEY_LAYER9` |`9` |Change default layer to 9|
|
||||
|`MAGIC_KEY_BOOTLOADER` |`PAUSE` |Exit keyboard and enter bootloader|
|
||||
|`MAGIC_KEY_LOCK` |`CAPS` |Lock the keyboard so nothing can be typed|
|
||||
|`MAGIC_KEY_EEPROM` |`E` |Erase EEPROM settings|
|
||||
|`MAGIC_KEY_NKRO` |`N` |Toggle NKRO on/off|
|
||||
|`MAGIC_KEY_SLEEP_LED` |`Z` |Toggle LED when computer is sleeping on/off|
|
@ -0,0 +1,163 @@
|
||||
# Common Keymap Shortcuts
|
||||
|
||||
Your keymap can include shortcuts to common operations, for example shifted keys. This page documents the functions that are available to you.
|
||||
|
||||
People often define custom names using `#define`. For example:
|
||||
|
||||
```c
|
||||
#define FN_CAPS LT(_FL, KC_CAPSLOCK)
|
||||
#define ALT_TAB LALT(KC_TAB)
|
||||
```
|
||||
|
||||
This will allow you to use `FN_CAPS` and `ALT_TAB` in your `KEYMAP()`, keeping it more readable.
|
||||
|
||||
### Limits of these aliases
|
||||
|
||||
Currently, the keycodes able to used with these functions are limited to the [Basic Keycodes](keycodes_basic.html), meaning you can't use keycodes like `KC_TILD`, or anything greater than 0xFF. For a full list of the keycodes able to be used see [Basic Keycodes](keycodes_basic.html).
|
||||
|
||||
## Switching and toggling layers
|
||||
|
||||
These functions allow you to activate layers in various ways.
|
||||
|
||||
* `MO(layer)` - momentary switch to *layer*. As soon as you let go of the key, the layer is deactivated and you pop back out to the previous layer.
|
||||
* `LT(layer, kc)` - momentary switch to *layer* when held, and *kc* when tapped.
|
||||
* `TG(layer)` - toggles a layer on or off.
|
||||
* `TO(layer)` - Goes to a layer. This code is special, because it lets you go either up or down the stack -- just goes directly to the layer you want. So while other codes only let you go _up_ the stack (from layer 0 to layer 3, for example), `TO(2)` is going to get you to layer 2, no matter where you activate it from -- even if you're currently on layer 5. This gets activated on keydown (as soon as the key is pressed).
|
||||
* `TT(layer)` - Layer Tap-Toggle. If you hold the key down, the layer becomes active, and then deactivates when you let go. And if you tap it, the layer simply becomes active (toggles on). It needs 5 taps by default, but you can set it by defining `TAPPING_TOGGLE`, for example, `#define TAPPING_TOGGLE 2` for just two taps.
|
||||
|
||||
## Working With Layers
|
||||
|
||||
Care must be taken when switching layers, it's possible to lock yourself into a layer with no way to deactivate that layer (without unplugging your keyboard.) We've created some guidelines to help users avoid the most common problems.
|
||||
|
||||
### Beginners
|
||||
|
||||
If you are just getting started with QMK you will want to keep everything simple. Follow these guidelines when setting up your layers:
|
||||
|
||||
* Setup layer 0 as your "base" layer. This is your normal typing layer, and could be whatever layout you want (qwerty, dvorak, colemak, etc.)
|
||||
* Arrange your layers in a "tree" layout, with layer 0 as the root. Do not try to enter the same layer from more than one other layer.
|
||||
* Never try to stack a higher numbered layer on top of a lower numbered layer. Doing so is tricky and error prone.
|
||||
|
||||
### Intermediate Users
|
||||
|
||||
Sometimes you need more than one base layer. For example, if you want to switch between QWERTY and Dvorak, switch between layouts for different countries, or switch your layout for different videogames. Your base layers should always be the lowest numbered layers. When you have multiple base layers you should always treat them as mutually exclusive. When one base layer is on the others are off.
|
||||
|
||||
### Advanced Users
|
||||
|
||||
Once you have a good feel for how layers work and what you can do, you can get more creative. The rules listed in the beginner section will help you be successful by avoiding some of the tricker details but they can be constraining, especially for ultra-compact keyboard users. Understanding how layers work will allow you to use them in more advanced ways.
|
||||
|
||||
Layers stack on top of each other in numerical order. When determining what a keypress does, QMK scans the layers from the top down, stopping when it reaches the first active layer that is not set to `KC_TRNS`. As a result if you activate a layer that is numerically lower than your current layer, and your current layer (or another layer that is active and higher than your target layer) has something other than `KC_TRNS`, that is the key that will be sent, not the key on the layer you just activated. This is the cause of most people's "why doesn't my layer get switched" problem.
|
||||
|
||||
## Modifier keys
|
||||
|
||||
These functions allow you to combine a mod with a keycode. When pressed the keydown for the mod will be sent first, and then *kc* will be sent. When released the keyup for *kc* will be sent and then the mod will be sent.
|
||||
|
||||
* `LSFT(kc)` or `S(kc)` - applies left Shift to *kc* (keycode)
|
||||
* `RSFT(kc)` - applies right Shift to *kc*
|
||||
* `LCTL(kc)` - applies left Control to *kc*
|
||||
* `RCTL(kc)` - applies right Control to *kc*
|
||||
* `LALT(kc)` - applies left Alt to *kc*
|
||||
* `RALT(kc)` - applies right Alt to *kc*
|
||||
* `LGUI(kc)` - applies left GUI (command/win) to *kc*
|
||||
* `RGUI(kc)` - applies right GUI (command/win) to *kc*
|
||||
* `HYPR(kc)` - applies Hyper (all modifiers) to *kc*
|
||||
* `MEH(kc)` - applies Meh (all modifiers except Win/Cmd) to *kc*
|
||||
* `LCAG(kc)` - applies CtrlAltGui to *kc*
|
||||
|
||||
You can also chain these, like this:
|
||||
|
||||
LALT(LCTL(KC_DEL)) -- this makes a key that sends Alt, Control, and Delete in a single keypress.
|
||||
|
||||
## Shifted Keycodes
|
||||
|
||||
The following shortcuts automatically add `LSFT()` to keycodes to get commonly used symbols.
|
||||
|
||||
|Name|Description|
|
||||
|----|-----------|
|
||||
| KC_TILD | ~ |
|
||||
| KC_EXLM | ! |
|
||||
| KC_QUES | ? |
|
||||
| KC_AT | @ |
|
||||
| KC_HASH | # |
|
||||
| KC_DLR | $ |
|
||||
| KC_PERC | % |
|
||||
| KC_CIRC | ^ |
|
||||
| KC_AMPR | & |
|
||||
| KC_ASTR | * |
|
||||
| KC_LPRN | ( |
|
||||
| KC_RPRN | ) |
|
||||
| KC_UNDS | _ |
|
||||
| KC_PLUS | + |
|
||||
| KC_DQUO | " |
|
||||
| KC_LCBR | { |
|
||||
| KC_RCBR | } |
|
||||
| KC_LABK | < |
|
||||
| KC_RABK | > |
|
||||
| KC_PIPE | | |
|
||||
| KC_COLN | : |
|
||||
|
||||
## Mod Tap
|
||||
|
||||
`MT(mod, kc)` - is *mod* (modifier key - MOD_LCTL, MOD_LSFT) when held, and *kc* when tapped. In other words, you can have a key that sends Esc (or the letter O or whatever) when you tap it, but works as a Control key or a Shift key when you hold it down.
|
||||
|
||||
These are the values you can use for the `mod` in `MT()` and `OSM()`:
|
||||
|
||||
* MOD_LCTL
|
||||
* MOD_LSFT
|
||||
* MOD_LALT
|
||||
* MOD_LGUI
|
||||
* MOD_RCTL
|
||||
* MOD_RSFT
|
||||
* MOD_RALT
|
||||
* MOD_RGUI
|
||||
* MOD_HYPR
|
||||
* MOD_MEH
|
||||
|
||||
These can also be combined like `MOD_LCTL | MOD_LSFT` e.g. `MT(MOD_LCTL | MOD_LSFT, KC_ESC)` which would activate Control and Shift when held, and send Escape when tapped. Note however, that you cannot mix right and left side modifiers.
|
||||
|
||||
We've added shortcuts to make common modifier/tap (mod-tap) mappings more compact:
|
||||
|
||||
* `CTL_T(kc)` - is LCTL when held and *kc* when tapped
|
||||
* `SFT_T(kc)` - is LSFT when held and *kc* when tapped
|
||||
* `ALT_T(kc)` - is LALT when held and *kc* when tapped
|
||||
* `ALGR_T(kc)` - is AltGr when held and *kc* when tapped
|
||||
* `GUI_T(kc)` - is LGUI when held and *kc* when tapped
|
||||
* `ALL_T(kc)` - is Hyper (all mods) when held and *kc* when tapped. To read more about what you can do with a Hyper key, see [this blog post by Brett Terpstra](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)
|
||||
* `LCAG_T(kc)` - is CtrlAltGui when held and *kc* when tapped
|
||||
* `MEH_T(kc)` - is like Hyper, but not as cool -- does not include the Cmd/Win key, so just sends Alt+Ctrl+Shift.
|
||||
|
||||
## One Shot Keys
|
||||
|
||||
One shot keys are keys that remain active until the next key is pressed, and then are releasd. This allows you to type keyboard combinations without pressing more than one key at a time.
|
||||
|
||||
For example, if you define a key as `OSM(MOD_LSFT)`, you can type a capital A character by first pressing and releasing shift, and then pressing and releasing A. Your computer will see the shift key being held the moment shift is pressed, and it will see the shift key being released immediately after A is released.
|
||||
|
||||
One shot keys also work as normal modifiers. If you hold down a one shot key and type other keys, your one shot will be released immediately after you let go of the key.
|
||||
|
||||
You can control the behavior of one shot keys by defining these in `config.h`:
|
||||
|
||||
```c
|
||||
#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */
|
||||
#define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */
|
||||
```
|
||||
|
||||
* `OSM(mod)` - Momentarily hold down *mod*. You must use the `MOD_*` keycodes as shown in [Mod Tap](#mod-tap), not the `KC_*` codes.
|
||||
* `OSL(layer)` - momentary switch to *layer*.
|
||||
|
||||
## Permissive Hold
|
||||
|
||||
As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option:
|
||||
|
||||
```
|
||||
#define PERMISSIVE_HOLD
|
||||
```
|
||||
|
||||
This makes it easier for fast typists to use dual-function keys. Without this, if you let go of a held key inside the tapping term, it won't register.
|
||||
|
||||
Example: (Tapping Term = 200ms)
|
||||
|
||||
- SHFT_T(KC_A) Down
|
||||
- KC_X Down
|
||||
- KC_X Up
|
||||
- SHFT_T(KC_A) Up
|
||||
|
||||
With defaults, if above is typed within tapping term, this will emit `ax`. With permissive hold, if above is typed within tapping term, this will emit `X` (so, Shift+X).
|
@ -1,63 +0,0 @@
|
||||
# Dynamic Macros: Record and Replay Macros in Runtime
|
||||
|
||||
QMK supports temporary macros created on the fly. We call these Dynamic Macros. They are defined by the user from the keyboard and are lost when the keyboard is unplugged or otherwise rebooted.
|
||||
|
||||
You can store one or two macros and they may have a combined total of 128 keypresses. You can increase this size at the cost of RAM.
|
||||
|
||||
To enable them, first add a new element to the `planck_keycodes` enum — `DYNAMIC_MACRO_RANGE`:
|
||||
|
||||
```c
|
||||
enum planck_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
DVORAK,
|
||||
PLOVER,
|
||||
LOWER,
|
||||
RAISE,
|
||||
BACKLIT,
|
||||
EXT_PLV,
|
||||
DYNAMIC_MACRO_RANGE,
|
||||
};
|
||||
```
|
||||
|
||||
It must be the last element because `dynamic_macros.h` will add some more keycodes after it.
|
||||
|
||||
Below it, include the `dynamic_macro.h` header:
|
||||
|
||||
```c
|
||||
#include "dynamic_macro.h"`
|
||||
```
|
||||
|
||||
Add the following keys to your keymap:
|
||||
|
||||
* `DYN_REC_START1` — start recording the macro 1,
|
||||
* `DYN_REC_START2` — start recording the macro 2,
|
||||
* `DYN_MACRO_PLAY1` — replay the macro 1,
|
||||
* `DYN_MACRO_PLAY2` — replay the macro 2,
|
||||
* `DYN_REC_STOP` — finish the macro that is currently being recorded.
|
||||
|
||||
Add the following code to the very beginning of your `process_record_user()` function:
|
||||
|
||||
```c
|
||||
if (!process_record_dynamic_macro(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
```
|
||||
|
||||
That should be everything necessary. To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. To finish the recording, press the `DYN_REC_STOP` layer button. To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`.
|
||||
|
||||
Note that it's possible to replay a macro as part of a macro. It's ok to replay macro 2 while recording macro 1 and vice versa but never create recursive macros i.e. macro 1 that replays macro 1. If you do so and the keyboard will get unresponsive, unplug the keyboard and plug it again.
|
||||
|
||||
For users of the earlier versions of dynamic macros: It is still possible to finish the macro recording using just the layer modifier used to access the dynamic macro keys, without a dedicated `DYN_REC_STOP` key. If you want this behavior back, use the following snippet instead of the one above:
|
||||
|
||||
```c
|
||||
uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode);
|
||||
|
||||
if (!process_record_dynamic_macro(macro_kc, record)) {
|
||||
return false;
|
||||
}
|
||||
```
|
||||
|
||||
If the LEDs start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 128; please read the comments for it in the header).
|
||||
|
||||
For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header.
|
@ -1,17 +0,0 @@
|
||||
# Grave Escape
|
||||
|
||||
Grave Escape is a feature that allows you to share the grave key (<code>`</code> and `~`) on the same key as Escape. When `KC_GESC` is used it will act as `KC_ESC`, unless Shift or GUI is pressed, in which case it will act as `KC_GRAVE`.
|
||||
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|---------|-----------|------------------------------------------------------------------|
|
||||
|`KC_GESC`|`GRAVE_ESC`|Escape when pressed, <code>`</code> when Shift or GUI are held|
|
||||
|
||||
There are several possible key combinations this will break, among them Ctrl+Shift+Esc on Windows and Cmd+Opt+Esc on macOS. You can use these options in your `config.h` to work around this:
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `GRAVE_ESC_ALT_OVERRIDE` | Always send Escape if Alt is pressed. |
|
||||
| `GRAVE_ESC_CTRL_OVERRIDE` | Always send Escape if Ctrl is pressed. |
|
||||
| `GRAVE_ESC_GUI_OVERRIDE` | Always send Escape if GUI is pressed. |
|
||||
| `GRAVE_ESC_SHIFT_OVERRIDE` | Always send Escape if SHIFT is pressed. |
|
@ -1,11 +0,0 @@
|
||||
## Key Lock: Holding Down Keys for You
|
||||
|
||||
Sometimes, you need to hold down a specific key for a long period of time. Whether this is while typing in ALL CAPS, or playing a video game that hasn't implemented auto-run, Key Lock is here to help. Key Lock adds a new keycode, `KC_LOCK`, that will hold down the next key you hit for you. The key is released when you hit it again. Here's an example: let's say you need to type in all caps for a few sentences. You hit KC_LOCK, and then shift. Now, shift will be considered held until you hit it again. You can think of key lock as caps lock, but supercharged.
|
||||
|
||||
Here's how to use it:
|
||||
|
||||
1. Pick a key on your keyboard. This will be the key lock key. Assign it the keycode `KC_LOCK`. This will be a single-action key: you won't be able to use it for anything else.
|
||||
2. Enable key lock by including `KEY_LOCK_ENABLE = yes` in your Makefile.
|
||||
3. That's it!
|
||||
|
||||
Important: switching layers does not cancel the key lock. Additionally, key lock is only able to hold standard action keys and One Shot modifier keys (for example, if you have your shift defined as `OSM(KC_LSFT)`; see [One Shot Keys](quantum_keycodes.md#one-shot-keys)). This does not include any of the QMK special functions (except One Shot modifiers), or shifted versions of keys such as KC_LPRN. If it's in the [Basic Keycodes](keycodes_basic.md) list, it can be held. If it's not, then it can't be.
|
@ -1,265 +0,0 @@
|
||||
# Macros
|
||||
|
||||
Macros allow you to send multiple keystrokes when pressing just one key. QMK has a number of ways to define and use macros. These can do anything you want: type common phrases for you, copypasta, repetitive game movements, or even help you code.
|
||||
|
||||
{% hint style='danger' %}
|
||||
**Security Note**: While it is possible to use macros to send passwords, credit card numbers, and other sensitive information it is a supremely bad idea to do so. Anyone who gets a hold of your keyboard will be able to access that information by opening a text editor.
|
||||
{% endhint %}
|
||||
|
||||
## The New Way: `SEND_STRING()` & `process_record_user`
|
||||
|
||||
Sometimes you just want a key to type out words or phrases. For the most common situations we've provided `SEND_STRING()`, which will type out your string (i.e. a sequence of characters) for you. All ASCII characters that are easily translated to a keycode are supported (e.g. `\n\t`).
|
||||
|
||||
Here is an example `keymap.c` for a two-key keyboard:
|
||||
|
||||
```c
|
||||
enum custom_keycodes {
|
||||
MY_CUSTOM_MACRO = SAFE_RANGE
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
switch(keycode) {
|
||||
case MY_CUSTOM_MACRO:
|
||||
SEND_STRING("QMK is the best thing ever!"); // this is our macro!
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = {
|
||||
{MY_CUSTOM_MACRO, KC_ESC}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
What happens here is this:
|
||||
We first define a new custom keycode in the range not occupied by any other keycodes.
|
||||
Then we use the `process_record_user` function, which is called whenever a key is pressed or released, to check if our custom keycode has been activated.
|
||||
If yes, we send the string `"QMK is the best thing ever!"` to the computer via the `SEND_STRING` macro (this is a C preprocessor macro, not to be confused with QMK macros).
|
||||
We return `false` to indicate to the caller that the key press we just processed need not be processed any further.
|
||||
Finally, we define the keymap so that the first button activates our macro and the second button is just an escape button.
|
||||
|
||||
You might want to add more than one macro.
|
||||
You can do that by adding another keycode and adding another case to the switch statement, like so:
|
||||
|
||||
```c
|
||||
enum custom_keycodes {
|
||||
MY_CUSTOM_MACRO = SAFE_RANGE,
|
||||
MY_OTHER_MACRO
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
switch(keycode) {
|
||||
case MY_CUSTOM_MACRO:
|
||||
SEND_STRING("QMK is the best thing ever!");
|
||||
return false;
|
||||
case MY_OTHER_MACRO:
|
||||
SEND_STRING(SS_LCTRL("ac")); // selects all and copies
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = {
|
||||
{MY_CUSTOM_MACRO, MY_OTHER_MACRO}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
### TAP, DOWN and UP
|
||||
|
||||
You may want to use keys in your macros that you can't write down, such as `Ctrl` or `Home`.
|
||||
You can send arbitrary keycodes by wrapping them in:
|
||||
|
||||
* `SS_TAP()` presses and releases a key.
|
||||
* `SS_DOWN()` presses (but does not release) a key.
|
||||
* `SS_UP()` releases a key.
|
||||
|
||||
For example:
|
||||
|
||||
SEND_STRING(SS_TAP(X_HOME));
|
||||
|
||||
Would tap `KC_HOME` - note how the prefix is now `X_`, and not `KC_`. You can also combine this with other strings, like this:
|
||||
|
||||
SEND_STRING("VE"SS_TAP(X_HOME)"LO");
|
||||
|
||||
Which would send "VE" followed by a `KC_HOME` tap, and "LO" (spelling "LOVE" if on a newline).
|
||||
|
||||
There's also a couple of mod shortcuts you can use:
|
||||
|
||||
* `SS_LCTRL(string)`
|
||||
* `SS_LGUI(string)`
|
||||
* `SS_LALT(string)`
|
||||
* `SS_LSFT(string)`
|
||||
* `SS_RALT(string)`
|
||||
|
||||
These press the respective modifier, send the supplied string and then release the modifier.
|
||||
They can be used like this:
|
||||
|
||||
SEND_STRING(SS_LCTRL("a"));
|
||||
|
||||
Which would send LCTRL+a (LCTRL down, a, LCTRL up) - notice that they take strings (eg `"k"`), and not the `X_K` keycodes.
|
||||
|
||||
### Alternative Keymaps
|
||||
|
||||
By default, it assumes a US keymap with a QWERTY layout; if you want to change that (e.g. if your OS uses software Colemak), include this somewhere in your keymap:
|
||||
|
||||
#include <sendstring_colemak.h>
|
||||
|
||||
### Strings in Memory
|
||||
|
||||
If for some reason you're manipulating strings and need to print out something you just generated (instead of being a literal, constant string), you can use `send_string()`, like this:
|
||||
|
||||
```c
|
||||
char my_str[4] = "ok.";
|
||||
send_string(my_str);
|
||||
```
|
||||
|
||||
The shortcuts defined above won't work with `send_string()`, but you can separate things out to different lines if needed:
|
||||
|
||||
```c
|
||||
char my_str[4] = "ok.";
|
||||
SEND_STRING("I said: ");
|
||||
send_string(my_str);
|
||||
SEND_STRING(".."SS_TAP(X_END));
|
||||
```
|
||||
|
||||
## The Old Way: `MACRO()` & `action_get_macro`
|
||||
|
||||
{% hint style='info' %}
|
||||
This is inherited from TMK, and hasn't been updated - it's recommend that you use `SEND_STRING` and `process_record_user` instead.
|
||||
{% endhint %}
|
||||
|
||||
By default QMK assumes you don't have any macros. To define your macros you create an `action_get_macro()` function. For example:
|
||||
|
||||
```c
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
if (record->event.pressed) {
|
||||
switch(id) {
|
||||
case 0:
|
||||
return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END);
|
||||
case 1:
|
||||
return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END);
|
||||
}
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
```
|
||||
|
||||
This defines two macros which will be run when the key they are assigned to is pressed. If instead you'd like them to run when the key is released you can change the if statement:
|
||||
|
||||
if (!record->event.pressed) {
|
||||
|
||||
### Macro Commands
|
||||
|
||||
A macro can include the following commands:
|
||||
|
||||
* I() change interval of stroke in milliseconds.
|
||||
* D() press key.
|
||||
* U() release key.
|
||||
* T() type key(press and release).
|
||||
* W() wait (milliseconds).
|
||||
* END end mark.
|
||||
|
||||
### Mapping a Macro to a Key
|
||||
|
||||
Use the `M()` function within your `KEYMAP()` to call a macro. For example, here is the keymap for a 2-key keyboard:
|
||||
|
||||
```c
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = KEYMAP(
|
||||
M(0), M(1)
|
||||
),
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
if (record->event.pressed) {
|
||||
switch(id) {
|
||||
case 0:
|
||||
return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END);
|
||||
case 1:
|
||||
return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END);
|
||||
}
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
```
|
||||
|
||||
When you press the key on the left it will type "Hi!" and when you press the key on the right it will type "Bye!".
|
||||
|
||||
### Naming Your Macros
|
||||
|
||||
If you have a bunch of macros you want to refer to from your keymap while keeping the keymap easily readable you can name them using `#define` at the top of your file.
|
||||
|
||||
```c
|
||||
#define M_HI M(0)
|
||||
#define M_BYE M(1)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = KEYMAP(
|
||||
M_HI, M_BYE
|
||||
),
|
||||
};
|
||||
```
|
||||
|
||||
## Advanced Macro Functions
|
||||
|
||||
There are some functions you may find useful in macro-writing. Keep in mind that while you can write some fairly advanced code within a macro if your functionality gets too complex you may want to define a custom keycode instead. Macros are meant to be simple.
|
||||
|
||||
### `record->event.pressed`
|
||||
|
||||
This is a boolean value that can be tested to see if the switch is being pressed or released. An example of this is
|
||||
|
||||
```c
|
||||
if (record->event.pressed) {
|
||||
// on keydown
|
||||
} else {
|
||||
// on keyup
|
||||
}
|
||||
```
|
||||
|
||||
### `register_code(<kc>);`
|
||||
|
||||
This sends the `<kc>` keydown event to the computer. Some examples would be `KC_ESC`, `KC_C`, `KC_4`, and even modifiers such as `KC_LSFT` and `KC_LGUI`.
|
||||
|
||||
### `unregister_code(<kc>);`
|
||||
|
||||
Parallel to `register_code` function, this sends the `<kc>` keyup event to the computer. If you don't use this, the key will be held down until it's sent.
|
||||
|
||||
### `clear_keyboard();`
|
||||
|
||||
This will clear all mods and keys currently pressed.
|
||||
|
||||
### `clear_mods();`
|
||||
|
||||
This will clear all mods currently pressed.
|
||||
|
||||
### `clear_keyboard_but_mods();`
|
||||
|
||||
This will clear all keys besides the mods currently pressed.
|
||||
|
||||
## Advanced Example: Single-Key Copy/Paste
|
||||
|
||||
This example defines a macro which sends `Ctrl-C` when pressed down, and `Ctrl-V` when released.
|
||||
|
||||
```c
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
switch(id) {
|
||||
case 0: {
|
||||
if (record->event.pressed) {
|
||||
return MACRO( D(LCTL), T(C), U(LCTL), END );
|
||||
} else {
|
||||
return MACRO( D(LCTL), T(V), U(LCTL), END );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
```
|
@ -1,81 +0,0 @@
|
||||
# Mousekeys
|
||||
|
||||
|
||||
Mousekeys is a feature that allows you to emulate a mouse using your keyboard. You can move the pointer around, click up to 5 buttons, and even scroll in all 4 directions. QMK uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
|
||||
|
||||
## Adding Mousekeys to a Keymap
|
||||
|
||||
There are two steps to adding Mousekeys support to your keyboard. You must enable support in the `rules.mk` file and you must map mouse actions to keys on your keyboard.
|
||||
|
||||
### Adding Mousekeys Support in the `rules.mk`
|
||||
|
||||
To add support for Mousekeys you simply need to add a single line to your keymap's `rules.mk`:
|
||||
|
||||
```
|
||||
MOUSEKEY_ENABLE = yes
|
||||
```
|
||||
|
||||
You can see an example here: https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/66/keymaps/mouse_keys/rules.mk
|
||||
|
||||
### Mapping Mouse Actions to Keyboard Keys
|
||||
|
||||
You can use these keycodes within your keymap to map button presses to mouse actions:
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|----------------|---------|---------------------------|
|
||||
|`KC_MS_UP` |`KC_MS_U`|Mouse Cursor Up |
|
||||
|`KC_MS_DOWN` |`KC_MS_D`|Mouse Cursor Down |
|
||||
|`KC_MS_LEFT` |`KC_MS_L`|Mouse Cursor Left |
|
||||
|`KC_MS_RIGHT` |`KC_MS_R`|Mouse Cursor Right |
|
||||
|`KC_MS_BTN1` |`KC_BTN1`|Mouse Button 1 |
|
||||
|`KC_MS_BTN2` |`KC_BTN2`|Mouse Button 2 |
|
||||
|`KC_MS_BTN3` |`KC_BTN3`|Mouse Button 3 |
|
||||
|`KC_MS_BTN4` |`KC_BTN4`|Mouse Button 4 |
|
||||
|`KC_MS_BTN5` |`KC_BTN5`|Mouse Button 5 |
|
||||
|`KC_MS_WH_UP` |`KC_WH_U`|Mouse Wheel Up |
|
||||
|`KC_MS_WH_DOWN` |`KC_WH_D`|Mouse Wheel Down |
|
||||
|`KC_MS_WH_LEFT` |`KC_WH_L`|Mouse Wheel Left |
|
||||
|`KC_MS_WH_RIGHT`|`KC_WH_R`|Mouse Wheel Right |
|
||||
|`KC_MS_ACCEL0` |`KC_ACL0`|Set mouse acceleration to 0|
|
||||
|`KC_MS_ACCEL1` |`KC_ACL1`|Set mouse acceleration to 1|
|
||||
|`KC_MS_ACCEL2` |`KC_ACL2`|Set mouse acceleration to 2|
|
||||
|
||||
You can see an example in the `_ML` here: https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/66/keymaps/mouse_keys/keymap.c#L46
|
||||
|
||||
## Configuring the Behavior of Mousekeys
|
||||
|
||||
The default speed for controlling the mouse with the keyboard is intentionally slow. You can adjust these parameters by adding these settings to your keymap's `config.h` file. All times are specified in milliseconds (ms).
|
||||
|
||||
```
|
||||
#define MOUSEKEY_DELAY 300
|
||||
#define MOUSEKEY_INTERVAL 50
|
||||
#define MOUSEKEY_MAX_SPEED 10
|
||||
#define MOUSEKEY_TIME_TO_MAX 20
|
||||
#define MOUSEKEY_WHEEL_MAX_SPEED 8
|
||||
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40
|
||||
```
|
||||
|
||||
|
||||
### `MOUSEKEY_DELAY`
|
||||
|
||||
When one of the mouse movement buttons is pressed this setting is used to define the delay between that button press and the mouse cursor moving. Some people find that small movements are impossible if this setting is too low, while settings that are too high feel sluggish.
|
||||
|
||||
### `MOUSEKEY_INTERVAL`
|
||||
|
||||
When a movement key is held down this specifies how long to wait between each movement report. Lower settings will translate into an effectively higher mouse speed.
|
||||
|
||||
### `MOUSEKEY_MAX_SPEED`
|
||||
|
||||
As a movement key is held down the speed of the mouse cursor will increase until it reaches `MOUSEKEY_MAX_SPEED`.
|
||||
|
||||
### `MOUSEKEY_TIME_TO_MAX`
|
||||
|
||||
How long you want to hold down a movement key for until `MOUSEKEY_MAX_SPEED` is reached. This controls how quickly your cursor will accelerate.
|
||||
|
||||
### `MOUSEKEY_WHEEL_MAX_SPEED`
|
||||
|
||||
The top speed for scrolling movements.
|
||||
|
||||
### `MOUSEKEY_WHEEL_TIME_TO_MAX`
|
||||
|
||||
How long you want to hold down a scroll key for until `MOUSEKEY_WHEEL_MAX_SPEED` is reached. This controls how quickly your scrolling will accelerate.
|
@ -1,24 +0,0 @@
|
||||
## Space Cadet Shift: The Future, Built In
|
||||
|
||||
Steve Losh [described](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) the Space Cadet Shift quite well. Essentially, you hit the left Shift on its own, and you get an opening parenthesis; hit the right Shift on its own, and you get the closing one. When hit with other keys, the Shift key keeps working as it always does. Yes, it's as cool as it sounds.
|
||||
|
||||
To use it, use `KC_LSPO` (Left Shift, Parenthesis Open) for your left Shift on your keymap, and `KC_RSPC` (Right Shift, Parenthesis Close) for your right Shift.
|
||||
|
||||
It's defaulted to work on US keyboards, but if your layout uses different keys for parenthesis, you can define those in your `config.h` like this:
|
||||
|
||||
#define LSPO_KEY KC_9
|
||||
#define RSPC_KEY KC_0
|
||||
|
||||
You can also choose between different rollover behaviors of the shift keys by defining:
|
||||
|
||||
#define DISABLE_SPACE_CADET_ROLLOVER
|
||||
|
||||
in your `config.h`. Disabling rollover allows you to use the opposite shift key to cancel the space cadet state in the event of an erroneous press instead of emitting a pair of parentheses when the keys are released.
|
||||
|
||||
The only other thing you're going to want to do is create a `Makefile` in your keymap directory and set the following:
|
||||
|
||||
```
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
```
|
||||
|
||||
This is just to keep the keyboard from going into command mode when you hold both Shift keys at the same time.
|
@ -1,26 +0,0 @@
|
||||
## Space Cadet Shift Enter: The future, built in
|
||||
|
||||
Based on the Space Cadet Shift by Steve Losh [described](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/)
|
||||
Essentially, you hit the Shift on its own, and it acts as the enter key. When hit with other keys, the Shift key keeps working as it always does. Yes, it's as cool as it sounds. This solution works better than using a macro since the timers defined in quantum allow us to tell when another key is pressed, rather than just having a janky timer than results in accidental endlines.
|
||||
|
||||
To use it, use `KC_SFTENT` (Shift, Enter) for any Shift on your keymap.
|
||||
|
||||
It's defaulted to work on US keyboards, but if you'd like to use a different key for Enter, you can define those in your `config.h` like this:
|
||||
|
||||
#define SFTENT_KEY KC_ENT
|
||||
|
||||
|
||||
The only other thing you're going to want to do is create a `rules.mk` in your keymap directory and set the following:
|
||||
|
||||
```
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
```
|
||||
|
||||
This is just to keep the keyboard from going into command mode when you hold both Shift keys at the same time.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PLEASE NOTE: this feature uses the same timers as the Space Cadet Shift feature, so using them in tandem may produce unwanted results.
|
||||
|
@ -1,132 +0,0 @@
|
||||
# Stenography in QMK
|
||||
|
||||
[Stenography](https://en.wikipedia.org/wiki/Stenotype) is a method of writing most often used by court reports, closed-captioning, and real-time transcription for the deaf. In stenography words are chorded syllable by syllable with a mixture of spelling, phonetic, and shortcut (briefs) strokes. Professional stenographers can reach 200-300 WPM without any of the strain usually found in standard typing and with far fewer errors (>99.9% accuracy).
|
||||
|
||||
The [Open Steno Project](http://www.openstenoproject.org/) has built an open-source program called Plover that provides real-time translation of steno strokes into words and commands. It has an established dictionary and supports
|
||||
|
||||
## Plover with QWERTY Keyboard
|
||||
|
||||
Plover can work with any standard QWERTY keyboard, although it is more efficient if the keyboard supports NKRO (n-key rollover) to allow Plover to see all the pressed keys at once. An example keymap for Plover can be found in `planck/keymaps/default`. Switching to the `PLOVER` layer adjusts the position of the keyboard to support the number bar.
|
||||
|
||||
To use Plover with QMK just enable NKRO and optionally adjust your layout if you have anything other than a standard layout. You may also want to purchase some steno-friendly keycaps to make it easier to hit multiple keys.
|
||||
|
||||
## Plover with Steno Protocol
|
||||
|
||||
Plover also understands the language of several steno machines. QMK can speak a couple of these languages, TX Bolt and GeminiPR. An example layout can be found in `planck/keymaps/steno`.
|
||||
|
||||
When QMK speaks to Plover over a steno protocol Plover will not use the keyboard as input. This means that you can switch back and forth between a standard keyboard and your steno keyboard, or even switch layers from Plover to standard and back without needing to activate/deactivate Plover.
|
||||
|
||||
In this mode Plover expects to speak with a steno machine over a serial port so QMK will present itself to the operating system as a virtual serial port in addition to a keyboard. By default QMK will speak the TX Bolt protocol but can be switched to GeminiPR; the last protocol used is stored in non-volatile memory so QMK will use the same protocol on restart.
|
||||
|
||||
> Note: Due to hardware limitations you may not be able to run both a virtual serial port and mouse emulation at the same time.
|
||||
|
||||
### TX Bolt
|
||||
|
||||
TX Bolt communicates the status of 24 keys over a very simple protocol in variable-sized (1-5 byte) packets.
|
||||
|
||||
### GeminiPR
|
||||
|
||||
GeminiPR encodes 42 keys into a 6-byte packet. While TX Bolt contains everything that is necessary for standard stenography, GeminiPR opens up many more options, including supporting non-English theories.
|
||||
|
||||
## Configuring QMK for Steno
|
||||
|
||||
Firstly, enable steno in your keymap's Makefile. You may also need disable mousekeys, extra keys, or another USB endpoint to prevent conflicts. The builtin USB stack for some processors only supports a certain number of USB endpoints and the virtual serial port needed for steno fills 3 of them.
|
||||
|
||||
```Makefile
|
||||
STENO_ENABLE = yes
|
||||
MOUSEKEY_ENABLE = no
|
||||
```
|
||||
|
||||
In your keymap create a new layer for Plover. You will need to include `keymap_steno.h`. See `planck/keymaps/steno/keymap.c` for an example. Remember to create a key to switch to the layer as well as a key for exiting the layer. If you would like to switch modes on the fly you can use the keycodes `QK_STENO_BOLT` and `QK_STENO_GEMINI`. If you only want to use one of the protocols you may set it up in your initialization function:
|
||||
|
||||
```C
|
||||
void matrix_init_user() {
|
||||
steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT
|
||||
}
|
||||
```
|
||||
|
||||
Once you have your keyboard flashed launch Plover. Click the 'Configure...' button. In the 'Machine' tab select the Stenotype Machine that corresponds to your desired protocol. Click the 'Configure...' button on this tab and enter the serial port or click 'Scan'. Baud rate is fine at 9600 (although you should be able to set as high as 115200 with no issues). Use the default settings for everything else (Data Bits: 8, Stop Bits: 1, Parity: N, no flow control).
|
||||
|
||||
On the display tab click 'Open stroke display'. With Plover disabled you should be able to hit keys on your keyboard and see them show up in the stroke display window. Use this to make sure you have set up your keymap correctly. You are now ready to steno!
|
||||
|
||||
## Learning Stenography
|
||||
|
||||
* [Learn Plover!](https://sites.google.com/site/ploverdoc/)
|
||||
* [QWERTY Steno](http://qwertysteno.com/Home/)
|
||||
* [Steno Jig](https://joshuagrams.github.io/steno-jig/)
|
||||
* More resources at the Plover [Learning Stenography](https://github.com/openstenoproject/plover/wiki/Learning-Stenography) wiki
|
||||
|
||||
## Interfacing with the code
|
||||
|
||||
The steno code has three interceptible hooks. If you define these functions, they will be called at certain points in processing; if they return true, processing continues, otherwise it's assumed you handled things.
|
||||
|
||||
```C
|
||||
bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]);
|
||||
```
|
||||
|
||||
This function is called when a chord is about to be sent. Mode will be one of `STENO_MODE_BOLT` or `STENO_MODE_GEMINI`. This represents the actual chord that would be sent via whichever protocol. You can modify the chord provided to alter what gets sent. Remember to return true if you want the regular sending process to happen.
|
||||
|
||||
```C
|
||||
bool process_steno_user(uint16_t keycode, keyrecord_t *record) { return true; }
|
||||
```
|
||||
|
||||
This function is called when a keypress has come in, before it is processed. The keycode should be one of `QK_STENO_BOLT`, `QK_STENO_GEMINI`, or one of the `STN_*` key values.
|
||||
|
||||
```C
|
||||
bool postprocess_steno_user(uint16_t keycode, keyrecord_t *record, steno_mode_t mode, uint8_t chord[6], int8_t pressed);
|
||||
```
|
||||
|
||||
This function is called after a key has been processed, but before any decision about whether or not to send a chord. If `IS_PRESSED(record->event)` is false, and `pressed` is 0 or 1, the chord will be sent shortly, but has not yet been sent. This is where to put hooks for things like, say, live displays of steno chords or keys.
|
||||
|
||||
|
||||
## Keycode Reference
|
||||
|
||||
As defined in `keymap_steno.h`.
|
||||
|
||||
> Note: TX Bolt does not support the full set of keys. The TX Bolt implementation in QMK will map the GeminiPR keys to the nearest TX Bolt key so that one key map will work for both.
|
||||
|
||||
|GeminiPR|TX Bolt|Steno Key|
|
||||
|--------|-------|-----------|
|
||||
|`STN_N1`|`STN_NUM`|Number bar #1|
|
||||
|`STN_N2`|`STN_NUM`|Number bar #2|
|
||||
|`STN_N3`|`STN_NUM`|Number bar #3|
|
||||
|`STN_N4`|`STN_NUM`|Number bar #4|
|
||||
|`STN_N5`|`STN_NUM`|Number bar #5|
|
||||
|`STN_N6`|`STN_NUM`|Number bar #6|
|
||||
|`STN_N7`|`STN_NUM`|Number bar #7|
|
||||
|`STN_N8`|`STN_NUM`|Number bar #8|
|
||||
|`STN_N9`|`STN_NUM`|Number bar #9|
|
||||
|`STN_NA`|`STN_NUM`|Number bar #A|
|
||||
|`STN_NB`|`STN_NUM`|Number bar #B|
|
||||
|`STN_NC`|`STN_NUM`|Number bar #C|
|
||||
|`STN_S1`|`STN_SL`| `S-` upper|
|
||||
|`STN_S2`|`STN_SL`| `S-` lower|
|
||||
|`STN_TL`|`STN_TL`| `T-`|
|
||||
|`STN_KL`|`STN_KL`| `K-`|
|
||||
|`STN_PL`|`STN_PL`| `P-`|
|
||||
|`STN_WL`|`STN_WL`| `W-`|
|
||||
|`STN_HL`|`STN_HL`| `H-`|
|
||||
|`STN_RL`|`STN_RL`| `R-`|
|
||||
|`STN_A`|`STN_A`| `A` vowel|
|
||||
|`STN_O`|`STN_O`| `O` vowel|
|
||||
|`STN_ST1`|`STN_STR`| `*` upper-left |
|
||||
|`STN_ST2`|`STN_STR`| `*` lower-left|
|
||||
|`STN_ST3`|`STN_STR`| `*` upper-right|
|
||||
|`STN_ST4`|`STN_STR`| `*` lower-right|
|
||||
|`STN_E`|`STN_E`| `E` vowel|
|
||||
|`STN_U`|`STN_U`| `U` vowel|
|
||||
|`STN_FR`|`STN_FR`| `-F`|
|
||||
|`STN_PR`|`STN_PR`| `-P`|
|
||||
|`STN_RR`|`STN_RR`| `-R`|
|
||||
|`STN_BR`|`STN_BR`| `-B`|
|
||||
|`STN_LR`|`STN_LR`| `-L`|
|
||||
|`STN_GR`|`STN_GR`| `-G`|
|
||||
|`STN_TR`|`STN_TR`| `-T`|
|
||||
|`STN_SR`|`STN_SR`| `-S`|
|
||||
|`STN_DR`|`STN_DR`| `-D`|
|
||||
|`STN_ZR`|`STN_ZR`| `-Z`|
|
||||
|`STN_FN`|| (GeminiPR only)|
|
||||
|`STN_RES1`||(GeminiPR only)|
|
||||
|`STN_RES2`||(GeminiPR only)|
|
||||
|`STN_PWR`||(GeminiPR only)|
|
||||
|
@ -1,30 +0,0 @@
|
||||
# Swap-Hands Action
|
||||
|
||||
The swap-hands action allows support for one-handed typing without requiring a separate layer. Set `SWAP_HANDS_ENABLE` in the Makefile and define a `hand_swap_config` entry in your keymap. Now whenever the `ACTION_SWAP_HANDS` command key is pressed the keyboard is mirrored. For instance, to type "Hello, World" on QWERTY you would type `^Ge^s^s^w^c W^wr^sd`
|
||||
|
||||
## Configuration
|
||||
|
||||
The configuration table is a simple 2-dimensional array to map from column/row to new column/row. Example `hand_swap_config` for Planck:
|
||||
|
||||
```C
|
||||
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
|
||||
{{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
|
||||
{{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
|
||||
{{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
|
||||
{{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}},
|
||||
};
|
||||
```
|
||||
|
||||
Note that the array indices are reversed same as the matrix and the values are of type `keypos_t` which is `{col, row}` and all values are zero-based. In the example above, `hand_swap_config[2][4]` (third row, fifth column) would return `{7, 2}` (third row, eighth column). Yes, this is confusing.
|
||||
|
||||
## Swap Keycodes
|
||||
|
||||
|Key |Description |
|
||||
|-----------|-------------------------------------------------------------------------|
|
||||
|`SH_T(key)`|Sends `key` with a tap; momentary swap when held. |
|
||||
|`SW_ON` |Turns on swapping and leaves it on. |
|
||||
|`SW_OFF` |Turn off swapping and leaves it off. Good for returning to a known state.|
|
||||
|`SW_MON` |Swaps hands when pressed, returns to normal when released (momentary). |
|
||||
|`SW_MOFF` |Momentarily turns off swap. |
|
||||
|`SH_TG` |Toggles swap on and off with every key press. |
|
||||
|`SH_TT` |Toggles with a tap; momentary when held. |
|
@ -1,250 +0,0 @@
|
||||
# Tap Dance: A Single Key Can Do 3, 5, or 100 Different Things
|
||||
|
||||
<!-- FIXME: Break this up into multiple sections -->
|
||||
|
||||
Hit the semicolon key once, send a semicolon. Hit it twice, rapidly -- send a colon. Hit it three times, and your keyboard's LEDs do a wild dance. That's just one example of what Tap Dance can do. It's one of the nicest community-contributed features in the firmware, conceived and created by [algernon](https://github.com/algernon) in [#451](https://github.com/qmk/qmk_firmware/pull/451). Here's how algernon describes the feature:
|
||||
|
||||
With this feature one can specify keys that behave differently, based on the amount of times they have been tapped, and when interrupted, they get handled before the interrupter.
|
||||
|
||||
To make it clear how this is different from `ACTION_FUNCTION_TAP`, lets explore a certain setup! We want one key to send `Space` on single tap, but `Enter` on double-tap.
|
||||
|
||||
With `ACTION_FUNCTION_TAP`, it is quite a rain-dance to set this up, and has the problem that when the sequence is interrupted, the interrupting key will be send first. Thus, `SPC a` will result in `a SPC` being sent, if they are typed within `TAPPING_TERM`. With the tap dance feature, that'll come out as `SPC a`, correctly.
|
||||
|
||||
The implementation hooks into two parts of the system, to achieve this: into `process_record_quantum()`, and the matrix scan. We need the latter to be able to time out a tap sequence even when a key is not being pressed, so `SPC` alone will time out and register after `TAPPING_TERM` time.
|
||||
|
||||
But lets start with how to use it, first!
|
||||
|
||||
First, you will need `TAP_DANCE_ENABLE=yes` in your `rules.mk`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()`, takes a number, which will later be used as an index into the `tap_dance_actions` array.
|
||||
|
||||
This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are three possible options:
|
||||
|
||||
* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. When the key is held, the appropriate keycode is registered: `kc1` when pressed and held, `kc2` when tapped once, then pressed and held.
|
||||
* `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the final tap count of the tap dance action.
|
||||
* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function on when the dance action finishes (like the previous option), and the last function when the tap dance action resets.
|
||||
|
||||
The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise.
|
||||
|
||||
And that's the bulk of it!
|
||||
|
||||
And now, on to the explanation of how it works!
|
||||
|
||||
The main entry point is `process_tap_dance()`, called from `process_record_quantum()`, which is run for every keypress, and our handler gets to run early. This function checks whether the key pressed is a tap-dance key. If it is not, and a tap-dance was in action, we handle that first, and enqueue the newly pressed key. If it is a tap-dance key, then we check if it is the same as the already active one (if there's one active, that is). If it is not, we fire off the old one first, then register the new one. If it was the same, we increment the counter and the timer.
|
||||
|
||||
This means that you have `TAPPING_TERM` time to tap the key again, you do not have to input all the taps within that timeframe. This allows for longer tap counts, with minimal impact on responsiveness.
|
||||
|
||||
Our next stop is `matrix_scan_tap_dance()`. This handles the timeout of tap-dance keys.
|
||||
|
||||
For the sake of flexibility, tap-dance actions can be either a pair of keycodes, or a user function. The latter allows one to handle higher tap counts, or do extra things, like blink the LEDs, fiddle with the backlighting, and so on. This is accomplished by using an union, and some clever macros.
|
||||
|
||||
# Examples
|
||||
|
||||
## Simple Example
|
||||
|
||||
Here's a simple example for a single definition:
|
||||
|
||||
1. In your `rules.mk`, add `TAP_DANCE_ENABLE = yes`
|
||||
2. In your `config.h` (which you can copy from `qmk_firmware/keyboards/planck/config.h` to your keymap directory), add `#define TAPPING_TERM 200`
|
||||
3. In your `keymap.c` file, define the variables and definitions, then add to your keymap:
|
||||
|
||||
```c
|
||||
//Tap Dance Declarations
|
||||
enum {
|
||||
TD_ESC_CAPS = 0
|
||||
};
|
||||
|
||||
//Tap Dance Definitions
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
//Tap once for Esc, twice for Caps Lock
|
||||
[TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS)
|
||||
// Other declarations would go here, separated by commas, if you have them
|
||||
};
|
||||
|
||||
//In Layer declaration, add tap dance item in place of a key code
|
||||
TD(TD_ESC_CAPS)
|
||||
```
|
||||
|
||||
## Complex Examples
|
||||
|
||||
This section details several complex tap dance examples.
|
||||
All the enums used in the examples are declared like this:
|
||||
|
||||
```c
|
||||
// Enums defined for all examples:
|
||||
enum {
|
||||
CT_SE = 0,
|
||||
CT_CLN,
|
||||
CT_EGG,
|
||||
CT_FLSH,
|
||||
X_TAP_DANCE
|
||||
};
|
||||
```
|
||||
### Example 1: Send `:` on Single Tap, `;` on Double Tap
|
||||
```c
|
||||
void dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 1) {
|
||||
register_code (KC_RSFT);
|
||||
register_code (KC_SCLN);
|
||||
} else {
|
||||
register_code (KC_SCLN);
|
||||
}
|
||||
}
|
||||
|
||||
void dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 1) {
|
||||
unregister_code (KC_RSFT);
|
||||
unregister_code (KC_SCLN);
|
||||
} else {
|
||||
unregister_code (KC_SCLN);
|
||||
}
|
||||
}
|
||||
|
||||
//All tap dance functions would go here. Only showing this one.
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset)
|
||||
};
|
||||
```
|
||||
### Example 2: Send "Safety Dance!" After 100 Taps
|
||||
```c
|
||||
void dance_egg (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 100) {
|
||||
SEND_STRING ("Safety dance!");
|
||||
reset_tap_dance (state);
|
||||
}
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg)
|
||||
};
|
||||
```
|
||||
|
||||
### Example 3: Turn LED Lights On Then Off, One at a Time
|
||||
|
||||
```c
|
||||
// on each tap, light up one led, from right to left
|
||||
// on the forth tap, turn them off from right to left
|
||||
void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (state->count) {
|
||||
case 1:
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
case 3:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 4:
|
||||
ergodox_right_led_3_off();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_2_off();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_1_off();
|
||||
}
|
||||
}
|
||||
|
||||
// on the fourth tap, set the keyboard on flash state
|
||||
void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 4) {
|
||||
reset_keyboard();
|
||||
reset_tap_dance(state);
|
||||
}
|
||||
}
|
||||
|
||||
// if the flash state didn't happen, then turn off LEDs, left to right
|
||||
void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
ergodox_right_led_1_off();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_2_off();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_3_off();
|
||||
}
|
||||
|
||||
//All tap dances now put together. Example 3 is "CT_FLASH"
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT)
|
||||
,[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset)
|
||||
,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg)
|
||||
,[CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED (dance_flsh_each, dance_flsh_finished, dance_flsh_reset)
|
||||
};
|
||||
```
|
||||
|
||||
### Example 4: 'Quad Function Tap-Dance'
|
||||
|
||||
By [DanielGGordon](https://github.com/danielggordon)
|
||||
|
||||
Allow one key to have 4 (or more) functions, depending on number of presses, and if the key is held or tapped.
|
||||
Below is a specific example:
|
||||
* Tap = Send `x`
|
||||
* Hold = Send `Control`
|
||||
* Double Tap = Send `Escape`
|
||||
* Double Tap and Hold = Send `Alt`
|
||||
|
||||
The following example can be easily expanded to more than 4 quite easily:
|
||||
```c
|
||||
//**************** Definitions needed for quad function to work *********************//
|
||||
//Enums used to clearly convey the state of the tap dance
|
||||
enum {
|
||||
SINGLE_TAP = 1,
|
||||
SINGLE_HOLD = 2,
|
||||
DOUBLE_TAP = 3,
|
||||
DOUBLE_HOLD = 4,
|
||||
DOUBLE_SINGLE_TAP = 5 //send SINGLE_TAP twice - NOT DOUBLE_TAP
|
||||
// Add more enums here if you want for triple, quadruple, etc.
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
bool is_press_action;
|
||||
int state;
|
||||
} tap;
|
||||
|
||||
int cur_dance (qk_tap_dance_state_t *state) {
|
||||
if (state->count == 1) {
|
||||
//If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP
|
||||
if (state->interrupted || state->pressed==0) return SINGLE_TAP;
|
||||
else return SINGLE_HOLD;
|
||||
}
|
||||
//If count = 2, and it has been interrupted - assume that user is trying to type the letter associated
|
||||
//with single tap. In example below, that means to send `xx` instead of `Escape`.
|
||||
else if (state->count == 2) {
|
||||
if (state->interrupted) return DOUBLE_SINGLE_TAP;
|
||||
else if (state->pressed) return DOUBLE_HOLD;
|
||||
else return DOUBLE_TAP;
|
||||
}
|
||||
else return 6; //magic number. At some point this method will expand to work for more presses
|
||||
}
|
||||
|
||||
//**************** Definitions needed for quad function to work *********************//
|
||||
|
||||
//instanalize an instance of 'tap' for the 'x' tap dance.
|
||||
static tap xtap_state = {
|
||||
.is_press_action = true,
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void x_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
xtap_state.state = cur_dance(state);
|
||||
switch (xtap_state.state) {
|
||||
case SINGLE_TAP: register_code(KC_X); break;
|
||||
case SINGLE_HOLD: register_code(KC_LCTRL); break;
|
||||
case DOUBLE_TAP: register_code(KC_ESC); break;
|
||||
case DOUBLE_HOLD: register_code(KC_LALT); break;
|
||||
case DOUBLE_SINGLE_TAP: register_code(KC_X); unregister_code(KC_X); register_code(KC_X);
|
||||
//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.
|
||||
}
|
||||
}
|
||||
|
||||
void x_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (xtap_state.state) {
|
||||
case SINGLE_TAP: unregister_code(KC_X); break;
|
||||
case SINGLE_HOLD: unregister_code(KC_LCTRL); break;
|
||||
case DOUBLE_TAP: unregister_code(KC_ESC); break;
|
||||
case DOUBLE_HOLD: unregister_code(KC_LALT);
|
||||
case DOUBLE_SINGLE_TAP: unregister_code(KC_X);
|
||||
}
|
||||
xtap_state.state = 0;
|
||||
}
|
||||
```
|
||||
And then simply add this to your list of tap dance functions:
|
||||
`[X_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished, x_reset)`
|
@ -1,54 +0,0 @@
|
||||
# Unicode Support
|
||||
|
||||
There are three Unicode keymap definition method available in QMK:
|
||||
|
||||
## UNICODE_ENABLE
|
||||
|
||||
Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in
|
||||
keymap file, where *n* is a 4 digit hexadecimal.
|
||||
|
||||
## UNICODEMAP_ENABLE
|
||||
|
||||
Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping
|
||||
table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file.
|
||||
The keycode function is `X(n)` where *n* is the array index of the mapping
|
||||
table.
|
||||
|
||||
## UCIS_ENABLE
|
||||
|
||||
TBD
|
||||
|
||||
Unicode input in QMK works by inputing a sequence of characters to the OS,
|
||||
sort of like macro. Unfortunately, each OS has different ideas on how Unicode is inputted.
|
||||
|
||||
This is the current list of Unicode input method in QMK:
|
||||
|
||||
* UC_OSX: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex.
|
||||
* UC_OSX_RALT: Same as UC_OSX, but sends the Right Alt key for unicode input
|
||||
* UC_LNX: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else.
|
||||
* UC_WIN: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead.
|
||||
* UC_WINC: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows.
|
||||
|
||||
# Additional Language Support
|
||||
|
||||
In `quantum/keymap_extras/`, you'll see various language files - these work the same way as the alternative layout ones do. Most are defined by their two letter country/language code followed by an underscore and a 4-letter abbreviation of its name. `FR_UGRV` which will result in a `ù` when using a software-implemented AZERTY layout. It's currently difficult to send such characters in just the firmware.
|
||||
|
||||
# International Characters on Windows
|
||||
|
||||
[AutoHotkey](https://autohotkey.com) allows Windows users to create custom hotkeys among others.
|
||||
|
||||
The method does not require Unicode support in the keyboard itself but depends instead of AutoHotkey running in the background.
|
||||
|
||||
First you need to select a modifier combination that is not in use by any of your programs.
|
||||
CtrlAltWin is not used very widely and should therefore be perfect for this.
|
||||
There is a macro defined for a mod-tab combo `LCAG_T`.
|
||||
Add this mod-tab combo to a key on your keyboard, e.g.: `LCAG_T(KC_TAB)`.
|
||||
This makes the key behave like a tab key if pressed and released immediately but changes it to the modifier if used with another key.
|
||||
|
||||
In the default script of AutoHotkey you can define custom hotkeys.
|
||||
|
||||
<^<!<#a::Send, ä
|
||||
<^<!<#<+a::Send, Ä
|
||||
|
||||
The hotkeys above are for the combination CtrlAltGui and CtrlAltGuiShift plus the letter a.
|
||||
AutoHotkey inserts the Text right of `Send, ` when this combination is pressed.
|
@ -1,125 +0,0 @@
|
||||
# Userspace: Sharing Code Between Keymaps
|
||||
|
||||
If you use more than one keyboard with a similar keymap, you might see the benefit in being able to share code between them. Create your own folder in `users/` named the same as your keymap (ideally your github username, `<name>`) with the following structure:
|
||||
|
||||
* `/users/<name>/` (added to the path automatically)
|
||||
* `readme.md` (optional, recommended)
|
||||
* `rules.mk` (included automatically)
|
||||
* `<name>.h` (optional)
|
||||
* `<name>.c` (optional)
|
||||
* `config.h` (optional)
|
||||
|
||||
`<name>.c` will need to be added to the SRC in `rules.mk` like this:
|
||||
|
||||
SRC += <name>.c
|
||||
|
||||
Additional files may be added in the same way - it's recommended you have one named `<name>`.c/.h though.
|
||||
|
||||
All this only happens when you build a keymap named `<name>`, like this:
|
||||
|
||||
make planck:<name>
|
||||
|
||||
For example,
|
||||
|
||||
make planck:jack
|
||||
|
||||
Will include the `/users/jack/` folder in the path, along with `/users/jack/rules.mk`.
|
||||
|
||||
Additionally, `config.h` here will be processed like the same file in your keymap folder. This is handled separately from the `<name>.h` file.
|
||||
|
||||
The reason for this, is that `<name>.h` won't be added in time to add settings (such as `#define TAPPING_TERM 100`), and including the `<name.h>` file in any `config.h` files will result in compile issues.
|
||||
|
||||
So you should use the `config.h` for QMK settings, and the `<name>.h` file for user or keymap specific settings.
|
||||
|
||||
## Readme
|
||||
|
||||
Please include authorship (your name, github username, email), and optionally [a license that's GPL compatible](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses).
|
||||
|
||||
## `Config.h`
|
||||
|
||||
If you do add a `config,h` file, you want to make sure that it only gets processed once. So you may want to start off with something like this:
|
||||
|
||||
```c
|
||||
#ifndef USERSPACE_CONFIG_H
|
||||
#define USERSPACE_CONFIG_H
|
||||
|
||||
// Put normal config.h settings here:
|
||||
|
||||
#endif // !USERSPACE_CONFIG_H
|
||||
```
|
||||
|
||||
You can use any option hre that you could use in your keymap's `config.h` file. You can find a list of vales [here](config_options.md).
|
||||
|
||||
## Example
|
||||
|
||||
For a brief example, checkout `/users/_example/` , or for a more detailed examples check out [`template.h`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.h) and [`template.c`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.c) in `/users/drashna/` .
|
||||
|
||||
### Consolidated Macros
|
||||
|
||||
If you wanted to consolidate macros and other functions into your userspace for all of your keymaps, you can do that. The issue is that you then cannot call any function defined in your userspace, or it gets complicated. To better handle this, you can call the functions here and create new functions to use in individual keymaps.
|
||||
|
||||
First, you'd want to go through all of your `keymap.c` files and replace `process_record_user` with `process_record_keymap` instead. This way, you can still use keyboard specific codes on those boards, and use your custom "global" keycodes as well. You'll also want to replace `SAFE_RANGE` with `NEW_SAFE_RANGE` so that you wont have any overlapping keycodes
|
||||
|
||||
Then add `#include <name.h>` to all of your keymap.c files. This allows you to use these new keycodes without having to redefine them in each keymap.
|
||||
|
||||
Once you've done that, you'll want to set the keycode definitions that you need to the `<name>.h` file. For instance:
|
||||
```
|
||||
#ifndef USERSPACE
|
||||
#define USERSPACE
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
// Define all of
|
||||
enum custom_keycodes {
|
||||
KC_MAKE = SAFE_RANGE,
|
||||
NEW_SAFE_RANGE //use "NEW_SAFE_RANGE" for keymap specific codes
|
||||
};
|
||||
|
||||
#endif
|
||||
```
|
||||
|
||||
Now you want to create the `<name>.c` file, and add this content to it:
|
||||
|
||||
```
|
||||
#include "<name>.h"
|
||||
#include "quantum.h"
|
||||
#include "action.h"
|
||||
#include "version.h"
|
||||
|
||||
__attribute__ ((weak))
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case KC_MAKE:
|
||||
if (!record->event.pressed) {
|
||||
SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
|
||||
#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
|
||||
":dfu "
|
||||
#elif defined(BOOTLOADER_HALFKAY)
|
||||
":teensy "
|
||||
#elif defined(BOOTLOADER_CATERINA)
|
||||
":avrdude "
|
||||
#endif
|
||||
SS_TAP(X_ENTER));
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return process_record_keymap(keycode, record);
|
||||
}
|
||||
```
|
||||
|
||||
This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make <keyboard>:<keymap">`, making frequent compiling easier. And this will work with any keyboard and any keymap as it will output the current boards info, so that you don't have to type this out every time.
|
||||
|
||||
Additionally, this should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems. AVRDUDE doesn't work on WSL, namely (and will dump the HEX in the ".build" folder instead).
|
||||
|
||||
## Override default userspace
|
||||
|
||||
By default the userspace used will be the same as the keymap name. In some situations this isn't desirable. For instance, if you use the [layout](feature_layouts.md) feature you can't use the same name for different keymaps (e.g. ANSI and ISO). You can name your layouts `mylayout-ansi` and `mylayout-iso` and add the following line to your layout's `rules.mk`:
|
||||
|
||||
```
|
||||
USER_NAME := mylayout
|
||||
```
|
@ -1,26 +1,105 @@
|
||||
# QMK Features
|
||||
|
||||
QMK has a staggering number of features for building your keyboard. It can take some time to understand all of them and determine which one will achieve your goal.
|
||||
|
||||
|
||||
* [Advanced Keycodes](feature_advanced_keycodes.md) - Change layers, type shifted keys, and more. Go beyond typing simple characters.
|
||||
* [Audio](feature_audio.md) - Connect a speaker to your keyboard for audio feedback, midi support, and music mode.
|
||||
* [Auto Shift](feature_auto_shift.md) - Tap for the normal key, hold slightly longer for its shifted state.
|
||||
* [Backlight](feature_backlight.md) - LED lighting support for your keyboard.
|
||||
* [Bootmagic](feature_bootmagic.md) - Adjust the behavior of your keyboard using hotkeys.
|
||||
* [Dynamic Macros](feature_dynamic_macros.md) - Record and playback macros from the keyboard itself.
|
||||
* [Key Lock](feature_key_lock.md) - Lock a key in the "down" state.
|
||||
* [Layouts](feature_layouts.md) - Use one keymap with any keyboard that supports your layout.
|
||||
* [Leader Key](feature_leader_key.md) - Tap the leader key followed by a sequence to trigger custom behavior.
|
||||
* [Macros](feature_macros.md) - Send multiple key presses when pressing only one physical key.
|
||||
* [Mouse keys](feature_mouse_keys.md) - Control your mouse pointer from your keyboard.
|
||||
* [Pointing Device](feature_pointing_device.md) - Framework for connecting your custom pointing device to your keyboard.
|
||||
* [PS2 Mouse](feature_ps2_mouse.md) - Driver for connecting a PS/2 mouse directly to your keyboard.
|
||||
* [RGB Light](feature_rgblight.md) - RGB lighting for your keyboard.
|
||||
* [Space Cadet](feature_space_cadet.md) - Use your left/right shift keys to type parenthesis and brackets.
|
||||
* [Stenography](feature_stenography.md) - Put your keyboard into Plover mode for stenography use.
|
||||
* [Tap Dance](feature_tap_dance.md) - Make a single key do as many things as you want.
|
||||
* [Terminal](feature_terminal.md) - CLI interface to the internals of your keyboard.
|
||||
* [Thermal Printer](feature_thermal_printer.md) - Connect a thermal printer to your keyboard to be able to toggle on a printed log of everything you type.
|
||||
* [Unicode](feature_unicode.md) - Unicode input support.
|
||||
* [Userspace](feature_userspace.md) - Share code between different keymaps and keyboards.
|
||||
|
||||
## Space Cadet Shift: The future, built in
|
||||
|
||||
Steve Losh [described](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) the Space Cadet Shift quite well. Essentially, you hit the left Shift on its own, and you get an opening parenthesis; hit the right Shift on its own, and you get the closing one. When hit with other keys, the Shift key keeps working as it always does. Yes, it's as cool as it sounds. Head on over to the [Space Cadet Shift](space_cadet_shift.md) page to read about it.
|
||||
|
||||
## The Leader key: A new kind of modifier
|
||||
|
||||
Most modifiers have to be held or toggled. But what if you had a key that indicated the start of a sequence? You could press that key and then rapidly press 1-3 more keys to trigger a macro, or enter a special layer, or anything else you might want to do. To learn more about it check out the [Leader Key](feature_leader_key.md) page.
|
||||
|
||||
## Tap Dance: A single key can do 3, 5, or 100 different things
|
||||
|
||||
Hit the semicolon key once, send a semicolon. Hit it twice, rapidly -- send a colon. Hit it three times, and your keyboard's LEDs do a wild dance. That's just one example of what Tap Dance can do. Read more about it on the [Tap Dance](tap_dance.md) page.
|
||||
|
||||
## Temporarily setting the default layer
|
||||
|
||||
`DF(layer)` - sets default layer to _layer_. The default layer is the one at the "bottom" of the layer stack - the ultimate fallback layer. This currently does not persist over power loss. When you plug the keyboard back in, layer 0 will always be the default. It is theoretically possible to work around that, but that's not what `DF` does.
|
||||
|
||||
## Macro shortcuts: Send a whole string when pressing just one key
|
||||
|
||||
How would you like a single keypress to send a whole word, sentence, paragraph, or even document? Head on over to the [Macros](macros.md) page to read up on all aspects of Simple and Dynamic Macros.
|
||||
|
||||
## Additional keycode aliases for software-implemented layouts \(Colemak, Dvorak, etc\)
|
||||
|
||||
Everything is assuming you're in Qwerty \(in software\) by default, but there is built-in support for using a Colemak or Dvorak layout by including this at the top of your keymap:
|
||||
|
||||
```
|
||||
#include <keymap_colemak.h>
|
||||
```
|
||||
|
||||
If you use Dvorak, use `keymap_dvorak.h` instead of `keymap_colemak.h` for this line. After including this line, you will get access to:
|
||||
|
||||
* `CM_*` for all of the Colemak-equivalent characters
|
||||
* `DV_*` for all of the Dvorak-equivalent characters
|
||||
|
||||
These implementations assume you're using Colemak or Dvorak on your OS, not on your keyboard - this is referred to as a software-implemented layout. If your computer is in Qwerty and your keymap is in Colemak or Dvorak, this is referred to as a firmware-implemented layout, and you won't need these features.
|
||||
|
||||
To give an example, if you're using software-implemented Colemak, and want to get an `F`, you would use `CM_F`. Using `KC_F` under these same circumstances would result in `T`.
|
||||
|
||||
## Backlight Breathing
|
||||
|
||||
In order to enable backlight breathing, the following line must be added to your config.h file.
|
||||
|
||||
```
|
||||
#define BACKLIGHT_BREATHING
|
||||
```
|
||||
|
||||
The following function calls are used to control the breathing effect.
|
||||
|
||||
* `breathing_enable()` - Enable the free-running breathing effect.
|
||||
* `breathing_disable()` - Disable the free-running breathing effect immediately.
|
||||
* `breathing_self_disable()` - Disable the free-running breathing effect after the current effect ends.
|
||||
* `breathing_toggle()` - Toggle the free-running breathing effect.
|
||||
* `breathing_defaults()` - Reset the speed and brightness settings of the breathing effect.
|
||||
|
||||
The following function calls are used to control the maximum brightness of the breathing effect.
|
||||
|
||||
* `breathing_intensity_set(value)` - Set the brightness of the breathing effect when it is at its max value.
|
||||
* `breathing_intensity_default()` - Reset the brightness of the breathing effect to the default value based on the current backlight intensity.
|
||||
|
||||
The following function calls are used to control the cycling speed of the breathing effect.
|
||||
|
||||
* `breathing_speed_set(value)` - Set the speed of the breathing effect - how fast it cycles.
|
||||
* `breathing_speed_inc(value)` - Increase the speed of the breathing effect by a fixed value.
|
||||
* `breathing_speed_dec(value)` - Decrease the speed of the breathing effect by a fixed value.
|
||||
* `breathing_speed_default()` - Reset the speed of the breathing effect to the default value.
|
||||
|
||||
The following example shows how to enable the backlight breathing effect when the FUNCTION layer macro button is pressed:
|
||||
|
||||
```
|
||||
case MACRO_FUNCTION:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
breathing_speed_set(3);
|
||||
breathing_enable();
|
||||
layer_on(LAYER_FUNCTION);
|
||||
}
|
||||
else
|
||||
{
|
||||
breathing_speed_set(1);
|
||||
breathing_self_disable();
|
||||
layer_off(LAYER_FUNCTION);
|
||||
}
|
||||
break;
|
||||
```
|
||||
|
||||
The following example shows how to pulse the backlight on-off-on when the RAISED layer macro button is pressed:
|
||||
|
||||
```
|
||||
case MACRO_RAISED:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
layer_on(LAYER_RAISED);
|
||||
breathing_speed_set(2);
|
||||
breathing_pulse();
|
||||
update_tri_layer(LAYER_LOWER, LAYER_RAISED, LAYER_ADJUST);
|
||||
}
|
||||
else
|
||||
{
|
||||
layer_off(LAYER_RAISED);
|
||||
update_tri_layer(LAYER_LOWER, LAYER_RAISED, LAYER_ADJUST);
|
||||
}
|
||||
break;
|
||||
```
|
@ -1,104 +0,0 @@
|
||||
# Flashing Instructions and Bootloader Information
|
||||
|
||||
There are quite a few different types of bootloaders that keyboards use, and just about all of the use a different flashing method. Luckily, projects like the [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) aim to be compatible with all the different types without having to think about it much, but this article will describe the different types of bootloaders, and available methods for flashing them.
|
||||
|
||||
If you have a bootloader selected with the `BOOTLOADER` variable in your `rules.mk`, QMK will automatically calculate if your .hex file is the right size to be flashed to the device, and output the total size it bytes (along with the max). To run this process manually, compile with the target `check-size`, eg `make planck/rev4:default:check-size`.
|
||||
|
||||
## DFU
|
||||
|
||||
Atmel's DFU bootloader comes on all atmega32u4 chips by default, and is used by many keyboards that have their own ICs on their PCBs (Older OLKB boards, Clueboards). Some keyboards may also use LUFA's DFU bootloader (or QMK's fork) (Newer OLKB boards) that adds in additional features specific to that hardware.
|
||||
|
||||
To ensure compatibility with the DFU bootloader, make sure this block is present your `rules.mk` (optionally with `lufa-dfu` or `qmk-dfu` instead):
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = atmel-dfu
|
||||
|
||||
Compatible flashers:
|
||||
|
||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (recommended GUI)
|
||||
* [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer) / `:dfu` in QMK (recommended command line)
|
||||
* [Atmel's Flip](http://www.microchip.com/developmenttools/productdetails.aspx?partno=flip) (not recommended)
|
||||
|
||||
Flashing sequence:
|
||||
|
||||
1. Press the `RESET` keycode, or tap the RESET button (or short RST to GND).
|
||||
2. Wait for the OS to detect the device
|
||||
3. Erase the memory (may be done automatically)
|
||||
4. Flash a .hex file
|
||||
5. Reset the device into application mode (may be done automatically)
|
||||
|
||||
or:
|
||||
|
||||
make <keyboard>:<keymap>:dfu
|
||||
|
||||
### QMK DFU
|
||||
|
||||
QMK has a fork of the LUFA DFU bootloader that allows for a simple matrix scan for exiting the bootloader and returning to the application, as well as flashing an LED/making a ticking noise with a speaker when things are happening. To enable these features, use this block in your `config.h` (The key that exits the bootloader needs to be hooked-up to the INPUT and OUTPUT defined here):
|
||||
|
||||
#define QMK_ESC_OUTPUT F1 // usually COL
|
||||
#define QMK_ESC_INPUT D5 // usually ROW
|
||||
#define QMK_LED E6
|
||||
#define QMK_SPEAKER C6
|
||||
|
||||
The Manufacturer and Product names are automatically pulled from your `config.h`, and "Bootloader" is added to the product.
|
||||
|
||||
To generate this bootloader, use the `bootloader` target, eg `make planck/rev4:default:bootloader`.
|
||||
|
||||
To generate a production-ready .hex file (containing the application and the bootloader), use the `production` target, eg `make planck/rev4:default:production`.
|
||||
|
||||
## Caterina
|
||||
|
||||
Arduino boards and their clones use the [Caterina bootloader](https://github.com/arduino/Arduino/tree/master/hardware/arduino/avr/bootloaders/caterina) (any keyboard built with a Pro Micro, or clone), and uses the avr109 protocol to communicate through virtual serial. Bootloaders like [A-Star](https://www.pololu.com/docs/0J61/9) are based on Caterina.
|
||||
|
||||
To ensure compatibility with the Caterina bootloader, make sure this block is present your `rules.mk`:
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
Compatible flashers:
|
||||
|
||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (recommended GUI)
|
||||
* [avrdude](http://www.nongnu.org/avrdude/) with avr109 / `:avrdude` (recommended command line)
|
||||
* [AVRDUDESS](https://github.com/zkemble/AVRDUDESS)
|
||||
|
||||
Flashing sequence:
|
||||
|
||||
1. Press the `RESET` keycode, or short RST to GND quickly (you only have 7 seconds to flash once it enters)
|
||||
2. Wait for the OS to detect the device
|
||||
4. Flash a .hex file
|
||||
5. Wait for the device to reset automatically
|
||||
|
||||
or
|
||||
|
||||
make <keyboard>:<keymap>:avrdude
|
||||
|
||||
## Halfkay
|
||||
|
||||
Halfkay is a super-slim protocol developed by PJRC that uses HID, and come on all Teensys (namely the 2.0).
|
||||
|
||||
To ensure compatibility with the Halfkay bootloader, make sure this block is present your `rules.mk`:
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = halfkay
|
||||
|
||||
Compatible flashers:
|
||||
|
||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (recommended GUI)
|
||||
* [Teensy Loader](https://www.pjrc.com/teensy/loader.html)
|
||||
* [Teensy Loader Command Line](https://www.pjrc.com/teensy/loader_cli.html) (recommended command line)
|
||||
|
||||
Flashing sequence:
|
||||
|
||||
1. Press the `RESET` keycode, or short RST to GND quickly (you only have 7 seconds to flash once it enters)
|
||||
2. Wait for the OS to detect the device
|
||||
4. Flash a .hex file
|
||||
5. Reset the device into application mode (may be done automatically)
|
@ -1,21 +0,0 @@
|
||||
# Getting Help
|
||||
|
||||
There are a lot of resources for getting help with QMK.
|
||||
|
||||
## Realtime Chat
|
||||
|
||||
You can find QMK developers and users on our main [gitter chat room](https://gitter.im/qmk/qmk_firmware). We also have other rooms for more specific discussion:
|
||||
|
||||
* [Main Firmware Chat](https://gitter.im/qmk/qmk_firmware)
|
||||
* [QMK Toolbox](https://gitter.im/qmk/qmk_toolbox)
|
||||
* [Hardware Design Discussion](https://gitter.im/qmk/qmk_hardware)
|
||||
* [Web Configurator](https://gitter.im/qmk/qmk_configurator)
|
||||
* [Compiler API](https://gitter.im/qmk/qmk_compiler_api)
|
||||
|
||||
## OLKB Subreddit
|
||||
|
||||
The official QMK forum is [/r/olkb](https://reddit.com/r/olkb) on [reddit.com](https://reddit.com).
|
||||
|
||||
## Github Issues
|
||||
|
||||
You can open an [issue on GitHub](https://github.com/qmk/qmk_firmware/issues). This is especially handy when your issue will require long-term discussion or debugging.
|
@ -0,0 +1,47 @@
|
||||
# Introduction
|
||||
|
||||
This page attempts to explain the basic information you need to know to work with the QMK project. It assumes that you are familiar with navigating a UNIX shell, but does not assume you are familiar with C or with compiling using make.
|
||||
|
||||
## Basic QMK structure
|
||||
|
||||
QMK is a fork of @tmk's [tmk_keyboard](https://github.com/tmk/tmk_keyboard) project. The original TMK code, with modifications, can be found in the `tmk` folder. The QMK additions to the project may be found in the `quantum` folder. Keyboard projects may be found in the `handwired` and `keyboard` folders.
|
||||
|
||||
### Keyboard project structure
|
||||
|
||||
Within the `handwired` and `keyboard` folders is a directory for each keyboard project, for example `qmk_firmware/keyboards/clueboard`. Within you'll find the following structure:
|
||||
|
||||
* `keymaps/`: Different keymaps that can be built
|
||||
* `rules.mk`: The file that sets the default "make" options. Do not edit this file directly, instead use a keymap specific `Makefile`.
|
||||
* `config.h`: The file that sets the default compile time options. Do not edit this file directly, instead use a keymap specific `config.h`.
|
||||
|
||||
### Keymap structure
|
||||
|
||||
In every keymap folder, the following files may be found. Only `keymap.c` is required, if the rest of the files are not found the default options will be chosen.
|
||||
|
||||
* `config.h`: the options to configure your keymap
|
||||
* `keymap.c`: all of your keymap code, required
|
||||
* `rules.mk`: the features of QMK that are enabled
|
||||
* `readme.md`: a description of your keymap, how others might use it, and explanations of features. Please upload images to a service like imgur.
|
||||
|
||||
# The `config.h` file
|
||||
|
||||
There are 2 `config.h` locations:
|
||||
|
||||
* keyboard (`/keyboards/<keyboard>/config.h`)
|
||||
* keymap (`/keyboards/<keyboard>/keymaps/<keymap>/config.h`)
|
||||
|
||||
If the keymap `config.h` exists that file is included by the build system and the keyboard `config.h` is not included. If you wish to override settings in your keymap's `config.h` you will need to include some glue code:
|
||||
|
||||
```
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
```
|
||||
|
||||
If you want to override a setting from the parent `config.h` file, you need to `#undef` and then `#define` the setting again, like this:
|
||||
|
||||
```c
|
||||
#undef MY_SETTING
|
||||
#define MY_SETTING 4
|
||||
```
|
@ -1,47 +0,0 @@
|
||||
# Introduction
|
||||
|
||||
This page attempts to explain the basic information you need to know to work with the QMK project. It assumes that you are familiar with navigating a Unix shell, but does not assume you are familiar with C or with compiling using make.
|
||||
|
||||
## Basic QMK Structure
|
||||
|
||||
QMK is a fork of [Jun Wako](https://github.com/tmk)'s [tmk_keyboard](https://github.com/tmk/tmk_keyboard) project. The original TMK code, with modifications, can be found in the `tmk` folder. The QMK additions to the project may be found in the `quantum` folder. Keyboard projects may be found in the `handwired` and `keyboard` folders.
|
||||
|
||||
### Keyboard Project Structure
|
||||
|
||||
Within the folder `keyboards` and its subfolder `handwired` is a directory for each keyboard project, for example `qmk_firmware/keyboards/clueboard`. Within it you'll find the following structure:
|
||||
|
||||
* `keymaps/`: Different keymaps that can be built
|
||||
* `rules.mk`: The file that sets the default "make" options. Do not edit this file directly, instead use a keymap specific `Makefile`
|
||||
* `config.h`: The file that sets the default compile time options. Do not edit this file directly, instead use a keymap specific `config.h`.
|
||||
|
||||
### Keymap Structure
|
||||
|
||||
In every keymap folder, the following files may be found. Only `keymap.c` is required, and if the rest of the files are not found the default options will be chosen.
|
||||
|
||||
* `config.h`: the options to configure your keymap
|
||||
* `keymap.c`: all of your keymap code, required
|
||||
* `rules.mk`: the features of QMK that are enabled
|
||||
* `readme.md`: a description of your keymap, how others might use it, and explanations of features. Please upload images to a service like imgur.
|
||||
|
||||
# The `config.h` File
|
||||
|
||||
There are 2 `config.h` locations:
|
||||
|
||||
* keyboard (`/keyboards/<keyboard>/config.h`)
|
||||
* keymap (`/keyboards/<keyboard>/keymaps/<keymap>/config.h`)
|
||||
|
||||
If the keymap `config.h` exists, that file is included by the build system and the keyboard `config.h` is not included. If you wish to override settings in your keymap's `config.h` you will need to include some glue code:
|
||||
|
||||
```
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
```
|
||||
|
||||
If you want to override a setting from the parent `config.h` file, you need to `#undef` and then `#define` the setting again, like this:
|
||||
|
||||
```c
|
||||
#undef MY_SETTING
|
||||
#define MY_SETTING 4
|
||||
```
|
@ -0,0 +1,170 @@
|
||||
# Glossary of QMK terms
|
||||
|
||||
## ARM
|
||||
A line of 32-bit MCU's produced by a number of companies, such as Atmel, Cypress, Kinetis, NXP, ST, and TI.
|
||||
|
||||
## AVR
|
||||
A line of 8-bit MCU's produced by [Atmel](http://atmel.com). AVR was the original platform that TMK supported.
|
||||
|
||||
## AZERTY
|
||||
The standard Français (French) keyboard layout. Named for the first 6 keys on the keyboard.
|
||||
|
||||
## Backlight
|
||||
A generic term for lighting on a keyboard. The backlight is typically, but not always, an array of LED's that shine through keycaps and/or switches.
|
||||
|
||||
## Bluetooth
|
||||
A short range peer to peer wireless protocol. Most common wireless protocol for a keyboard.
|
||||
|
||||
## Bootloader
|
||||
A special program that is written to a protected area of your MCU that allows the MCU to upgrade its own firmware, typically over USB.
|
||||
|
||||
## Bootmagic
|
||||
A feature that allows for various keyboard behavior changes to happen on the fly, such as swapping or disabling common keys.
|
||||
|
||||
## C
|
||||
A low-level programming language suitable for system code. Most QMK code is written in C.
|
||||
|
||||
## Colemak
|
||||
An alternative keyboard layout that is gaining in popularity.
|
||||
|
||||
## Compile
|
||||
The process of turning human readable code into machine code your MCU can run.
|
||||
|
||||
## Dvorak
|
||||
An alternative keyboard layout developed by Dr. August Dvorak in the 1930's. A shortened form of the Dvorak Simplified Keyboard.
|
||||
|
||||
## Dynamic Macro
|
||||
A macro which has been recorded on the keyboard and which will be lost when the keyboard is unplugged or the computer rebooted.
|
||||
|
||||
* [Dynamic Macro Documentation](dynamic_macros.html)
|
||||
|
||||
## Eclipse
|
||||
An IDE that is popular with many C developers.
|
||||
|
||||
* [Eclipse Setup Instructions](eclipse.html)
|
||||
|
||||
## Firmware
|
||||
The software that controls your MCU.
|
||||
|
||||
## FLIP
|
||||
Software provided by Atmel for flashing AVR devices. We generally recommend [QMK Flasher](https://github.com/qmk/qmk_flasher) instead, but for some advanced use cases FLIP is required.
|
||||
|
||||
## git
|
||||
Versioning software used at the commandline
|
||||
|
||||
## GitHub
|
||||
The website that hosts most of the QMK project. It provides integration with git, issue tracking, and other features that help us run QMK.
|
||||
|
||||
## ISP
|
||||
In-system programming, a method of programming an AVR chip using external hardware and the JTAG pins.
|
||||
|
||||
## hid_listen
|
||||
An interface for receiving debugging messages from your keyboard. You can view these messages using [QMK Flasher](https://github.com/qmk/qmk_flasher) or [PJRC's hid_listen](https://www.pjrc.com/teensy/hid_listen.html)
|
||||
|
||||
## Keycode
|
||||
A 2-byte number that represents a particular key. `0x00`-`0xFF` are used for [Basic Keycodes](keycodes_basic.html) while `0x100`-`0xFFFF` are used for [Quantum Keycodes](quantum_keycodes.html).
|
||||
|
||||
## Key Down
|
||||
An event that happens when a key is pressed down, but is completed before a key is released.
|
||||
|
||||
## Key Up
|
||||
An event that happens when a key is released.
|
||||
|
||||
## Keymap
|
||||
An array of keycodes mapped to a physical keyboard layout, which are processed on key presses and releases
|
||||
|
||||
## Layer
|
||||
An abstraction used to allow a key to serve multiple purposes. The highest active layer takes precedence.
|
||||
|
||||
## Leader Key
|
||||
A feature that allows you to tap the leader key followed by a sequence of 1, 2, or 3 keys to activate key presses or other quantum features.
|
||||
|
||||
* [Leader Key Documentation](feature_leader_key.html)
|
||||
|
||||
## LED
|
||||
Light Emitting Diode, the most common device used for indicators on a keyboard.
|
||||
|
||||
## Make
|
||||
Software package that is used to compile all the source files. You run `make` with various options to compile your keyboard firmware.
|
||||
|
||||
## Matrix
|
||||
A wiring pattern of columns and rows that enables the MCU to detect keypresses with a fewer number of pins. The matrix often incorporates diodes to allow for NKRO.
|
||||
|
||||
## Macro
|
||||
A feature that lets you send muiltple keypress events (hid reports) after having pressed only a single key.
|
||||
|
||||
* [Macro Documentation](macros.html)
|
||||
|
||||
## MCU
|
||||
Microcontrol Unit, the processor that powers your keyboard.
|
||||
|
||||
## Modifier
|
||||
A key that is held down while typing another key to modify the action of that key. Examples include Ctrl, Alt, and Shift.
|
||||
|
||||
## Mousekeys
|
||||
A feature that lets you control your mouse cursor and click from your keyboard.
|
||||
|
||||
* [Mousekeys Documentation](mouse_keys.html)
|
||||
|
||||
## N-Key Rollover (NKRO)
|
||||
A term that applies to keyboards that are capable of reporting any number of key-presses at once.
|
||||
|
||||
## Oneshot Modifier
|
||||
A modifier that acts as if it is held down until another key is released, so you can press the mod and then press the key, rather than holding the mod while pressing the key.
|
||||
|
||||
## ProMicro
|
||||
A low cost AVR development board. Clones of this device are often found on ebay very inexpensively (under $5) but people often struggle with flashing their pro micros.
|
||||
|
||||
## Pull Request
|
||||
A request to submit code to QMK. We encourage all users to submit Pull Requests for their personal keymaps.
|
||||
|
||||
## QWERTY
|
||||
The standard English keyboard layout, and often a shortcut for other language's standard layouts. Named for the first 6 letters on the keyboard.
|
||||
|
||||
## QWERTZ
|
||||
The standard Deutsche (German) keyboard layout. Named for the first 6 letters on the keyboard.
|
||||
|
||||
## Rollover
|
||||
The term for pressing a key while a key is already held down. Variants include 2KRO, 6KRO, and NKRO.
|
||||
|
||||
## Scancode
|
||||
A 1 byte number that is sent as part of a HID report over USB that represents a single key. These numbers are documented in the [HID Usage Tables](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) published by the [USB-IF](http://www.usb.org/).
|
||||
|
||||
## Space Cadet Shift
|
||||
A special set of shift keys which allow you to type various types of braces by tapping the left or right shift one or more times.
|
||||
|
||||
* [Space Cadet Shift Documentation](space_cadet_shift.html)
|
||||
|
||||
## Tap
|
||||
Pressing and releasing a key. In some situations you will need to distinguish between a key down and a key up event, and Tap always refers to both at once.
|
||||
|
||||
## Tap Dance
|
||||
A feature that lets you assign muiltple keycodes to the same key based on how many times you press it.
|
||||
|
||||
* [Tap Dance Documentation](tap_dance.md)
|
||||
|
||||
## Teensy
|
||||
A low-cost AVR development board that is commonly used for hand-wired builds. A teensy is often chosen despite costing a few dollors more due to its halfkay bootloader, which makes flashing very simple.
|
||||
|
||||
## Underlight
|
||||
A generic term for LEDs that light the underside of the board. These LED's typically shine away from the bottom of the PCB and towards the surface the keyboard rests on.
|
||||
|
||||
## Unicode
|
||||
In the larger computer world Unicode is a set of encoding schemes for representing characters in any language. As it relates to QMK it means using various OS schemes to send unicode codepoints instead of scancodes.
|
||||
|
||||
* [Unicode Documentation](unicode.md)
|
||||
|
||||
## Unit Testing
|
||||
A framework for running automated tests against QMK. Unit testing helps us be confident that our changes do not break anything.
|
||||
|
||||
* [Unit Testing Documentation](unit_testing.md)
|
||||
|
||||
## USB
|
||||
Universal Serial Bus, the most common wired interface for a keyboard.
|
||||
|
||||
## USB Host (or simply Host)
|
||||
The USB Host is your computer, or whatever device your keyboard is plugged into.
|
||||
|
||||
# Couldn't find the term you're looking for?
|
||||
|
||||
[Open an issue](https://github.com/qmk/qmk_firmware/issues) with your question and the term in question could be added here. Better still, open a pull request with the definition. :)
|
@ -1,8 +0,0 @@
|
||||
# Hardware
|
||||
|
||||
QMK runs on a variety of hardware. If your processor can be targeted by [LUFA](http://www.fourwalledcubicle.com/LUFA.php) or [ChibiOS](http://www.chibios.com) you can probably get QMK running on it. This section explores getting QMK running on, and communicating with, hardware of all kinds.
|
||||
|
||||
* [Keyboard Guidelines](hardware_keyboard_guidelines.md)
|
||||
* [AVR Processors](hardware_avr.md)
|
||||
* ARM Processors (TBD)
|
||||
* [Drivers](hardware_drivers.md)
|
@ -1,157 +0,0 @@
|
||||
# Keyboards with AVR Processors
|
||||
|
||||
This page describes the support for for AVR processors in QMK. AVR processors include the atmega32u4, atmega32u2, at90usb1286, and other processors from Atmel Corporation. AVR processors are 8-bit MCU's that are designed to be easy to work with. The most common AVR processors in keyboards have on-board USB and plenty of GPIO for supporting large keyboard matrices. They are the most popular MCU for use in keyboards today.
|
||||
|
||||
If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_guidelines.md) to get a sense of how keyboards fit into QMK.
|
||||
|
||||
## Adding Your AVR Keyboard to QMK
|
||||
|
||||
QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started run the `util/new_project.sh` script:
|
||||
|
||||
```
|
||||
$ util/new_project.sh my_awesome_keyboard
|
||||
######################################################
|
||||
# /keyboards/my_awesome_keyboard project created. To start
|
||||
# working on things, cd into keyboards/my_awesome_keyboard
|
||||
######################################################
|
||||
```
|
||||
|
||||
This will create all the files needed to support your new keyboard, and populate the settings with default values. Now you just need to customize it for your keyboard.
|
||||
|
||||
## `readme.md`
|
||||
|
||||
This is where you'll describe your keyboard. Please follow the [Keyboard Readme Template](documentation_templates.md#keyboard-readmemd-template) when writing your `readme.md`. You're encouraged to place an image at the top of your `readme.md`, please use an external service such as [Imgur](http://imgur.com) to host the images.
|
||||
|
||||
## `<keyboard>.c`
|
||||
|
||||
This is where all the custom logic for your keyboard goes. Many keyboards do not need to put anything at all in here. You can learn more about writing custom logic in [Custom Quantum Functions](custom_quantum_functions.md).
|
||||
|
||||
## `<keyboard>.h`
|
||||
|
||||
This is the file you define your [Layout Macro(s)](feature_layouts.md) in. At minimum you should have a `#define LAYOUT` for your keyboard that looks something like this:
|
||||
|
||||
```
|
||||
#define LAYOUT( \
|
||||
k00, k01, k02, \
|
||||
k10, k11 \
|
||||
) { \
|
||||
{ k00, k01, k02 }, \
|
||||
{ k10, KC_NO, k11 }, \
|
||||
}
|
||||
```
|
||||
|
||||
The first half of the `LAYOUT` pre-processor macro defines the physical arrangement of keys. The second half of the macro defines the matrix the switches are connected to. This allows you to have a physical arrangement of keys that differs from the wiring matrix.
|
||||
|
||||
Each of the `k__` variables needs to be unique, and typically they follow the format `k<row><col>`.
|
||||
|
||||
The physical matrix (the second half) must have a number of rows equaling `MATRIX_ROWS`, and each row must have exactly `MATRIX_COLS` elements in it. If you do not have this many physical keys you can use `KC_NO` to fill in the blank spots.
|
||||
|
||||
## `config.h`
|
||||
|
||||
The `config.h` file is where you configure the hardware and feature set for your keyboard. There are a lot of options that can be placed in that file, too many to list there. For a complete overview of available options see the [Config Options](config_options.md) page.
|
||||
|
||||
### Hardware Configuration
|
||||
|
||||
|
||||
At the top of the `config.h` you'll find USB related settings. These control how your keyboard appears to the Operating System. If you don't have a good reason to change you should leave the `VENDOR_ID` as `0xFEED`. For the `PRODUCT_ID` you should pick a number that is not yet in use.
|
||||
|
||||
Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately reflect your keyboard.
|
||||
|
||||
```
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER You
|
||||
#define PRODUCT my_awesome_keyboard
|
||||
#define DESCRIPTION A custom keyboard
|
||||
```
|
||||
|
||||
{% hint style='info' %}
|
||||
Note: On Windows and macOS the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` fields will be displayed in the list of USB devices. On Linux these values will not be visible in `lsusb`, since Linux takes that information from the list published by the USB-IF.
|
||||
{% endhint %}
|
||||
|
||||
### Keyboard Matrix Configuration
|
||||
|
||||
The next section of the `config.h` file deals with your keyboard's matrix. The first thing you should set is the matrix's size. This is usually, but not always, the same number of rows and columns as the physical key arrangement.
|
||||
|
||||
```
|
||||
#define MATRIX_ROWS 2
|
||||
#define MATRIX_COLS 3
|
||||
```
|
||||
|
||||
Once you've defined the size of your matrix you need to define which pins on your MCU are connected to rows and columns. To do so simply specify the names of those pins:
|
||||
|
||||
```
|
||||
#define MATRIX_ROW_PINS { D0, D5 }
|
||||
#define MATRIX_COL_PINS { F1, F0, B0 }
|
||||
#define UNUSED_PINS
|
||||
```
|
||||
|
||||
The number of `MATRIX_ROW_PINS` entries must be the same as the number you assigned to `MATRIX_ROWS`, and likewise for `MATRIX_COL_PINS` and `MATRIX_COLS`. You do not have to specify `UNUSED_PINS`, but you can if you want to document what pins are open.
|
||||
|
||||
Finally, you can specify the direction your diodes point. This can be `COL2ROW`, `ROW2COL`, or `CUSTOM_MATRIX`.
|
||||
|
||||
```
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
```
|
||||
|
||||
### Backlight Configuration
|
||||
|
||||
By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are using one of those you can simply enable it here. For more details see the [Backlight Documentation](feature_backlight.md).
|
||||
|
||||
```
|
||||
#define BACKLIGHT_PIN B7
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
#define BACKLIGHT_BREATHING
|
||||
#define BREATHING_PERIOD 6
|
||||
```
|
||||
|
||||
{% hint style='info' %}
|
||||
You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details.
|
||||
{% endhint %}
|
||||
|
||||
### Other Configuration Options
|
||||
|
||||
There are a lot of features that can be configured or tuned in `config.h`. You should see the [Config Options](config_options.md) page for more details.
|
||||
|
||||
## `rules.mk`
|
||||
|
||||
You use the `rules.mk` file to tell QMK what files to build and what features to enable. If you are building around an atmega32u4 you can largely leave these defaults alone. If you are using another MCU you may have to tweak some parameters.
|
||||
|
||||
### MCU Options
|
||||
|
||||
These options tell the build system what CPU to build for. Be very careful if you change any of these settings, you can render your keyboard inoperable.
|
||||
|
||||
```
|
||||
MCU = atmega32u4
|
||||
F_CPU = 16000000
|
||||
ARCH = AVR8
|
||||
F_USB = $(F_CPU)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
```
|
||||
|
||||
### Bootloader Size
|
||||
|
||||
The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard. If you are using a teensy 2.0, or a device like the Ergodox EZ that uses the teensy bootloader you should set this to `512`. Most other bootloaders should be set to `4096`, but `1024` and `2048` are other possible values you may encounter.
|
||||
|
||||
#### Teensy 2.0 Bootloader Example
|
||||
|
||||
```
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
```
|
||||
|
||||
#### Teensy 2.0++ Bootloader Example
|
||||
|
||||
```
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=1024
|
||||
```
|
||||
|
||||
#### Atmel DFU Loader Example
|
||||
|
||||
```
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
```
|
||||
|
||||
### Build Options
|
||||
|
||||
There are a number of features that can be turned on or off in `rules.mk`. See the [Config Options](config_options.md#feature-options) page for a detailed list and description.
|
@ -1,27 +0,0 @@
|
||||
# QMK Hardware Drivers
|
||||
|
||||
QMK is used on a lot of different hardware. While support for the most common MCU's and matrix configurations is built-in there are a number of drivers that can be added to a keyboard to support additional hardware. Examples include mice and other pointing devices, i/o expanders for split keyboards, bluetooth modules, and LCD, OLED, and TFT screens.
|
||||
|
||||
<!-- FIXME: This should talk about how drivers are integrated into QMK and how you can add your own driver.
|
||||
|
||||
# Driver System Overview
|
||||
|
||||
-->
|
||||
|
||||
# Available Drivers
|
||||
|
||||
## ProMicro (AVR Only)
|
||||
|
||||
Support for addressing pins on the ProMicro by their Arduino name rather than their AVR name. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process.
|
||||
|
||||
## SSD1306 (AVR Only)
|
||||
|
||||
Support for SSD1306 based OLED displays. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process.
|
||||
|
||||
## uGFX
|
||||
|
||||
You can make use of uGFX within QMK to drive character and graphic LCD's, LED arrays, OLED, TFT, and other display technologies. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process.
|
||||
|
||||
## WS2812 (AVR Only)
|
||||
|
||||
Support for WS2811/WS2812{a,b,c} LED's. For more information see the [RGB Light](feature_rgblight.md) page.
|
@ -1,146 +0,0 @@
|
||||
# QMK Keyboard Guidelines
|
||||
|
||||
We welcome all keyboard projects into QMK, but ask that you try to stick to a couple guidelines that help us keep things organised and consistent.
|
||||
|
||||
## Naming Your Keyboard/Project
|
||||
|
||||
All names should be lowercase alphanumeric, and separated by an underscore (`_`), but not begin with one. Your directory and your `.h` and `.c` files should have exactly the same name. All folders should follow the same format. `test`, `keyboard`, and `all` are reserved by make and are not a valid name for a keyboard.
|
||||
|
||||
## `readme.md`
|
||||
|
||||
All projects need to have a `readme.md` file that explains what the keyboard is, who made it, where it is available, and links to more information. Please follow the [published template](documentation_templates.md#keyboard-readmemd-template).
|
||||
|
||||
## Image/Hardware Files
|
||||
|
||||
In an effort to keep the repo size down, we're no longer accepting images of any format in the repo, with few exceptions. Hosting them elsewhere (imgur) and linking them in the `readme.md` is the preferred method.
|
||||
|
||||
Any sort of hardware file (plate, case, pcb) can't be stored in qmk_firmware, but we have the [qmk.fm repo](https://github.com/qmk/qmk.fm) where such files (as well as in-depth info) can be stored and viewed on [qmk.fm](http://qmk.fm). Downloadable files are stored in `/<keyboard>/` (name follows the same format as above) which are served at `http://qmk.fm/<keyboard>/`, and pages are generated from `/_pages/<keyboard>/` which are served at the same location (.md files are generated into .html files through Jekyll). Check out the `lets_split` directory for an example.
|
||||
|
||||
## Keyboard Defaults
|
||||
|
||||
Given the amount of functionality that QMK exposes it's very easy to confuse new users. When putting together the default firmware for your keyboard we recommend limiting your enabled features and options to the minimal set needed to support your hardware. Recommendations for specific features follow.
|
||||
|
||||
### Bootmagic and Command
|
||||
|
||||
[Bootmagic](feature_bootmagic.md) and [Command](feature_command.md) are two related features that allow a user to control their keyboard in non-obvious ways. We recommend you think long and hard about if you're going to enable either feature, and how you will expose this functionality. Keep in mind that users who want this functionality can enable it in their personal keymaps without affecting all the novice users who may be using your keyboard as their first programmable board.
|
||||
|
||||
By far the most common problem new users encounter is accidentally triggering Bootmagic while they're plugging in their keyboard. They're holding the keyboard by the bottom, unknowingly pressing in alt and spacebar, and then they find that these keys have been swapped on them. We recommend leaving this feature disabled by default, but if you do turn it on consider setting `BOOTMAGIC_KEY_SALT` to a key that is hard to press while plugging your keyboard in.
|
||||
|
||||
If your keyboard does not have 2 shift keys you should provide a working default for `IS_COMMAND`, even when you have set `COMMAND_ENABLE = no`. This will give your users a default to conform to if they do enable Command.
|
||||
|
||||
## Custom Keyboard Programming
|
||||
|
||||
As documented on [Customizing Functionality](custom_quantum_functions.md) you can define custom functions for your keyboard. Please keep in mind that your users may want to customize that behavior as well, and make it possible for them to do that. If you are providing a custom function, for example `process_record_kb()`, make sure that your function calls the `_user()` version of the call too. You should also take into account the return value of the `_user()` version, and only run your custom code if the user returns `true`.
|
||||
|
||||
## Keyboard Metadata
|
||||
|
||||
As QMK grows so does the ecosystem surrounding QMK. To make it easier for projects in that ecosystem to tie into QMK as we make changes we are developing a metadata system to expose information about keyboards in QMK.
|
||||
|
||||
You can create `info.json` files at every level under `qmk_firmware/keyboards/<name>` to specify this metadata. These files are combined, with more specific files overriding keys in less specific files. This means you do not need to duplicate your metadata information. For example, `qmk_firmware/keyboards/clueboard/info.json` specifies `manufacturer` and `maintainer`, while `qmk_firmware/keyboards/clueboard/66/info.json` specifies more specific information about Clueboard 66%.
|
||||
|
||||
### `info.json` Format
|
||||
|
||||
The `info.json` file is a JSON formatted dictionary with the following keys available to be set. You do not have to set all of them, merely the keys that apply to your keyboard.
|
||||
|
||||
* `keyboard_name`
|
||||
* A free-form text string describing the keyboard.
|
||||
* Example: `Clueboard 66%`
|
||||
* `url`
|
||||
* A URL to the keyboard's product page, [QMK.fm/keyboards](https://qmk.fm/keyboards) page, or other page describing information about the keyboard.
|
||||
* `bootloader`
|
||||
* What bootloader this keyboard uses. Available options:
|
||||
* `atmel-dfu`
|
||||
* `kiibohd-dfu-util`
|
||||
* `lufa-dfu`
|
||||
* `qmk-dfu`
|
||||
* `stm32-dfu-util`
|
||||
* `caterina`
|
||||
* `halfkay`
|
||||
* `bootloadHID`
|
||||
* `maintainer`
|
||||
* GitHub username of the maintainer, or `qmk` for community maintained boards
|
||||
* `width`
|
||||
* Width of the board in Key Units
|
||||
* `height`
|
||||
* Height of the board in Key Units
|
||||
* `layouts`
|
||||
* Physical Layout representations. See the next section for more detail.
|
||||
|
||||
#### Layout Format
|
||||
|
||||
Within our `info.json` file the `layouts` portion of the dictionary contains several nested dictionaries. The outer layer consists of QMK layout macros, for example `LAYOUT_ansi` or `LAYOUT_iso`. Within each layout macro are keys for `width`, `height`, and `key_count`, each of which should be self-explanatory.
|
||||
|
||||
* `width`
|
||||
* Optional: The width of the layout in Key Units
|
||||
* `height`
|
||||
* Optional: The height of the layout in Key Units
|
||||
* `key_count`
|
||||
* **Required**: The number of keys in this layout
|
||||
* `layout`
|
||||
* A list of Key Dictionaries describing the physical layout. See the next section for more details.
|
||||
|
||||
#### Key Dictionary Format
|
||||
|
||||
Each Key Dictionary in a layout describes the physical properties of a key. If you are familiar with the Raw Code for <http://keyboard-layout-editor.com> you will find many of the concepts the same. We re-use the same key names and layout choices wherever possible, but unlike keyboard-layout-editor each key is stateless, inheriting no properties from the keys that came before it.
|
||||
|
||||
All key positions and rotations are specified in relation to the top-left corner of the keyboard, and the top-left corner of each key.
|
||||
|
||||
* `X`
|
||||
* **Required**: The absolute position of the key in the horizontal axis, in Key Units.
|
||||
* `Y`
|
||||
* **Required**: The absolute position of the key in the vertical axis, in Key Units.
|
||||
* `W`
|
||||
* The width of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
||||
* `H`
|
||||
* The height of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
||||
* `R`
|
||||
* How many degrees clockwise to rotate the key.
|
||||
* `RX`
|
||||
* The absolute position of the point to rotate the key around in the horizontal axis. Default: `x`
|
||||
* `RY`
|
||||
* The absolute position of the point to rotate the key around in the vertical axis. Default: `y`
|
||||
* `KS`
|
||||
* Key Shape: define a polygon by providing a list of points, in Key Units.
|
||||
* **Important**: These are relative to the top-left of the key, not absolute.
|
||||
* Example ISO Enter: `[ [0,0], [1.5,0], [1.5,2], [0.25,2], [0.25,1], [0,1], [0,0] ]`
|
||||
|
||||
### How is the Metadata Exposed?
|
||||
|
||||
This metadata is primarily used in two ways:
|
||||
|
||||
* To allow web-based configurators to dynamically generate UI
|
||||
* To support the new `make keyboard:keymap:qmk` target, which bundles this metadata up with the firmware to allow QMK Toolbox to be smarter.
|
||||
|
||||
Configurator authors can see the [QMK Compiler](https://docs.compile.qmk.fm/api_docs.html) docs for more information on using the JSON API.
|
||||
|
||||
## Non-Production/Handwired Projects
|
||||
|
||||
We're happy to accept any project that uses QMK, including prototypes and handwired ones, but we have a separate `/keyboards/handwired/` folder for them, so the main `/keyboards/` folder doesn't get overcrowded. If a prototype project becomes a production project at some point in the future, we'd be happy to move it to the main `/keyboards/` folder!
|
||||
|
||||
## Warnings as Errors
|
||||
|
||||
When developing your keyboard, keep in mind that all warnings will be treated as errors - these small warnings can build-up and cause larger errors down the road (and keeping them is generally a bad practice).
|
||||
|
||||
## Copyright Blurb
|
||||
|
||||
If you're adapting your keyboard's setup from another project, but not using the same code, but sure to update the copyright header at the top of the files to show your name, in this format:
|
||||
|
||||
Copyright 2017 Your Name <your@email.com>
|
||||
|
||||
If you are modifying someone else's code and have made only trivial changes you should leave their name in the copyright statement. If you have done significant work on the file you should add your name to theirs, like so:
|
||||
|
||||
Copyright 2017 Their Name <original_author@example.com> Your Name <you@example.com>
|
||||
|
||||
The year should be the first year the file is created. If work was done to that file in later years you can reflect that by appending the second year to the first, like so:
|
||||
|
||||
Copyright 2015-2017 Your Name <you@example.com>
|
||||
|
||||
## License
|
||||
|
||||
The core of QMK is licensed under the [GNU General Public License](https://www.gnu.org/licenses/licenses.en.html). If you are shipping binaries for AVR processors you may choose either [GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) or [GPLv3](https://www.gnu.org/licenses/gpl.html). If you are shipping binaries for ARM processors you must choose [GPL Version 3](https://www.gnu.org/licenses/gpl.html) to comply with the [ChibiOS](http://www.chibios.org) GPLv3 license.
|
||||
|
||||
If your keyboard makes use of the [uGFX](https://ugfx.io) features within QMK you must comply with the [uGFX License](https://ugfx.io/license.html), which requires a separate commercial license before selling a device containing uGFX.
|
||||
|
||||
## Technical Details
|
||||
|
||||
If you're looking for more information on making your keyboard work with QMK, [check out the hardware section](hardware.md)!
|
@ -1,78 +0,0 @@
|
||||
# group `defines` {#group__defines}
|
||||
|
||||
## Summary
|
||||
|
||||
Members | Descriptions
|
||||
--------------------------------|---------------------------------------------
|
||||
`define `[`SYSEX_BEGIN`](#group__defines_1ga1a3c39bb790dda8a368c4247caabcf79) |
|
||||
`define `[`SYSEX_END`](#group__defines_1ga753706d1d28e6f96d7caf1973e80feed) |
|
||||
`define `[`MIDI_STATUSMASK`](#group__defines_1gab78a1c818a5f5dab7a8946543f126c69) |
|
||||
`define `[`MIDI_CHANMASK`](#group__defines_1ga239edc0a6f8405d3a8f2804f1590b909) |
|
||||
`define `[`MIDI_CC`](#group__defines_1ga45f116a1daab76b3c930c2cecfaef215) |
|
||||
`define `[`MIDI_NOTEON`](#group__defines_1gafd416f27bf3590868c0c1f55c30be4c7) |
|
||||
`define `[`MIDI_NOTEOFF`](#group__defines_1gabed24bea2d989fd655e2ef2ad0765adc) |
|
||||
`define `[`MIDI_AFTERTOUCH`](#group__defines_1ga3a322d8cfd53576a2e167c1840551b0f) |
|
||||
`define `[`MIDI_PITCHBEND`](#group__defines_1gabcc799504e8064679bca03f232223af4) |
|
||||
`define `[`MIDI_PROGCHANGE`](#group__defines_1gaefb3f1595ffbb9db66b46c2c919a3d42) |
|
||||
`define `[`MIDI_CHANPRESSURE`](#group__defines_1gaeb3281cc7fcd0daade8ed3d2dfc33dbe) |
|
||||
`define `[`MIDI_CLOCK`](#group__defines_1gafa5e4e295aafd15ab7893344599b3b89) |
|
||||
`define `[`MIDI_TICK`](#group__defines_1ga3b99408ff864613765d4c3c2ceb52aa7) |
|
||||
`define `[`MIDI_START`](#group__defines_1ga8233631c85823aa546f932ad8975caa4) |
|
||||
`define `[`MIDI_CONTINUE`](#group__defines_1gab24430f0081e27215b0da84dd0ee745c) |
|
||||
`define `[`MIDI_STOP`](#group__defines_1ga3af9271d4b1f0d22904a0b055f48cf62) |
|
||||
`define `[`MIDI_ACTIVESENSE`](#group__defines_1gacd88ed42dba52bb4b2052c5656362677) |
|
||||
`define `[`MIDI_RESET`](#group__defines_1ga02947f30ca62dc332fdeb10c5868323b) |
|
||||
`define `[`MIDI_TC_QUARTERFRAME`](#group__defines_1gaaa072f33590e236d1bfd8f28e833ae31) |
|
||||
`define `[`MIDI_SONGPOSITION`](#group__defines_1ga412f6ed33a2150051374bee334ee1705) |
|
||||
`define `[`MIDI_SONGSELECT`](#group__defines_1gafcab254838b028365ae0259729e72c4e) |
|
||||
`define `[`MIDI_TUNEREQUEST`](#group__defines_1ga8100b907b8c0a84e58b1c53dcd9bd795) |
|
||||
`define `[`SYSEX_EDUMANUFID`](#group__defines_1ga5ef855ed955b00a2239ca16afbeb164f) |
|
||||
|
||||
## Members
|
||||
|
||||
#### `define `[`SYSEX_BEGIN`](#group__defines_1ga1a3c39bb790dda8a368c4247caabcf79) {#group__defines_1ga1a3c39bb790dda8a368c4247caabcf79}
|
||||
|
||||
#### `define `[`SYSEX_END`](#group__defines_1ga753706d1d28e6f96d7caf1973e80feed) {#group__defines_1ga753706d1d28e6f96d7caf1973e80feed}
|
||||
|
||||
#### `define `[`MIDI_STATUSMASK`](#group__defines_1gab78a1c818a5f5dab7a8946543f126c69) {#group__defines_1gab78a1c818a5f5dab7a8946543f126c69}
|
||||
|
||||
#### `define `[`MIDI_CHANMASK`](#group__defines_1ga239edc0a6f8405d3a8f2804f1590b909) {#group__defines_1ga239edc0a6f8405d3a8f2804f1590b909}
|
||||
|
||||
#### `define `[`MIDI_CC`](#group__defines_1ga45f116a1daab76b3c930c2cecfaef215) {#group__defines_1ga45f116a1daab76b3c930c2cecfaef215}
|
||||
|
||||
#### `define `[`MIDI_NOTEON`](#group__defines_1gafd416f27bf3590868c0c1f55c30be4c7) {#group__defines_1gafd416f27bf3590868c0c1f55c30be4c7}
|
||||
|
||||
#### `define `[`MIDI_NOTEOFF`](#group__defines_1gabed24bea2d989fd655e2ef2ad0765adc) {#group__defines_1gabed24bea2d989fd655e2ef2ad0765adc}
|
||||
|
||||
#### `define `[`MIDI_AFTERTOUCH`](#group__defines_1ga3a322d8cfd53576a2e167c1840551b0f) {#group__defines_1ga3a322d8cfd53576a2e167c1840551b0f}
|
||||
|
||||
#### `define `[`MIDI_PITCHBEND`](#group__defines_1gabcc799504e8064679bca03f232223af4) {#group__defines_1gabcc799504e8064679bca03f232223af4}
|
||||
|
||||
#### `define `[`MIDI_PROGCHANGE`](#group__defines_1gaefb3f1595ffbb9db66b46c2c919a3d42) {#group__defines_1gaefb3f1595ffbb9db66b46c2c919a3d42}
|
||||
|
||||
#### `define `[`MIDI_CHANPRESSURE`](#group__defines_1gaeb3281cc7fcd0daade8ed3d2dfc33dbe) {#group__defines_1gaeb3281cc7fcd0daade8ed3d2dfc33dbe}
|
||||
|
||||
#### `define `[`MIDI_CLOCK`](#group__defines_1gafa5e4e295aafd15ab7893344599b3b89) {#group__defines_1gafa5e4e295aafd15ab7893344599b3b89}
|
||||
|
||||
#### `define `[`MIDI_TICK`](#group__defines_1ga3b99408ff864613765d4c3c2ceb52aa7) {#group__defines_1ga3b99408ff864613765d4c3c2ceb52aa7}
|
||||
|
||||
#### `define `[`MIDI_START`](#group__defines_1ga8233631c85823aa546f932ad8975caa4) {#group__defines_1ga8233631c85823aa546f932ad8975caa4}
|
||||
|
||||
#### `define `[`MIDI_CONTINUE`](#group__defines_1gab24430f0081e27215b0da84dd0ee745c) {#group__defines_1gab24430f0081e27215b0da84dd0ee745c}
|
||||
|
||||
#### `define `[`MIDI_STOP`](#group__defines_1ga3af9271d4b1f0d22904a0b055f48cf62) {#group__defines_1ga3af9271d4b1f0d22904a0b055f48cf62}
|
||||
|
||||
#### `define `[`MIDI_ACTIVESENSE`](#group__defines_1gacd88ed42dba52bb4b2052c5656362677) {#group__defines_1gacd88ed42dba52bb4b2052c5656362677}
|
||||
|
||||
#### `define `[`MIDI_RESET`](#group__defines_1ga02947f30ca62dc332fdeb10c5868323b) {#group__defines_1ga02947f30ca62dc332fdeb10c5868323b}
|
||||
|
||||
#### `define `[`MIDI_TC_QUARTERFRAME`](#group__defines_1gaaa072f33590e236d1bfd8f28e833ae31) {#group__defines_1gaaa072f33590e236d1bfd8f28e833ae31}
|
||||
|
||||
#### `define `[`MIDI_SONGPOSITION`](#group__defines_1ga412f6ed33a2150051374bee334ee1705) {#group__defines_1ga412f6ed33a2150051374bee334ee1705}
|
||||
|
||||
#### `define `[`MIDI_SONGSELECT`](#group__defines_1gafcab254838b028365ae0259729e72c4e) {#group__defines_1gafcab254838b028365ae0259729e72c4e}
|
||||
|
||||
#### `define `[`MIDI_TUNEREQUEST`](#group__defines_1ga8100b907b8c0a84e58b1c53dcd9bd795) {#group__defines_1ga8100b907b8c0a84e58b1c53dcd9bd795}
|
||||
|
||||
#### `define `[`SYSEX_EDUMANUFID`](#group__defines_1ga5ef855ed955b00a2239ca16afbeb164f) {#group__defines_1ga5ef855ed955b00a2239ca16afbeb164f}
|
||||
|
@ -1,169 +0,0 @@
|
||||
# group `input_callback_reg` {#group__input__callback__reg}
|
||||
|
||||
These are the functions you use to register your input callbacks.
|
||||
|
||||
The functions are called when the appropriate midi message is matched on the associated device's input.
|
||||
|
||||
## Summary
|
||||
|
||||
Members | Descriptions
|
||||
--------------------------------|---------------------------------------------
|
||||
`public void `[`midi_register_cc_callback`](#group__input__callback__reg_1ga64ab672abbbe393c9c4a83110c8df718)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` | Register a control change message (cc) callback.
|
||||
`public void `[`midi_register_noteon_callback`](#group__input__callback__reg_1ga3962f276c17618923f1152779552103e)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` | Register a note on callback.
|
||||
`public void `[`midi_register_noteoff_callback`](#group__input__callback__reg_1gac847b66051bd6d53b762958be0ec4c6d)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` | Register a note off callback.
|
||||
`public void `[`midi_register_aftertouch_callback`](#group__input__callback__reg_1gaa95bc901bd9edff956a667c9a69dd01f)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` | Register an after touch callback.
|
||||
`public void `[`midi_register_pitchbend_callback`](#group__input__callback__reg_1ga071a28f02ba14f53de219be70ebd9a48)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` | Register a pitch bend callback.
|
||||
`public void `[`midi_register_songposition_callback`](#group__input__callback__reg_1gaf2adfd79637f3553d8f26deb1ca22ed6)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` | Register a song position callback.
|
||||
`public void `[`midi_register_progchange_callback`](#group__input__callback__reg_1gae6ba1a35a4cde9bd15dd42f87401d127)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` | Register a program change callback.
|
||||
`public void `[`midi_register_chanpressure_callback`](#group__input__callback__reg_1ga39b31f1f4fb93917ce039b958f21b4f5)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` | Register a channel pressure callback.
|
||||
`public void `[`midi_register_songselect_callback`](#group__input__callback__reg_1gaf9aafc76a2dc4b9fdbb4106cbda6ce72)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` | Register a song select callback.
|
||||
`public void `[`midi_register_tc_quarterframe_callback`](#group__input__callback__reg_1ga0a119fada2becc628cb15d753b257e6e)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` | Register a tc quarter frame callback.
|
||||
`public void `[`midi_register_realtime_callback`](#group__input__callback__reg_1ga764f440e857b89084b1a07f9da2ff93a)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_one_byte_func_t func)` | Register a realtime callback.
|
||||
`public void `[`midi_register_tunerequest_callback`](#group__input__callback__reg_1gae40ff3ce20bda79fef87da24b8321cb1)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_one_byte_func_t func)` | Register a tune request callback.
|
||||
`public void `[`midi_register_sysex_callback`](#group__input__callback__reg_1ga63ce9631b025785c1848d0122d4c4c48)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_sysex_func_t func)` | Register a sysex callback.
|
||||
`public void `[`midi_register_fallthrough_callback`](#group__input__callback__reg_1ga7ed189164aa9682862b3181153afbd94)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_var_byte_func_t func)` | Register fall through callback.
|
||||
`public void `[`midi_register_catchall_callback`](#group__input__callback__reg_1ga9dbfed568d047a6cd05708f11fe39e99)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_var_byte_func_t func)` | Register a catch all callback.
|
||||
|
||||
## Members
|
||||
|
||||
#### `public void `[`midi_register_cc_callback`](#group__input__callback__reg_1ga64ab672abbbe393c9c4a83110c8df718)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` {#group__input__callback__reg_1ga64ab672abbbe393c9c4a83110c8df718}
|
||||
|
||||
Register a control change message (cc) callback.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_noteon_callback`](#group__input__callback__reg_1ga3962f276c17618923f1152779552103e)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` {#group__input__callback__reg_1ga3962f276c17618923f1152779552103e}
|
||||
|
||||
Register a note on callback.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_noteoff_callback`](#group__input__callback__reg_1gac847b66051bd6d53b762958be0ec4c6d)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` {#group__input__callback__reg_1gac847b66051bd6d53b762958be0ec4c6d}
|
||||
|
||||
Register a note off callback.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_aftertouch_callback`](#group__input__callback__reg_1gaa95bc901bd9edff956a667c9a69dd01f)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` {#group__input__callback__reg_1gaa95bc901bd9edff956a667c9a69dd01f}
|
||||
|
||||
Register an after touch callback.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_pitchbend_callback`](#group__input__callback__reg_1ga071a28f02ba14f53de219be70ebd9a48)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` {#group__input__callback__reg_1ga071a28f02ba14f53de219be70ebd9a48}
|
||||
|
||||
Register a pitch bend callback.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_songposition_callback`](#group__input__callback__reg_1gaf2adfd79637f3553d8f26deb1ca22ed6)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` {#group__input__callback__reg_1gaf2adfd79637f3553d8f26deb1ca22ed6}
|
||||
|
||||
Register a song position callback.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_progchange_callback`](#group__input__callback__reg_1gae6ba1a35a4cde9bd15dd42f87401d127)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` {#group__input__callback__reg_1gae6ba1a35a4cde9bd15dd42f87401d127}
|
||||
|
||||
Register a program change callback.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_chanpressure_callback`](#group__input__callback__reg_1ga39b31f1f4fb93917ce039b958f21b4f5)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` {#group__input__callback__reg_1ga39b31f1f4fb93917ce039b958f21b4f5}
|
||||
|
||||
Register a channel pressure callback.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_songselect_callback`](#group__input__callback__reg_1gaf9aafc76a2dc4b9fdbb4106cbda6ce72)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` {#group__input__callback__reg_1gaf9aafc76a2dc4b9fdbb4106cbda6ce72}
|
||||
|
||||
Register a song select callback.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_tc_quarterframe_callback`](#group__input__callback__reg_1ga0a119fada2becc628cb15d753b257e6e)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` {#group__input__callback__reg_1ga0a119fada2becc628cb15d753b257e6e}
|
||||
|
||||
Register a tc quarter frame callback.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_realtime_callback`](#group__input__callback__reg_1ga764f440e857b89084b1a07f9da2ff93a)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_one_byte_func_t func)` {#group__input__callback__reg_1ga764f440e857b89084b1a07f9da2ff93a}
|
||||
|
||||
Register a realtime callback.
|
||||
|
||||
The callback will be called for all of the real time message types.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_tunerequest_callback`](#group__input__callback__reg_1gae40ff3ce20bda79fef87da24b8321cb1)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_one_byte_func_t func)` {#group__input__callback__reg_1gae40ff3ce20bda79fef87da24b8321cb1}
|
||||
|
||||
Register a tune request callback.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_sysex_callback`](#group__input__callback__reg_1ga63ce9631b025785c1848d0122d4c4c48)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_sysex_func_t func)` {#group__input__callback__reg_1ga63ce9631b025785c1848d0122d4c4c48}
|
||||
|
||||
Register a sysex callback.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_fallthrough_callback`](#group__input__callback__reg_1ga7ed189164aa9682862b3181153afbd94)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_var_byte_func_t func)` {#group__input__callback__reg_1ga7ed189164aa9682862b3181153afbd94}
|
||||
|
||||
Register fall through callback.
|
||||
|
||||
This is only called if a more specific callback is not matched and called. For instance, if you don't register a note on callback but you get a note on message the fall through callback will be called, if it is registered.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
||||
#### `public void `[`midi_register_catchall_callback`](#group__input__callback__reg_1ga9dbfed568d047a6cd05708f11fe39e99)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_var_byte_func_t func)` {#group__input__callback__reg_1ga9dbfed568d047a6cd05708f11fe39e99}
|
||||
|
||||
Register a catch all callback.
|
||||
|
||||
If registered, the catch all callback is called for every message that is matched, even if a more specific or the fallthrough callback is registered.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device associate with
|
||||
|
||||
* `func` the callback function to register
|
||||
|
@ -1,143 +0,0 @@
|
||||
# group `midi_device` {#group__midi__device}
|
||||
|
||||
You use the functions when you are implementing your own midi device.
|
||||
|
||||
You set a send function to actually send bytes via your device, this method is called when you call a send function with this device, for instance midi_send_cc
|
||||
|
||||
You use the midi_device_input to process input data from the device and pass it through the device's associated callbacks.
|
||||
|
||||
You use the midi_device_set_pre_input_process_func if you want to have a function called at the beginning of the device's process function, generally to poll for input and pass that into midi_device_input
|
||||
|
||||
## Summary
|
||||
|
||||
Members | Descriptions
|
||||
--------------------------------|---------------------------------------------
|
||||
`define `[`MIDI_INPUT_QUEUE_LENGTH`](#group__midi__device_1ga4aaa419caebdca2bbdfc1331e79781a8) |
|
||||
`enum `[`input_state_t`](#group__midi__device_1gac203e877d3df4275ceb8e7180a61f621) |
|
||||
`public void `[`midi_device_input`](#group__midi__device_1gad8d3db8eb35d9cfa51ef036a0a9d70db)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t cnt,uint8_t * input)` | Process input bytes. This function parses bytes and calls the appropriate callbacks associated with the given device. You use this function if you are creating a custom device and you want to have midi input.
|
||||
`public void `[`midi_device_set_send_func`](#group__midi__device_1ga59f5a46bdd4452f186cc73d9e96d4673)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_var_byte_func_t send_func)` | Set the callback function that will be used for sending output data bytes. This is only used if you're creating a custom device. You'll most likely want the callback function to disable interrupts so that you can call the various midi send functions without worrying about locking.
|
||||
`public void `[`midi_device_set_pre_input_process_func`](#group__midi__device_1ga4de0841b87c04fc23cb56b6451f33b69)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_no_byte_func_t pre_process_func)` | Set a callback which is called at the beginning of the midi_device_process call. This can be used to poll for input data and send the data through the midi_device_input function. You'll probably only use this if you're creating a custom device.
|
||||
`struct `[`_midi_device`](docs/api_midi_device.md#struct__midi__device) | This structure represents the input and output functions and processing data for a midi device.
|
||||
|
||||
## Members
|
||||
|
||||
#### `define `[`MIDI_INPUT_QUEUE_LENGTH`](#group__midi__device_1ga4aaa419caebdca2bbdfc1331e79781a8) {#group__midi__device_1ga4aaa419caebdca2bbdfc1331e79781a8}
|
||||
|
||||
#### `enum `[`input_state_t`](#group__midi__device_1gac203e877d3df4275ceb8e7180a61f621) {#group__midi__device_1gac203e877d3df4275ceb8e7180a61f621}
|
||||
|
||||
Values | Descriptions
|
||||
--------------------------------|---------------------------------------------
|
||||
IDLE |
|
||||
ONE_BYTE_MESSAGE |
|
||||
TWO_BYTE_MESSAGE |
|
||||
THREE_BYTE_MESSAGE |
|
||||
SYSEX_MESSAGE |
|
||||
|
||||
#### `public void `[`midi_device_input`](#group__midi__device_1gad8d3db8eb35d9cfa51ef036a0a9d70db)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t cnt,uint8_t * input)` {#group__midi__device_1gad8d3db8eb35d9cfa51ef036a0a9d70db}
|
||||
|
||||
Process input bytes. This function parses bytes and calls the appropriate callbacks associated with the given device. You use this function if you are creating a custom device and you want to have midi input.
|
||||
|
||||
#### Parameters
|
||||
* `device` the midi device to associate the input with
|
||||
|
||||
* `cnt` the number of bytes you are processing
|
||||
|
||||
* `input` the bytes to process
|
||||
|
||||
#### `public void `[`midi_device_set_send_func`](#group__midi__device_1ga59f5a46bdd4452f186cc73d9e96d4673)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_var_byte_func_t send_func)` {#group__midi__device_1ga59f5a46bdd4452f186cc73d9e96d4673}
|
||||
|
||||
Set the callback function that will be used for sending output data bytes. This is only used if you're creating a custom device. You'll most likely want the callback function to disable interrupts so that you can call the various midi send functions without worrying about locking.
|
||||
|
||||
#### Parameters
|
||||
* `device` the midi device to associate this callback with
|
||||
|
||||
* `send_func` the callback function that will do the sending
|
||||
|
||||
#### `public void `[`midi_device_set_pre_input_process_func`](#group__midi__device_1ga4de0841b87c04fc23cb56b6451f33b69)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_no_byte_func_t pre_process_func)` {#group__midi__device_1ga4de0841b87c04fc23cb56b6451f33b69}
|
||||
|
||||
Set a callback which is called at the beginning of the midi_device_process call. This can be used to poll for input data and send the data through the midi_device_input function. You'll probably only use this if you're creating a custom device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the midi device to associate this callback with
|
||||
|
||||
* `midi_no_byte_func_t` the actual callback function
|
||||
|
||||
# struct `_midi_device` {#struct__midi__device}
|
||||
|
||||
This structure represents the input and output functions and processing data for a midi device.
|
||||
|
||||
A device can represent an actual physical device [serial port, usb port] or something virtual. You should not need to modify this structure directly.
|
||||
|
||||
## Summary
|
||||
|
||||
Members | Descriptions
|
||||
--------------------------------|---------------------------------------------
|
||||
`public midi_var_byte_func_t `[`send_func`](docs/api_midi_device.md#struct__midi__device_1a25d4c94b4bbccd5b98f1032b469f3ff9) |
|
||||
`public midi_three_byte_func_t `[`input_cc_callback`](docs/api_midi_device.md#struct__midi__device_1a6da5236c1bc73877728df92d213a78d1) |
|
||||
`public midi_three_byte_func_t `[`input_noteon_callback`](docs/api_midi_device.md#struct__midi__device_1aa10b15cf1a7fb825a5df0d2abbe34a1c) |
|
||||
`public midi_three_byte_func_t `[`input_noteoff_callback`](docs/api_midi_device.md#struct__midi__device_1aaf290043078534d3a5a0ea4c840eba84) |
|
||||
`public midi_three_byte_func_t `[`input_aftertouch_callback`](docs/api_midi_device.md#struct__midi__device_1acb0b4901c545cec4b28b126f2d8c315f) |
|
||||
`public midi_three_byte_func_t `[`input_pitchbend_callback`](docs/api_midi_device.md#struct__midi__device_1a305fea672caeb996f2233bf8cd2bef18) |
|
||||
`public midi_three_byte_func_t `[`input_songposition_callback`](docs/api_midi_device.md#struct__midi__device_1a5f3f13638b3fef3fc561ed1bf301d586) |
|
||||
`public midi_two_byte_func_t `[`input_progchange_callback`](docs/api_midi_device.md#struct__midi__device_1adaf1da617c9a10a9dcad00ab1959d3da) |
|
||||
`public midi_two_byte_func_t `[`input_chanpressure_callback`](docs/api_midi_device.md#struct__midi__device_1ab7ca2925c539915d43974eff604d85f7) |
|
||||
`public midi_two_byte_func_t `[`input_songselect_callback`](docs/api_midi_device.md#struct__midi__device_1a89bed8a5a55376120cfc0a62b42f057f) |
|
||||
`public midi_two_byte_func_t `[`input_tc_quarterframe_callback`](docs/api_midi_device.md#struct__midi__device_1ad9813e75d22e284f9f65a907d20600f0) |
|
||||
`public midi_one_byte_func_t `[`input_realtime_callback`](docs/api_midi_device.md#struct__midi__device_1a9448eba4afb7e43650434748db3777be) |
|
||||
`public midi_one_byte_func_t `[`input_tunerequest_callback`](docs/api_midi_device.md#struct__midi__device_1a0cb8fd53e00cf1d4202d4fa04d038e8d) |
|
||||
`public midi_sysex_func_t `[`input_sysex_callback`](docs/api_midi_device.md#struct__midi__device_1afff9a0ce641762aaef24c1e6953ec9a2) |
|
||||
`public midi_var_byte_func_t `[`input_fallthrough_callback`](docs/api_midi_device.md#struct__midi__device_1abb974ec6d734001b4a0e370f292be503) |
|
||||
`public midi_var_byte_func_t `[`input_catchall_callback`](docs/api_midi_device.md#struct__midi__device_1aae0d535129d4fd650edc98eb3f7584f8) |
|
||||
`public midi_no_byte_func_t `[`pre_input_process_callback`](docs/api_midi_device.md#struct__midi__device_1aeb0bb8923d66c23d874e177dc4265754) |
|
||||
`public uint8_t `[`input_buffer`](docs/api_midi_device.md#struct__midi__device_1a7c5684857d6af4ebc4dc12da27bd6b2a) |
|
||||
`public input_state_t `[`input_state`](docs/api_midi_device.md#struct__midi__device_1a69a687d2d1c449ec15a11c07a5722e39) |
|
||||
`public uint16_t `[`input_count`](docs/api_midi_device.md#struct__midi__device_1a68dea8e7b6151e89c85c95caa612ee5d) |
|
||||
`public uint8_t `[`input_queue_data`](docs/api_midi_device.md#struct__midi__device_1ada41de021135dc423abedcbb30f366ff) |
|
||||
`public `[`byteQueue_t`](#structbyte_queue__t)` `[`input_queue`](#struct__midi__device_1a49c8538a8a02193c58e28a56eb695d8f) |
|
||||
|
||||
## Members
|
||||
|
||||
#### `public midi_var_byte_func_t `[`send_func`](docs/api_midi_device.md#struct__midi__device_1a25d4c94b4bbccd5b98f1032b469f3ff9) {#struct__midi__device_1a25d4c94b4bbccd5b98f1032b469f3ff9}
|
||||
|
||||
#### `public midi_three_byte_func_t `[`input_cc_callback`](docs/api_midi_device.md#struct__midi__device_1a6da5236c1bc73877728df92d213a78d1) {#struct__midi__device_1a6da5236c1bc73877728df92d213a78d1}
|
||||
|
||||
#### `public midi_three_byte_func_t `[`input_noteon_callback`](docs/api_midi_device.md#struct__midi__device_1aa10b15cf1a7fb825a5df0d2abbe34a1c) {#struct__midi__device_1aa10b15cf1a7fb825a5df0d2abbe34a1c}
|
||||
|
||||
#### `public midi_three_byte_func_t `[`input_noteoff_callback`](docs/api_midi_device.md#struct__midi__device_1aaf290043078534d3a5a0ea4c840eba84) {#struct__midi__device_1aaf290043078534d3a5a0ea4c840eba84}
|
||||
|
||||
#### `public midi_three_byte_func_t `[`input_aftertouch_callback`](docs/api_midi_device.md#struct__midi__device_1acb0b4901c545cec4b28b126f2d8c315f) {#struct__midi__device_1acb0b4901c545cec4b28b126f2d8c315f}
|
||||
|
||||
#### `public midi_three_byte_func_t `[`input_pitchbend_callback`](docs/api_midi_device.md#struct__midi__device_1a305fea672caeb996f2233bf8cd2bef18) {#struct__midi__device_1a305fea672caeb996f2233bf8cd2bef18}
|
||||
|
||||
#### `public midi_three_byte_func_t `[`input_songposition_callback`](docs/api_midi_device.md#struct__midi__device_1a5f3f13638b3fef3fc561ed1bf301d586) {#struct__midi__device_1a5f3f13638b3fef3fc561ed1bf301d586}
|
||||
|
||||
#### `public midi_two_byte_func_t `[`input_progchange_callback`](docs/api_midi_device.md#struct__midi__device_1adaf1da617c9a10a9dcad00ab1959d3da) {#struct__midi__device_1adaf1da617c9a10a9dcad00ab1959d3da}
|
||||
|
||||
#### `public midi_two_byte_func_t `[`input_chanpressure_callback`](docs/api_midi_device.md#struct__midi__device_1ab7ca2925c539915d43974eff604d85f7) {#struct__midi__device_1ab7ca2925c539915d43974eff604d85f7}
|
||||
|
||||
#### `public midi_two_byte_func_t `[`input_songselect_callback`](docs/api_midi_device.md#struct__midi__device_1a89bed8a5a55376120cfc0a62b42f057f) {#struct__midi__device_1a89bed8a5a55376120cfc0a62b42f057f}
|
||||
|
||||
#### `public midi_two_byte_func_t `[`input_tc_quarterframe_callback`](docs/api_midi_device.md#struct__midi__device_1ad9813e75d22e284f9f65a907d20600f0) {#struct__midi__device_1ad9813e75d22e284f9f65a907d20600f0}
|
||||
|
||||
#### `public midi_one_byte_func_t `[`input_realtime_callback`](docs/api_midi_device.md#struct__midi__device_1a9448eba4afb7e43650434748db3777be) {#struct__midi__device_1a9448eba4afb7e43650434748db3777be}
|
||||
|
||||
#### `public midi_one_byte_func_t `[`input_tunerequest_callback`](docs/api_midi_device.md#struct__midi__device_1a0cb8fd53e00cf1d4202d4fa04d038e8d) {#struct__midi__device_1a0cb8fd53e00cf1d4202d4fa04d038e8d}
|
||||
|
||||
#### `public midi_sysex_func_t `[`input_sysex_callback`](docs/api_midi_device.md#struct__midi__device_1afff9a0ce641762aaef24c1e6953ec9a2) {#struct__midi__device_1afff9a0ce641762aaef24c1e6953ec9a2}
|
||||
|
||||
#### `public midi_var_byte_func_t `[`input_fallthrough_callback`](docs/api_midi_device.md#struct__midi__device_1abb974ec6d734001b4a0e370f292be503) {#struct__midi__device_1abb974ec6d734001b4a0e370f292be503}
|
||||
|
||||
#### `public midi_var_byte_func_t `[`input_catchall_callback`](docs/api_midi_device.md#struct__midi__device_1aae0d535129d4fd650edc98eb3f7584f8) {#struct__midi__device_1aae0d535129d4fd650edc98eb3f7584f8}
|
||||
|
||||
#### `public midi_no_byte_func_t `[`pre_input_process_callback`](docs/api_midi_device.md#struct__midi__device_1aeb0bb8923d66c23d874e177dc4265754) {#struct__midi__device_1aeb0bb8923d66c23d874e177dc4265754}
|
||||
|
||||
#### `public uint8_t `[`input_buffer`](docs/api_midi_device.md#struct__midi__device_1a7c5684857d6af4ebc4dc12da27bd6b2a) {#struct__midi__device_1a7c5684857d6af4ebc4dc12da27bd6b2a}
|
||||
|
||||
#### `public input_state_t `[`input_state`](docs/api_midi_device.md#struct__midi__device_1a69a687d2d1c449ec15a11c07a5722e39) {#struct__midi__device_1a69a687d2d1c449ec15a11c07a5722e39}
|
||||
|
||||
#### `public uint16_t `[`input_count`](docs/api_midi_device.md#struct__midi__device_1a68dea8e7b6151e89c85c95caa612ee5d) {#struct__midi__device_1a68dea8e7b6151e89c85c95caa612ee5d}
|
||||
|
||||
#### `public uint8_t `[`input_queue_data`](docs/api_midi_device.md#struct__midi__device_1ada41de021135dc423abedcbb30f366ff) {#struct__midi__device_1ada41de021135dc423abedcbb30f366ff}
|
||||
|
||||
#### `public `[`byteQueue_t`](#structbyte_queue__t)` `[`input_queue`](#struct__midi__device_1a49c8538a8a02193c58e28a56eb695d8f) {#struct__midi__device_1a49c8538a8a02193c58e28a56eb695d8f}
|
||||
|
@ -1,31 +0,0 @@
|
||||
# group `midi_device_setup_process` {#group__midi__device__setup__process}
|
||||
|
||||
These are method that you must use to initialize and run a device.
|
||||
|
||||
## Summary
|
||||
|
||||
Members | Descriptions
|
||||
--------------------------------|---------------------------------------------
|
||||
`public void `[`midi_device_init`](#group__midi__device__setup__process_1gaf29deddc94ea98a59daa0bde1aefd9d9)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Initialize a device.
|
||||
`public void `[`midi_device_process`](#group__midi__device__setup__process_1gaa3d5993d0e998a1b59bbf5ab9c7b492b)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Process input data.
|
||||
|
||||
## Members
|
||||
|
||||
#### `public void `[`midi_device_init`](#group__midi__device__setup__process_1gaf29deddc94ea98a59daa0bde1aefd9d9)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__midi__device__setup__process_1gaf29deddc94ea98a59daa0bde1aefd9d9}
|
||||
|
||||
Initialize a device.
|
||||
|
||||
You must call this before using the device in question.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to initialize
|
||||
|
||||
#### `public void `[`midi_device_process`](#group__midi__device__setup__process_1gaa3d5993d0e998a1b59bbf5ab9c7b492b)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__midi__device__setup__process_1gaa3d5993d0e998a1b59bbf5ab9c7b492b}
|
||||
|
||||
Process input data.
|
||||
|
||||
This method drives the input processing, you must call this method frequently if you expect to have your input callbacks called.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to process
|
||||
|
@ -1,54 +0,0 @@
|
||||
# group `midi_util` {#group__midi__util}
|
||||
|
||||
## Summary
|
||||
|
||||
Members | Descriptions
|
||||
--------------------------------|---------------------------------------------
|
||||
`enum `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e) | An enumeration of the possible packet length values.
|
||||
`public bool `[`midi_is_statusbyte`](#group__midi__util_1ga12e3b42ff9cbb4b4f2bc455fc8743ee5)`(uint8_t theByte)` | Test to see if the byte given is a status byte.
|
||||
`public bool `[`midi_is_realtime`](#group__midi__util_1gad2f52c363e34a8000d80c983c324e2d7)`(uint8_t theByte)` | Test to see if the byte given is a realtime message.
|
||||
`public `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e)` `[`midi_packet_length`](#group__midi__util_1gaa168b43af6ae9de0debce1625e4b8175)`(uint8_t status)` | Find the length of the packet associated with the status byte given.
|
||||
|
||||
## Members
|
||||
|
||||
#### `enum `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e) {#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e}
|
||||
|
||||
Values | Descriptions
|
||||
--------------------------------|---------------------------------------------
|
||||
UNDEFINED |
|
||||
ONE |
|
||||
TWO |
|
||||
THREE |
|
||||
|
||||
An enumeration of the possible packet length values.
|
||||
|
||||
#### `public bool `[`midi_is_statusbyte`](#group__midi__util_1ga12e3b42ff9cbb4b4f2bc455fc8743ee5)`(uint8_t theByte)` {#group__midi__util_1ga12e3b42ff9cbb4b4f2bc455fc8743ee5}
|
||||
|
||||
Test to see if the byte given is a status byte.
|
||||
|
||||
#### Parameters
|
||||
* `theByte` the byte to test
|
||||
|
||||
#### Returns
|
||||
true if the byte given is a midi status byte
|
||||
|
||||
#### `public bool `[`midi_is_realtime`](#group__midi__util_1gad2f52c363e34a8000d80c983c324e2d7)`(uint8_t theByte)` {#group__midi__util_1gad2f52c363e34a8000d80c983c324e2d7}
|
||||
|
||||
Test to see if the byte given is a realtime message.
|
||||
|
||||
#### Parameters
|
||||
* `theByte` the byte to test
|
||||
|
||||
#### Returns
|
||||
true if it is a realtime message, false otherwise
|
||||
|
||||
#### `public `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e)` `[`midi_packet_length`](#group__midi__util_1gaa168b43af6ae9de0debce1625e4b8175)`(uint8_t status)` {#group__midi__util_1gaa168b43af6ae9de0debce1625e4b8175}
|
||||
|
||||
Find the length of the packet associated with the status byte given.
|
||||
|
||||
#### Parameters
|
||||
* `status` the status byte
|
||||
|
||||
#### Returns
|
||||
the length of the packet, will return UNDEFINED if the byte is not a status byte or if it is a sysex status byte
|
||||
|
@ -1,241 +0,0 @@
|
||||
# group `send_functions` {#group__send__functions}
|
||||
|
||||
These are the functions you use to send midi data through a device.
|
||||
|
||||
## Summary
|
||||
|
||||
Members | Descriptions
|
||||
--------------------------------|---------------------------------------------
|
||||
`public void `[`midi_send_cc`](#group__send__functions_1gaaf884811c92df405ca8fe1a00082f960)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t val)` | Send a control change message (cc) via the given device.
|
||||
`public void `[`midi_send_noteon`](#group__send__functions_1ga467bcf46dbf03ec269ce565b46bc2775)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t vel)` | Send a note on message via the given device.
|
||||
`public void `[`midi_send_noteoff`](#group__send__functions_1gaedb7d8805425eef5d47d57ddcb4c7a49)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t vel)` | Send a note off message via the given device.
|
||||
`public void `[`midi_send_aftertouch`](#group__send__functions_1ga0014847571317a0e34b2ef46a6bc584f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t note_num,uint8_t amt)` | Send an after touch message via the given device.
|
||||
`public void `[`midi_send_pitchbend`](#group__send__functions_1gae5a4a1e71611e7534be80af9ce3d3491)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,int16_t amt)` | Send a pitch bend message via the given device.
|
||||
`public void `[`midi_send_programchange`](#group__send__functions_1ga7b15588ef25e5e1ff09c2afc3151ce86)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num)` | Send a program change message via the given device.
|
||||
`public void `[`midi_send_channelpressure`](#group__send__functions_1gaf23e69fdf812e89c0036f51f88ab2e1b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t amt)` | Send a channel pressure message via the given device.
|
||||
`public void `[`midi_send_clock`](#group__send__functions_1ga4e1b11a7cdb0875f6e03ce7c79c581aa)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a clock message via the given device.
|
||||
`public void `[`midi_send_tick`](#group__send__functions_1ga2b43c7d433d940c5b907595aac947972)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a tick message via the given device.
|
||||
`public void `[`midi_send_start`](#group__send__functions_1ga1569749a8d58ccc56789289d7c7245cc)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a start message via the given device.
|
||||
`public void `[`midi_send_continue`](#group__send__functions_1gaed5dc29d754a27372e89ab8bc20ee120)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a continue message via the given device.
|
||||
`public void `[`midi_send_stop`](#group__send__functions_1ga026e1a620276cb653ac501aa0d12a988)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a stop message via the given device.
|
||||
`public void `[`midi_send_activesense`](#group__send__functions_1ga9b6e4c6ce4719d2604187b325620db37)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send an active sense message via the given device.
|
||||
`public void `[`midi_send_reset`](#group__send__functions_1ga3671e39a6d93ca9568fc493001af1b1b)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a reset message via the given device.
|
||||
`public void `[`midi_send_tcquarterframe`](#group__send__functions_1ga5b85639910eec280bb744c934d0fd45a)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t time)` | Send a tc quarter frame message via the given device.
|
||||
`public void `[`midi_send_songposition`](#group__send__functions_1gab1c9eeef3b57a8cd2e6128d18e85eb7f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t pos)` | Send a song position message via the given device.
|
||||
`public void `[`midi_send_songselect`](#group__send__functions_1ga42de7838ba70d949af9a50f9facc3c50)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t song)` | Send a song select message via the given device.
|
||||
`public void `[`midi_send_tunerequest`](#group__send__functions_1ga8db6c7e04d48e4d2266dd59118ca0656)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a tune request message via the given device.
|
||||
`public void `[`midi_send_byte`](#group__send__functions_1ga857e85eb90b288385642d4d991e09881)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t b)` | Send a byte via the given device.
|
||||
`public void `[`midi_send_data`](#group__send__functions_1ga36e2f2e45369d911b76969361679054b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t byte0,uint8_t byte1,uint8_t byte2)` | Send up to 3 bytes of data.
|
||||
`public void `[`midi_send_array`](#group__send__functions_1ga245243cb1da18d2cea18d4b18d846ead)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t * array)` | Send an array of formatted midi data.
|
||||
|
||||
## Members
|
||||
|
||||
#### `public void `[`midi_send_cc`](#group__send__functions_1gaaf884811c92df405ca8fe1a00082f960)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t val)` {#group__send__functions_1gaaf884811c92df405ca8fe1a00082f960}
|
||||
|
||||
Send a control change message (cc) via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `chan` the channel to send on, 0-15
|
||||
|
||||
* `num` the cc num
|
||||
|
||||
* `val` the value of that cc num
|
||||
|
||||
#### `public void `[`midi_send_noteon`](#group__send__functions_1ga467bcf46dbf03ec269ce565b46bc2775)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t vel)` {#group__send__functions_1ga467bcf46dbf03ec269ce565b46bc2775}
|
||||
|
||||
Send a note on message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `chan` the channel to send on, 0-15
|
||||
|
||||
* `num` the note number
|
||||
|
||||
* `vel` the note velocity
|
||||
|
||||
#### `public void `[`midi_send_noteoff`](#group__send__functions_1gaedb7d8805425eef5d47d57ddcb4c7a49)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t vel)` {#group__send__functions_1gaedb7d8805425eef5d47d57ddcb4c7a49}
|
||||
|
||||
Send a note off message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `chan` the channel to send on, 0-15
|
||||
|
||||
* `num` the note number
|
||||
|
||||
* `vel` the note velocity
|
||||
|
||||
#### `public void `[`midi_send_aftertouch`](#group__send__functions_1ga0014847571317a0e34b2ef46a6bc584f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t note_num,uint8_t amt)` {#group__send__functions_1ga0014847571317a0e34b2ef46a6bc584f}
|
||||
|
||||
Send an after touch message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `chan` the channel to send on, 0-15
|
||||
|
||||
* `note_num` the note number
|
||||
|
||||
* `amt` the after touch amount
|
||||
|
||||
#### `public void `[`midi_send_pitchbend`](#group__send__functions_1gae5a4a1e71611e7534be80af9ce3d3491)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,int16_t amt)` {#group__send__functions_1gae5a4a1e71611e7534be80af9ce3d3491}
|
||||
|
||||
Send a pitch bend message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `chan` the channel to send on, 0-15
|
||||
|
||||
* `amt` the bend amount range: -8192..8191, 0 means no bend
|
||||
|
||||
#### `public void `[`midi_send_programchange`](#group__send__functions_1ga7b15588ef25e5e1ff09c2afc3151ce86)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num)` {#group__send__functions_1ga7b15588ef25e5e1ff09c2afc3151ce86}
|
||||
|
||||
Send a program change message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `chan` the channel to send on, 0-15
|
||||
|
||||
* `num` the program to change to
|
||||
|
||||
#### `public void `[`midi_send_channelpressure`](#group__send__functions_1gaf23e69fdf812e89c0036f51f88ab2e1b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t amt)` {#group__send__functions_1gaf23e69fdf812e89c0036f51f88ab2e1b}
|
||||
|
||||
Send a channel pressure message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `chan` the channel to send on, 0-15
|
||||
|
||||
* `amt` the amount of channel pressure
|
||||
|
||||
#### `public void `[`midi_send_clock`](#group__send__functions_1ga4e1b11a7cdb0875f6e03ce7c79c581aa)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga4e1b11a7cdb0875f6e03ce7c79c581aa}
|
||||
|
||||
Send a clock message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
#### `public void `[`midi_send_tick`](#group__send__functions_1ga2b43c7d433d940c5b907595aac947972)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga2b43c7d433d940c5b907595aac947972}
|
||||
|
||||
Send a tick message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
#### `public void `[`midi_send_start`](#group__send__functions_1ga1569749a8d58ccc56789289d7c7245cc)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga1569749a8d58ccc56789289d7c7245cc}
|
||||
|
||||
Send a start message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
#### `public void `[`midi_send_continue`](#group__send__functions_1gaed5dc29d754a27372e89ab8bc20ee120)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1gaed5dc29d754a27372e89ab8bc20ee120}
|
||||
|
||||
Send a continue message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
#### `public void `[`midi_send_stop`](#group__send__functions_1ga026e1a620276cb653ac501aa0d12a988)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga026e1a620276cb653ac501aa0d12a988}
|
||||
|
||||
Send a stop message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
#### `public void `[`midi_send_activesense`](#group__send__functions_1ga9b6e4c6ce4719d2604187b325620db37)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga9b6e4c6ce4719d2604187b325620db37}
|
||||
|
||||
Send an active sense message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
#### `public void `[`midi_send_reset`](#group__send__functions_1ga3671e39a6d93ca9568fc493001af1b1b)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga3671e39a6d93ca9568fc493001af1b1b}
|
||||
|
||||
Send a reset message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
#### `public void `[`midi_send_tcquarterframe`](#group__send__functions_1ga5b85639910eec280bb744c934d0fd45a)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t time)` {#group__send__functions_1ga5b85639910eec280bb744c934d0fd45a}
|
||||
|
||||
Send a tc quarter frame message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `time` the time of this quarter frame, range 0..16383
|
||||
|
||||
#### `public void `[`midi_send_songposition`](#group__send__functions_1gab1c9eeef3b57a8cd2e6128d18e85eb7f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t pos)` {#group__send__functions_1gab1c9eeef3b57a8cd2e6128d18e85eb7f}
|
||||
|
||||
Send a song position message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `pos` the song position
|
||||
|
||||
#### `public void `[`midi_send_songselect`](#group__send__functions_1ga42de7838ba70d949af9a50f9facc3c50)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t song)` {#group__send__functions_1ga42de7838ba70d949af9a50f9facc3c50}
|
||||
|
||||
Send a song select message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `song` the song to select
|
||||
|
||||
#### `public void `[`midi_send_tunerequest`](#group__send__functions_1ga8db6c7e04d48e4d2266dd59118ca0656)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga8db6c7e04d48e4d2266dd59118ca0656}
|
||||
|
||||
Send a tune request message via the given device.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
#### `public void `[`midi_send_byte`](#group__send__functions_1ga857e85eb90b288385642d4d991e09881)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t b)` {#group__send__functions_1ga857e85eb90b288385642d4d991e09881}
|
||||
|
||||
Send a byte via the given device.
|
||||
|
||||
This is a generic method for sending data via the given midi device. This would be useful for sending sysex data or messages that are not implemented in this API, if there are any. Please contact the author if you find some so we can add them.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `b` the byte to send
|
||||
|
||||
#### `public void `[`midi_send_data`](#group__send__functions_1ga36e2f2e45369d911b76969361679054b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t byte0,uint8_t byte1,uint8_t byte2)` {#group__send__functions_1ga36e2f2e45369d911b76969361679054b}
|
||||
|
||||
Send up to 3 bytes of data.
|
||||
|
||||
% 4 is applied to count so that you can use this to pass sysex through
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `count` the count of bytes to send, %4 is applied
|
||||
|
||||
* `byte0` the first byte
|
||||
|
||||
* `byte1` the second byte, ignored if cnt % 4 != 2
|
||||
|
||||
* `byte2` the third byte, ignored if cnt % 4 != 3
|
||||
|
||||
#### `public void `[`midi_send_array`](#group__send__functions_1ga245243cb1da18d2cea18d4b18d846ead)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t * array)` {#group__send__functions_1ga245243cb1da18d2cea18d4b18d846ead}
|
||||
|
||||
Send an array of formatted midi data.
|
||||
|
||||
Can be used for sysex.
|
||||
|
||||
#### Parameters
|
||||
* `device` the device to use for sending
|
||||
|
||||
* `count` the count of bytes to send
|
||||
|
||||
* `array` the array of bytes
|
||||
|
@ -1,61 +0,0 @@
|
||||
# group `sysex_tools` {#group__sysex__tools}
|
||||
|
||||
## Summary
|
||||
|
||||
Members | Descriptions
|
||||
--------------------------------|---------------------------------------------
|
||||
`public uint16_t `[`sysex_encoded_length`](#group__sysex__tools_1ga061e5607030412d6e62e2390d8013f0a)`(uint16_t decoded_length)` | Compute the length of a message after it is encoded.
|
||||
`public uint16_t `[`sysex_decoded_length`](#group__sysex__tools_1ga121fc227d3acc1c0ea08c9a5c26fa3b0)`(uint16_t encoded_length)` | Compute the length of a message after it is decoded.
|
||||
`public uint16_t `[`sysex_encode`](#group__sysex__tools_1ga54d77f8d32f92a6f329daefa2b314742)`(uint8_t * encoded,const uint8_t * source,uint16_t length)` | Encode data so that it can be transmitted safely in a sysex message.
|
||||
`public uint16_t `[`sysex_decode`](#group__sysex__tools_1gaaad1d9ba2d5eca709a0ab4ba40662229)`(uint8_t * decoded,const uint8_t * source,uint16_t length)` | Decode encoded data.
|
||||
|
||||
## Members
|
||||
|
||||
#### `public uint16_t `[`sysex_encoded_length`](#group__sysex__tools_1ga061e5607030412d6e62e2390d8013f0a)`(uint16_t decoded_length)` {#group__sysex__tools_1ga061e5607030412d6e62e2390d8013f0a}
|
||||
|
||||
Compute the length of a message after it is encoded.
|
||||
|
||||
#### Parameters
|
||||
* `decoded_length` The length, in bytes, of the message to encode.
|
||||
|
||||
#### Returns
|
||||
The length, in bytes, of the message after encodeing.
|
||||
|
||||
#### `public uint16_t `[`sysex_decoded_length`](#group__sysex__tools_1ga121fc227d3acc1c0ea08c9a5c26fa3b0)`(uint16_t encoded_length)` {#group__sysex__tools_1ga121fc227d3acc1c0ea08c9a5c26fa3b0}
|
||||
|
||||
Compute the length of a message after it is decoded.
|
||||
|
||||
#### Parameters
|
||||
* `encoded_length` The length, in bytes, of the encoded message.
|
||||
|
||||
#### Returns
|
||||
The length, in bytes, of the message after it is decoded.
|
||||
|
||||
#### `public uint16_t `[`sysex_encode`](#group__sysex__tools_1ga54d77f8d32f92a6f329daefa2b314742)`(uint8_t * encoded,const uint8_t * source,uint16_t length)` {#group__sysex__tools_1ga54d77f8d32f92a6f329daefa2b314742}
|
||||
|
||||
Encode data so that it can be transmitted safely in a sysex message.
|
||||
|
||||
#### Parameters
|
||||
* `encoded` The output data buffer, must be at least sysex_encoded_length(length) bytes long.
|
||||
|
||||
* `source` The input buffer of data to be encoded.
|
||||
|
||||
* `length` The number of bytes from the input buffer to encode.
|
||||
|
||||
#### Returns
|
||||
number of bytes encoded.
|
||||
|
||||
#### `public uint16_t `[`sysex_decode`](#group__sysex__tools_1gaaad1d9ba2d5eca709a0ab4ba40662229)`(uint8_t * decoded,const uint8_t * source,uint16_t length)` {#group__sysex__tools_1gaaad1d9ba2d5eca709a0ab4ba40662229}
|
||||
|
||||
Decode encoded data.
|
||||
|
||||
#### Parameters
|
||||
* `decoded` The output data buffer, must be at least sysex_decoded_length(length) bytes long.
|
||||
|
||||
* `source` The input buffer of data to be decoded.
|
||||
|
||||
* `length` The number of bytes from the input buffer to decode.
|
||||
|
||||
#### Returns
|
||||
number of bytes decoded.
|
||||
|
@ -0,0 +1,11 @@
|
||||
## Key Lock: Holding down keys for you
|
||||
|
||||
Sometimes, you need to hold down a specific key for a long period of time. Whether this is while typing in ALL CAPS, or playing a video game that hasn't implemented auto-run, Key Lock is here to help. Key Lock adds a new keycode, `KC_LOCK`, that will hold down the next key you hit for you. The key is released when you hit it again. Here's an example: let's say you need to type in all caps for a few sentences. You hit KC_LOCK, and then shift. Now, shift will be considered held until you hit it again. You can think of key lock as caps lock, but supercharged.
|
||||
|
||||
Here's how to use it:
|
||||
|
||||
1. Pick a key on your keyboard. This will be the key lock key. Assign it the keycode `KC_LOCK`. This will be a single-action key: you won't be able to use it for anything else.
|
||||
2. Enable key lock by including `KEY_LOCK_ENABLE = yes` in your Makefile.
|
||||
3. That's it!
|
||||
|
||||
Important: switching layers does not cancel the key lock. Additionally, key lock is only able to hold standard action keys and One Shot modifier keys (for example, if you have your shift defined as `OSM(KC_LSFT)`; see [One Shot Keys](quantum_keycodes.md#one-shot-keys)). This does not include any of the QMK special functions (except One Shot modifiers), or shifted versions of keys such as KC_LPRN. If it's in the [basic_keycodes](basic_keycodes.md) list, it can be held. If it's not, then it can't be.
|
@ -1,31 +1,31 @@
|
||||
# US ANSI Shifted Symbols
|
||||
# US ANSI Shifted symbols
|
||||
|
||||
These keycodes correspond to characters that are "shifted" on a standard US ANSI keyboards. They do not have dedicated keycodes but are instead typed by holding down shift and then sending a keycode.
|
||||
These keycodes correspond to characters that are "shifted" on a standard US ANSI keyboards. They do not have dedicated keycodes but are instead typed by holding down shift and then sending a keycode.
|
||||
|
||||
It's important to remember that all of these keycodes send a left shift - this may cause unintended actions if unaccounted for. The short code is preferred in most situations.
|
||||
|
||||
## US ANSI Shifted Keycodes
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|------------------------|------------------|-------------------|
|
||||
|`KC_TILDE` |`KC_TILD` |`~` |
|
||||
|`KC_EXCLAIM` |`KC_EXLM` |`!` |
|
||||
|`KC_AT` | |`@` |
|
||||
|`KC_HASH` | |`#` |
|
||||
|`KC_DOLLAR` |`KC_DLR` |`$` |
|
||||
|`KC_PERCENT` |`KC_PERC` |`%` |
|
||||
|`KC_CIRCUMFLEX` |`KC_CIRC` |`^` |
|
||||
|`KC_AMPERSAND` |`KC_AMPR` |`&` |
|
||||
|`KC_ASTERISK` |`KC_ASTR` |`*` |
|
||||
|`KC_LEFT_PAREN` |`KC_LPRN` |`(` |
|
||||
|`KC_RIGHT_PAREN` |`KC_RPRN` |`)` |
|
||||
|`KC_UNDERSCORE` |`KC_UNDS` |`_` |
|
||||
|`KC_PLUS` | |`+` |
|
||||
|`KC_LEFT_CURLY_BRACE` |`KC_LCBR` |`{` |
|
||||
|`KC_RIGHT_CURLY_BRACE` |`KC_RCBR` |`}` |
|
||||
|`KC_PIPE` | |<code>|</code>|
|
||||
|`KC_COLON` |`KC_COLN` |`:` |
|
||||
|`KC_DOUBLE_QUOTE` |`KC_DQT`/`KC_DQUO`|`"` |
|
||||
|`KC_LEFT_ANGLE_BRACKET` |`KC_LT`/`KC_LABK` |`<` |
|
||||
|`KC_RIGHT_ANGLE_BRACKET`|`KC_GT`/`KC_RABK` |`>` |
|
||||
|`KC_QUESTION` |`KC_QUES` |`?` |
|
||||
|Short Name|Long Name|Description|
|
||||
|----------|---------|-----------|
|
||||
|`KC_TILD`|`KC_TILDE`|tilde `~`|
|
||||
|`KC_EXLM`|`KC_EXCLAIM`|exclamation mark `!`|
|
||||
|`KC_AT`||at sign `@`|
|
||||
|`KC_HASH`||hash sign `#`|
|
||||
|`KC_DLR`|`KC_DOLLAR`|dollar sign `$`|
|
||||
|`KC_PERC`|`KC_PERCENT`|percent sign `%`|
|
||||
|`KC_CIRC`|`KC_CIRCUMFLEX`|circumflex `^`|
|
||||
|`KC_AMPR`|`KC_AMPERSAND`|ampersand `&`|
|
||||
|`KC_ASTR`|`KC_ASTERISK`|asterisk `*`|
|
||||
|`KC_LPRN`|`KC_LEFT_PAREN`|left parenthesis `(`|
|
||||
|`KC_RPRN`|`KC_RIGHT_PAREN`|right parenthesis `)`|
|
||||
|`KC_UNDS`|`KC_UNDERSCORE`|underscore `_`|
|
||||
|`KC_PLUS`||plus sign `+`|
|
||||
|`KC_LCBR`|`KC_LEFT_CURLY_BRACE`|left curly brace `{`|
|
||||
|`KC_RCBR`|`KC_RIGHT_CURLY_BRACE`|right curly brace `}`|
|
||||
|`KC_LT`/`KC_LABK`|`KC_LEFT_ANGLE_BRACKET`|left angle bracket `<`|
|
||||
|`KC_GT`/`KC_RABK`|`KC_RIGHT_ANGLE_BRACKET`|right angle bracket `>`|
|
||||
|`KC_COLN`|`KC_COLON`|colon `:`|
|
||||
|`KC_PIPE`||pipe `\|`|
|
||||
|`KC_QUES`|`KC_QUESTION`|question mark `?`|
|
||||
|`KC_DQT`/`KC_DQUO`|`KC_DOUBLE_QUOTE`|double quote `"`|
|
||||
|
@ -0,0 +1,220 @@
|
||||
# Macros
|
||||
|
||||
Macros allow you to send multiple keystrokes when pressing just one key. QMK has a number of ways to define and use macros. These can do anything you want: type common phrases for you, copypasta, repetitive game movements, or even help you code.
|
||||
|
||||
{% hint style='danger' %}
|
||||
**Security Note**: While it is possible to use macros to send passwords, credit card numbers, and other sensitive information it is a supremely bad idea to do so. Anyone who gets ahold of your keyboard will be able to access that information by opening a text editor.
|
||||
{% endhint %}
|
||||
|
||||
## The new way: `SEND_STRING()` & `process_record_user`
|
||||
|
||||
Sometimes you just want a key to type out words or phrases. For the most common situations we've provided `SEND_STRING()`, which will type out your string for you. All ascii that is easily translated to a keycode is supported (eg `\n\t`).
|
||||
|
||||
For example:
|
||||
|
||||
```c
|
||||
enum custom_keycodes {
|
||||
PRINT_TRUTH = SAFE_RANGE
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
switch(keycode) {
|
||||
case PRINT_TRUTH:
|
||||
SEND_STRING("QMK is the best thing ever!");
|
||||
return false; break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
```
|
||||
|
||||
### Tap/down/up
|
||||
|
||||
You can send arbitary keycodes by wrapping them in:
|
||||
|
||||
* `SS_TAP()`
|
||||
* `SS_DOWN()`
|
||||
* `SS_UP()`
|
||||
|
||||
For example:
|
||||
|
||||
SEND_STRING(SS_TAP(X_HOME));
|
||||
|
||||
Would tap `KC_HOME` - note how the prefix is now `X_`, and not `KC_`. You can also combine this with other strings, like this:
|
||||
|
||||
SEND_STRING("VE"SS_TAP(X_HOME)"LO");
|
||||
|
||||
Which would send "VE" followed by a `KC_HOME` tap, and "LO" (spelling "LOVE" if on a newline).
|
||||
|
||||
There's also a couple of mod shortcuts you can use:
|
||||
|
||||
* `SS_LCTRL(string)`
|
||||
* `SS_LGUI(string)`
|
||||
* `SS_LALT(string)`
|
||||
|
||||
That can be used like this:
|
||||
|
||||
SEND_STRING(SS_LCTRL("a"));
|
||||
|
||||
Which would send LCTRL+a (LTRL down, a, LTRL up) - notice that they take strings (eg `"k"`), and not the `X_K` keycodes.
|
||||
|
||||
### Alternative keymaps
|
||||
|
||||
By default, it assumes a US keymap with a QWERTY layout; if you want to change that (e.g. if your OS uses software Colemak), include this somewhere in your keymap:
|
||||
|
||||
#include <sendstring_colemak.h>
|
||||
|
||||
### Strings in memory
|
||||
|
||||
If for some reason you're manipulating strings and need to print out something you just generated (instead of being a literal, constant string), you can use `send_string()`, like this:
|
||||
|
||||
```c
|
||||
char my_str[4] = "ok.";
|
||||
send_string(my_str);
|
||||
```
|
||||
|
||||
The shortcuts defined above won't work with `send_string()`, but you can separate things out to different lines if needed:
|
||||
|
||||
```c
|
||||
char my_str[4] = "ok.";
|
||||
SEND_STRING("I said: ");
|
||||
send_string(my_str);
|
||||
SEND_STRING(".."SS_TAP(X_END));
|
||||
```
|
||||
|
||||
## The old way: `MACRO()` & `action_get_macro`
|
||||
|
||||
{% hint style='info' %}
|
||||
This is inherited from TMK, and hasn't been updated - it's recommend that you use `SEND_STRING` and `process_record_user` instead.
|
||||
{% endhint %}
|
||||
|
||||
By default QMK assumes you don't have any macros. To define your macros you create an `action_get_macro()` function. For example:
|
||||
|
||||
```c
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
if (record->event.pressed) {
|
||||
switch(id) {
|
||||
case 0:
|
||||
return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END);
|
||||
case 1:
|
||||
return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END);
|
||||
}
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
```
|
||||
|
||||
This defines two macros which will be run when the key they are assigned to is pressed. If instead you'd like them to run when the key is released you can change the if statement:
|
||||
|
||||
if (!record->event.pressed) {
|
||||
|
||||
### Macro Commands
|
||||
|
||||
A macro can include the following commands:
|
||||
|
||||
* I() change interval of stroke in milliseconds.
|
||||
* D() press key.
|
||||
* U() release key.
|
||||
* T() type key(press and release).
|
||||
* W() wait (milliseconds).
|
||||
* END end mark.
|
||||
|
||||
### Mapping a Macro to a key
|
||||
|
||||
Use the `M()` function within your `KEYMAP()` to call a macro. For example, here is the keymap for a 2-key keyboard:
|
||||
|
||||
```c
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = KEYMAP(
|
||||
M(0), M(1)
|
||||
),
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
if (record->event.pressed) {
|
||||
switch(id) {
|
||||
case 0:
|
||||
return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END);
|
||||
case 1:
|
||||
return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END);
|
||||
}
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
```
|
||||
|
||||
When you press the key on the left it will type "Hi!" and when you press the key on the right it will type "Bye!".
|
||||
|
||||
### Naming your macros
|
||||
|
||||
If you have a bunch of macros you want to refer to from your keymap while keeping the keymap easily readable you can name them using `#define` at the top of your file.
|
||||
|
||||
```c
|
||||
#define M_HI M(0)
|
||||
#define M_BYE M(1)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = KEYMAP(
|
||||
M_HI, M_BYE
|
||||
),
|
||||
};
|
||||
```
|
||||
|
||||
## Advanced macro functions
|
||||
|
||||
There are some functions you may find useful in macro-writing. Keep in mind that while you can write some fairly advanced code within a macro if your functionality gets too complex you may want to define a custom keycode instead. Macros are meant to be simple.
|
||||
|
||||
### `record->event.pressed`
|
||||
|
||||
This is a boolean value that can be tested to see if the switch is being pressed or released. An example of this is
|
||||
|
||||
```c
|
||||
if (record->event.pressed) {
|
||||
// on keydown
|
||||
} else {
|
||||
// on keyup
|
||||
}
|
||||
```
|
||||
|
||||
### `register_code(<kc>);`
|
||||
|
||||
This sends the `<kc>` keydown event to the computer. Some examples would be `KC_ESC`, `KC_C`, `KC_4`, and even modifiers such as `KC_LSFT` and `KC_LGUI`.
|
||||
|
||||
### `unregister_code(<kc>);`
|
||||
|
||||
Parallel to `register_code` function, this sends the `<kc>` keyup event to the computer. If you don't use this, the key will be held down until it's sent.
|
||||
|
||||
### `clear_keyboard();`
|
||||
|
||||
This will clear all mods and keys currently pressed.
|
||||
|
||||
### `clear_mods();`
|
||||
|
||||
This will clear all mods currently pressed.
|
||||
|
||||
### `clear_keyboard_but_mods();`
|
||||
|
||||
This will clear all keys besides the mods currently pressed.
|
||||
|
||||
## Advanced Example: Single-key copy/paste
|
||||
|
||||
This example defines a macro which sends `Ctrl-C` when pressed down, and `Ctrl-V` when released.
|
||||
|
||||
```c
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
switch(id) {
|
||||
case 0: {
|
||||
if (record->event.pressed) {
|
||||
return MACRO( D(LCTL), T(C), U(LCTL), END );
|
||||
} else {
|
||||
return MACRO( D(LCTL), T(V), U(LCTL), END );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
```
|
||||
|
||||
|
@ -0,0 +1,81 @@
|
||||
# Mousekeys
|
||||
|
||||
|
||||
Mousekeys is a feature that allows you to emulate a mouse using your keyboard. You can move the pointer around, click up to 5 buttons, and even scroll in all 4 directions. QMK uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
|
||||
|
||||
## Adding Mousekeys To a Keymap
|
||||
|
||||
There are two steps to adding Mousekeys support to your keyboard. You must enable support in the Makefile and you must map mouse actions to keys on your keyboard.
|
||||
|
||||
### Adding Mousekeys support in the `Makefile`
|
||||
|
||||
To add support for Mousekeys you simply need to add a single line to your keymap's `Makefile`:
|
||||
|
||||
```
|
||||
MOUSEKEY_ENABLE = yes
|
||||
```
|
||||
|
||||
You can see an example here: https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/keymaps/mouse_keys/Makefile
|
||||
|
||||
### Mapping Mouse Actions To Keyboard Keys
|
||||
|
||||
You can use these keycodes within your keymap to map button presses to mouse actions:
|
||||
|
||||
|Long Name|Short Name|Description|
|
||||
|---------|----------|-----------|
|
||||
|KC_MS_UP|KC_MS_U|Mouse Cursor Up|
|
||||
|KC_MS_DOWN|KC_MS_D|Mouse Cursor Down|
|
||||
|KC_MS_LEFT|KC_MS_L|Mouse Cursor Left|
|
||||
|KC_MS_RIGHT|KC_MS_R|Mouse Cursor Right|
|
||||
|KC_MS_BTN1|KC_BTN1|Mouse Button 1|
|
||||
|KC_MS_BTN2|KC_BTN2|Mouse Button 2|
|
||||
|KC_MS_BTN3|KC_BTN3|Mouse Button 3|
|
||||
|KC_MS_BTN4|KC_BTN4|Mouse Button 4|
|
||||
|KC_MS_BTN5|KC_BTN5|Mouse Button 5|
|
||||
|KC_MS_WH_UP|KC_WH_U|Mouse Wheel Up|
|
||||
|KC_MS_WH_DOWN|KC_WH_D|Mouse Wheel Down|
|
||||
|KC_MS_WH_LEFT|KC_WH_L|Mouse Wheel Left|
|
||||
|KC_MS_WH_RIGHT|KC_WH_R|Mouse Wheel Right|
|
||||
|KC_MS_ACCEL0|KC_ACL0|Set Mouse Acceleration Speed to 0|
|
||||
|KC_MS_ACCEL1|KC_ACL1|Set Mouse Acceleration Speed to 1|
|
||||
|KC_MS_ACCEL2|KC_ACL2|Set Mouse Acceleration Speed to 2|
|
||||
|
||||
You can see an example in the `_ML` here: https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/keymaps/mouse_keys/keymap.c#L46
|
||||
|
||||
## Configuring the behavior of Mousekeys
|
||||
|
||||
The default speed for controlling the mouse with the keyboard is intentionaly slow. You can adjust these parameters by adding these settings to your keymap's `config.h` file. All times are specified in miliseconds (ms).
|
||||
|
||||
```
|
||||
#define MOUSEKEY_DELAY 300
|
||||
#define MOUSEKEY_INTERVAL 50
|
||||
#define MOUSEKEY_MAX_SPEED 10
|
||||
#define MOUSEKEY_TIME_TO_MAX 20
|
||||
#define MOUSEKEY_WHEEL_MAX_SPEED 8
|
||||
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40
|
||||
```
|
||||
|
||||
|
||||
### `MOUSEKEY_DELAY`
|
||||
|
||||
When one of the mouse movement buttons is pressed this setting is used to define the delay between that button press and the mouse cursor moving. Some people find that small movements are impossible if this setting is too low, while settings that are too high feel sluggish.
|
||||
|
||||
### `MOUSEKEY_INTERVAL`
|
||||
|
||||
When a movement key is held down this specifies how long to wait between each movement report. Lower settings will translate into an effectively higher mouse speed.
|
||||
|
||||
### `MOUSEKEY_MAX_SPEED`
|
||||
|
||||
As a movement key is held down the speed of the mouse cursor will increase until it reaches `MOUSEKEY_MAX_SPEED`.
|
||||
|
||||
### `MOUSEKEY_TIME_TO_MAX`
|
||||
|
||||
How long you want to hold down a movement key for until `MOUSEKEY_MAX_SPEED` is reached. This controls how quickly your cursor will accelerate.
|
||||
|
||||
### `MOUSEKEY_WHEEL_MAX_SPEED`
|
||||
|
||||
The top speed for scrolling movements.
|
||||
|
||||
### `MOUSEKEY_WHEEL_TIME_TO_MAX`
|
||||
|
||||
How long you want to hold down a scroll key for until `MOUSEKEY_WHEEL_MAX_SPEED` is reached. This controls how quickling your scrolling will accelerate.
|
@ -1,16 +0,0 @@
|
||||
# The Compelete Newbs Guide To QMK
|
||||
|
||||
QMK is a powerful Open Source firmware for your mechanical keyboard. You can use QMK to customize your keyboard in ways both simple and powerful. People of all skill levels, from complete newbie to master programmer, have successfully used QMK to customize their keyboard. This guide will help you do the same, no matter your skill level.
|
||||
|
||||
Not sure if your keyboard can run QMK? If it's a mechanical keyboard you built yourself chances are good it can. We support a [large number of hobbyist boards](http://qmk.fm/keyboards/), so even if your current keyboard can't run QMK you shouldn't have trouble finding one to suit your needs.
|
||||
|
||||
## Overview
|
||||
|
||||
There are 4 main sections to this guide:
|
||||
|
||||
* [Getting Started](newbs_getting_started.md)
|
||||
* [Building Your First Firmware](newbs_building_firmware.md)
|
||||
* [Flashing Firmware](newbs_flashing.md)
|
||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||
|
||||
This guide is focused on helping someone who has never compiled software before. It makes choices and recommendations based on that viewpoint. There are alternative methods for many of these procedures, and we support most of those alternatives. If you have any doubt about how to accomplish a task you can [ask us for guidance](getting_started_getting_help.md).
|
@ -1,73 +0,0 @@
|
||||
# Building Your First Firmware
|
||||
|
||||
Now that you have setup your build environment you are ready to start building custom firmware. For this section of the guide we will bounce between 3 programs- your file manager, your text editor, and your terminal window. Keep all 3 open until you are done and happy with your keyboard firmware.
|
||||
|
||||
If you have closed and reopened your terminal window since following the first part of the guide, don't forget to `cd qmk_firmware` so that your terminal is in the correct directory.
|
||||
|
||||
## Navigate To Your Keymaps Folder
|
||||
|
||||
Start by navigating to the `keymaps` folder for your keyboard.
|
||||
|
||||
{% hint style='info' %}
|
||||
If you are on macOS or Windows there are commands you can use to easily open the keymaps folder.
|
||||
|
||||
macOS:
|
||||
|
||||
open keyboards/<keyboard_folder>/keymaps
|
||||
|
||||
Windows:
|
||||
|
||||
start keyboards/<keyboard_folder>/keymaps
|
||||
{% endhint %}
|
||||
|
||||
## Create a Copy Of The `default` Keymap
|
||||
|
||||
Once you have the `keymaps` folder open you will want to create a copy of the `default` folder. We highly recommend you name your folder the same as your GitHub username, but you can use any name you want as long as it contains only lower case letters, numbers, and the underscore character.
|
||||
|
||||
## Open `keymap.c` In Your Favorite Text Editor
|
||||
|
||||
Open up your `keymap.c`. Inside this file you'll find the structure that controls how your keyboard behaves. At the top of `keymap.c` there may be some defines and enums that make the keymap easier to read. Farther down you'll find a line that looks like this:
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
This line indicates the start of the list of Layers. Below that you'll find lines containing either `LAYOUT` or `KEYMAP`, and these lines indicate the start of a layer. Below that line is the list of keys that comprise a that particular layer.
|
||||
|
||||
{% hint style='danger' %}
|
||||
When editing your keymap file be careful not to add or remove any commas. If you do you will prevent your firmware from compiling and it may not be easy to figure out where the extra, or missing, comma is.
|
||||
{% endhint %}
|
||||
|
||||
## Customize The Layout To Your Liking
|
||||
|
||||
How to complete this step is entirely up to you. Make the one change that's been bugging you, or completely rework everything. You can remove layers if you don't need all of them, or add layers up to a total of 32. Check the following documentation to find out what you can define here:
|
||||
|
||||
* [Keycodes](keycodes.md)
|
||||
* [Features](features.md)
|
||||
* [FAQ](faq.md)
|
||||
|
||||
{% hint style='info' %}
|
||||
While you get a feel for how keymaps work, keep each change small. Bigger changes make it harder to debug any problems that arise.
|
||||
{% endhint %}
|
||||
|
||||
## Build Your Firmware
|
||||
|
||||
When your changes to the keymap are complete you will need to build the firmware. To do so go back to your terminal window and run the build command:
|
||||
|
||||
make <my_keyboard>:<my_keymap>
|
||||
|
||||
For example, if your keymap is named "xyverz" and you're building a keymap for a rev5 planck, you'll use this command:
|
||||
|
||||
make planck/rev5:xyverz
|
||||
|
||||
While this compiles you will have a lot of output going to the screen informing you of what files are being compiled. It should end with output that looks similar to this:
|
||||
|
||||
```
|
||||
Linking: .build/planck_rev5_xyverz.elf [OK]
|
||||
Creating load file for flashing: .build/planck_rev5_xyverz.hex [OK]
|
||||
Copying planck_rev5_xyverz.hex to qmk_firmware folder [OK]
|
||||
Checking file size of planck_rev5_xyverz.hex [OK]
|
||||
* File size is fine - 18392/28672
|
||||
```
|
||||
|
||||
## Flash Your Firmware
|
||||
|
||||
Move on to [Flashing Firmware](newbs_flashing.md) to learn how to write your new firmware to your keyboard.
|
@ -1,242 +0,0 @@
|
||||
# Flashing Your Keyboard
|
||||
|
||||
Now that you've built a custom firmware file you'll want to flash your keyboard.
|
||||
|
||||
## Flashing Your Keyboard with QMK Toolbox
|
||||
|
||||
The simplest way to flash your keyboard will be with the [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases).
|
||||
|
||||
However, the QMK Toolbox is only available for Windows and macOS currently. If you're using Linux (or just wish to flash the firmware from the command line), you'll have to use the [method outlined below](newbs_flashing.md#flash-your-keyboard-from-the-command-line).
|
||||
|
||||
### Load The File Into QMK Toolbox
|
||||
|
||||
Begin by opening the QMK Toolbox application. You'll want to locate the firmware file in Finder or Explorer. Your keyboard firmware may be in one of two formats- `.hex` or `.bin`. QMK tries to copy the appropriate one for your keyboard into the root `qmk_firmware` directory.
|
||||
|
||||
{% hint style='info' %}
|
||||
If you are on Windows or macOS there are commands you can use to easily open the current firmware folder in Explorer or Finder.
|
||||
|
||||
Windows:
|
||||
|
||||
start .
|
||||
|
||||
macOS:
|
||||
|
||||
open .
|
||||
{% endhint %}
|
||||
|
||||
The firmware file always follows this naming format:
|
||||
|
||||
<keyboard_name>_<keymap_name>.{bin,hex}
|
||||
|
||||
For example, the `plank/rev5` with a `default` keymap will have this filename:
|
||||
|
||||
planck_rev5_default.hex
|
||||
|
||||
Once you have located your firmware file drag it into the "Local file" box in QMK Toolbox, or click "Open" and navigate to where your firmware file is stored.
|
||||
|
||||
### Put Your Keyboard Into DFU (Bootloader) Mode
|
||||
|
||||
In order to flash your custom firmware you have to put your keyboard into a special flashing mode. While it is in this mode you will not be able to type or otherwise use your keyboard. It is very important that you do not unplug your keyboard or otherwise interrupt the flashing process while the firmware is being written.
|
||||
|
||||
Different keyboards have different ways to enter this special mode. If your PCB currently runs QMK or TMK and you have not been given specific instructions try the following, in order:
|
||||
|
||||
* Hold down both shift keys and press `Pause`
|
||||
* Hold down both shift keys and press `B`
|
||||
* Unplug your keyboard, hold down the Spacebar and `B` at the same time, plug in your keyboard and wait a second before releasing the keys
|
||||
* Press the physical `RESET` button on the bottom of the PCB
|
||||
* Locate header pins on the PCB labeled `BOOT0` or `RESET`, short those together while plugging your PCB in
|
||||
|
||||
When you are successful you will see a message similar to this in QMK Toolbox:
|
||||
|
||||
```
|
||||
*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390
|
||||
*** DFU device connected
|
||||
```
|
||||
|
||||
### Flash Your Keyboard
|
||||
|
||||
Click the `Flash` button in QMK Toolbox. You will see output similar to the following:
|
||||
|
||||
```
|
||||
*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390
|
||||
*** DFU device connected
|
||||
*** Attempting to flash, please don't remove device
|
||||
>>> dfu-programmer atmega32u4 erase --force
|
||||
Erasing flash... Success
|
||||
Checking memory from 0x0 to 0x6FFF... Empty.
|
||||
>>> dfu-programmer atmega32u4 flash /Users/skully/qmk_firmware/clueboard_66_hotswap_gen1_skully.hex
|
||||
Checking memory from 0x0 to 0x55FF... Empty.
|
||||
0% 100% Programming 0x5600 bytes...
|
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
|
||||
0% 100% Reading 0x7000 bytes...
|
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
|
||||
Validating... Success
|
||||
0x5600 bytes written into 0x7000 bytes memory (76.79%).
|
||||
>>> dfu-programmer atmega32u4 reset
|
||||
|
||||
*** DFU device disconnected
|
||||
*** Clueboard - Clueboard 66% HotSwap connected -- 0xC1ED:0x2390
|
||||
```
|
||||
|
||||
## Flash your Keyboard from the Command Line
|
||||
|
||||
First thing you'll need to know is which bootloader that your keyboard uses. There are four main bootloaders that are used, usually. Pro-Micro and clones use CATERINA, and Teensy's use Halfkay, OLKB boards use QMK-DFU, and other atmega32u4 chips use DFU.
|
||||
|
||||
You can find more information about the bootloaders in the [Flashing Instructions and Bootloader Information](flashing.md) page.
|
||||
|
||||
If you know what bootloader that you're using, then when compiling the firmware, you can actually add some extra text to the `make` command to automate the flashing process.
|
||||
|
||||
### DFU
|
||||
|
||||
For the DFU bootloader, when you're ready to compile and flash your firmware, open up your terminal window and run the built command:
|
||||
|
||||
make <my_keyboard>:<my_keymap>:dfu
|
||||
|
||||
For example, if your keymap is named "xyverz" and you're building a keymap for a rev5 planck, you'll use this command:
|
||||
|
||||
make planck/rev5:xyverz:dfu
|
||||
|
||||
Once it finishes compiling, it should output the following:
|
||||
|
||||
```
|
||||
Linking: .build/planck_rev5_xyverz.elf [OK]
|
||||
Creating load file for flashing: .build/planck_rev5_xyverz.hex [OK]
|
||||
Copying planck_rev5_xyverz.hex to qmk_firmware folder [OK]
|
||||
Checking file size of planck_rev5_xyverz.hex
|
||||
* File size is fine - 18574/28672
|
||||
```
|
||||
|
||||
After it gets to this point, the build script will look for the DFU bootloader every 5 seconds. It will repeat the following until the device is found or you cancel it.
|
||||
|
||||
dfu-programmer: no device present.
|
||||
Error: Bootloader not found. Trying again in 5s.
|
||||
|
||||
Once it does this, you'll want to reset the controller. It should then show output similiar to this:
|
||||
|
||||
```
|
||||
*** Attempting to flash, please don't remove device
|
||||
>>> dfu-programmer atmega32u4 erase --force
|
||||
Erasing flash... Success
|
||||
Checking memory from 0x0 to 0x6FFF... Empty.
|
||||
>>> dfu-programmer atmega32u4 flash /Users/skully/qmk_firmware/clueboard_66_hotswap_gen1_skully.hex
|
||||
Checking memory from 0x0 to 0x55FF... Empty.
|
||||
0% 100% Programming 0x5600 bytes...
|
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
|
||||
0% 100% Reading 0x7000 bytes...
|
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
|
||||
Validating... Success
|
||||
0x5600 bytes written into 0x7000 bytes memory (76.79%).
|
||||
>>> dfu-programmer atmega32u4 reset
|
||||
```
|
||||
|
||||
If you have any issues with this, you may need to this:
|
||||
|
||||
sudo make <my_keyboard>:<my_keymap>:dfu
|
||||
|
||||
### Caterina
|
||||
|
||||
For Arduino boards and their close (such as the SparkFun ProMicro), when you're ready to compile and flash your firmware, open up your terminal window and run the built command:
|
||||
|
||||
make <my_keyboard>:<my_keymap>:avrdude
|
||||
|
||||
For example, if your keymap is named "xyverz" and you're building a keymap for a rev2 Lets Split, you'll use this command:
|
||||
|
||||
make lets_split/rev2:xyverz:avrdude
|
||||
|
||||
Once the firmware finishes compiling, it will output something like this:
|
||||
|
||||
```
|
||||
Linking: .build/lets_split_rev2_xyverz.elf [OK]
|
||||
Creating load file for flashing: .build/lets_split_rev2_xyverz.hex [OK]
|
||||
Checking file size of lets_split_rev2_xyverz.hex [OK]
|
||||
* File size is fine - 27938/28672
|
||||
Detecting USB port, reset your controller now..............
|
||||
```
|
||||
|
||||
At this point, reset the board and then the script will detect the bootloader and then flash the board. The output should look something like this:
|
||||
|
||||
```
|
||||
Detected controller on USB port at /dev/ttyS15
|
||||
|
||||
Connecting to programmer: .
|
||||
Found programmer: Id = "CATERIN"; type = S
|
||||
Software Version = 1.0; No Hardware Version given.
|
||||
Programmer supports auto addr increment.
|
||||
Programmer supports buffered memory access with buffersize=128 bytes.
|
||||
|
||||
Programmer supports the following devices:
|
||||
Device code: 0x44
|
||||
|
||||
avrdude.exe: AVR device initialized and ready to accept instructions
|
||||
|
||||
Reading | ################################################## | 100% 0.00s
|
||||
|
||||
avrdude.exe: Device signature = 0x1e9587 (probably m32u4)
|
||||
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
|
||||
To disable this feature, specify the -D option.
|
||||
avrdude.exe: erasing chip
|
||||
avrdude.exe: reading input file "./.build/lets_split_rev2_xyverz.hex"
|
||||
avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex auto detected as Intel Hex
|
||||
avrdude.exe: writing flash (27938 bytes):
|
||||
|
||||
Writing | ################################################## | 100% 2.40s
|
||||
|
||||
avrdude.exe: 27938 bytes of flash written
|
||||
avrdude.exe: verifying flash memory against ./.build/lets_split_rev2_xyverz.hex:
|
||||
avrdude.exe: load data flash data from input file ./.build/lets_split_rev2_xyverz.hex:
|
||||
avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex auto detected as Intel Hex
|
||||
avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex contains 27938 bytes
|
||||
avrdude.exe: reading on-chip flash data:
|
||||
|
||||
Reading | ################################################## | 100% 0.43s
|
||||
|
||||
avrdude.exe: verifying ...
|
||||
avrdude.exe: 27938 bytes of flash verified
|
||||
|
||||
avrdude.exe: safemode: Fuses OK (E:CB, H:D8, L:FF)
|
||||
|
||||
avrdude.exe done. Thank you.
|
||||
```
|
||||
If you have any issues with this, you may need to this:
|
||||
|
||||
sudo make <my_keyboard>:<my_keymap>:avrdude
|
||||
|
||||
## HalfKay
|
||||
|
||||
For the PJRC devices (Teensy's), when you're ready to compile and flash your firmware, open up your terminal window and run the built command:
|
||||
|
||||
make <my_keyboard>:<my_keymap>:teensy
|
||||
|
||||
For example, if your keymap is named "xyverz" and you're building a keymap for an Ergodox or Ergodox EZ, you'll use this command:
|
||||
|
||||
make erdogox_ez:xyverz:teensy
|
||||
|
||||
Once the firmware finishes compiling, it will output something like this:
|
||||
|
||||
```
|
||||
Linking: .build/ergodox_ez_xyverz.elf [OK]
|
||||
Creating load file for flashing: .build/ergodox_ez_xyverz.hex [OK]
|
||||
Checking file size of ergodox_ez_xyverz.hex [OK]
|
||||
* File size is fine - 25584/32256
|
||||
Teensy Loader, Command Line, Version 2.1
|
||||
Read "./.build/ergodox_ez_xyverz.hex": 25584 bytes, 79.3% usage
|
||||
Waiting for Teensy device...
|
||||
(hint: press the reset button)
|
||||
```
|
||||
|
||||
At this point, reset your board. Once you've done that, you'll see output like this:
|
||||
|
||||
```
|
||||
Found HalfKay Bootloader
|
||||
Read "./.build/ergodox_ez_drashna.hex": 28532 bytes, 88.5% usage
|
||||
Programming............................................................................................................................................................................
|
||||
...................................................
|
||||
Booting
|
||||
```
|
||||
|
||||
|
||||
## Test It Out!
|
||||
|
||||
Congrats! Your custom firmware has been programmed to your keyboard!
|
||||
|
||||
Give it a try and make sure everything works the way you want it to. We've written [Testing and Debugging](newbs_testing_debugging.md) to round out this Newbie Guide, so head over there to learn about how to troubleshoot your custom functionality.
|
@ -1,98 +0,0 @@
|
||||
# Introduction
|
||||
|
||||
Your computer keyboard has a processor inside of it, not unlike the one inside your computer. This processor runs software that is responsible for detecting button presses and sending reports about the state of the keyboard when they are pressed or released. QMK fills the role of that software, detecting button presses and passing that information on to the host computer. When you build your custom layout you are creating the equivalent of an .exe for your keyboard.
|
||||
|
||||
QMK tries to put a lot of power into your hands by making easy things easy, and hard things possible. You don't have to know how to program to create powerful layouts, you only have to follow a few simple syntax rules.
|
||||
|
||||
# Getting Started
|
||||
|
||||
Before you can build keymaps you need to install some software and setup your build environment. This only has to be done one time no matter how many keyboards you want to compile firmware for.
|
||||
|
||||
## Download Software
|
||||
|
||||
### Text Editor
|
||||
|
||||
You'll need a program that can edit and save **plain text** files. If you are on Windows you can make due with Notepad, and on Linux you can use Gedit, both of which are simple but functional text editors. On macOS you can not use TextEdit.app, it will not save plain text files. You will need to install another program such as Sublime Text.
|
||||
|
||||
{% hint style='info' %}
|
||||
Not sure which text editor to use? Laurence Bradford wrote [a great introduction](https://learntocodewith.me/programming/basics/text-editors/) to the subject.
|
||||
{% endhint %}
|
||||
|
||||
### QMK Toolbox
|
||||
|
||||
QMK Toolbox is a Windows and macOS program that allows you to both program and debug your custom keyboard. You will want to install it so that you can easily flash your keyboard and receive the debugging messages that your keyboard will print.
|
||||
|
||||
* [Newest Release](https://github.com/qmk/qmk_toolbox/releases/latest)
|
||||
* [Source Code](https://github.com/qmk/qmk_toolbox/)
|
||||
|
||||
## Environment Setup
|
||||
|
||||
We've tried to make QMK as easy to setup as possible. You only have to prepare your Linux or Unix environment and let QMK install the rest.
|
||||
|
||||
{% hint style="info" %}
|
||||
If you haven't worked with the Linux/Unix command line before there are a few basic concepts and commands you should learn. These resources will teach you enough to work with QMK:
|
||||
|
||||
* [Must Know Linux Commands](https://www.guru99.com/must-know-linux-commands.html)
|
||||
* [Some Basic Unix Commands](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html)
|
||||
{% endhint %}
|
||||
|
||||
### Windows
|
||||
|
||||
You will need to install msys2 and git.
|
||||
|
||||
* Follow the installation instructions on the msys2 homepage: http://www.msys2.org
|
||||
* Close any open msys2 terminals, and open a new terminal
|
||||
* Install git by running this command: `pacman -S git`
|
||||
|
||||
### macOS
|
||||
|
||||
You will need to install homebrew. Follow the instructions on the homebrew homepage: https://brew.sh
|
||||
|
||||
### Linux
|
||||
|
||||
You will need to install git. It's extremely likely you already have it, but if not one of the following commands should install it:
|
||||
|
||||
* Debian/Ubuntu/Devuan: `apt-get install git`
|
||||
* Fedora/Redhat/Centos: `yum install git`
|
||||
* Arch: `pacman -S git`
|
||||
|
||||
## Download QMK
|
||||
|
||||
Once you have setup your Linux/Unix environment you are ready to download QMK. We will do this by using git to "clone" the QMK repository. Open a Terminal or MSYS2 Console window and leave it open for the remainder of this guide. Inside that window run these two commands:
|
||||
|
||||
git clone https://github.com/qmk/qmk_firmware.git
|
||||
cd qmk_firmware
|
||||
|
||||
{% hint style='info' %}
|
||||
If you already know [how to use GitHub](getting_started_github.md) we recommend you create and clone your own fork instead. If you don't know what that means you can safely ignore this message.
|
||||
{% endhint %}
|
||||
|
||||
## Setup QMK
|
||||
|
||||
QMK comes with a script to help you setup the rest of what you'll need. You should run it now by typing in this command:
|
||||
|
||||
./util/qmk_install.sh
|
||||
|
||||
## Test Your Build Environment
|
||||
|
||||
Now that your QMK build environment is setup you can build a firmware for your keyboard. Start by trying to build the default layout for your keyboard. You should be able to do that with a command in this format:
|
||||
|
||||
make <keyboard>:default
|
||||
|
||||
For example, to build a firmware for a Clueboard 66% use:
|
||||
|
||||
make clueboard/66/rev3:default
|
||||
|
||||
When it is done you should have a lot of output that ends similar to this:
|
||||
|
||||
```
|
||||
Linking: .build/clueboard_66_rev2_default.elf [OK]
|
||||
Creating load file for flashing: .build/clueboard_66_rev2_default.hex [OK]
|
||||
Copying clueboard_66_rev2_default.hex to qmk_firmware folder [OK]
|
||||
Checking file size of clueboard_66_rev2_default.hex [OK]
|
||||
* File size is fine - 25174/28672
|
||||
```
|
||||
|
||||
## Creating Your Layout
|
||||
|
||||
Now you are ready to create your own personal layout. Move on to [Building Your First Firmware](newbs_building_firmware.md) for that.
|
@ -1,33 +0,0 @@
|
||||
# Testing and Debugging
|
||||
|
||||
Once you've flashed your keyboard with a custom firmware you're ready to test it out. With a little bit of luck everything will work perfectly, but if not this document will help you figure out what's wrong.
|
||||
|
||||
## Testing
|
||||
|
||||
Testing your keyboard is usually pretty straightforward. Press every single key and make sure it sends the keys you expect. There are even programs that will help you make sure that no key is missed.
|
||||
|
||||
Note: These programs are not provided by or endorsed by QMK.
|
||||
|
||||
* [Switch Hitter](https://elitekeyboards.com/switchhitter.php) (Windows Only)
|
||||
* [Keyboard Viewer](https://www.imore.com/how-use-keyboard-viewer-your-mac) (Mac Only)
|
||||
* [Keyboard Tester](http://www.keyboardtester.com) (Web Based)
|
||||
* [Keyboard Checker](http://keyboardchecker.com) (Web Based)
|
||||
|
||||
## Debugging With QMK Toolbox
|
||||
|
||||
[QMK Toolbox](https://github.com/qmk/qmk_toolbox) will show messages from your keyboard if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, or use the [Command](feature_command.md) feature to enable debug mode.
|
||||
|
||||
<!-- FIXME: Describe the debugging messages here. -->
|
||||
|
||||
## Sending Your Own Debug Messages
|
||||
|
||||
Sometimes it's useful to print debug messages from within your [custom code](custom_quantum_functions.md). Doing so is pretty simple. Start by including `print.h` at the top of your file:
|
||||
|
||||
#include <print.h>
|
||||
|
||||
After that you can use a few different print functions:
|
||||
|
||||
* `print("string")`: Print a simple string.
|
||||
* `sprintf("%s string", var)`: Print a formatted string
|
||||
* `dprint("string")` Print a simple string, but only when debug mode is enabled
|
||||
* `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled
|
@ -0,0 +1,63 @@
|
||||
# Porting your keyboard to QMK
|
||||
|
||||
This page describes the technical details of porting an existing keyboard to QMK. If you're looking to add your keyboard to QMK, please [look through these guidelines](adding_a_keyboard_to_qmk.md)!
|
||||
|
||||
If your keyboard is running an Atmega chip (atmega32u4 and others), it's pretty easy to get things setup for compiling your own firmware to flash onto your board. There is a `/util/new_project.sh <keyboard>` script to help get you started - you can simply pass your keyboard's name into the script, and all of the necessary files will be created. The components of each are described below.
|
||||
|
||||
## `/keyboards/<keyboard>/config.h`
|
||||
|
||||
The `USB Device descriptor parameter` block contains parameters are used to uniquely identify your keyboard, but they don't really matter to the machine.
|
||||
|
||||
Your `MATRIX_ROWS` and `MATRIX_COLS` are the numbers of rows and cols in your keyboard matrix - this may be different than the number of actual rows and columns on your keyboard. There are some tricks you can pull to increase the number of keys in a given matrix, but most keyboards are pretty straight-forward.
|
||||
|
||||
The `MATRIX_ROW_PINS` and `MATRIX_COL_PINS` are the pins your MCU uses on each row/column. Your schematic (if you have one) will have this information on it, and the values will vary depending on your setup. This is one of the most important things to double-check in getting your keyboard setup correctly.
|
||||
|
||||
For the `DIODE_DIRECTION`, most hand-wiring guides will instruct you to wire the diodes in the `COL2ROW` position, but it's possible that they are in the other - people coming from EasyAVR often use `ROW2COL`. Nothing will function if this is incorrect.
|
||||
|
||||
`BACKLIGHT_PIN` is the pin that your PWM-controlled backlight (if one exists) is hooked-up to. Currently only B5, B6, and B7 are supported.
|
||||
|
||||
`BACKLIGHT_BREATHING` is a fancier backlight feature that adds breathing/pulsing/fading effects to the backlight. It uses the same timer as the normal backlight. These breathing effects must be called by code in your keymap.
|
||||
|
||||
`BACKLIGHT_LEVELS` is how many levels exist for your backlight - max is 15, and they are computed automatically from this number.
|
||||
|
||||
## `/keyboards/<keyboard>/rules.mk`
|
||||
|
||||
The values at the top likely won't need to be changed, since most boards use the `atmega32u4` chip. The `BOOTLOADER_SIZE` will need to be adjusted based on your MCU type. It's defaulted to the Teensy, since that's the most common controller. Below is quoted from the `Makefile`.
|
||||
|
||||
```
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
```
|
||||
|
||||
At the bottom of the file, you'll find lots of features to turn on and off - all of these options should be set with `?=` to allow for the keymap overrides. `?=` only assigns if the variable was previously undefined. For the full documenation of these features, see the [Makefile options](getting_started_make_guide.md#makefile-options).
|
||||
|
||||
## `/keyboards/<keyboard>/readme.md`
|
||||
|
||||
This is where you'll describe your keyboard - please write as much as you can about it! Talking about default functionality/features is useful here. Feel free to link to external pages/sites if necessary. Images can be included here as well, as long as they're hosted elsewhere (imgur).
|
||||
|
||||
## `/keyboards/<keyboard>/<keyboard>.c`
|
||||
|
||||
This is where all of the custom logic for your keyboard goes - you may not need to put anything in this file, since a lot of things are configured automatically. All of the `*_kb()` functions are defined here. If you modify them, remember to keep the calls to `*_user()`, or things in the keymaps might not work. You can read more about the functions [here](custom_quantum_functions.md).
|
||||
|
||||
## `/keyboards/<keyboard>/<keyboard>.h`
|
||||
|
||||
Here is where you can (optionally) define your `KEYMAP` function to remap your matrix into a more readable format. With ortholinear boards, this isn't always necessary, but it can help to accomodate the dead spots on your matrix, where there are keys that take up more than one space (2u, staggering, 6.25u, etc). The example shows the difference between the physical keys, and the matrix design:
|
||||
|
||||
```
|
||||
#define KEYMAP( \
|
||||
k00, k01, k02, \
|
||||
k10, k11 \
|
||||
) \
|
||||
{ \
|
||||
{ k00, k01, k02 }, \
|
||||
{ k10, KC_NO, k11 }, \
|
||||
}
|
||||
```
|
||||
|
||||
Each of the `kxx` variables needs to be unique, and usually follows the format `k<row><col>`. You can place `KC_NO` where your dead keys are in your matrix.
|
||||
|
@ -1,48 +1,12 @@
|
||||
{
|
||||
"redirects": [
|
||||
{
|
||||
"from": "adding_a_keyboard_to_qmk.html",
|
||||
"to": "hardware_keyboard_guidelines.html"
|
||||
},
|
||||
{
|
||||
"from": "build_environment_setup.html",
|
||||
"to": "getting_started_build_tools.html"
|
||||
},
|
||||
{
|
||||
"from": "dynamic_macros.html",
|
||||
"to": "feature_dynamic_macros.html"
|
||||
},
|
||||
{
|
||||
"from": "feature_common_shortcuts.html",
|
||||
"to": "feature_advanced_keycodes.html"
|
||||
},
|
||||
{
|
||||
"from": "glossary.html",
|
||||
"to": "reference_glossary.html"
|
||||
},
|
||||
{
|
||||
"from": "key_lock.html",
|
||||
"to": "feature_key_lock.html"
|
||||
},
|
||||
{
|
||||
"from": "make_instructions.html",
|
||||
"to": "getting_started_make_guide.html"
|
||||
},
|
||||
{
|
||||
"from": "porting_your_keyboard_to_qmk.html",
|
||||
"to": "hardware_avr.html"
|
||||
},
|
||||
{
|
||||
"from": "space_cadet_shift.html",
|
||||
"to": "feature_space_cadet.html"
|
||||
},
|
||||
{
|
||||
"from": "tap_dance.html",
|
||||
"to": "feature_tap_dance.html"
|
||||
},
|
||||
{
|
||||
"from": "unicode.html",
|
||||
"to": "feature_unicode.html"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -1,170 +0,0 @@
|
||||
# Glossary of QMK Terms
|
||||
|
||||
## ARM
|
||||
A line of 32-bit MCU's produced by a number of companies, such as Atmel, Cypress, Kinetis, NXP, ST, and TI.
|
||||
|
||||
## AVR
|
||||
A line of 8-bit MCU's produced by [Atmel](http://www.microchip.com/). AVR was the original platform that TMK supported.
|
||||
|
||||
## AZERTY
|
||||
The standard Français (French) keyboard layout. Named for the first 6 keys on the keyboard.
|
||||
|
||||
## Backlight
|
||||
A generic term for lighting on a keyboard. The backlight is typically, but not always, an array of LED's that shine through keycaps and/or switches.
|
||||
|
||||
## Bluetooth
|
||||
A short range peer to peer wireless protocol. Most common wireless protocol for a keyboard.
|
||||
|
||||
## Bootloader
|
||||
A special program that is written to a protected area of your MCU that allows the MCU to upgrade its own firmware, typically over USB.
|
||||
|
||||
## Bootmagic
|
||||
A feature that allows for various keyboard behavior changes to happen on the fly, such as swapping or disabling common keys.
|
||||
|
||||
## C
|
||||
A low-level programming language suitable for system code. Most QMK code is written in C.
|
||||
|
||||
## Colemak
|
||||
An alternative keyboard layout that is gaining in popularity.
|
||||
|
||||
## Compile
|
||||
The process of turning human readable code into machine code your MCU can run.
|
||||
|
||||
## Dvorak
|
||||
An alternative keyboard layout developed by Dr. August Dvorak in the 1930's. A shortened form of the Dvorak Simplified Keyboard.
|
||||
|
||||
## Dynamic Macro
|
||||
A macro which has been recorded on the keyboard and which will be lost when the keyboard is unplugged or the computer rebooted.
|
||||
|
||||
* [Dynamic Macro Documentation](feature_dynamic_macros.md)
|
||||
|
||||
## Eclipse
|
||||
An IDE that is popular with many C developers.
|
||||
|
||||
* [Eclipse Setup Instructions](eclipse.md)
|
||||
|
||||
## Firmware
|
||||
The software that controls your MCU.
|
||||
|
||||
## FLIP
|
||||
Software provided by Atmel for flashing AVR devices. We generally recommend [QMK Flasher](https://github.com/qmk/qmk_flasher) instead, but for some advanced use cases FLIP is required.
|
||||
|
||||
## git
|
||||
Versioning software used at the command line
|
||||
|
||||
## GitHub
|
||||
The website that hosts most of the QMK project. It provides integration with git, issue tracking, and other features that help us run QMK.
|
||||
|
||||
## ISP
|
||||
In-system programming, a method of programming an AVR chip using external hardware and the JTAG pins.
|
||||
|
||||
## hid_listen
|
||||
An interface for receiving debugging messages from your keyboard. You can view these messages using [QMK Flasher](https://github.com/qmk/qmk_flasher) or [PJRC's hid_listen](https://www.pjrc.com/teensy/hid_listen.html)
|
||||
|
||||
## Keycode
|
||||
A 2-byte number that represents a particular key. `0x00`-`0xFF` are used for [Basic Keycodes](keycodes_basic.md) while `0x100`-`0xFFFF` are used for [Quantum Keycodes](quantum_keycodes.md).
|
||||
|
||||
## Key Down
|
||||
An event that happens when a key is pressed down, but is completed before a key is released.
|
||||
|
||||
## Key Up
|
||||
An event that happens when a key is released.
|
||||
|
||||
## Keymap
|
||||
An array of keycodes mapped to a physical keyboard layout, which are processed on key presses and releases
|
||||
|
||||
## Layer
|
||||
An abstraction used to allow a key to serve multiple purposes. The highest active layer takes precedence.
|
||||
|
||||
## Leader Key
|
||||
A feature that allows you to tap the leader key followed by a sequence of 1, 2, or 3 keys to activate key presses or other quantum features.
|
||||
|
||||
* [Leader Key Documentation](feature_leader_key.md)
|
||||
|
||||
## LED
|
||||
Light Emitting Diode, the most common device used for indicators on a keyboard.
|
||||
|
||||
## Make
|
||||
Software package that is used to compile all the source files. You run `make` with various options to compile your keyboard firmware.
|
||||
|
||||
## Matrix
|
||||
A wiring pattern of columns and rows that enables the MCU to detect keypresses with a fewer number of pins. The matrix often incorporates diodes to allow for NKRO.
|
||||
|
||||
## Macro
|
||||
A feature that lets you send multiple keypress events (hid reports) after having pressed only a single key.
|
||||
|
||||
* [Macro Documentation](feature_macros.md)
|
||||
|
||||
## MCU
|
||||
Microcontrol Unit, the processor that powers your keyboard.
|
||||
|
||||
## Modifier
|
||||
A key that is held down while typing another key to modify the action of that key. Examples include Ctrl, Alt, and Shift.
|
||||
|
||||
## Mousekeys
|
||||
A feature that lets you control your mouse cursor and click from your keyboard.
|
||||
|
||||
* [Mousekeys Documentation](feature_mouse_keys.md)
|
||||
|
||||
## N-Key Rollover (NKRO)
|
||||
A term that applies to keyboards that are capable of reporting any number of key-presses at once.
|
||||
|
||||
## Oneshot Modifier
|
||||
A modifier that acts as if it is held down until another key is released, so you can press the mod and then press the key, rather than holding the mod while pressing the key. Also known as a Sticky key or a Dead key.
|
||||
|
||||
## ProMicro
|
||||
A low cost AVR development board. Clones of this device are often found on ebay very inexpensively (under $5) but people often struggle with flashing their pro micros.
|
||||
|
||||
## Pull Request
|
||||
A request to submit code to QMK. We encourage all users to submit Pull Requests for their personal keymaps.
|
||||
|
||||
## QWERTY
|
||||
The standard English keyboard layout, and often a shortcut for other language's standard layouts. Named for the first 6 letters on the keyboard.
|
||||
|
||||
## QWERTZ
|
||||
The standard Deutsche (German) keyboard layout. Named for the first 6 letters on the keyboard.
|
||||
|
||||
## Rollover
|
||||
The term for pressing a key while a key is already held down. Variants include 2KRO, 6KRO, and NKRO.
|
||||
|
||||
## Scancode
|
||||
A 1 byte number that is sent as part of a HID report over USB that represents a single key. These numbers are documented in the [HID Usage Tables](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) published by the [USB-IF](http://www.usb.org/).
|
||||
|
||||
## Space Cadet Shift
|
||||
A special set of shift keys which allow you to type various types of braces by tapping the left or right shift one or more times.
|
||||
|
||||
* [Space Cadet Shift Documentation](feature_space_cadet.md)
|
||||
|
||||
## Tap
|
||||
Pressing and releasing a key. In some situations you will need to distinguish between a key down and a key up event, and Tap always refers to both at once.
|
||||
|
||||
## Tap Dance
|
||||
A feature that lets you assign multiple keycodes to the same key based on how many times you press it.
|
||||
|
||||
* [Tap Dance Documentation](feature_tap_dance.md)
|
||||
|
||||
## Teensy
|
||||
A low-cost AVR development board that is commonly used for hand-wired builds. A teensy is often chosen despite costing a few dollars more due to its halfkay bootloader, which makes flashing very simple.
|
||||
|
||||
## Underlight
|
||||
A generic term for LEDs that light the underside of the board. These LED's typically shine away from the bottom of the PCB and towards the surface the keyboard rests on.
|
||||
|
||||
## Unicode
|
||||
In the larger computer world Unicode is a set of encoding schemes for representing characters in any language. As it relates to QMK it means using various OS schemes to send unicode codepoints instead of scancodes.
|
||||
|
||||
* [Unicode Documentation](feature_unicode.md)
|
||||
|
||||
## Unit Testing
|
||||
A framework for running automated tests against QMK. Unit testing helps us be confident that our changes do not break anything.
|
||||
|
||||
* [Unit Testing Documentation](unit_testing.md)
|
||||
|
||||
## USB
|
||||
Universal Serial Bus, the most common wired interface for a keyboard.
|
||||
|
||||
## USB Host (or simply Host)
|
||||
The USB Host is your computer, or whatever device your keyboard is plugged into.
|
||||
|
||||
# Couldn't Find the Term You're Looking For?
|
||||
|
||||
[Open an issue](https://github.com/qmk/qmk_firmware/issues) with your question and the term in question could be added here. Better still, open a pull request with the definition. :)
|
@ -0,0 +1,24 @@
|
||||
## Space Cadet Shift: The future, built in
|
||||
|
||||
Steve Losh [described](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) the Space Cadet Shift quite well. Essentially, you hit the left Shift on its own, and you get an opening parenthesis; hit the right Shift on its own, and you get the closing one. When hit with other keys, the Shift key keeps working as it always does. Yes, it's as cool as it sounds.
|
||||
|
||||
To use it, use `KC_LSPO` (Left Shift, Parens Open) for your left Shift on your keymap, and `KC_RSPC` (Right Shift, Parens Close) for your right Shift.
|
||||
|
||||
It's defaulted to work on US keyboards, but if your layout uses different keys for parenthesis, you can define those in your `config.h` like this:
|
||||
|
||||
#define LSPO_KEY KC_9
|
||||
#define RSPC_KEY KC_0
|
||||
|
||||
You can also choose between different rollover behaviors of the shift keys by defining:
|
||||
|
||||
#define DISABLE_SPACE_CADET_ROLLOVER
|
||||
|
||||
in your `config.h`. Disabling rollover allows you to use the opposite shift key to cancel the space cadet state in the event of an erroneous press instead of emitting a pair of parentheses when the keys are released.
|
||||
|
||||
The only other thing you're going to want to do is create a `Makefile` in your keymap directory and set the following:
|
||||
|
||||
```
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
```
|
||||
|
||||
This is just to keep the keyboard from going into command mode when you hold both Shift keys at the same time.
|
@ -0,0 +1,108 @@
|
||||
# Stenography in QMK
|
||||
|
||||
[Stenography](https://en.wikipedia.org/wiki/Stenotype) is a method of writing most often used by court reports, closed-captioning, and real-time transcription for the deaf. In stenography words are chorded syllable by syllable with a mixture of spelling, phonetic, and shortcut (briefs) strokes. Professional stenographers can reach 200-300 WPM without any of the strain usually found in standard typing and with far fewer errors (>99.9% accuracy).
|
||||
|
||||
The [Open Steno Project](http://www.openstenoproject.org/) has built an open-source program called Plover that provides real-time translation of steno strokes into words and commands. It has an established dictionary and supports
|
||||
|
||||
## Plover with QWERTY Keyboard
|
||||
|
||||
Plover can work with any standard QWERTY keyboard, although it is more efficient if the keyboard supports NKRO (n-key rollover) to allow Plover to see all the pressed keys at once. An example keymap for Plover can be found in `planck/keymaps/default`. Switching to the `PLOVER` layer adjusts the position of the keyboard to support the number bar.
|
||||
|
||||
To use Plover with QMK just enable NKRO and optionally adjust your layout if you have anything other than a standard layout. You may also want to purchase some steno-friendly keycaps to make it easier to hit multiple keys.
|
||||
|
||||
## Plover with Steno Protocol
|
||||
|
||||
Plover also understands the language of several steno machines. QMK can speak a couple of these languages, TX Bolt and GeminiPR. An example layout can be found in `planck/keymaps/steno`.
|
||||
|
||||
When QMK speaks to Plover over a steno protocol Plover will not use the keyboard as input. This means that you can switch back and forth between a standard keyboard and your steno keyboard, or even switch layers from Plover to standard and back without needing to activate/deactive Plover.
|
||||
|
||||
In this mode Plover expects to speak with a steno machine over a serial port so QMK will present itself to the operating system as a virtual serial port in addition to a keyboard. By default QMK will speak the TX Bolt protocol but can be switched to GeminiPR; the last protocol used is stored in non-volatile memory so QMK will use the same protocol on restart.
|
||||
|
||||
> Note: Due to hardware limitations you may not be able to run both a virtual serial port and mouse emulation at the same time.
|
||||
|
||||
### TX Bolt
|
||||
|
||||
TX Bolt communicates the status of 24 keys over a very simple protocol in variable-sized (1-5 byte) packets.
|
||||
|
||||
### GeminiPR
|
||||
|
||||
GeminiPR encodes 42 keys into a 6-byte packet. While TX Bolt contains everything that is necessary for standard stenography, GeminiPR opens up many more options, including supporting non-English theories.
|
||||
|
||||
## Configuring QMK for Steno
|
||||
|
||||
Firstly, enable steno in your keymap's Makefile. You may also need disable mousekeys, extra keys, or another USB endpoint to prevent conflicts. The builtin USB stack for some processors only supports a certain number of USB endpoints and the virtual serial port needed for steno fills 3 of them.
|
||||
|
||||
```Makefile
|
||||
STENO_ENABLE = yes
|
||||
MOUSEKEY_ENABLE = no
|
||||
```
|
||||
|
||||
In your keymap create a new layer for Plover. You will need to include `keymap_steno.h`. See `planck/keymaps/steno/keymap.c` for an example. Remember to create a key to switch to the layer as well as a key for exiting the layer. If you would like to switch modes on the fly you can use the keycodes `QK_STENO_BOLT` and `QK_STENO_GEMINI`. If you only want to use one of the protocols you may set it up in your initialization function:
|
||||
|
||||
```C
|
||||
void matrix_init_user() {
|
||||
steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT
|
||||
}
|
||||
```
|
||||
|
||||
Once you have your keyboard flashed launch Plover. Click the 'Configure...' button. In the 'Machine' tab select the Stenotype Machine that corresponds to your desired protocol. Click the 'Configure...' button on this tab and enter the serial port or click 'Scan'. Baud rate is fine at 9600 (although you should be able to set as high as 115200 with no issues). Use the default settings for everything else (Data Bits: 8, Stop Bits: 1, Parity: N, no flow control).
|
||||
|
||||
On the display tab click 'Open stroke display'. With Plover disabled you should be able to hit keys on your keyboard and see them show up in the stroke display window. Use this to make sure you have set up your keymap correctly. You are now ready to steno!
|
||||
|
||||
## Learning Stenography
|
||||
|
||||
* [Learn Plover!](https://sites.google.com/site/ploverdoc/)
|
||||
* [QWERTY Steno](http://qwertysteno.com/Home/)
|
||||
* [Steno Jig](https://joshuagrams.github.io/steno-jig/)
|
||||
* More resources at the Plover [Learning Stenography](https://github.com/openstenoproject/plover/wiki/Learning-Stenography) wiki
|
||||
|
||||
## Keycode Reference
|
||||
|
||||
As defined in `keymap_steno.h`.
|
||||
|
||||
> Note: TX Bolt does not support the full set of keys. The TX Bolt implementation in QMK will map the GeminiPR keys to the nearest TX Bolt key so that one key map will work for both.
|
||||
|
||||
|GeminiPR|TX Bolt|Steno Key|
|
||||
|--------|-------|-----------|
|
||||
|`STN_N1`|`STN_NUM`|Number bar #1|
|
||||
|`STN_N2`|`STN_NUM`|Number bar #2|
|
||||
|`STN_N3`|`STN_NUM`|Number bar #3|
|
||||
|`STN_N4`|`STN_NUM`|Number bar #4|
|
||||
|`STN_N5`|`STN_NUM`|Number bar #5|
|
||||
|`STN_N6`|`STN_NUM`|Number bar #6|
|
||||
|`STN_N7`|`STN_NUM`|Number bar #7|
|
||||
|`STN_N8`|`STN_NUM`|Number bar #8|
|
||||
|`STN_N9`|`STN_NUM`|Number bar #9|
|
||||
|`STN_NA`|`STN_NUM`|Number bar #A|
|
||||
|`STN_NB`|`STN_NUM`|Number bar #B|
|
||||
|`STN_NC`|`STN_NUM`|Number bar #C|
|
||||
|`STN_S1`|`STN_SL`| `S-` upper|
|
||||
|`STN_S2`|`STN_SL`| `S-` lower|
|
||||
|`STN_TL`|`STN_TL`| `T-`|
|
||||
|`STN_KL`|`STN_KL`| `K-`|
|
||||
|`STN_PL`|`STN_PL`| `P-`|
|
||||
|`STN_WL`|`STN_WL`| `W-`|
|
||||
|`STN_HL`|`STN_HL`| `H-`|
|
||||
|`STN_RL`|`STN_RL`| `R-`|
|
||||
|`STN_A`|`STN_A`| `A` vowel|
|
||||
|`STN_O`|`STN_O`| `O` vowel|
|
||||
|`STN_ST1`|`STN_STR`| `*` upper-left |
|
||||
|`STN_ST2`|`STN_STR`| `*` lower-left|
|
||||
|`STN_ST3`|`STN_STR`| `*` upper-right|
|
||||
|`STN_ST4`|`STN_STR`| `*` lower-right|
|
||||
|`STN_E`|`STN_E`| `E` vowel|
|
||||
|`STN_U`|`STN_U`| `U` vowel|
|
||||
|`STN_FR`|`STN_FR`| `-F`|
|
||||
|`STN_PR`|`STN_PR`| `-P`|
|
||||
|`STN_RR`|`STN_RR`| `-R`|
|
||||
|`STN_BR`|`STN_BR`| `-B`|
|
||||
|`STN_LR`|`STN_LR`| `-L`|
|
||||
|`STN_GR`|`STN_GR`| `-G`|
|
||||
|`STN_TR`|`STN_TR`| `-T`|
|
||||
|`STN_SR`|`STN_SR`| `-S`|
|
||||
|`STN_DR`|`STN_DR`| `-D`|
|
||||
|`STN_ZR`|`STN_ZR`| `-Z`|
|
||||
|`STN_FN`|| (GeminiPR only)|
|
||||
|`STN_RES1`||(GeminiPR only)|
|
||||
|`STN_RES2`||(GeminiPR only)|
|
||||
|`STN_PWR`||(GeminiPR only)|
|
@ -0,0 +1,150 @@
|
||||
# Tap Dance: A single key can do 3, 5, or 100 different things
|
||||
|
||||
<!-- FIXME: Break this up into multiple sections -->
|
||||
|
||||
Hit the semicolon key once, send a semicolon. Hit it twice, rapidly -- send a colon. Hit it three times, and your keyboard's LEDs do a wild dance. That's just one example of what Tap Dance can do. It's one of the nicest community-contributed features in the firmware, conceived and created by [algernon](https://github.com/algernon) in [#451](https://github.com/qmk/qmk_firmware/pull/451). Here's how algernon describes the feature:
|
||||
|
||||
With this feature one can specify keys that behave differently, based on the amount of times they have been tapped, and when interrupted, they get handled before the interrupter.
|
||||
|
||||
To make it clear how this is different from `ACTION_FUNCTION_TAP`, lets explore a certain setup! We want one key to send `Space` on single tap, but `Enter` on double-tap.
|
||||
|
||||
With `ACTION_FUNCTION_TAP`, it is quite a rain-dance to set this up, and has the problem that when the sequence is interrupted, the interrupting key will be send first. Thus, `SPC a` will result in `a SPC` being sent, if they are typed within `TAPPING_TERM`. With the tap dance feature, that'll come out as `SPC a`, correctly.
|
||||
|
||||
The implementation hooks into two parts of the system, to achieve this: into `process_record_quantum()`, and the matrix scan. We need the latter to be able to time out a tap sequence even when a key is not being pressed, so `SPC` alone will time out and register after `TAPPING_TERM` time.
|
||||
|
||||
But lets start with how to use it, first!
|
||||
|
||||
First, you will need `TAP_DANCE_ENABLE=yes` in your `rules.mk`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()`, takes a number, which will later be used as an index into the `tap_dance_actions` array.
|
||||
|
||||
This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are three possible options:
|
||||
|
||||
* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. When the key is held, the appropriate keycode is registered: `kc1` when pressed and held, `kc2` when tapped once, then pressed and held.
|
||||
* `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the final tap count of the tap dance action.
|
||||
* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function on when the dance action finishes (like the previous option), and the last function when the tap dance action resets.
|
||||
|
||||
The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise.
|
||||
|
||||
And that's the bulk of it!
|
||||
|
||||
And now, on to the explanation of how it works!
|
||||
|
||||
The main entry point is `process_tap_dance()`, called from `process_record_quantum()`, which is run for every keypress, and our handler gets to run early. This function checks whether the key pressed is a tap-dance key. If it is not, and a tap-dance was in action, we handle that first, and enqueue the newly pressed key. If it is a tap-dance key, then we check if it is the same as the already active one (if there's one active, that is). If it is not, we fire off the old one first, then register the new one. If it was the same, we increment the counter and the timer.
|
||||
|
||||
This means that you have `TAPPING_TERM` time to tap the key again, you do not have to input all the taps within that timeframe. This allows for longer tap counts, with minimal impact on responsiveness.
|
||||
|
||||
Our next stop is `matrix_scan_tap_dance()`. This handles the timeout of tap-dance keys.
|
||||
|
||||
For the sake of flexibility, tap-dance actions can be either a pair of keycodes, or a user function. The latter allows one to handle higher tap counts, or do extra things, like blink the LEDs, fiddle with the backlighting, and so on. This is accomplished by using an union, and some clever macros.
|
||||
|
||||
# Examples
|
||||
|
||||
## Simple Example
|
||||
|
||||
Here's a simple example for a single definition:
|
||||
|
||||
1. In your `rules.mk`, add `TAP_DANCE_ENABLE = yes`
|
||||
2. In your `config.h` (which you can copy from `qmk_firmware/keyboards/planck/config.h` to your keymap directory), add `#define TAPPING_TERM 200`
|
||||
3. In your `keymap.c` file, define the variables and definitions, then add to your keymap:
|
||||
|
||||
```c
|
||||
//Tap Dance Declarations
|
||||
enum {
|
||||
TD_ESC_CAPS = 0
|
||||
};
|
||||
|
||||
//Tap Dance Definitions
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
//Tap once for Esc, twice for Caps Lock
|
||||
[TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS)
|
||||
// Other declarations would go here, separated by commas, if you have them
|
||||
};
|
||||
|
||||
//In Layer declaration, add tap dance item in place of a key code
|
||||
TD(TD_ESC_CAPS)
|
||||
```
|
||||
|
||||
## Complex Example
|
||||
|
||||
Here's a more complex example involving custom actions:
|
||||
|
||||
```c
|
||||
enum {
|
||||
CT_SE = 0,
|
||||
CT_CLN,
|
||||
CT_EGG,
|
||||
CT_FLSH,
|
||||
};
|
||||
|
||||
/* Have the above three on the keymap, TD(CT_SE), etc... */
|
||||
|
||||
void dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 1) {
|
||||
register_code (KC_RSFT);
|
||||
register_code (KC_SCLN);
|
||||
} else {
|
||||
register_code (KC_SCLN);
|
||||
}
|
||||
}
|
||||
|
||||
void dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 1) {
|
||||
unregister_code (KC_RSFT);
|
||||
unregister_code (KC_SCLN);
|
||||
} else {
|
||||
unregister_code (KC_SCLN);
|
||||
}
|
||||
}
|
||||
|
||||
void dance_egg (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 100) {
|
||||
SEND_STRING ("Safety dance!");
|
||||
reset_tap_dance (state);
|
||||
}
|
||||
}
|
||||
|
||||
// on each tap, light up one led, from right to left
|
||||
// on the forth tap, turn them off from right to left
|
||||
void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (state->count) {
|
||||
case 1:
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
case 3:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 4:
|
||||
ergodox_right_led_3_off();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_2_off();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_1_off();
|
||||
}
|
||||
}
|
||||
|
||||
// on the fourth tap, set the keyboard on flash state
|
||||
void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 4) {
|
||||
reset_keyboard();
|
||||
reset_tap_dance(state);
|
||||
}
|
||||
}
|
||||
|
||||
// if the flash state didnt happen, then turn off leds, left to right
|
||||
void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
ergodox_right_led_1_off();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_2_off();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_3_off();
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT)
|
||||
,[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset)
|
||||
,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg)
|
||||
,[CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED (dance_flsh_each, dance_flsh_finished, dance_flsh_reset)
|
||||
};
|
||||
```
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue