Merge branch 'master' of https://github.com/qmk/qmk_firmware
This commit is contained in:
commit
a6845036e2
2039 changed files with 320347 additions and 14594 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -23,6 +23,7 @@ quantum/version.h
|
||||||
CMakeLists.txt
|
CMakeLists.txt
|
||||||
.DS_STORE
|
.DS_STORE
|
||||||
/util/wsl_downloaded
|
/util/wsl_downloaded
|
||||||
|
/util/win_downloaded
|
||||||
|
|
||||||
# Eclipse/PyCharm/Other IDE Settings
|
# Eclipse/PyCharm/Other IDE Settings
|
||||||
.cproject
|
.cproject
|
||||||
|
@ -32,10 +33,15 @@ CMakeLists.txt
|
||||||
.browse.VC.db*
|
.browse.VC.db*
|
||||||
*.stackdump
|
*.stackdump
|
||||||
util/Win_Check_Output.txt
|
util/Win_Check_Output.txt
|
||||||
.vscode
|
# Let these ones be user specific, since we have so many different configurations
|
||||||
|
.vscode/launch.json
|
||||||
|
.vscode/tasks.json
|
||||||
.stfolder
|
.stfolder
|
||||||
|
|
||||||
# ignore image files
|
# ignore image files
|
||||||
*.png
|
*.png
|
||||||
*.jpg
|
*.jpg
|
||||||
*.gif
|
*.gif
|
||||||
|
|
||||||
|
# Do not ignore MiniDox left/right hand eeprom files
|
||||||
|
!keyboards/minidox/*.eep
|
14
.vscode/settings.json
vendored
Normal file
14
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
// Place your settings in this file to overwrite default and user settings.
|
||||||
|
{
|
||||||
|
// Configure glob patterns for excluding files and folders.
|
||||||
|
"files.exclude": {
|
||||||
|
"**/.build": true,
|
||||||
|
"**/*.hex": true
|
||||||
|
},
|
||||||
|
"files.associations": {
|
||||||
|
"*.h": "c",
|
||||||
|
"*.c": "c",
|
||||||
|
"*.cpp": "cpp",
|
||||||
|
"*.hpp": "cpp"
|
||||||
|
}
|
||||||
|
}
|
9
Makefile
9
Makefile
|
@ -19,6 +19,11 @@ endif
|
||||||
# Otherwise the [OK], [ERROR] and [WARN] messages won't be displayed correctly
|
# Otherwise the [OK], [ERROR] and [WARN] messages won't be displayed correctly
|
||||||
override SILENT := false
|
override SILENT := false
|
||||||
|
|
||||||
|
QMK_VERSION := $(shell git describe --abbrev=0 --tags 2>/dev/null)
|
||||||
|
ifneq ($(QMK_VERSION),)
|
||||||
|
$(info QMK Firmware v$(QMK_VERSION))
|
||||||
|
endif
|
||||||
|
|
||||||
ON_ERROR := error_occurred=1
|
ON_ERROR := error_occurred=1
|
||||||
|
|
||||||
BREAK_ON_ERRORS = no
|
BREAK_ON_ERRORS = no
|
||||||
|
@ -419,7 +424,7 @@ define BUILD_TEST
|
||||||
MAKE_TARGET := $2
|
MAKE_TARGET := $2
|
||||||
COMMAND := $1
|
COMMAND := $1
|
||||||
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET)
|
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET)
|
||||||
MAKE_VARS := TEST=$$(TEST_NAME) FULL_TESTS=$$(FULL_TESTS)
|
MAKE_VARS := TEST=$$(TEST_NAME) FULL_TESTS="$$(FULL_TESTS)"
|
||||||
MAKE_MSG := $$(MSG_MAKE_TEST)
|
MAKE_MSG := $$(MSG_MAKE_TEST)
|
||||||
$$(eval $$(call BUILD))
|
$$(eval $$(call BUILD))
|
||||||
ifneq ($$(MAKE_TARGET),clean)
|
ifneq ($$(MAKE_TARGET),clean)
|
||||||
|
@ -483,6 +488,8 @@ define RUN_TEST
|
||||||
+error_occurred=0;\
|
+error_occurred=0;\
|
||||||
$($(TEST)_COMMAND)\
|
$($(TEST)_COMMAND)\
|
||||||
if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
|
if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
|
||||||
|
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps
|
# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps
|
||||||
|
|
25
book.json
25
book.json
|
@ -1,17 +1,34 @@
|
||||||
{
|
{
|
||||||
"structure": {
|
"structure": {
|
||||||
"readme": "home.md",
|
|
||||||
"summary": "_summary.md"
|
"summary": "_summary.md"
|
||||||
},
|
},
|
||||||
"plugins" : ["toolbar", "edit-link", "anchors"],
|
"plugins" : [
|
||||||
|
"edit-link",
|
||||||
|
"forkmegithub",
|
||||||
|
"hints",
|
||||||
|
"page-toc",
|
||||||
|
"terminal",
|
||||||
|
"toolbar"
|
||||||
|
],
|
||||||
"pluginsConfig": {
|
"pluginsConfig": {
|
||||||
"edit-link": {
|
"edit-link": {
|
||||||
"base": "https://github.com/qmk/qmk_firmware/edit/master/docs",
|
"base": "https://github.com/qmk/qmk_firmware/edit/master/docs",
|
||||||
"label": "Suggest an edit"
|
"label": "Suggest an edit"
|
||||||
},
|
},
|
||||||
|
"forkmegithub": {
|
||||||
|
"color": "red",
|
||||||
|
"url": "https://github.com/qmk/qmk_firmware"
|
||||||
|
},
|
||||||
|
"page-toc": {
|
||||||
|
"selector": ".markdown-section h1, .markdown-section h2"
|
||||||
|
},
|
||||||
|
"terminal": {
|
||||||
|
"copyButtons": true,
|
||||||
|
"fade": false,
|
||||||
|
"style": "flat"
|
||||||
|
},
|
||||||
"toolbar": {
|
"toolbar": {
|
||||||
"buttons":
|
"buttons": [
|
||||||
[
|
|
||||||
{
|
{
|
||||||
"label": "QMK Firmware",
|
"label": "QMK Firmware",
|
||||||
"icon": "fa fa-github",
|
"icon": "fa fa-github",
|
||||||
|
|
|
@ -18,13 +18,16 @@
|
||||||
TEST_PATH=tests/$(TEST)
|
TEST_PATH=tests/$(TEST)
|
||||||
|
|
||||||
$(TEST)_SRC= \
|
$(TEST)_SRC= \
|
||||||
$(TEST_PATH)/test.cpp \
|
$(TEST_PATH)/keymap.c \
|
||||||
$(TMK_COMMON_SRC) \
|
$(TMK_COMMON_SRC) \
|
||||||
$(QUANTUM_SRC) \
|
$(QUANTUM_SRC) \
|
||||||
|
$(SRC) \
|
||||||
tests/test_common/matrix.c \
|
tests/test_common/matrix.c \
|
||||||
tests/test_common/test_driver.cpp \
|
tests/test_common/test_driver.cpp \
|
||||||
tests/test_common/keyboard_report_util.cpp \
|
tests/test_common/keyboard_report_util.cpp \
|
||||||
tests/test_common/test_fixture.cpp
|
tests/test_common/test_fixture.cpp
|
||||||
$(TEST)_DEFS=$(TMK_COMMON_DEFS)
|
$(TEST)_SRC += $(patsubst $(ROOTDIR)/%,%,$(wildcard $(TEST_PATH)/*.cpp))
|
||||||
|
|
||||||
|
$(TEST)_DEFS=$(TMK_COMMON_DEFS) $(OPT_DEFS)
|
||||||
$(TEST)_CONFIG=$(TEST_PATH)/config.h
|
$(TEST)_CONFIG=$(TEST_PATH)/config.h
|
||||||
VPATH+=$(TOP_DIR)/tests/test_common
|
VPATH+=$(TOP_DIR)/tests/test_common
|
|
@ -9,6 +9,9 @@ LIB_PATH = $(TOP_DIR)/lib
|
||||||
QUANTUM_DIR = quantum
|
QUANTUM_DIR = quantum
|
||||||
QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)
|
QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)
|
||||||
|
|
||||||
|
DRIVER_DIR = drivers
|
||||||
|
DRIVER_PATH = $(TOP_DIR)/$(DRIVER_DIR)
|
||||||
|
|
||||||
BUILD_DIR := $(TOP_DIR)/.build
|
BUILD_DIR := $(TOP_DIR)/.build
|
||||||
|
|
||||||
COMMON_VPATH := $(TOP_DIR)
|
COMMON_VPATH := $(TOP_DIR)
|
||||||
|
@ -18,3 +21,4 @@ COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras
|
||||||
COMMON_VPATH += $(QUANTUM_PATH)/audio
|
COMMON_VPATH += $(QUANTUM_PATH)/audio
|
||||||
COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
|
COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
|
||||||
COMMON_VPATH += $(QUANTUM_PATH)/api
|
COMMON_VPATH += $(QUANTUM_PATH)/api
|
||||||
|
COMMON_VPATH += $(DRIVER_PATH)
|
|
@ -54,6 +54,12 @@ ifeq ($(strip $(COMBO_ENABLE)), yes)
|
||||||
SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
|
SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(STENO_ENABLE)), yes)
|
||||||
|
OPT_DEFS += -DSTENO_ENABLE
|
||||||
|
VIRTSER_ENABLE := yes
|
||||||
|
SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(VIRTSER_ENABLE)), yes)
|
ifeq ($(strip $(VIRTSER_ENABLE)), yes)
|
||||||
OPT_DEFS += -DVIRTSER_ENABLE
|
OPT_DEFS += -DVIRTSER_ENABLE
|
||||||
endif
|
endif
|
||||||
|
@ -87,7 +93,7 @@ endif
|
||||||
|
|
||||||
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
||||||
OPT_DEFS += -DRGBLIGHT_ENABLE
|
OPT_DEFS += -DRGBLIGHT_ENABLE
|
||||||
SRC += $(QUANTUM_DIR)/light_ws2812.c
|
SRC += ws2812.c
|
||||||
SRC += $(QUANTUM_DIR)/rgblight.c
|
SRC += $(QUANTUM_DIR)/rgblight.c
|
||||||
CIE1931_CURVE = yes
|
CIE1931_CURVE = yes
|
||||||
LED_BREATHING_TABLE = yes
|
LED_BREATHING_TABLE = yes
|
||||||
|
@ -98,6 +104,11 @@ ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
|
||||||
SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
|
SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(KEY_LOCK_ENABLE)), yes)
|
||||||
|
OPT_DEFS += -DKEY_LOCK_ENABLE
|
||||||
|
SRC += $(QUANTUM_DIR)/process_keycode/process_key_lock.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(PRINTING_ENABLE)), yes)
|
ifeq ($(strip $(PRINTING_ENABLE)), yes)
|
||||||
OPT_DEFS += -DPRINTING_ENABLE
|
OPT_DEFS += -DPRINTING_ENABLE
|
||||||
SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
|
SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
|
||||||
|
|
25
docs/README.md
Normal file
25
docs/README.md
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# Quantum Mechanical Keyboard Firmware
|
||||||
|
|
||||||
|
## What is QMK Firmware? {#what-is-qmk-firmware}
|
||||||
|
|
||||||
|
QMK (*Quantum Mechanical Keyboard*) is an open source community that maintains QMK Firmware, QMK Flasher, qmk.fm, and these docs. QMK Firmware is a keyboard firmware based on the [tmk\_keyboard](http://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR controllers, and more specifically, the [OLKB product line](http://olkb.com), the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard, and the [Clueboard product line](http://clueboard.co/). It has also been ported to ARM chips using ChibiOS. You can use it to power your own hand-wired or custom keyboard PCB.
|
||||||
|
|
||||||
|
## How to get it {#how-to-get-it}
|
||||||
|
|
||||||
|
If you plan on contributing a keymap, keyboard, or features to QMK, the easiest thing to do is [fork the repo through Github](https://github.com/qmk/qmk_firmware#fork-destination-box), and clone your repo locally to make your changes, push them, then open a [Pull Request](https://github.com/qmk/qmk_firmware/pulls) from your fork.
|
||||||
|
|
||||||
|
Otherwise, you can either download it directly ([zip](https://github.com/qmk/qmk_firmware/zipball/master), [tar](https://github.com/qmk/qmk_firmware/tarball/master)), or clone it via git (`git@github.com:qmk/qmk_firmware.git`), or https (`https://github.com/qmk/qmk_firmware.git`).
|
||||||
|
|
||||||
|
## How to compile {#how-to-compile}
|
||||||
|
|
||||||
|
Before you are able to compile, you'll need to [install an environment](getting_started_build_tools.md) for AVR or/and ARM development. Once that is complete, you'll use the `make` command to build a keyboard and keymap with the following notation:
|
||||||
|
|
||||||
|
make planck-rev4-default
|
||||||
|
|
||||||
|
This would build the `rev4` revision of the `planck` with the `default` keymap. Not all keyboards have revisions (also called subprojects), in which case, it can be omitted:
|
||||||
|
|
||||||
|
make preonic-default
|
||||||
|
|
||||||
|
## How to customize {#how-to-customize}
|
||||||
|
|
||||||
|
QMK has lots of [features](features.md) to explore, and a good deal of [reference documentation](http://docs.qmk.fm) to dig through. Most features are taken advantage of by modifying your [keymap](keymap.md), and changing the [keycodes](keycodes.md).
|
|
@ -1,32 +1,67 @@
|
||||||
|
* [Getting started](README.md)
|
||||||
|
* [QMK Introduction](getting_started_introduction.md)
|
||||||
|
* [Install Build Tools](getting_started_build_tools.md)
|
||||||
|
* Alternative: [Vagrant Guide](getting_started_vagrant_guide.md)
|
||||||
|
* [Build/Compile instructions](getting_started_make_guide.md)
|
||||||
|
* [How to Use Github](getting_started_github.md)
|
||||||
|
|
||||||
### Getting started
|
* [FAQ](faq.md)
|
||||||
* [Introduction](home.md)
|
* [General FAQ](faq_general.md)
|
||||||
* [QMK Overview](qmk_overview.md)
|
* [Build/Compile QMK](faq_build.md)
|
||||||
* [Build Environment Setup](build_environment_setup.md)
|
* [Debugging/Troubleshooting QMK](faq_debug.md)
|
||||||
* [Make instructions](make_instructions.md)
|
* [Keymap](faq_keymap.md)
|
||||||
|
|
||||||
### Making a keymap
|
* [Features](features.md)
|
||||||
* [Keymap overview](keymap.md)
|
* [Common Shortcuts](feature_common_shortcuts.md)
|
||||||
* [Custom Quantum Functions](custom_quantum_functions.md)
|
* [Backlight](feature_backlight.md)
|
||||||
* [Keycodes](keycodes.md)
|
* [Bootmagic](feature_bootmagic.md)
|
||||||
* [Layer switching](key_functions.md)
|
|
||||||
* [Leader Key](leader_key.md)
|
|
||||||
* [Macros](macros.md)
|
|
||||||
* [Dynamic Macros](dynamic_macros.md)
|
* [Dynamic Macros](dynamic_macros.md)
|
||||||
|
* [Key Lock](key_lock.md)
|
||||||
|
* [Leader Key](feature_leader_key.md)
|
||||||
|
* [Macros](macros.md)
|
||||||
|
* [Mouse keys](mouse_keys.md)
|
||||||
|
* [PS2 Mouse](feature_ps2_mouse.md)
|
||||||
* [Space Cadet](space_cadet_shift.md)
|
* [Space Cadet](space_cadet_shift.md)
|
||||||
* [Tap Dance](tap_dance.md)
|
* [Tap Dance](tap_dance.md)
|
||||||
* [Mouse keys](mouse_keys.md)
|
* [Audio](feature_audio.md)
|
||||||
* [FAQ: Creating a Keymap](faq_keymap.md)
|
* [Thermal Printer](feature_thermal_printer.md)
|
||||||
* [FAQ: Compiling QMK](faq_build.md)
|
* [Stenography](stenography.md)
|
||||||
|
* [Unicode](unicode.md)
|
||||||
|
|
||||||
### For hardware makers and modders
|
* Reference
|
||||||
|
* [Glossary](glossary.md)
|
||||||
|
* [Keymap overview](keymap.md)
|
||||||
|
* [Keycodes](keycodes.md)
|
||||||
|
* [Basic](keycodes_basic.md)
|
||||||
|
* [Quantum](quantum_keycodes.md)
|
||||||
|
* [Backlight](feature_backlight.md#backlight-keycodes)
|
||||||
|
* [Bluetooth](feature_bluetooth.md#bluetooth-keycodes)
|
||||||
|
* [Bootmagic](feature_bootmagic.md#bootmagic-keycodes)
|
||||||
|
* [Layer Switching](feature_common_shortcuts.md#switching-and-toggling-layers)
|
||||||
|
* [Mod+Key](feature_common_shortcuts.md#modifier-keys)
|
||||||
|
* [Mod Tap](feature_common_shortcuts.md#mod-tap)
|
||||||
|
* [One Shot Keys](feature_common_shortcuts.md#one-shot-keys)
|
||||||
|
* [Shifted Keys](feature_common_shortcuts.md#shifted-keycodes)
|
||||||
|
* [Stenography](stenography.md#keycode-reference)
|
||||||
|
* [RGB Light](feature_rgblight.md#rgblight-keycodes)
|
||||||
|
* [Thermal Printer](feature_thermal_printer.md#thermal-printer-keycodes)
|
||||||
|
* [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md)
|
||||||
|
* [The `config.h` File](config_options.md)
|
||||||
|
* [Customizing Functionality](custom_quantum_functions.md)
|
||||||
|
* [Documentation Best Practices](documentation_best_practices.md)
|
||||||
|
* [Unit Testing](unit_testing.md)
|
||||||
|
|
||||||
|
* For Makers and Modders
|
||||||
* [Adding a keyboard to QMK](adding_a_keyboard_to_qmk.md)
|
* [Adding a keyboard to QMK](adding_a_keyboard_to_qmk.md)
|
||||||
* [Porting your keyboard to QMK](porting_your_keyboard_to_qmk.md)
|
|
||||||
* [Modding your keyboard](modding_your_keyboard.md)
|
|
||||||
* [Adding features to QMK](adding_features_to_qmk.md)
|
* [Adding features to QMK](adding_features_to_qmk.md)
|
||||||
|
* [Hand Wiring Guide](hand_wiring.md)
|
||||||
* [ISP flashing guide](isp_flashing_guide.md)
|
* [ISP flashing guide](isp_flashing_guide.md)
|
||||||
|
* [Modding your keyboard](modding_your_keyboard.md)
|
||||||
|
* [Porting your keyboard to QMK](porting_your_keyboard_to_qmk.md)
|
||||||
|
|
||||||
### Other topics
|
* For a Deeper Understanding
|
||||||
* [General FAQ](faq.md)
|
* [How Keyboards Work](how_keyboards_work.md)
|
||||||
* [Differences from TMK](differences_from_tmk.md)
|
* [Understanding QMK](understanding_qmk.md)
|
||||||
|
|
||||||
|
* Other Topics
|
||||||
* [Using Eclipse with QMK](eclipse.md)
|
* [Using Eclipse with QMK](eclipse.md)
|
||||||
|
|
|
@ -1,7 +1,16 @@
|
||||||
If you have an idea for a custom feature or extra hardware connection, we'd love to accept it into QMK! These are generally done via [pull request](https://github.com/qmk/qmk_firmware/pulls) after forking, and here are some things to keep in mind when creating one:
|
# How To Add Features To QMK
|
||||||
|
|
||||||
* **Disable by default** - memory is a pretty limited on most chips QMK supports, and it's important that current keymaps aren't broken, so please allow your feature to be turned **on**, rather than being turned off. If you think it should be on by default, or reduces the size of the code, [open an issue](https://github.com/qmk/qmk_firmware/issues) for everyone to discuss it!
|
If you have an idea for a custom feature or extra hardware connection, we'd love to accept it into QMK!
|
||||||
|
|
||||||
|
Before you put a lot of work into building your new feature you should make sure you are implementing it in the best way. You can get a basic understanding of QMK by reading [Understaning QMK](understanding_qmk.html), which will take you on a tour of the QMK program flow. From here you should talk to us to get a sense of the best way to implement your idea. There are two main ways to do this:
|
||||||
|
|
||||||
|
* [Chat on Gitter](https://gitter.im/qmk/qmk_firmware)
|
||||||
|
* [Open an Issue](https://github.com/qmk/qmk_firmware/issues/new)
|
||||||
|
|
||||||
|
Once you have implemented your new feature you will generally submit a [pull request](https://github.com/qmk/qmk_firmware/pulls). Here are some things to keep in mind when creating one:
|
||||||
|
|
||||||
|
* **Disabled by default** - memory is a pretty limited on most chips QMK supports, and it's important that current keymaps aren't broken, so please allow your feature to be turned **on**, rather than being turned off. If you think it should be on by default, or reduces the size of the code, please talk with us about it.
|
||||||
* **Compile locally before submitting** - hopefully this one is obvious, but things need to compile! Our Travis system will catch any issues, but it's generally faster for you to compile a few keyboards locally instead of waiting for the results to come back.
|
* **Compile locally before submitting** - hopefully this one is obvious, but things need to compile! Our Travis system will catch any issues, but it's generally faster for you to compile a few keyboards locally instead of waiting for the results to come back.
|
||||||
* **Consider subprojects and different chip-bases** - there are several keyboards that have subprojects that have allow for slightly different configurations, and even different chip-bases. Try to make a feature supported in ARM and AVR, or automatically disabled in one that doesn't work.
|
* **Consider subprojects and different chip-bases** - there are several keyboards that have subprojects that allow for slightly different configurations, and even different chip-bases. Try to make a feature supported in ARM and AVR, or automatically disabled on platforms it doesn't work on.
|
||||||
* **Explain your feature** - submitting a markdown write-up of what your feature does with your PR may be needed, and it will allow a collaborator to easily copy it into the wiki for documentation (after proofing and editing).
|
* **Explain your feature** - Document it in `docs/`, either as a new file or as part of an existing file. If you don't document it other people won't be able to benefit from your hard work.
|
||||||
* **Don't refactor code** - to maintain a clear vision of how things are laid out in QMK, we try to plan out refactors in-depth, and have a collaborator make the changes. If you have an idea for refactoring, or suggestions, [open an issue](https://github.com/qmk/qmk_firmware/issues).
|
* **Don't refactor code** - to maintain a clear vision of how things are laid out in QMK, we try to plan out refactors in-depth, and have a collaborator make the changes. If you have an idea for refactoring, or suggestions, [open an issue](https://github.com/qmk/qmk_firmware/issues), we'd love to talk about how QMK can be improved.
|
||||||
|
|
|
@ -1,103 +0,0 @@
|
||||||
# This guide has now been included in the main readme - please reference that one instead.
|
|
||||||
|
|
||||||
## Build Environment Setup
|
|
||||||
|
|
||||||
### Windows (Vista and later)
|
|
||||||
1. If you have ever installed WinAVR, uninstall it.
|
|
||||||
2. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**.
|
|
||||||
3. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location.
|
|
||||||
4. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/qmk/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer.
|
|
||||||
5. Double-click on the 1-setup-path-win batch script to run it. You'll need to accept a User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up.
|
|
||||||
6. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete!
|
|
||||||
7. Future build commands should be run from the standard Windows command prompt, which you can find by searching for "command prompt" from the start menu or start screen. Ignore the "MHV AVR Shell".
|
|
||||||
|
|
||||||
### Mac
|
|
||||||
If you're using [homebrew,](http://brew.sh/) you can use the following commands:
|
|
||||||
|
|
||||||
brew tap osx-cross/avr
|
|
||||||
brew install avr-libc
|
|
||||||
brew install dfu-programmer
|
|
||||||
|
|
||||||
This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line.
|
|
||||||
|
|
||||||
You can also try these instructions:
|
|
||||||
|
|
||||||
1. Install Xcode from the App Store.
|
|
||||||
2. Install the Command Line Tools from `Xcode->Preferences->Downloads`.
|
|
||||||
3. Install [DFU-Programmer][dfu-prog].
|
|
||||||
|
|
||||||
### Linux
|
|
||||||
Install AVR GCC, AVR libc, and dfu-progammer with your favorite package manager.
|
|
||||||
|
|
||||||
Debian/Ubuntu example:
|
|
||||||
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install gcc-avr avr-libc dfu-programmer
|
|
||||||
|
|
||||||
### Vagrant
|
|
||||||
If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [vagrant guide](vagrant_guide.md).
|
|
||||||
|
|
||||||
## Verify Your Installation
|
|
||||||
1. If you haven't already, obtain this repository ([https://github.com/qmk/qmk_firmware](https://github.com/qmk/qmk_firmware)). You can either download it as a zip file and extract it, or clone it using the command line tool git or the Github Desktop application.
|
|
||||||
2. Open up a terminal or command prompt and navigate to the `qmk_firmware` folder using the `cd` command. The command prompt will typically open to your home directory. If, for example, you cloned the repository to your Documents folder, then you would type `cd Documents/qmk_firmware`. If you extracted the file from a zip, then it may be named `qmk_firmware-master` instead.
|
|
||||||
3. To confirm that you're in the correct location, you can display the contents of your current folder using the `dir` command on Windows, or the `ls` command on Linux or Mac. You should see several files, including `readme.md` and a `quantum` folder. From here, you need to navigate to the appropriate folder under `keyboards/`. For example, if you're building for a Planck, run `cd keyboards/planck`.
|
|
||||||
4. Once you're in the correct keyboard-specific folder, run the `make` command. This should output a lot of information about the build process. More information about the `make` command can be found below.
|
|
||||||
|
|
||||||
## Customizing, Building, and Deploying Your Firmware
|
|
||||||
|
|
||||||
### The Make command
|
|
||||||
|
|
||||||
The `make` command is how you compile the firmware into a .hex file, which can be loaded by a dfu programmer (like dfu-progammer via `make dfu`) or the [Teensy loader](https://www.pjrc.com/teensy/loader.html) (only used with Teensys). You can run `make` from the root (`/`), your keyboard folder (`/keyboards/<keyboard>/`), or your keymap folder (`/keyboards/<keyboard>/keymaps/<keymap>/`) if you have a `Makefile` there (see the example [here](/doc/keymap_makefile_example.mk)).
|
|
||||||
|
|
||||||
By default, this will generate a `<keyboard>_<keymap>.hex` file in whichever folder you run `make` from. These files are ignored by git, so don't worry about deleting them when committing/creating pull requests.
|
|
||||||
|
|
||||||
* The "root" (`/`) folder is the qmk_firmware folder, in which are `doc`, `keyboard`, `quantum`, etc.
|
|
||||||
* The "keyboard" folder is any keyboard project's folder, like `/keyboards/planck`.
|
|
||||||
* The "keymap" folder is any keymap's folder, like `/keyboards/planck/keymaps/default`.
|
|
||||||
|
|
||||||
Below is a list of the useful `make` commands in QMK:
|
|
||||||
|
|
||||||
* `make` - cleans automatically and builds your keyboard and keymap depending on which folder you're in. This defaults to the "default" layout (unless in a keymap folder), and Planck keyboard in the root folder
|
|
||||||
* `make keyboard=<keyboard>` - specifies the keyboard (only to be used in root)
|
|
||||||
* `make keymap=<keymap>` - specifies the keymap (only to be used in root and keyboard folder - not needed when in keymap folder)
|
|
||||||
* `make quick` - skips the clean step (cannot be used immediately after modifying config.h or Makefiles)
|
|
||||||
* `make dfu` - (requires dfu-programmer) builds and flashes the keymap to your keyboard once placed in reset/dfu mode (button or press `KC_RESET`). This does not work for Teensy-based keyboards like the ErgoDox EZ.
|
|
||||||
* `keyboard=` and `keymap=` are compatible with this
|
|
||||||
* `make all-keyboards` - builds all keymaps for all keyboards and outputs status of each (use in root)
|
|
||||||
* `make all-keyboards-default` - builds all default keymaps for all keyboards and outputs status of each (use in root)
|
|
||||||
* `make all-keymaps [keyboard=<keyboard>]` - builds all of the keymaps for whatever keyboard folder you're in, or specified by `<keyboard>`
|
|
||||||
* `make all-keyboards-quick`, `make all-keyboards-default-quick` and `make all-keymaps-quick [keyboard=<keyboard>]` - like the normal "make-all-*" commands, but they skip the clean steps
|
|
||||||
|
|
||||||
Other, less useful functionality:
|
|
||||||
|
|
||||||
* `make COLOR=false` - turns off color output
|
|
||||||
* `make SILENT=true` - turns off output besides errors/warnings
|
|
||||||
* `make VERBOSE=true` - outputs all of the avr-gcc stuff (not interesting)
|
|
||||||
|
|
||||||
### The Makefile
|
|
||||||
|
|
||||||
There are 3 different `make` and `Makefile` locations:
|
|
||||||
|
|
||||||
* root (`/`)
|
|
||||||
* keyboard (`/keyboards/<keyboard>/`)
|
|
||||||
* keymap (`/keyboards/<keyboard>/keymaps/<keymap>/`)
|
|
||||||
|
|
||||||
The root contains the code used to automatically figure out which keymap or keymaps to compile based on your current directory and commandline arguments. It's considered stable, and shouldn't be modified. The keyboard one will contain the MCU set-up and default settings for your keyboard, and shouldn't be modified unless you are the producer of that keyboard. The keymap Makefile can be modified by users, and is optional. It is included automatically if it exists. You can see an example [here](/doc/keymap_makefile_example.mk) - the last few lines are the most important. The settings you set here will override any defaults set in the keyboard Makefile. **It is required if you want to run `make` in the keymap folder.**
|
|
||||||
|
|
||||||
### The `config.h` file
|
|
||||||
|
|
||||||
There are 2 `config.h` locations:
|
|
||||||
|
|
||||||
* keyboard (`/keyboards/<keyboard>/`)
|
|
||||||
* keymap (`/keyboards/<keyboard>/keymaps/<keymap>/`)
|
|
||||||
|
|
||||||
The keyboard `config.h` is included only if the keymap one doesn't exist. The format to use for your custom one [is here](/doc/keymap_config_h_example.h). If you want to override a setting from the parent `config.h` file, you need to do this:
|
|
||||||
|
|
||||||
```
|
|
||||||
#undef MY_SETTING
|
|
||||||
#define MY_SETTING 4
|
|
||||||
```
|
|
||||||
|
|
||||||
For a value of `4` for this imaginary setting. So we `undef` it first, then `define` it.
|
|
||||||
|
|
||||||
You can then override any settings, rather than having to copy and paste the whole thing.
|
|
|
@ -1,187 +0,0 @@
|
||||||
Build Firmware and Program Controller
|
|
||||||
=====================================
|
|
||||||
|
|
||||||
## This guide may be out-dated - use [build_guide.md](build_guide.md) instead
|
|
||||||
|
|
||||||
Download and Install
|
|
||||||
--------------------
|
|
||||||
### 1. Install Tools
|
|
||||||
|
|
||||||
1. **Toolchain** On Windows install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack]. On Linux you can install AVR GCC (and avr-libc) with your favorite package manager or run the avr_setup.sh script in the root of this repository.
|
|
||||||
|
|
||||||
2. **Programmer** On Windows install [Atmel FLIP][flip]. On Mac and Linux install [dfu-programmer][dfu-prog].
|
|
||||||
|
|
||||||
3. **Driver** On Windows you start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you shall need to update its driver on 'Device Manager'. You will find the driver in `FLIP` install directory like: C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\. In case of `dfu-programmer` use its driver.
|
|
||||||
|
|
||||||
If you use PJRC Teensy you don't need step 2 and 3 above, just get [Teensy loader][teensy-loader].
|
|
||||||
|
|
||||||
|
|
||||||
### 2. Download source
|
|
||||||
You can find firmware source at github:
|
|
||||||
|
|
||||||
- <https://github.com/tmk/tmk_keyboard>
|
|
||||||
|
|
||||||
If you are familiar with `Git` tools you are recommended to use it but you can also download zip archive from:
|
|
||||||
|
|
||||||
- <https://github.com/tmk/tmk_keyboard/archive/master.zip>
|
|
||||||
|
|
||||||
|
|
||||||
Build firmware
|
|
||||||
--------------
|
|
||||||
### 1. Open terminal
|
|
||||||
Open terminal window to get access to commands. Use Cygwin(or MingGW) `shell terminal` in Windows or `Terminal.app` on Mac OSX. In Windows press `Windows` key and `R` then enter `cmd` in 'Run command' dialog showing up.
|
|
||||||
|
|
||||||
### 2. Change directory
|
|
||||||
Move to project directory in the firmware source.
|
|
||||||
|
|
||||||
cd tmk_keyboard/{'keyboard' or 'converter'}/<project>
|
|
||||||
|
|
||||||
### 3. Make
|
|
||||||
Build firmware using GNU `make` command. You'll see `<project>_<variant>.hex` file in that directory unless something unexpected occurs in build process.
|
|
||||||
|
|
||||||
|
|
||||||
make -f Makefile.<variant> clean
|
|
||||||
make -f Makefile.<variant>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Program Controller
|
|
||||||
------------------
|
|
||||||
Now you have **hex** file to program on current directory. This **hex** is only needed to program your controller, other files are used for development and you may leave and forget them.
|
|
||||||
|
|
||||||
### 1. Start bootloader
|
|
||||||
How to program controller depends on controller chip and its board design. To program AVR USB chips you'll need to start it up in bootloader mode. Most of boards with the chip have a push button to let bootloader come up. Consult with your controller board manual.
|
|
||||||
|
|
||||||
### 2. Program with DFU bootloader
|
|
||||||
Stock AVR USB chip including ATmega32U4 has DFU bootloader by factory default. `FLIP` is a DFU programmer on Windows offered by Atmel. Open source command line tool `dfu-programmer` also supports AVR chips, it runs on Linux, Mac OSX and even Windows.
|
|
||||||
|
|
||||||
To program AVR chip with DFU bootloader use `FLIP` or `dfu-programmer`.
|
|
||||||
If you have a proper program command in `Makefile` just type this.
|
|
||||||
|
|
||||||
`FLIP` has two version of tool, GUI app and command line program. If you want GUI see tutorial below.
|
|
||||||
To use command line tool run this command. Note that you need to set PATH variable properly.
|
|
||||||
|
|
||||||
$ make -f Makefile.<variant> flip
|
|
||||||
|
|
||||||
Or to program with `dfu-programmer` run:
|
|
||||||
|
|
||||||
$ make -f Makefile.<variant> dfu
|
|
||||||
|
|
||||||
#### FLIP GUI tutorial
|
|
||||||
1. On menu bar click Device -> Select, then. `ATmega32u4`.
|
|
||||||
2. On menu bar click Settings -> Communication -> USB, then click 'Open' button on 'USB Port Connection' dialog.
|
|
||||||
At this point you'll see grey-outed widgets on the app get colored and ready.
|
|
||||||
|
|
||||||
3. On menu bar click File -> Load HEX File, then select your firmware hex file on File Selector dialog.
|
|
||||||
4. On 'Operations Flow' panel click 'Run' button to load the firmware binary to the chip. Note that you should keep 'Erase', 'Blank Check', 'Program' and 'Verify' check boxes selected.
|
|
||||||
5. Re-plug USB cord or click 'Start Application' button to restart your controller.
|
|
||||||
Done.
|
|
||||||
|
|
||||||
See also these instructions if you need.
|
|
||||||
|
|
||||||
- <http://code.google.com/p/micropendous/wiki/LoadingFirmwareWithFLIP>
|
|
||||||
- <http://www.atmel.com/Images/doc7769.pdf>
|
|
||||||
|
|
||||||
|
|
||||||
### 3. Program with Teensy Loader
|
|
||||||
If you have PJRC Teensy see instruction of `Teensy Loader`.
|
|
||||||
|
|
||||||
- <http://www.pjrc.com/teensy/loader.html>
|
|
||||||
|
|
||||||
Or use this command if you have command line version of Teensy Loader installed.
|
|
||||||
|
|
||||||
$ make -f Makefile.<variant> teensy
|
|
||||||
|
|
||||||
|
|
||||||
### 4. Program with Other programmer
|
|
||||||
You may want to use other programmer like `avrdude` with AVRISPmkII, Arduino or USBasp. In that case you can still use make target `program` for build with configuring `PROGRAM_CMD` in Makefile.
|
|
||||||
|
|
||||||
$ make -f Makefile.<variant> program
|
|
||||||
|
|
||||||
|
|
||||||
[cygwin]: https://www.cygwin.com/
|
|
||||||
[mingw]: http://www.mingw.org/
|
|
||||||
[mhv]: https://infernoembedded.com/products/avr-tools
|
|
||||||
[winavr]: http://winavr.sourceforge.net/
|
|
||||||
[crosspack]: http://www.obdev.at/products/crosspack/index.html
|
|
||||||
[flip]: http://www.atmel.com/tools/FLIP.aspx
|
|
||||||
[dfu-prog]: http://dfu-programmer.sourceforge.net/
|
|
||||||
[teensy-loader]:http://www.pjrc.com/teensy/loader.html
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Makefile Options
|
|
||||||
----------------
|
|
||||||
### 1. MCU and Frequency.
|
|
||||||
|
|
||||||
MCU = atmega32u4 # Teensy 2.0
|
|
||||||
#MCU = at90usb1286 # Teensy++ 2.0
|
|
||||||
F_CPU = 16000000
|
|
||||||
|
|
||||||
Set your MCU and its clock in Hz.
|
|
||||||
|
|
||||||
# Boot Section Size in *bytes*
|
|
||||||
# Teensy halfKay 512
|
|
||||||
# Atmel DFU loader 4096
|
|
||||||
# LUFA bootloader 4096
|
|
||||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
|
||||||
|
|
||||||
If you are using PJRC Teensy use `512` for `BOOTLOADER_SIZE`, otherwise use `4096` unless you are sure.
|
|
||||||
|
|
||||||
### 2. Features
|
|
||||||
Optional. Note that ***comment out*** with `#` to disable them.
|
|
||||||
|
|
||||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
|
||||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
|
||||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
|
||||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
|
||||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
|
||||||
SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
|
||||||
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
|
|
||||||
#BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
|
||||||
|
|
||||||
### 3. Programmer
|
|
||||||
Optional. Set proper command for your controller, bootloader and programmer. This command can be used with `make program`. Not needed if you use `FLIP`, `dfu-programmer` or `Teensy Loader`.
|
|
||||||
|
|
||||||
# avrdude with AVRISPmkII
|
|
||||||
PROGRAM_CMD = avrdude -p $(MCU) -c avrispmkII -P USB -U flash:w:$(TARGET).hex
|
|
||||||
|
|
||||||
# avrdude with USBaspLoader
|
|
||||||
PROGRAM_CMD = avrdude -p $(MCU) -c usbasp -U flash:w:$(TARGET).hex
|
|
||||||
|
|
||||||
# avrdude with arduino
|
|
||||||
PROGRAM_CMD = avrdude -p $(MCU) -c arduino -P COM1 -b 57600 -U flash:w:$(TARGET).hex
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Config.h Options
|
|
||||||
----------------
|
|
||||||
### 1. Magic command key combination
|
|
||||||
|
|
||||||
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT)))
|
|
||||||
|
|
||||||
### 2. Mechanical Locking Support for CapsLock
|
|
||||||
|
|
||||||
/* Mechanical locking CapsLock support. Use KC_LCAP instead of KC_CAPS in keymap */
|
|
||||||
#define CAPSLOCK_LOCKING_ENABLE
|
|
||||||
/* Locking CapsLock re-synchronize hack */
|
|
||||||
#define CAPSLOCK_LOCKING_RESYNC_ENABLE
|
|
||||||
|
|
||||||
### 3. Disable Debug and Print
|
|
||||||
|
|
||||||
/* disable debug print */
|
|
||||||
#define NO_DEBUG
|
|
||||||
|
|
||||||
/* disable print */
|
|
||||||
#define NO_PRINT
|
|
||||||
|
|
||||||
### 4. Disable Action Features
|
|
||||||
|
|
||||||
#define NO_ACTION_LAYER
|
|
||||||
#define NO_ACTION_TAPPING
|
|
||||||
#define NO_ACTION_ONESHOT
|
|
||||||
#define NO_ACTION_MACRO
|
|
||||||
#define NO_ACTION_FUNCTION
|
|
||||||
|
|
||||||
***TBD***
|
|
133
docs/config_options.md
Normal file
133
docs/config_options.md
Normal file
|
@ -0,0 +1,133 @@
|
||||||
|
# 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 (namely keymaps). This file can exist at a couple different levels:
|
||||||
|
|
||||||
|
## Keyboard
|
||||||
|
|
||||||
|
```c
|
||||||
|
#ifndef CONFIG_H
|
||||||
|
#define CONFIG_H
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
// config options
|
||||||
|
|
||||||
|
#ifdef SUBPROJECT_<subproject>
|
||||||
|
#include "<subproject>/config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
This file contains config options that should apply to the whole keyboard, and won't change in subprojects, or most keymaps. The suproject block here only applies to keyboards with subprojects.
|
||||||
|
|
||||||
|
## Subproject
|
||||||
|
|
||||||
|
```c
|
||||||
|
#ifndef <subproject>_CONFIG_H
|
||||||
|
#define <subproject>_CONFIG_H
|
||||||
|
|
||||||
|
#include "../config.h"
|
||||||
|
|
||||||
|
// config options
|
||||||
|
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
For keyboards that have subprojects, this file contains config options that should apply to only that subproject, and won't change in most keymaps.
|
||||||
|
|
||||||
|
## Keymap
|
||||||
|
|
||||||
|
```c
|
||||||
|
#ifndef CONFIG_USER_H
|
||||||
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
#include "../../config.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
|
||||||
|
|
||||||
|
```
|
|
@ -1,6 +1,10 @@
|
||||||
A custom keyboard is about more than sending button presses to your computer. QMK has designed hooks to allow you to inject code, override functionality, and otherwise customize how your keyboard responds in different situations.
|
# How To Customize Your Keyboard's Behavior
|
||||||
|
|
||||||
## A Word on Keyboards vs Keymap
|
For a lot of people a custom keyboard is about more than sending button presses to your computer. You want to be able to do things that are more complex than simple button presses and macros. QMK has hooks that allow you to inject code, override functionality, and otherwise customize how your keyboard behaves in different situations.
|
||||||
|
|
||||||
|
This page does not assume any special knowledge about QMK, but reading [Understanding QMK](understanding_qmk.html) will help you understand what is going on at a more fundamental level.
|
||||||
|
|
||||||
|
## A Word on Core vs Keyboards vs Keymap
|
||||||
|
|
||||||
We have structured QMK as a hierarchy:
|
We have structured QMK as a hierarchy:
|
||||||
|
|
||||||
|
@ -8,59 +12,66 @@ We have structured QMK as a hierarchy:
|
||||||
* Keyboard/Revision (`_kb`)
|
* Keyboard/Revision (`_kb`)
|
||||||
* Keymap (`_user`)
|
* Keymap (`_user`)
|
||||||
|
|
||||||
Each of the functions described below can be defined with a `_kb()` suffix or an `_user()` suffix. We intend for you to use the `_kb()` suffix at the Keyboard/Revision level, while the `_user()` suffix should be used at the Keymap level.
|
Each of the functions described below can be defined with a `_kb()` suffix or a `_user()` suffix. We intend for you to use the `_kb()` suffix at the Keyboard/Revision level, while the `_user()` suffix should be used at the Keymap level.
|
||||||
|
|
||||||
When defining functions at the Keyboard/Revision level it is important that your `_kb()` implementation call `_user()` before executing anything else- otherwise the keymap level function will never be called.
|
When defining functions at the Keyboard/Revision level it is important that your `_kb()` implementation call `_user()` before executing anything else- otherwise the keymap level function will never be called.
|
||||||
|
|
||||||
## Matrix Initialization Code
|
# Custom Keycodes
|
||||||
|
|
||||||
* Keyboard/Revision: `void matrix_init_kb(void)`
|
By far the most common task is to change the behavior of an existing keycode or to create a new keycode. From a code standpoint the mechanism for each is very similar.
|
||||||
* Keymap: `void matrix_init_user(void)`
|
|
||||||
|
|
||||||
This function gets called when the matrix is initiated. You should use this function to initialize any custom hardware you may have, such as speakers, LED drivers, or other features which need to be setup after the keyboard powers on.
|
## Defining a New Keycode
|
||||||
|
|
||||||
### Example
|
The first step to creating your own custom keycode(s) is to enumerate them. This means both naming them and assigning a unique number to that keycode. Rather than limit custom keycodes to a fixed range of numbers QMK provides the `SAFE_RANGE` macro. You can use `SAFE_RANGE` when enumerating your custom keycodes to guarantee that you get a unique number.
|
||||||
|
|
||||||
|
|
||||||
|
Here is an example of enumerating 2 keycodes. After adding this block to your `keymap.c` you will be able to use `FOO` and `BAR` inside your keymap.
|
||||||
|
|
||||||
```
|
```
|
||||||
void matrix_init_kb(void) {
|
enum my_keycodes {
|
||||||
// put your keyboard start-up code here
|
FOO = SAFE_RANGE,
|
||||||
// runs once when the firmware starts up
|
BAR
|
||||||
matrix_init_user();
|
};
|
||||||
|
```
|
||||||
|
|
||||||
// JTAG disable for PORT F. write JTD bit twice within four cycles.
|
## Programming The Behavior Of Any Keycode
|
||||||
MCUCR |= (1<<JTD);
|
|
||||||
MCUCR |= (1<<JTD);
|
|
||||||
|
|
||||||
// * Set our LED pins as output
|
When you want to override the behavior of an existing key, or define the behavior for a new key, you should use the `process_record_kb()` and `process_record_user()` functions. These are called by QMK during key processing before the actual key event is handled. If these functions return `true` QMK will process the keycodes as usual. That can be handy for extending the functionality of a key rather than replacing it. If these functions return `false` QMK will skip the normal key handling, and it will be up you to send any key up or down events that are required.
|
||||||
DDRB |= (1<<0);
|
|
||||||
DDRB |= (1<<1);
|
These function are called every time a key is pressed or released.
|
||||||
DDRB |= (1<<2);
|
|
||||||
DDRB |= (1<<3);
|
### Example `process_record_user()` implementation
|
||||||
DDRB |= (1<<4);
|
|
||||||
|
This example does two things. It defines the behavior for a custom keycode called `FOO`, and it supplements our Enter key by playing a tone whenever it is pressed.
|
||||||
|
|
||||||
|
```
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case FOO:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
// Do something when pressed
|
||||||
|
} else {
|
||||||
|
// Do something else when release
|
||||||
|
}
|
||||||
|
return false; // Skip all further processing of this key
|
||||||
|
case KC_ENTER:
|
||||||
|
// Play a tone when enter is pressed
|
||||||
|
if (record->event.pressed) {
|
||||||
|
PLAY_NOTE_ARRAY(tone_qwerty);
|
||||||
|
}
|
||||||
|
return true; // Let QMK send the enter press/release events
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Matrix Scanning Code
|
### `process_record_*` Function documentation
|
||||||
|
|
||||||
* Keyboard/Revision: `void matrix_scan_kb(void)`
|
|
||||||
* Keymap: `void matrix_scan_user(void)`
|
|
||||||
|
|
||||||
This function gets called at every matrix scan, which is basically as often as the MCU can handle. Be careful what you put here, as it will get run a lot.
|
|
||||||
|
|
||||||
You should use this function if you need custom matrix scanning code. It can also be used for custom status output (such as LED's or a display) or other functionality that you want to trigger regularly even when the user isn't typing.
|
|
||||||
|
|
||||||
## Hook Into Key Presses
|
|
||||||
|
|
||||||
* Keyboard/Revision: `bool process_record_kb(uint16_t keycode, keyrecord_t *record)`
|
* Keyboard/Revision: `bool process_record_kb(uint16_t keycode, keyrecord_t *record)`
|
||||||
* Keymap: `bool process_record_user(uint16_t keycode, keyrecord_t *record)`
|
* Keymap: `bool process_record_user(uint16_t keycode, keyrecord_t *record)`
|
||||||
|
|
||||||
This function gets called every time a key is pressed or released. This is particularly useful when defining custom keys or overriding the behavior of existing keys.
|
The `keycode` argument is whatever is defined in your keymap, eg `MO(1)`, `KC_L`, etc. You should use a `switch...case` block to handle these events.
|
||||||
|
|
||||||
The return value is whether or not QMK should continue processing the keycode - returning `false` stops the execution.
|
The `record` argument contains infomation about the actual press:
|
||||||
|
|
||||||
The `keycode` variable is whatever is defined in your keymap, eg `MO(1)`, `KC_L`, etc. and can be switch-cased to execute code whenever a particular code is pressed.
|
|
||||||
|
|
||||||
The `record` variable contains infomation about the actual press:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
keyrecord_t record {
|
keyrecord_t record {
|
||||||
|
@ -75,12 +86,7 @@ keyrecord_t record {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The conditional `if (record->event.pressed)` can tell if the key is being pressed or released, and you can execute code based on that.
|
# LED Control
|
||||||
|
|
||||||
## LED Control
|
|
||||||
|
|
||||||
* Keyboard/Revision: `void led_set_kb(uint8_t usb_led)`
|
|
||||||
* Keymap: `void led_set_user(uint8_t usb_led)`
|
|
||||||
|
|
||||||
This allows you to control the 5 LED's defined as part of the USB Keyboard spec. It will be called when the state of one of those 5 LEDs changes.
|
This allows you to control the 5 LED's defined as part of the USB Keyboard spec. It will be called when the state of one of those 5 LEDs changes.
|
||||||
|
|
||||||
|
@ -90,7 +96,7 @@ This allows you to control the 5 LED's defined as part of the USB Keyboard spec.
|
||||||
* `USB_LED_COMPOSE`
|
* `USB_LED_COMPOSE`
|
||||||
* `USB_LED_KANA`
|
* `USB_LED_KANA`
|
||||||
|
|
||||||
### Example:
|
### Example `led_set_kb()` implementation
|
||||||
|
|
||||||
```
|
```
|
||||||
void led_set_kb(uint8_t usb_led) {
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
@ -121,3 +127,50 @@ void led_set_kb(uint8_t usb_led) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `led_set_*` Function documentation
|
||||||
|
|
||||||
|
* Keyboard/Revision: `void led_set_kb(uint8_t usb_led)`
|
||||||
|
* Keymap: `void led_set_user(uint8_t usb_led)`
|
||||||
|
|
||||||
|
# Matrix Initialization Code
|
||||||
|
|
||||||
|
Before a keyboard can be used the hardware must be initialized. QMK handles initialization of the keyboard matrix itself, but if you have other hardware like LED's or i²c controllers you will need to set up that hardware before it can be used.
|
||||||
|
|
||||||
|
### Example `matrix_init_kb()` implementation
|
||||||
|
|
||||||
|
This example, at the keyboard level, sets up B1, B2, and B3 as LED pins.
|
||||||
|
|
||||||
|
```
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// Call the keymap level matrix init.
|
||||||
|
matrix_init_user();
|
||||||
|
|
||||||
|
// Set our LED pins as output
|
||||||
|
DDRB |= (1<<1);
|
||||||
|
DDRB |= (1<<2);
|
||||||
|
DDRB |= (1<<3);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `matrix_init_*` Function documentation
|
||||||
|
|
||||||
|
* Keyboard/Revision: `void matrix_init_kb(void)`
|
||||||
|
* Keymap: `void matrix_init_user(void)`
|
||||||
|
|
||||||
|
# Matrix Scanning Code
|
||||||
|
|
||||||
|
Whenever possible you should customize your keyboard by using `process_record_*()` and hooking into events that way, to ensure that your code does not have a negative performance impact on your keyboard. However, in rare cases it is necessary to hook into the matrix scanning. Be extremely careful with the performance of code in these functions, as it will be called at least 10 times per second.
|
||||||
|
|
||||||
|
### Example `matrix_scan_*` implementation
|
||||||
|
|
||||||
|
This example has been deliberately omitted. You should understand enough about QMK internals to write this without an example before hooking into such a performance sensitive area. If you need help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) or [chat with us on gitter](https://gitter.im/qmk/qmk_firmware).
|
||||||
|
|
||||||
|
### `matrix_scan_*` Function documentation
|
||||||
|
|
||||||
|
* Keyboard/Revision: `void matrix_scan_kb(void)`
|
||||||
|
* Keymap: `void matrix_scan_user(void)`
|
||||||
|
|
||||||
|
This function gets called at every matrix scan, which is basically as often as the MCU can handle. Be careful what you put here, as it will get run a lot.
|
||||||
|
|
||||||
|
You should use this function if you need custom matrix scanning code. It can also be used for custom status output (such as LED's or a display) or other functionality that you want to trigger regularly even when the user isn't typing.
|
||||||
|
|
|
@ -1,352 +0,0 @@
|
||||||
#Planck Advanced (but not too advanced) `cygwin` Users Guide
|
|
||||||
If you are a user of the [cygwin environment](https://cygwin.com) in Windows and want the freedom to use the latest tools available, then this is the guide for you. If compiling your own copy of the latest and greatest Gnu C Compiler makes you super happy, then this is the guide for you. If the command line make you smile, then this is the guide for you.
|
|
||||||
|
|
||||||
This guide was written step by step as I went through the process on a `Windows 10` `x86_64` and a `Windows 7` `amd k10` based system. This should be generally applicable to to any `Windows` environment with `cygwin`.
|
|
||||||
|
|
||||||
#####Do not skip steps. Do not move past a step until the previous step finishes successfully.
|
|
||||||
|
|
||||||
Based on [avr-libc installation guide](http://www.nongnu.org/avr-libc/user-manual/install_tools.html)
|
|
||||||
|
|
||||||
##Get the Required Packages
|
|
||||||
Download the `cygwin` setup ([x86_64](https://cygwin.com/setup-x86_64.exe)) and install the default system plus the following if they are not already selected:
|
|
||||||
- devel/git
|
|
||||||
- devel/gcc-core
|
|
||||||
- devel/gcc-g++
|
|
||||||
- devel/flex
|
|
||||||
- devel/bison
|
|
||||||
- devel/make
|
|
||||||
- devel/texinfo
|
|
||||||
- devel/gettext-devel
|
|
||||||
- devel/automake
|
|
||||||
- devel/autoconfig
|
|
||||||
- devel/libtool
|
|
||||||
- text/gettext
|
|
||||||
- libs/libgcc1
|
|
||||||
- interpreters/m4
|
|
||||||
- web/wget
|
|
||||||
- archive/unzip
|
|
||||||
|
|
||||||
The following sources will be required:
|
|
||||||
- [gmp](https://gmplib.org/) (6.1.0)
|
|
||||||
- [mpfr](http://www.mpfr.org/) (3.1.4)
|
|
||||||
- [mpc](http://www.multiprecision.org/) (1.0.3)
|
|
||||||
- [binutils](https://www.sourceware.org/binutils/) (2.26)
|
|
||||||
- [gcc](https://gcc.gnu.org/) (5.3.0)
|
|
||||||
- [avr-libc](http://www.nongnu.org/avr-libc/) (2.0.0)
|
|
||||||
|
|
||||||
The `dfu-programmer` will be required to flash the new firmware
|
|
||||||
- [dfu-programmer](https://dfu-programmer.github.io/) (0.7.2)
|
|
||||||
|
|
||||||
The set of commands below will create a directory (`~/local/avr`) for the sources you compile to be installed on the machine and a directory (`~/src`) for these source files to be stored. The commands then download the sources of the needed packages and unpack them. Note: the expand commands are different depending on if the packages are offered as a `bz2` or `gz` archive
|
|
||||||
```
|
|
||||||
$ mkdir ~/local
|
|
||||||
$ mkdir ~/local/avr
|
|
||||||
$ mkdir ~/src
|
|
||||||
$ cd ~/src
|
|
||||||
$ wget https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2
|
|
||||||
$ wget http://www.mpfr.org/mpfr-3.1.4/mpfr-3.1.4.tar.bz2
|
|
||||||
$ wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz
|
|
||||||
$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz
|
|
||||||
$ wget http://mirror0.babylon.network/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz
|
|
||||||
$ wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2
|
|
||||||
$ tar -xjf gmp-6.1.0.tar.bz2
|
|
||||||
$ tar -xjf mpfr-3.1.4.tar.bz2
|
|
||||||
$ tar -zxf mpc-1.0.3.tar.gz
|
|
||||||
$ tar -zxf binutils-2.26.tar.gz
|
|
||||||
$ tar -zxf gcc-5.3.0.tar.gz
|
|
||||||
$ tar -xjf avr-libc-2.0.0.tar.bz2
|
|
||||||
```
|
|
||||||
|
|
||||||
##Setup the Build Environment
|
|
||||||
These commands will set up the install directory and the `PATH` variable, which will allow you to access your installed packages. Note: if you close the `cygwin` terminal window, you will need to rerun these commands, they are not permanent.
|
|
||||||
```
|
|
||||||
$ PREFIX=$HOME/local/avr
|
|
||||||
$ export PREFIX
|
|
||||||
$ PATH=/usr/local/bin:/usr/local/lib:/usr/local/include:/bin:/lib:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS
|
|
||||||
$ PATH=$PATH:$PREFIX/bin:$PREFIX/lib
|
|
||||||
$ export PATH
|
|
||||||
```
|
|
||||||
|
|
||||||
##The `gcc` Required Math Library Packages
|
|
||||||
The following packages are required to be complied and installed in order to compile `gcc`. They are not sufficiently available through the `cygwin` package system, so we have to make them ourselves. They must be complied in this order because each one depends on the previous. Verfiy that for each package, `make check` returns all passing and no fails.
|
|
||||||
|
|
||||||
###Build and Install `gmp`
|
|
||||||
```
|
|
||||||
$ cd ~/src/gmp-6.1.0
|
|
||||||
$ ./configure --enable-static --disable-shared
|
|
||||||
$ make
|
|
||||||
$ make check
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
|
|
||||||
###Build and Install `mpfr`
|
|
||||||
```
|
|
||||||
$ cd ~/src/mpfr-3.1.4
|
|
||||||
$ ./configure --with-gmp-build=../gmp-6.1.0 --enable-static --disable-shared
|
|
||||||
$ make
|
|
||||||
$ make check
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
|
|
||||||
###Build and Install `mpc`
|
|
||||||
```
|
|
||||||
$ cd ~/src/mpc-1.0.3
|
|
||||||
$ ./configure --with-gmp=/usr/local --with-mpfr=/usr/local --enable-static --disable-shared
|
|
||||||
$ make
|
|
||||||
$ make check
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
|
|
||||||
##OPTIONAL Part
|
|
||||||
You can build and install a brand new `gcc` or you can use the one supplied by `cygwin`. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while).
|
|
||||||
|
|
||||||
###Build and Install `gcc` for Your Machine
|
|
||||||
```
|
|
||||||
$ cd ~/src/gcc-5.3.0
|
|
||||||
$ mkdir obj-local
|
|
||||||
$ cd obj-local
|
|
||||||
$ ../configure --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared
|
|
||||||
$ make
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
##End OPTIONAL Part
|
|
||||||
|
|
||||||
###Build and Install `binutils` for Your Machine
|
|
||||||
```
|
|
||||||
$ cd ~/src/binutils-2.26
|
|
||||||
$ mkdir obj-local
|
|
||||||
$ cd obj-local
|
|
||||||
$ ../configure
|
|
||||||
$ make
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
|
|
||||||
##Buliding `binutils`, `gcc`, and `avr-libc` for the AVR system
|
|
||||||
Now we can make the critical stuff for compiling our firmware: `binutils`, `gcc`, and `avr-libc` for the AVR architecture. These allow us to build and manipulate the firmware for the keyboard.
|
|
||||||
|
|
||||||
###Build `binutils` for AVR
|
|
||||||
If you plan to build and install `avr-gdb` also, use the `gdb` install at the end of this guide as it also builds the `binutils`
|
|
||||||
```
|
|
||||||
$ cd ~/src/binutils-2.26
|
|
||||||
$ mkdir obj-avr
|
|
||||||
$ cd obj-avr
|
|
||||||
$ ../configure --prefix=$PREFIX --target=avr --disable-nls
|
|
||||||
$ make
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
|
|
||||||
###Build `gcc` for AVR
|
|
||||||
```
|
|
||||||
$ cd ~/src/gcc-5.3.0
|
|
||||||
$ mkdir obj-avr
|
|
||||||
$ cd obj-avr
|
|
||||||
$ ../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared --disable-nls --disable-libssp --with-dwarf2
|
|
||||||
$ make
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
|
|
||||||
###Build `avr-libc` for AVR
|
|
||||||
For building the `avr-libc`, we have to specify the host build system. In my case it is `x86_64-unknown-cygwin`. You can look for build system type in the `gcc` configure notes for the proper `--build` specification to pass when you configure `avr-libc`.
|
|
||||||
```
|
|
||||||
$ cd ~/src/avr-libc-2.0.0
|
|
||||||
$ ./configure --prefix=$PREFIX --build=x86_64-unknown-cygwin --host=avr
|
|
||||||
$ make
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
|
|
||||||
##Building 'dfu-programmer' for flashing the firmware via USB and installing the drivers
|
|
||||||
We can either build our own, or use the precomplied binaries. The precompiled binaries don't play well with `cygwin` so it is better to build them ourselves. The procedure for the precompiled binaries is included at the end of this guide.
|
|
||||||
|
|
||||||
### Build and Install the `libusb`
|
|
||||||
The `dfu-programmer` requires `libusb` so that it can interact with the USB system. These repos must be bootstrapped in order to create an appropriate `./configure` and `Makefile` for your system.
|
|
||||||
```
|
|
||||||
$ cd ~/src
|
|
||||||
$ git clone https://github.com/libusb/libusb.git
|
|
||||||
$ cd libusb
|
|
||||||
$ ./bootstrap.sh
|
|
||||||
$ ./configure
|
|
||||||
$ make
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
|
|
||||||
### Build and Install the `dfu-programmer`
|
|
||||||
```
|
|
||||||
$ cd ~/src
|
|
||||||
$ git clone https://github.com/dfu-programmer/dfu-programmer.git
|
|
||||||
$ cd dfu-programmer
|
|
||||||
$ ./bootstrap.sh
|
|
||||||
$ ./configure
|
|
||||||
$ make
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
|
|
||||||
Verify the installation with:
|
|
||||||
```
|
|
||||||
$ which dfu-programmer
|
|
||||||
/usr/local/bin/dfu-programmer
|
|
||||||
|
|
||||||
$ dfu-programmer
|
|
||||||
dfu-programmer 0.7.2
|
|
||||||
https://github.com/dfu-programmer/dfu-programmer
|
|
||||||
Type 'dfu-programmer --help' for a list of commands
|
|
||||||
'dfu-programmer --targets' to list supported target devices
|
|
||||||
```
|
|
||||||
If you are not getting the above result, you will not be able to flash the firmware!
|
|
||||||
|
|
||||||
###Install the USB drivers
|
|
||||||
The drivers are included in the windows binary version of [`dfu-programmer` 0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip).
|
|
||||||
```
|
|
||||||
$ cd ~/src
|
|
||||||
$ wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip
|
|
||||||
$ unzip dfu-programmer-win-0.7.2.zip -d dfu-programmer-win-0.7.2
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
The official drivers are found in [Atmel's `FLIP` installer](http://www.atmel.com/images/Flip%20Installer%20-%203.4.7.112.exe). Download and then install `FLIP`. Upon installation, the drivers will be found in `C:\Program Files (x86)\Atmel\Flip 3.4.7\usb`.
|
|
||||||
|
|
||||||
Then, from an **administrator-privileged** `Windows` terminal, run the following command (adjust the path for username, etc. as necessary) and accept the prompt that pops up:
|
|
||||||
```
|
|
||||||
C:\> pnputil -i -a C:\cygwin64\home\Kevin\src\dfu-programmer-win-0.7.2\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf
|
|
||||||
or
|
|
||||||
C:\> pnputil -i -a "C:\Program Files (x86)\Atmel\Flip 3.4.7\usb\atmel_usb_dfu.inf"
|
|
||||||
```
|
|
||||||
|
|
||||||
This should be the result:
|
|
||||||
```
|
|
||||||
Microsoft PnP Utility
|
|
||||||
|
|
||||||
Processing inf : atmel_usb_dfu.inf
|
|
||||||
Successfully installed the driver on a device on the system.
|
|
||||||
Driver package added successfully.
|
|
||||||
Published name : oem104.inf
|
|
||||||
|
|
||||||
|
|
||||||
Total attempted: 1
|
|
||||||
Number successfully imported: 1
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, the `Windows` driver can be installed when prompted by `Windows` when the keyboard is attached. Do not let `Windows` search for a driver; specify the path to search for a driver and point it to the `atmel_usb_dfu.inf` file.
|
|
||||||
|
|
||||||
##Building and Flashing the Planck firmware!
|
|
||||||
If you did everything else right. This part should be a snap! Grab the latest sources from `github`, make the Plank firmware, then flash it.
|
|
||||||
|
|
||||||
###Build Planck and Load the Firmware
|
|
||||||
```
|
|
||||||
$ cd ~/src
|
|
||||||
$ git clone https://github.com/qmk/qmk_firmware.git
|
|
||||||
$ cd qmk_firmware/keyboards/planck
|
|
||||||
$ make
|
|
||||||
```
|
|
||||||
|
|
||||||
Make sure there are no errors. You should end up with this or something similar:
|
|
||||||
```
|
|
||||||
Creating load file for Flash: planck.hex
|
|
||||||
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature planck.elf planck.hex
|
|
||||||
|
|
||||||
Creating load file for EEPROM: planck.eep
|
|
||||||
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
|
||||||
--change-section-lma .eeprom=0 --no-change-warnings -O ihex planck.elf planck.eep || exit 0
|
|
||||||
|
|
||||||
Creating Extended Listing: planck.lss
|
|
||||||
avr-objdump -h -S -z planck.elf > planck.lss
|
|
||||||
|
|
||||||
Creating Symbol Table: planck.sym
|
|
||||||
avr-nm -n planck.elf > planck.sym
|
|
||||||
|
|
||||||
Size after:
|
|
||||||
text data bss dec hex filename
|
|
||||||
18602 82 155 18839 4997 planck.elf
|
|
||||||
|
|
||||||
-------- end --------
|
|
||||||
```
|
|
||||||
|
|
||||||
If you do not get the above, you **did not** build the firmware, and you will have nothing to flash. If you have the fresh clone from `github`, it was probably something gone wrong in this install process, go check and see what didn't work and threw errors or what steps you might have missed.
|
|
||||||
|
|
||||||
But if everything went OK, you are ready to flash! Press the reset button on the bottom of the Planck, wait two seconds, then:
|
|
||||||
```
|
|
||||||
$ make dfu
|
|
||||||
```
|
|
||||||
.
|
|
||||||
.
|
|
||||||
.
|
|
||||||
profit!!!
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##extra bits...
|
|
||||||
|
|
||||||
###Installing Precompiled `dfu-programmer` Binaries (not recommended for `cygwin`)
|
|
||||||
To install the `dfu-programmer` from the binaries, we must get if from [the `dfu-programmer` website](https://dfu-programmer.github.io/) ([0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip)).
|
|
||||||
|
|
||||||
Copy this file into your `cygwin` home\src directory. (For me, it is `C:\cygwin64\home\Kevin\src`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `./dfu-prog-usb-1.2.2/x86/` to a directory in the `Windows` `PATH` and the `cygwin` `PATH`. This is because the `dfu-programmer` binary is `mingw` based, not `cygwin` based, so the `dlls` do not cooperate. I achieved acceptable pathing by moving the files to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a `WINDOWS` command prompt running (Adjusting your path for username, etc. as needed):
|
|
||||||
```
|
|
||||||
C:\> set PATH=%PATH%;C:\cygwin64\home\Kevin\local\avr\bin
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, rename `libusb0_x86.dll` to `libusb0.dll`.
|
|
||||||
|
|
||||||
You can tell that you were successful by trying to execute 'dfu-programmer' from the 'cygwin' prompt:
|
|
||||||
```
|
|
||||||
$ which dfu-programmer
|
|
||||||
/home/Kevin/local/avr/bin/dfu-programmer
|
|
||||||
|
|
||||||
$ dfu-programmer
|
|
||||||
dfu-programmer 0.7.2
|
|
||||||
https://github.com/dfu-programmer/dfu-programmer
|
|
||||||
Type 'dfu-programmer --help' for a list of commands
|
|
||||||
'dfu-programmer --targets' to list supported target devices
|
|
||||||
```
|
|
||||||
|
|
||||||
If you are not getting the above result, you will not be able to flash the firmware!
|
|
||||||
- Try making sure your `PATH` variables are set correctly for both `Windows` and `cygwin`.
|
|
||||||
- Make sure the `dll` is named correctly.
|
|
||||||
- Do not extract it with `cygwin`'s `unzip` as it does not set the executable permission. If you did it anyway, do `chmod +x dfu-programmer.exe`.
|
|
||||||
- Still have problems? Try building it instead.
|
|
||||||
|
|
||||||
|
|
||||||
##Debugging Tools
|
|
||||||
|
|
||||||
These tools are for debugging your firmware, etc. before flashing. Theoretically, it can save your memory from wearing out. However, these tool do not work 100% for the Planck firmware.
|
|
||||||
|
|
||||||
### `gdb` for AVR
|
|
||||||
`gdb` has a simulator for AVR but it does not support all instructions (like WDT), so it immediately crashes when running the Planck firmware (because `lufa.c` disables the WDT in the first few lines of execution). But it can still be useful in debugging example code and test cases, if you know how to use it.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ cd ~/src
|
|
||||||
$ git clone git://sourceware.org/git/binutils-gdb.git
|
|
||||||
$ cd binutils-gdb
|
|
||||||
$ mkdir obj-avr
|
|
||||||
$ cd obj-avr
|
|
||||||
$ ../configure --prefix=$PREFIX --target=avr --build=x86_64-unknown-cygwin --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --disable-nls --enable-static
|
|
||||||
$ make
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
|
|
||||||
### `simulavr`
|
|
||||||
`simulavr` is an AVR simulator. It runs the complied AVR elfs. `simulavr` does not support the `atmega32u4` device... it does `atmega32` but that is not good enough for the firmware (no PORTE and other things), so you cannot run the Planck firmware. I use it to simulate ideas I have for features in separate test projects.
|
|
||||||
|
|
||||||
This one is a major pain in the butt because it has a lot of dependencies and it is buggy. I will do my best to explain it but... it was hard to figure out. A few things need to be changed in the 'Makefile' to make it work in `cygwin`.
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
$ cd ~/src
|
|
||||||
$ git clone https://github.com/Traumflug/simulavr.git
|
|
||||||
$ cd simulavr
|
|
||||||
$ ./bootstrap
|
|
||||||
$ ./configure --prefix=$PREFIX --enable-static --disable-tcl --disable-doxygen-doc
|
|
||||||
```
|
|
||||||
Edit `src/Makefile.am` now so that `-no-undefined` is included (I did this by removing the SYS_MINGW conditional surrounding `libsim_la_LDFLAGS += -no-undefined` and `libsimulavr_la_LDFLAGS += -no-undefined \ libsimulavr_la_LIBADD += $(TCL_LIB)`. Also, `$(EXEEXT)` is added after `kbdgentables` in two places.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ make
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
TODO:
|
|
||||||
- git repos for all sources
|
|
||||||
- command line magic for cygwin setup
|
|
||||||
- better options for `dfu-drivers`
|
|
|
@ -1,7 +0,0 @@
|
||||||
Understanding the essential changes made on the [tmk_keyboard firmware](http://github.com/tmk/tmk_keyboard) should help you understand the QMK Firmware.
|
|
||||||
|
|
||||||
| Firmware |TMK |QMK |
|
|
||||||
|------------------------------|-----------------------|-------------------------|
|
|
||||||
| Maintainer |hasu (@tmk) |Jack Humbert et al. |
|
|
||||||
| Build path customization | `TMK_DIR = ...` | `include .../Makefile` |
|
|
||||||
| `keymaps` array data | 3D array of `uint8_t` holding **keycode** | 3D array of `uint16_t` holding **keycode** |
|
|
97
docs/documentation_best_practices.md
Normal file
97
docs/documentation_best_practices.md
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
# Documentation Best Practices
|
||||||
|
|
||||||
|
This page exists to document best practices when writing documentation for QMK. Following these guidelines will help to keep a consistent tone and style, which will in turn help other people more easily understand QMK.
|
||||||
|
|
||||||
|
# Page Opening
|
||||||
|
|
||||||
|
Your documentation page should generally start with an H1 heading, followed by a 1 paragrah description of what the user will find on this page. Keep in mind that this heading and paragraph will sit next to the Table of Contents, so keep the heading short and avoid long strings with no whitespace.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
# My Page Title
|
||||||
|
|
||||||
|
This page covers my super cool feature. You can use this feature to make coffee, squeeze fresh oj, and have an egg mcmuffin and hashbrowns delivered from your local macca's by drone.
|
||||||
|
```
|
||||||
|
|
||||||
|
# Headings
|
||||||
|
|
||||||
|
Your page should generally have multiple "H1" headings. Only H1 and H2 headings will included in the Table of Contents, so plan them out appropriately. Excess width should be avoided in H1 and H2 headings to prevent the Table of Contents from getting too wide.
|
||||||
|
|
||||||
|
# Styled Hint Blocks
|
||||||
|
|
||||||
|
You can have styled hint blocks drawn around text to draw attention to it.
|
||||||
|
|
||||||
|
```
|
||||||
|
{% hint style='info' %}
|
||||||
|
This uses `hint style='info'`
|
||||||
|
{% endhint %}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples:
|
||||||
|
|
||||||
|
{% hint style='info' %}
|
||||||
|
This uses `hint style='info'`
|
||||||
|
{% endhint %}
|
||||||
|
|
||||||
|
{% hint style='tip' %}
|
||||||
|
This uses `hint style='tip'`
|
||||||
|
{% endhint %}
|
||||||
|
|
||||||
|
{% hint style='danger' %}
|
||||||
|
This uses `hint style='danger'`
|
||||||
|
{% endhint %}
|
||||||
|
|
||||||
|
{% hint style='working' %}
|
||||||
|
This uses `hint style='working'`
|
||||||
|
{% endhint %}
|
||||||
|
|
||||||
|
# Styled Terminal Blocks
|
||||||
|
|
||||||
|
You can present styled terminal blocks by including special tokens inside your text block.
|
||||||
|
|
||||||
|
```
|
||||||
|
\`\`\`
|
||||||
|
**[terminal]
|
||||||
|
**[prompt foo@joe]**[path ~]**[delimiter $ ]**[command ./myscript]
|
||||||
|
Normal output line. Nothing special here...
|
||||||
|
But...
|
||||||
|
You can add some colors. What about a warning message?
|
||||||
|
**[warning [WARNING] The color depends on the theme. Could look normal too]
|
||||||
|
What about an error message?
|
||||||
|
**[error [ERROR] This is not the error you are looking for]
|
||||||
|
\`\`\`
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```
|
||||||
|
**[terminal]
|
||||||
|
**[prompt foo@joe]**[path ~]**[delimiter $ ]**[command ./myscript]
|
||||||
|
Normal output line. Nothing special here...
|
||||||
|
But...
|
||||||
|
You can add some colors. What about a warning message?
|
||||||
|
**[warning [WARNING] The color depends on the theme. Could look normal too]
|
||||||
|
What about an error message?
|
||||||
|
**[error [ERROR] This is not the error you are looking for]
|
||||||
|
```
|
||||||
|
|
||||||
|
# Documenting Features
|
||||||
|
|
||||||
|
If you create a new feature for QMK, create a documentation page for it. It doesn't have to be very long, a few sentances describing your feature and a table listing any relevant keycodes is enough. Here is a basic template:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
# My Cool Feature
|
||||||
|
|
||||||
|
This page describes my cool feature. You can use my cool feature to make coffee and order cream and sugar to be delivered via drone.
|
||||||
|
|
||||||
|
## My Cool Feature Keycodes
|
||||||
|
|
||||||
|
|Long Name|Short Name|Description|
|
||||||
|
|---------|----------|-----------|
|
||||||
|
|KC_COFFEE||Make Coffee|
|
||||||
|
|KC_CREAM||Order Cream|
|
||||||
|
|KC_SUGAR||Order Sugar|
|
||||||
|
```
|
||||||
|
|
||||||
|
Place your documentation into `docs/feature_<my_cool_feature>.md`, and add that file to the appropriate place in `docs/_summary.md`. If you have added any keycodes be sure to add them to `docs/keycodes.md` with a link back to your feature page.
|
|
@ -1,3 +1,5 @@
|
||||||
|
# Setting Up Eclipse for QMK Development
|
||||||
|
|
||||||
[Eclipse](https://en.wikipedia.org/wiki/Eclipse_(software)) is an open-source [Integrated Development Environment](https://en.wikipedia.org/wiki/Integrated_development_environment) (IDE) widely used for Java development, but with an extensible plugin system that allows to customize it for other languages and usages.
|
[Eclipse](https://en.wikipedia.org/wiki/Eclipse_(software)) is an open-source [Integrated Development Environment](https://en.wikipedia.org/wiki/Integrated_development_environment) (IDE) widely used for Java development, but with an extensible plugin system that allows to customize it for other languages and usages.
|
||||||
|
|
||||||
Using an IDE such as Eclipse provides many advantages over a plain text editor, such as:
|
Using an IDE such as Eclipse provides many advantages over a plain text editor, such as:
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
# WARNING: Until issue [#173](https://github.com/tmk/tmk_keyboard/issues/173) goes through, the [core][1] repository will not be up-to-date with the latest changes and fixes, but can still be used.
|
|
||||||
|
|
||||||
If you want to use TMK for your own keyboard project, you've got three options for embedding the [core][1].
|
|
||||||
The recommended option is [subtrees](#1-git-subtree).
|
|
||||||
|
|
||||||
After adding the embed you'll need to [modify the Makefile](#modifications-to-the-makefile) of your project to point to the core correctly.
|
|
||||||
|
|
||||||
## 1. git subtree
|
|
||||||
|
|
||||||
In order to set up the subtree in your project, first add the core repository as a remote:
|
|
||||||
```
|
|
||||||
git remote add -f core https://github.com/tmk/tmk_core
|
|
||||||
```
|
|
||||||
|
|
||||||
Then add the core as a subtree (directory) in your local repository:
|
|
||||||
```
|
|
||||||
git subtree add -P tmk_core core master --squash
|
|
||||||
```
|
|
||||||
|
|
||||||
And that's it!
|
|
||||||
|
|
||||||
When you want to update the subtree in your repository to match the master on [tmk_core][1], do this:
|
|
||||||
```
|
|
||||||
git subtree pull -P tmk_core core master --squash
|
|
||||||
```
|
|
||||||
|
|
||||||
## 2. git submodule
|
|
||||||
|
|
||||||
In order to set up the submodule in your project, first add a new submodule:
|
|
||||||
```
|
|
||||||
git submodule add https://github.com/tmk/tmk_core tmk_core
|
|
||||||
```
|
|
||||||
|
|
||||||
Then pull, sync and update the submodule:
|
|
||||||
```
|
|
||||||
git pull
|
|
||||||
git submodule sync --recursive
|
|
||||||
git submodule update --init --recursive
|
|
||||||
```
|
|
||||||
|
|
||||||
And that's it!
|
|
||||||
|
|
||||||
When you want to update the subtree in your repository to match the master on [tmk_core][1], follow the same steps as above.
|
|
||||||
|
|
||||||
If you want to clone a repository from GitHub that has submodule(s) in it, pass <kbd>--recursive</kbd> when cloning, like so:
|
|
||||||
`git clone --recursive https://github.com/<username>/<repository>`
|
|
||||||
|
|
||||||
## 3. Manually (without git)
|
|
||||||
|
|
||||||
*Note: This is not recommended in any way, but it's still possible.*
|
|
||||||
|
|
||||||
Download a zipped version of the [tmk_core][1] repository using this link:
|
|
||||||
<https://github.com/tmk/tmk_core/archive/master.zip>
|
|
||||||
|
|
||||||
Extract the zip in your project's directory, then rename the folder to <kbd>tmk_core</kbd>.
|
|
||||||
|
|
||||||
## Modifications to the *Makefile*
|
|
||||||
|
|
||||||
The one thing you have to make sure to change in the *Makefile* (compared to [tmk_keyboard](https://github.com/tmk/tmk_keyboard) drivers' *[Makefile](https://github.com/tmk/tmk_keyboard/blob/master/keyboard/gh60/Makefile#L45)*) is the "TMK_DIR" variable, which needs to point to the embed directory:
|
|
||||||
```Makefile
|
|
||||||
TMK_DIR = ./tmk_core
|
|
||||||
```
|
|
||||||
|
|
||||||
[1]: https://github.com/tmk/tmk_core
|
|
242
docs/faq.md
242
docs/faq.md
|
@ -1,238 +1,6 @@
|
||||||
## READ FIRST
|
# Frequently Asked Questions
|
||||||
- **README** of top directory : https://github.com/tmk/tmk_keyboard/blob/master/README.md
|
|
||||||
- **README** of target project(keyboard/converter) directory.
|
|
||||||
|
|
||||||
Note that you'll need to read **both**.
|
* [General](faq_general.md)
|
||||||
|
* [Building or Compiling QMK](faq_build.md)
|
||||||
|
* [Debugging and Troubleshooting QMK](faq_debug.md)
|
||||||
# Build
|
* [Keymap](faq_keymap.md)
|
||||||
- [[FAQ/Build]]
|
|
||||||
|
|
||||||
|
|
||||||
# Keymap
|
|
||||||
- [[FAQ/Keymap]]
|
|
||||||
|
|
||||||
|
|
||||||
# Debug Console
|
|
||||||
## hid_listen can't recognize device
|
|
||||||
When debug console of your device is not ready you will see like this:
|
|
||||||
|
|
||||||
Waiting for device:.........
|
|
||||||
|
|
||||||
once the device is pluged in then *hid_listen* finds it you will get this message:
|
|
||||||
|
|
||||||
Waiting for new device:.........................
|
|
||||||
Listening:
|
|
||||||
|
|
||||||
Check if you can't get this 'Listening:' message:
|
|
||||||
- build with `CONSOLE_ENABLE=yes` in **Makefile**.
|
|
||||||
|
|
||||||
You may need privilege to access the device on OS like Linux.
|
|
||||||
- try `sudo hid_listen`
|
|
||||||
|
|
||||||
## Can't get message on console
|
|
||||||
Check:
|
|
||||||
- *hid_listen* finds your device. See above.
|
|
||||||
- Enable debug with pressing **Magic**+d. See [Magic Commands](https://github.com/tmk/tmk_keyboard#magic-commands).
|
|
||||||
- set `debug_enable=true` usually in `matrix_init()` in **matrix.c**.
|
|
||||||
- try using 'print' function instead of debug print. See **common/print.h**.
|
|
||||||
- disconnect other devices with console function. See [Issue #97](https://github.com/tmk/tmk_keyboard/issues/97).
|
|
||||||
|
|
||||||
## Linux or UNIX like system requires Super User privilege
|
|
||||||
Just use 'sudo' to execute *hid_listen* with privilege.
|
|
||||||
```
|
|
||||||
$ sudo hid_listen
|
|
||||||
```
|
|
||||||
|
|
||||||
Or add an *udev rule* for TMK devices with placing a file in rules directory. The directory may vary on each system.
|
|
||||||
|
|
||||||
File: /etc/udev/rules.d/52-tmk-keyboard.rules(in case of Ubuntu)
|
|
||||||
```
|
|
||||||
# tmk keyboard products https://github.com/tmk/tmk_keyboard
|
|
||||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
# Miscellaneous
|
|
||||||
## NKRO Doesn't work
|
|
||||||
First you have to compile frimware with this build option `NKRO_ENABLE` in **Makefile**.
|
|
||||||
|
|
||||||
Try `Magic` **N** command(`LShift+RShift+N` by default) when **NKRO** still doesn't work. You can use this command to toggle between **NKRO** and **6KRO** mode temporarily. In some situations **NKRO** doesn't work you need to switch to **6KRO** mode, in particular when you are in BIOS.
|
|
||||||
|
|
||||||
If your firmeare built with `BOOTMAGIC_ENABLE` you need to turn its switch on by `BootMagic` **N** command(`Space+N` by default). This setting is stored in EEPROM and keeped over power cycles.
|
|
||||||
|
|
||||||
https://github.com/tmk/tmk_keyboard#boot-magic-configuration---virtual-dip-switch
|
|
||||||
|
|
||||||
|
|
||||||
## TrackPoint needs reset circuit(PS/2 mouse support)
|
|
||||||
Without reset circuit you will have inconsistent reuslt due to improper initialize of the hardware. See circuit schematic of TPM754.
|
|
||||||
|
|
||||||
- http://geekhack.org/index.php?topic=50176.msg1127447#msg1127447
|
|
||||||
- http://www.mikrocontroller.net/attachment/52583/tpm754.pdf
|
|
||||||
|
|
||||||
|
|
||||||
## Can't read column of matrix beyond 16
|
|
||||||
Use `1UL<<16` instead of `1<<16` in `read_cols()` in **matrix.h** when your columns goes beyond 16.
|
|
||||||
|
|
||||||
In C `1` means one of **int** type which is **16bit** in case of AVR so you can't shift left more than 15. You will get unexpected zero when you say `1<<16`. You have to use **unsigned long** type with `1UL`.
|
|
||||||
|
|
||||||
http://deskthority.net/workshop-f7/rebuilding-and-redesigning-a-classic-thinkpad-keyboard-t6181-60.html#p146279
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Pull-up Resistor
|
|
||||||
In some case converters needed to have pull-up resistors to work correctly. Place the resistor between VCC and signal line in parallel.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
```
|
|
||||||
Keyboard Conveter
|
|
||||||
,------.
|
|
||||||
5V------+------|VCC |
|
|
||||||
| | |
|
|
||||||
R | |
|
|
||||||
| | |
|
|
||||||
Signal--+------|PD0 |
|
|
||||||
| |
|
|
||||||
GND------------|GND |
|
|
||||||
`------'
|
|
||||||
R: 1K Ohm resistor
|
|
||||||
```
|
|
||||||
|
|
||||||
https://github.com/tmk/tmk_keyboard/issues/71
|
|
||||||
|
|
||||||
|
|
||||||
## Arduino Micro's pin naming is confusing
|
|
||||||
Note that Arduino Micro PCB marking is different from real AVR port name. D0 of Arduino Micro is not PD0, PD0 is D3. Check schematic yourself.
|
|
||||||
http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Bootloader jump doesn't work
|
|
||||||
Properly configure bootloader size in **Makefile**. With wrong section size bootloader won't probably start with **Magic command** and **Boot Magic**.
|
|
||||||
```
|
|
||||||
# Size of Bootloaders in bytes:
|
|
||||||
# Atmel DFU loader(ATmega32U4) 4096
|
|
||||||
# Atmel DFU loader(AT90USB128) 8192
|
|
||||||
# LUFA bootloader(ATmega32U4) 4096
|
|
||||||
# Arduino Caterina(ATmega32U4) 4096
|
|
||||||
# USBaspLoader(ATmega***) 2048
|
|
||||||
# Teensy halfKay(ATmega32U4) 512
|
|
||||||
# Teensy++ halfKay(AT90USB128) 2048
|
|
||||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
|
||||||
```
|
|
||||||
AVR Boot section size are defined by setting **BOOTSZ** fuse in fact. Consult with your MCU datasheet.
|
|
||||||
Note that **Word**(2 bytes) size and address are used in datasheet while TMK uses **Byte**.
|
|
||||||
|
|
||||||
AVR Boot section is located at end of Flash memory like the followings.
|
|
||||||
```
|
|
||||||
byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB1286)
|
|
||||||
0x0000 +---------------+ 0x00000 +---------------+
|
|
||||||
| | | |
|
|
||||||
| | | |
|
|
||||||
| Application | | Application |
|
|
||||||
| | | |
|
|
||||||
= = = =
|
|
||||||
| | 32KB-4KB | | 128KB-8KB
|
|
||||||
0x6000 +---------------+ 0x1E000 +---------------+
|
|
||||||
| Bootloader | 4KB | Bootloader | 8KB
|
|
||||||
0x7FFF +---------------+ 0x1FFFF +---------------+
|
|
||||||
|
|
||||||
|
|
||||||
byte Teensy(ATMega32u4) byte Teensy++(AT90SUB1286)
|
|
||||||
0x0000 +---------------+ 0x00000 +---------------+
|
|
||||||
| | | |
|
|
||||||
| | | |
|
|
||||||
| Application | | Application |
|
|
||||||
| | | |
|
|
||||||
= = = =
|
|
||||||
| | 32KB-512B | | 128KB-2KB
|
|
||||||
0x7E00 +---------------+ 0x1FC00 +---------------+
|
|
||||||
| Bootloader | 512B | Bootloader | 2KB
|
|
||||||
0x7FFF +---------------+ 0x1FFFF +---------------+
|
|
||||||
```
|
|
||||||
|
|
||||||
And see this discussion for further reference.
|
|
||||||
https://github.com/tmk/tmk_keyboard/issues/179
|
|
||||||
|
|
||||||
|
|
||||||
## Special Extra key doesn't work(System, Audio control keys)
|
|
||||||
You need to define `EXTRAKEY_ENABLE` in **makefile** to use them in TMK.
|
|
||||||
```
|
|
||||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
|
||||||
```
|
|
||||||
http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-60.html#p157919
|
|
||||||
|
|
||||||
|
|
||||||
## Wakeup from sleep doesn't work
|
|
||||||
In Windows check `Allow this device to wake the computer` setting in Power **Management property** tab of **Device Manager**. Also check BIOS setting.
|
|
||||||
|
|
||||||
Pressing any key during sleep should wake host.
|
|
||||||
|
|
||||||
|
|
||||||
## Using Arduino?
|
|
||||||
**Note that Arduino pin naming is different from actual chip.** For example, Arduino pin `D0` is not `PD0`. Check circuit with its schematics yourself.
|
|
||||||
|
|
||||||
- http://arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf
|
|
||||||
- http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf
|
|
||||||
|
|
||||||
Arduino leonardo and micro have **ATMega32U4** and can be used for TMK, though Arduino bootloader may be a problem.
|
|
||||||
|
|
||||||
|
|
||||||
## Using PF4-7 pins of USB AVR?
|
|
||||||
You need to set JTD bit of MCUCR yourself to use PF4-7 as GPIO. Those pins are configured to serve JTAG function by default. MCUs like ATMega*U* or AT90USB* are affeteced with this.
|
|
||||||
|
|
||||||
If you are using Teensy this isn't needed. Teensy is shipped with JTAGEN fuse bit unprogrammed to disable the function.
|
|
||||||
|
|
||||||
See this code.
|
|
||||||
```
|
|
||||||
// JTAG disable for PORT F. write JTD bit twice within four cycles.
|
|
||||||
MCUCR |= (1<<JTD);
|
|
||||||
MCUCR |= (1<<JTD);
|
|
||||||
```
|
|
||||||
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hbkb/matrix.c#L67
|
|
||||||
|
|
||||||
And read **26.5.1 MCU Control Register – MCUCR** of ATMega32U4 datasheet.
|
|
||||||
|
|
||||||
|
|
||||||
## Adding LED indicators of Lock keys
|
|
||||||
You need your own LED indicators for CapsLock, ScrollLock and NumLock? See this post.
|
|
||||||
|
|
||||||
http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-120.html#p191560
|
|
||||||
|
|
||||||
## Program Arduino Micro/Leonardo
|
|
||||||
Push reset button and then run command like this within 8 seconds.
|
|
||||||
|
|
||||||
```
|
|
||||||
avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:adb_usb.hex -P/dev/ttyACM0
|
|
||||||
```
|
|
||||||
|
|
||||||
Device name will vary depending on your system.
|
|
||||||
|
|
||||||
http://arduino.cc/en/Main/ArduinoBoardMicro
|
|
||||||
https://geekhack.org/index.php?topic=14290.msg1563867#msg1563867
|
|
||||||
|
|
||||||
|
|
||||||
## USB 3 compatibility
|
|
||||||
I heard some people have a problem with USB 3 port, try USB 2 port.
|
|
||||||
|
|
||||||
|
|
||||||
## Mac compatibility
|
|
||||||
### OS X 10.11 and Hub
|
|
||||||
https://geekhack.org/index.php?topic=14290.msg1884034#msg1884034
|
|
||||||
|
|
||||||
|
|
||||||
## Problem on BIOS(UEFI)/Resume(Sleep&Wake)/Power cycles
|
|
||||||
Some people reported their keyboard stops working on BIOS and/or after resume(power cycles).
|
|
||||||
|
|
||||||
As of now root of its cause is not clear but some build options seem to be related. In Makefile try to disable those options like `CONSOLE_ENABLE`, `NKRO_ENABLE`, `SLEEP_LED_ENABLE` and/or others.
|
|
||||||
|
|
||||||
https://github.com/tmk/tmk_keyboard/issues/266
|
|
||||||
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## FLIP doesn't work
|
|
||||||
### AtLibUsbDfu.dll not found
|
|
||||||
Remove current driver and reinstall one FLIP provides from DeviceManager.
|
|
||||||
http://imgur.com/a/bnwzy
|
|
||||||
|
|
|
@ -1,18 +1,9 @@
|
||||||
## READ FIRST
|
# Frequently Asked Build Questions
|
||||||
- https://github.com/qmk/qmk_firmware/blob/master/docs/build_guide.md
|
|
||||||
|
|
||||||
In short,
|
This page covers questions about building QMK. If you have not yet you should read the [Build Environment Setup](getting_started_build_tools.md) and [Make Instructions](make_instructions.md) guides.
|
||||||
|
|
||||||
$ make [-f Makefile.<variant>] [KEYMAP=...] clean
|
## Can't program on Linux
|
||||||
$ make [-f Makefile.<variant>] [KEYMAP=...]
|
You will need proper permission to operate a device. For Linux users see udev rules below. Easy way is to use `sudo` command, if you are not familiar with this command check its manual with `man sudo` or this page on line.
|
||||||
$ make [-f Makefile.<variant>] [KEYMAP=...] dfu
|
|
||||||
|
|
||||||
|
|
||||||
## Can't program on Linux and Mac
|
|
||||||
You will need proper permission to operate a device. For Linux users see udev rules below.
|
|
||||||
Easy way is to use `sudo` command, if you are not familiar with this command check its manual with `man sudo` or this page on line.
|
|
||||||
|
|
||||||
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/sudo.8.html
|
|
||||||
|
|
||||||
In short when your controller is ATMega32u4,
|
In short when your controller is ATMega32u4,
|
||||||
|
|
||||||
|
@ -22,67 +13,18 @@ In short when your controller is ATMega32u4,
|
||||||
|
|
||||||
or just
|
or just
|
||||||
|
|
||||||
$ sudo make dfu
|
$ sudo make <keyboard>-<keymap>-dfu
|
||||||
|
|
||||||
But to run `make` with root privilege is not good idea. Use former method as possible.
|
|
||||||
|
|
||||||
## Do 'make clean' before 'make'
|
|
||||||
You'll need `make clean` after you edit **config.h** or change options like `KEYMAP`.
|
|
||||||
|
|
||||||
Frist remove all files made in previous build,
|
|
||||||
|
|
||||||
$ make clean
|
|
||||||
|
|
||||||
then build new firmware.
|
|
||||||
|
|
||||||
$ make [KEYMAP=...]
|
|
||||||
|
|
||||||
Also you can always try `make clean` when you get other strange result during build.
|
|
||||||
|
|
||||||
|
But to run `make` with root privilege is not good idea. Use former method if possible.
|
||||||
|
|
||||||
## WINAVR is obsolete
|
## WINAVR is obsolete
|
||||||
It is no longer recommended and may cause some problem.
|
It is no longer recommended and may cause some problem.
|
||||||
See [Issue #99](https://github.com/tmk/tmk_keyboard/issues/99).
|
See [TMK Issue #99](https://github.com/tmk/tmk_keyboard/issues/99).
|
||||||
|
|
||||||
## USB stack: LUFA or PJRC?
|
|
||||||
Use **LUFA**.
|
|
||||||
|
|
||||||
**PJRC** stack won't be supported actively anymore. There is no reason to hesitate to use LUFA except for binary size(about 1KB lager?). But **PJRC** is still very useful for debug and development purpose.
|
|
||||||
See also [Issue #50](https://github.com/tmk/tmk_keyboard/issues/50) and [Issue #58](https://github.com/tmk/tmk_keyboard/issues/58).
|
|
||||||
|
|
||||||
## Edit configuration but not change
|
|
||||||
You will need followings after editing `CONSOLE_ENABLE`, `NKRO_ENABLE`, `EXTRAKEY_ENABLE` or `MOUSEKEY_ENABLE` option in **Makefile**.
|
|
||||||
|
|
||||||
### 1. make clean
|
|
||||||
This will be needed when you edit **config.h**.
|
|
||||||
|
|
||||||
### 2. Remove Drivers from Device Manager(Windows)
|
|
||||||
**Windows only.** Linux, OSX and other OS's doesn't require this. It looks like Windows keeps using driver installed when device was connected first time even after the device changes its configuration. To load proper drivers for new configuration you need to remove existent drivers from **Drvice Manager**.
|
|
||||||
|
|
||||||
### 3. Build with different VID:PID
|
|
||||||
**Windows only.** If method 2. does't work fou you try this. Change Vendor ID or Product ID in **config.h** and build firmware. Windows should recognize it as whole new device and start drivers install process.
|
|
||||||
|
|
||||||
### 4. Just try other ports
|
|
||||||
This will be useful and the easiest workaround for **Windows**.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## USB VID and PID
|
## USB VID and PID
|
||||||
You can use any ID you want with editing `config.h`. Using any presumably unused ID will be no problem in fact except for very least chance of collision with other product.
|
You can use any ID you want with editing `config.h`. Using any presumably unused ID will be no problem in fact except for very low chance of collision with other product.
|
||||||
|
|
||||||
For example TMK uses following numbers by default.
|
Most boards in QMK use `0xFEED` as the vendor ID. You should look through other keyboards to make sure you pick a unique Product ID.
|
||||||
```
|
|
||||||
keyboard:
|
|
||||||
hhkb: FEED:CAFE
|
|
||||||
gh60: FEED:6060
|
|
||||||
|
|
||||||
converter:
|
|
||||||
x68k: FEED:6800
|
|
||||||
ps2: FEED:6512
|
|
||||||
adb: FEED:0ADB
|
|
||||||
ibm4704: FEED:4704
|
|
||||||
pc98: FEED:9898
|
|
||||||
```
|
|
||||||
|
|
||||||
Also see this.
|
Also see this.
|
||||||
https://github.com/tmk/tmk_keyboard/issues/150
|
https://github.com/tmk/tmk_keyboard/issues/150
|
||||||
|
@ -91,7 +33,6 @@ You can buy a really unique VID:PID here. I don't think you need this for person
|
||||||
- http://www.obdev.at/products/vusb/license.html
|
- http://www.obdev.at/products/vusb/license.html
|
||||||
- http://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=92&option=com_phpshop&Itemid=1
|
- http://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=92&option=com_phpshop&Itemid=1
|
||||||
|
|
||||||
|
|
||||||
## Linux udev rules
|
## Linux udev rules
|
||||||
On Linux you need proper privilege to access device file of MCU, you'll have to use `sudo` when flashing firmware. You can circumvent this with placing these files in `/etc/udev/rules.d/`.
|
On Linux you need proper privilege to access device file of MCU, you'll have to use `sudo` when flashing firmware. You can circumvent this with placing these files in `/etc/udev/rules.d/`.
|
||||||
|
|
||||||
|
@ -112,7 +53,6 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Cortex: cstddef: No such file or directory
|
## Cortex: cstddef: No such file or directory
|
||||||
GCC 4.8 of Ubuntu 14.04 had this problem and had to update to 4.9 with this PPA.
|
GCC 4.8 of Ubuntu 14.04 had this problem and had to update to 4.9 with this PPA.
|
||||||
https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded
|
https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded
|
||||||
|
|
242
docs/faq_debug.md
Normal file
242
docs/faq_debug.md
Normal file
|
@ -0,0 +1,242 @@
|
||||||
|
# Debugging FAQ
|
||||||
|
|
||||||
|
This page details various common questions people have about troubleshooting their keyboards.
|
||||||
|
|
||||||
|
# Debug Console
|
||||||
|
|
||||||
|
## hid_listen can't recognize device
|
||||||
|
When debug console of your device is not ready you will see like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
Waiting for device:.........
|
||||||
|
```
|
||||||
|
|
||||||
|
once the device is pluged in then *hid_listen* finds it you will get this message:
|
||||||
|
|
||||||
|
```
|
||||||
|
Waiting for new device:.........................
|
||||||
|
Listening:
|
||||||
|
```
|
||||||
|
|
||||||
|
If you can't get this 'Listening:' message try building with `CONSOLE_ENABLE=yes` in [Makefile]
|
||||||
|
|
||||||
|
You may need privilege to access the device on OS like Linux.
|
||||||
|
- try `sudo hid_listen`
|
||||||
|
|
||||||
|
## Can't get message on console
|
||||||
|
Check:
|
||||||
|
- *hid_listen* finds your device. See above.
|
||||||
|
- Enable debug with pressing **Magic**+d. See [Magic Commands](https://github.com/tmk/tmk_keyboard#magic-commands).
|
||||||
|
- set `debug_enable=true` usually in `matrix_init()` in **matrix.c**.
|
||||||
|
- try using 'print' function instead of debug print. See **common/print.h**.
|
||||||
|
- disconnect other devices with console function. See [Issue #97](https://github.com/tmk/tmk_keyboard/issues/97).
|
||||||
|
|
||||||
|
## Linux or UNIX like system requires Super User privilege
|
||||||
|
Just use 'sudo' to execute *hid_listen* with privilege.
|
||||||
|
```
|
||||||
|
$ sudo hid_listen
|
||||||
|
```
|
||||||
|
|
||||||
|
Or add an *udev rule* for TMK devices with placing a file in rules directory. The directory may vary on each system.
|
||||||
|
|
||||||
|
File: /etc/udev/rules.d/52-tmk-keyboard.rules(in case of Ubuntu)
|
||||||
|
```
|
||||||
|
# tmk keyboard products https://github.com/tmk/tmk_keyboard
|
||||||
|
SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"
|
||||||
|
```
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
# Miscellaneous
|
||||||
|
## Safety Considerations
|
||||||
|
|
||||||
|
You probably don't want to "brick" your keyboard, making it impossible
|
||||||
|
to rewrite firmware onto it. Here are some of the parameters to show
|
||||||
|
what things are (and likely aren't) too risky.
|
||||||
|
|
||||||
|
- If your keyboard map does not include RESET, then, to get into DFU
|
||||||
|
mode, you will need to press the reset button on the PCB, which
|
||||||
|
requires unscrewing the bottom.
|
||||||
|
- Messing with tmk_core / common files might make the keyboard
|
||||||
|
inoperable
|
||||||
|
- Too large a .hex file is trouble; `make dfu` will erase the block,
|
||||||
|
test the size (oops, wrong order!), which errors out, failing to
|
||||||
|
flash the keyboard, leaving it in DFU mode.
|
||||||
|
- To this end, note that the maximum .hex file size on Planck is
|
||||||
|
7000h (28672 decimal)
|
||||||
|
|
||||||
|
```
|
||||||
|
Linking: .build/planck_rev4_cbbrowne.elf [OK]
|
||||||
|
Creating load file for Flash: .build/planck_rev4_cbbrowne.hex [OK]
|
||||||
|
|
||||||
|
Size after:
|
||||||
|
text data bss dec hex filename
|
||||||
|
0 22396 0 22396 577c planck_rev4_cbbrowne.hex
|
||||||
|
```
|
||||||
|
|
||||||
|
- The above file is of size 22396/577ch, which is less than
|
||||||
|
28672/7000h
|
||||||
|
- As long as you have a suitable alternative .hex file around, you
|
||||||
|
can retry, loading that one
|
||||||
|
- Some of the options you might specify in your keyboard's Makefile
|
||||||
|
consume extra memory; watch out for BOOTMAGIC_ENABLE,
|
||||||
|
MOUSEKEY_ENABLE, EXTRAKEY_ENABLE, CONSOLE_ENABLE, API_SYSEX_ENABLE
|
||||||
|
- DFU tools do /not/ allow you to write into the bootloader (unless
|
||||||
|
you throw in extra fruitsalad of options), so there is little risk
|
||||||
|
there.
|
||||||
|
- EEPROM has around a 100000 write cycle. You shouldn't rewrite the
|
||||||
|
firmware repeatedly and continually; that'll burn the EEPROM
|
||||||
|
eventually.
|
||||||
|
## NKRO Doesn't work
|
||||||
|
First you have to compile frimware with this build option `NKRO_ENABLE` in **Makefile**.
|
||||||
|
|
||||||
|
Try `Magic` **N** command(`LShift+RShift+N` by default) when **NKRO** still doesn't work. You can use this command to toggle between **NKRO** and **6KRO** mode temporarily. In some situations **NKRO** doesn't work you need to switch to **6KRO** mode, in particular when you are in BIOS.
|
||||||
|
|
||||||
|
If your firmeare built with `BOOTMAGIC_ENABLE` you need to turn its switch on by `BootMagic` **N** command(`Space+N` by default). This setting is stored in EEPROM and keeped over power cycles.
|
||||||
|
|
||||||
|
https://github.com/tmk/tmk_keyboard#boot-magic-configuration---virtual-dip-switch
|
||||||
|
|
||||||
|
|
||||||
|
## TrackPoint needs reset circuit(PS/2 mouse support)
|
||||||
|
Without reset circuit you will have inconsistent reuslt due to improper initialize of the hardware. See circuit schematic of TPM754.
|
||||||
|
|
||||||
|
- http://geekhack.org/index.php?topic=50176.msg1127447#msg1127447
|
||||||
|
- http://www.mikrocontroller.net/attachment/52583/tpm754.pdf
|
||||||
|
|
||||||
|
|
||||||
|
## Can't read column of matrix beyond 16
|
||||||
|
Use `1UL<<16` instead of `1<<16` in `read_cols()` in [matrix.h] when your columns goes beyond 16.
|
||||||
|
|
||||||
|
In C `1` means one of [int] type which is [16bit] in case of AVR so you can't shift left more than 15. You will get unexpected zero when you say `1<<16`. You have to use [unsigned long] type with `1UL`.
|
||||||
|
|
||||||
|
http://deskthority.net/workshop-f7/rebuilding-and-redesigning-a-classic-thinkpad-keyboard-t6181-60.html#p146279
|
||||||
|
|
||||||
|
|
||||||
|
## Bootloader jump doesn't work
|
||||||
|
Properly configure bootloader size in **Makefile**. With wrong section size bootloader won't probably start with **Magic command** and **Boot Magic**.
|
||||||
|
```
|
||||||
|
# Size of Bootloaders in bytes:
|
||||||
|
# Atmel DFU loader(ATmega32U4) 4096
|
||||||
|
# Atmel DFU loader(AT90USB128) 8192
|
||||||
|
# LUFA bootloader(ATmega32U4) 4096
|
||||||
|
# Arduino Caterina(ATmega32U4) 4096
|
||||||
|
# USBaspLoader(ATmega***) 2048
|
||||||
|
# Teensy halfKay(ATmega32U4) 512
|
||||||
|
# Teensy++ halfKay(AT90USB128) 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
```
|
||||||
|
AVR Boot section size are defined by setting **BOOTSZ** fuse in fact. Consult with your MCU datasheet.
|
||||||
|
Note that **Word**(2 bytes) size and address are used in datasheet while TMK uses **Byte**.
|
||||||
|
|
||||||
|
AVR Boot section is located at end of Flash memory like the followings.
|
||||||
|
```
|
||||||
|
byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB1286)
|
||||||
|
0x0000 +---------------+ 0x00000 +---------------+
|
||||||
|
| | | |
|
||||||
|
| | | |
|
||||||
|
| Application | | Application |
|
||||||
|
| | | |
|
||||||
|
= = = =
|
||||||
|
| | 32KB-4KB | | 128KB-8KB
|
||||||
|
0x6000 +---------------+ 0x1E000 +---------------+
|
||||||
|
| Bootloader | 4KB | Bootloader | 8KB
|
||||||
|
0x7FFF +---------------+ 0x1FFFF +---------------+
|
||||||
|
|
||||||
|
|
||||||
|
byte Teensy(ATMega32u4) byte Teensy++(AT90SUB1286)
|
||||||
|
0x0000 +---------------+ 0x00000 +---------------+
|
||||||
|
| | | |
|
||||||
|
| | | |
|
||||||
|
| Application | | Application |
|
||||||
|
| | | |
|
||||||
|
= = = =
|
||||||
|
| | 32KB-512B | | 128KB-2KB
|
||||||
|
0x7E00 +---------------+ 0x1FC00 +---------------+
|
||||||
|
| Bootloader | 512B | Bootloader | 2KB
|
||||||
|
0x7FFF +---------------+ 0x1FFFF +---------------+
|
||||||
|
```
|
||||||
|
|
||||||
|
And see this discussion for further reference.
|
||||||
|
https://github.com/tmk/tmk_keyboard/issues/179
|
||||||
|
|
||||||
|
|
||||||
|
## Special Extra key doesn't work(System, Audio control keys)
|
||||||
|
You need to define `EXTRAKEY_ENABLE` in `rules.mk` to use them in QMK.
|
||||||
|
|
||||||
|
```
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||||
|
```
|
||||||
|
|
||||||
|
## Wakeup from sleep doesn't work
|
||||||
|
|
||||||
|
In Windows check `Allow this device to wake the computer` setting in Power **Management property** tab of **Device Manager**. Also check BIOS setting.
|
||||||
|
|
||||||
|
Pressing any key during sleep should wake host.
|
||||||
|
|
||||||
|
## Using Arduino?
|
||||||
|
|
||||||
|
**Note that Arduino pin naming is different from actual chip.** For example, Arduino pin `D0` is not `PD0`. Check circuit with its schematics yourself.
|
||||||
|
|
||||||
|
- http://arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf
|
||||||
|
- http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf
|
||||||
|
|
||||||
|
Arduino leonardo and micro have **ATMega32U4** and can be used for TMK, though Arduino bootloader may be a problem.
|
||||||
|
|
||||||
|
|
||||||
|
## Using PF4-7 pins of USB AVR?
|
||||||
|
You need to set JTD bit of MCUCR yourself to use PF4-7 as GPIO. Those pins are configured to serve JTAG function by default. MCUs like ATMega*U* or AT90USB* are affeteced with this.
|
||||||
|
|
||||||
|
If you are using Teensy this isn't needed. Teensy is shipped with JTAGEN fuse bit unprogrammed to disable the function.
|
||||||
|
|
||||||
|
See this code.
|
||||||
|
```
|
||||||
|
// JTAG disable for PORT F. write JTD bit twice within four cycles.
|
||||||
|
MCUCR |= (1<<JTD);
|
||||||
|
MCUCR |= (1<<JTD);
|
||||||
|
```
|
||||||
|
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hbkb/matrix.c#L67
|
||||||
|
|
||||||
|
And read **26.5.1 MCU Control Register – MCUCR** of ATMega32U4 datasheet.
|
||||||
|
|
||||||
|
|
||||||
|
## Adding LED indicators of Lock keys
|
||||||
|
You need your own LED indicators for CapsLock, ScrollLock and NumLock? See this post.
|
||||||
|
|
||||||
|
http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-120.html#p191560
|
||||||
|
|
||||||
|
## Program Arduino Micro/Leonardo
|
||||||
|
Push reset button and then run command like this within 8 seconds.
|
||||||
|
|
||||||
|
```
|
||||||
|
avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:adb_usb.hex -P/dev/ttyACM0
|
||||||
|
```
|
||||||
|
|
||||||
|
Device name will vary depending on your system.
|
||||||
|
|
||||||
|
http://arduino.cc/en/Main/ArduinoBoardMicro
|
||||||
|
https://geekhack.org/index.php?topic=14290.msg1563867#msg1563867
|
||||||
|
|
||||||
|
|
||||||
|
## USB 3 compatibility
|
||||||
|
I heard some people have a problem with USB 3 port, try USB 2 port.
|
||||||
|
|
||||||
|
|
||||||
|
## Mac compatibility
|
||||||
|
### OS X 10.11 and Hub
|
||||||
|
https://geekhack.org/index.php?topic=14290.msg1884034#msg1884034
|
||||||
|
|
||||||
|
|
||||||
|
## Problem on BIOS(UEFI)/Resume(Sleep&Wake)/Power cycles
|
||||||
|
Some people reported their keyboard stops working on BIOS and/or after resume(power cycles).
|
||||||
|
|
||||||
|
As of now root of its cause is not clear but some build options seem to be related. In Makefile try to disable those options like `CONSOLE_ENABLE`, `NKRO_ENABLE`, `SLEEP_LED_ENABLE` and/or others.
|
||||||
|
|
||||||
|
https://github.com/tmk/tmk_keyboard/issues/266
|
||||||
|
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## FLIP doesn't work
|
||||||
|
### AtLibUsbDfu.dll not found
|
||||||
|
Remove current driver and reinstall one FLIP provides from DeviceManager.
|
||||||
|
http://imgur.com/a/bnwzy
|
20
docs/faq_general.md
Normal file
20
docs/faq_general.md
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# Frequently Asked Questions
|
||||||
|
|
||||||
|
## What is QMK?
|
||||||
|
|
||||||
|
[QMK](https://github.com/qmk), short for Quantum Mechanical Keyboard, is a group of people building tools for custom keyboards. We started with the [QMK firmware](https://github.com/qmk/qmk_firmware), a heavily modified fork of [TMK](https://github.com/tmk/tmk_keyboard).
|
||||||
|
|
||||||
|
### Why the name Quantum?
|
||||||
|
|
||||||
|
<!-- FIXME -->
|
||||||
|
|
||||||
|
## What Differences Are There Between QMK and TMK?
|
||||||
|
|
||||||
|
TMK was originally designed and implemented by [Jun Wako](https://github.com/tmk). QMK started as [Jack Humbert's](https://github.com/jackhumbert) fork of TMK for the Planck. After a while Jack's fork had diverged quite a bit from TMK, and in 2015 Jack decided to rename his fork to QMK.
|
||||||
|
|
||||||
|
From a technical standpoint QMK builds upon TMK by adding several new features. Most notably QMK has expanded the number of available keycodes and uses these to implement advanced features like `S()`, `LCTL()`, and `MO()`. You can see a complete list of these keycodes in [Keycodes](keycodes.md).
|
||||||
|
|
||||||
|
From a project and community management standpoint TMK maintains all the officially supported keyboards by himself, with a bit of community support. Separate community maintained forks exist or can be created for other keyboards. Only a few keymaps are provided by default, so users typically don't share keymaps with each other. QMK encourages sharing of both keyboards and keymaps through a centrally managed repository, accepting all pull requests that follow the quality standards. These are mostly community maintained, but the QMK team also helps when necessary.
|
||||||
|
|
||||||
|
Both approaches have their merits and their drawbacks, and code flows freely between TMK and QMK when it makes sense.
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
## READ FIRST
|
# Keymap FAQ
|
||||||
https://github.com/tmk/tmk_core/blob/master/doc/keymap.md
|
|
||||||
|
|
||||||
## How to get keycode
|
This page covers questions people often have about keymaps. If you haven't you should read [Keymap Overview](keymap.md) first.
|
||||||
See [Keycodes](Keycodes). Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
|
|
||||||
|
|
||||||
## Sysrq key
|
## What Keycodes Can I Use?
|
||||||
|
See [Keycodes](keycodes.md) for an index of keycodes available to you. These link to more extensive documentation when available.
|
||||||
|
|
||||||
|
Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
|
||||||
|
|
||||||
|
## `KC_SYSREQ` isn't working
|
||||||
Use keycode for Print Screen(`KC_PSCREEN` or `KC_PSCR`) instead of `KC_SYSREQ`. Key combination of 'Alt + Print Screen' is recognized as 'System request'.
|
Use keycode for Print Screen(`KC_PSCREEN` or `KC_PSCR`) instead of `KC_SYSREQ`. Key combination of 'Alt + Print Screen' is recognized as 'System request'.
|
||||||
|
|
||||||
See [issue #168](https://github.com/tmk/tmk_keyboard/issues/168) and
|
See [issue #168](https://github.com/tmk/tmk_keyboard/issues/168) and
|
||||||
|
@ -16,7 +19,7 @@ Use `KC_PWR` instead of `KC_POWER` or vice versa.
|
||||||
- `KC_PWR` works with Windows and Linux, not with OSX.
|
- `KC_PWR` works with Windows and Linux, not with OSX.
|
||||||
- `KC_POWER` works with OSX and Linux, not with Windows.
|
- `KC_POWER` works with OSX and Linux, not with Windows.
|
||||||
|
|
||||||
http://geekhack.org/index.php?topic=14290.msg1327264#msg1327264
|
More info: http://geekhack.org/index.php?topic=14290.msg1327264#msg1327264
|
||||||
|
|
||||||
## Oneshot modifier
|
## Oneshot modifier
|
||||||
Solves my personal 'the' problem. I often got 'the' or 'THe' wrongly instead of 'The'. Oneshot Shift mitgates this for me.
|
Solves my personal 'the' problem. I often got 'the' or 'THe' wrongly instead of 'The'. Oneshot Shift mitgates this for me.
|
||||||
|
@ -32,15 +35,17 @@ For Modifier keys and layer actions you have to place `KC_TRANS` on same positio
|
||||||
|
|
||||||
|
|
||||||
## Mechanical Lock Switch Support
|
## Mechanical Lock Switch Support
|
||||||
https://github.com/tmk/tmk_keyboard#mechanical-locking-support
|
|
||||||
|
|
||||||
This feature is for *mechanical lock switch* like this Alps one.
|
This feature is for *mechanical lock switch* like [this Alps one](http://deskthority.net/wiki/Alps_SKCL_Lock). You can enable it by adding this to your `config.h`:
|
||||||
http://deskthority.net/wiki/Alps_SKCL_Lock
|
|
||||||
|
|
||||||
Using enabling this feature and using keycodes `LCAP`, `LNUM` or `LSCR` in keymap you can use physical locking CapsLock, NumLock or ScrollLock keys as you expected.
|
```
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
```
|
||||||
|
|
||||||
Old vintage mechanical keyboards occasionally have lock switches but modern ones don't have. ***You don't need this feature in most case and just use keycodes `CAPS`, `NLCK` and `SLCK`.***
|
After enabling this feature use keycodes `KC_LCAP`, `KC_LNUM` and `KC_LSCR` in your keymap instead.
|
||||||
|
|
||||||
|
Old vintage mechanical keyboards occasionally have lock switches but modern ones don't have. ***You don't need this feature in most case and just use keycodes `KC_CAPS`, `KC_NLCK` and `KC_SLCK`.***
|
||||||
|
|
||||||
## Input special charactors other than ASCII like Cédille 'Ç'
|
## Input special charactors other than ASCII like Cédille 'Ç'
|
||||||
NO UNIVERSAL METHOD TO INPUT THOSE WORKS OVER ALL SYSTEMS. You have to define **MACRO** in way specific to your OS or layout.
|
NO UNIVERSAL METHOD TO INPUT THOSE WORKS OVER ALL SYSTEMS. You have to define **MACRO** in way specific to your OS or layout.
|
||||||
|
@ -111,68 +116,14 @@ https://github.com/tekezo/Karabiner/issues/403
|
||||||
|
|
||||||
## Esc and `~ on a key
|
## Esc and `~ on a key
|
||||||
|
|
||||||
You can define FC660 and Poker style ESC with `ACTION_LAYER_MODS`.
|
Use `GRAVE_ESC` or `KC_GESC` in your keymap. `GUI`+`GRAVE_ESC` results in `` ` `` and `SHIFT`+`GRAVE_ESC` results in `~`.
|
||||||
https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#35-momentary-switching-with-modifiers
|
|
||||||
|
|
||||||
```
|
|
||||||
#include "keymap_common.h"
|
|
||||||
|
|
||||||
|
|
||||||
/* Leopold FC660
|
|
||||||
* https://elitekeyboards.com/products.php?sub=leopold,compact&pid=fc660c
|
|
||||||
* Shift + Esc = ~
|
|
||||||
* Fn + Esc = `
|
|
||||||
*
|
|
||||||
* Votex Poker II
|
|
||||||
* https://adprice.fedorapeople.org/poker2_manual.pdf
|
|
||||||
* Fn + Esc = `
|
|
||||||
* Fn + Shift + Esc = ~
|
|
||||||
*/
|
|
||||||
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
||||||
/* 0: qwerty */
|
|
||||||
[0] = KEYMAP( \
|
|
||||||
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS,BSPC, \
|
|
||||||
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
|
|
||||||
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \
|
|
||||||
FN0, NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,ESC, \
|
|
||||||
LCTL,LGUI,LALT, SPC, RALT,FN1, RGUI,RCTL),
|
|
||||||
[1] = KEYMAP( \
|
|
||||||
GRV, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
|
|
||||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,\
|
|
||||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
|
|
||||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
|
|
||||||
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
|
|
||||||
[2] = KEYMAP( \
|
|
||||||
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,TRNS, \
|
|
||||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,\
|
|
||||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
|
|
||||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
|
|
||||||
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint16_t PROGMEM fn_actions[] = {
|
|
||||||
// https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#35-momentary-switching-with-modifiers
|
|
||||||
[0] = ACTION_LAYER_MODS(1, MOD_LSFT),
|
|
||||||
[1] = ACTION_LAYER_MOMENTARY(2),
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
Otherwise, you can write code, see this.
|
|
||||||
https://github.com/p3lim/keyboard_firmware/commit/fd799c12b69a5ab5addd1d4c03380a1b8ef8e9dc
|
|
||||||
|
|
||||||
|
|
||||||
## 32 Fn keys are not enough?
|
|
||||||
### actionmap
|
|
||||||
It uses 16 bit codes and has no limitation of 32 Fn at the expense of memory space. TMK keymap is actually is 8 bit codes as subset of the actionmap.
|
|
||||||
https://github.com/tmk/tmk_keyboard/issues?utf8=%E2%9C%93&q=is%3Aissue+actionmap
|
|
||||||
|
|
||||||
### extension for modified keys
|
|
||||||
https://geekhack.org/index.php?topic=41989.msg1885526#msg1885526
|
|
||||||
|
|
||||||
|
Note that this will break the CTRL+SHIFT+ESC shortcut to the Windows task manager. Use `#define GRAVE_ESC_CTRL_OVERRIDE` in your `config.h` to get the shortcut back. With this option, `ESC_GRAVE` results in `ESC` if `CTRL` is held, even if `SHIFT` or `GUI` are also held.
|
||||||
|
|
||||||
## Arrow on Right Modifier keys with Dual-Role
|
## Arrow on Right Modifier keys with Dual-Role
|
||||||
This turns right modifer keys into arrow keys when the keys are tapped while still modifiers when the keys are hold. In TMK the dual-role function is dubbed **TAP**.
|
This turns right modifer keys into arrow keys when the keys are tapped while still modifiers when the keys are hold. In TMK the dual-role function is dubbed **TAP**.
|
||||||
```
|
```
|
||||||
|
|
||||||
#include "keymap_common.h"
|
#include "keymap_common.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,18 +162,16 @@ const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Dual-role key: https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys
|
Dual-role key: https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys
|
||||||
|
|
||||||
|
|
||||||
## Eject on Mac OSX
|
## Eject on Mac OSX
|
||||||
`EJCT` keycode works on OSX. https://github.com/tmk/tmk_keyboard/issues/250
|
`KC_EJCT` keycode works on OSX. https://github.com/tmk/tmk_keyboard/issues/250
|
||||||
It seems Windows 10 ignores the code and Linux/Xorg recognizes but has no mapping by default.
|
It seems Windows 10 ignores the code and Linux/Xorg recognizes but has no mapping by default.
|
||||||
|
|
||||||
Not sure what keycode Eject is on genuine Apple keyboard actually. HHKB uses `F20` for Eject key(`Fn+f`) on Mac mode but this is not same as Apple Eject keycode probably.
|
Not sure what keycode Eject is on genuine Apple keyboard actually. HHKB uses `F20` for Eject key(`Fn+f`) on Mac mode but this is not same as Apple Eject keycode probably.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## What's weak_mods and real_mods in action_util.c
|
## What's weak_mods and real_mods in action_util.c
|
||||||
___TO BE IMPROVED___
|
___TO BE IMPROVED___
|
||||||
|
|
||||||
|
@ -262,4 +211,3 @@ if (timer_elapsed(key_timer) < 100) {
|
||||||
```
|
```
|
||||||
|
|
||||||
It's best to declare the `static uint16_t key_timer;` at the top of the file, outside of any code blocks you're using it in.
|
It's best to declare the `static uint16_t key_timer;` at the top of the file, outside of any code blocks you're using it in.
|
||||||
|
|
||||||
|
|
204
docs/feature_audio.md
Normal file
204
docs/feature_audio.md
Normal file
|
@ -0,0 +1,204 @@
|
||||||
|
# Audio
|
||||||
|
|
||||||
|
Your keyboard can make sounds! If you've got a Planck, Preonic, or basically any AVR keyboard that allows access to the C6 or B5 port (`#define C6_AUDIO` and/or `#define B5_AUDIO`), you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes.
|
||||||
|
|
||||||
|
If you add `AUDIO_ENABLE = yes` to your `rules.mk`, there's a couple different sounds that will automatically be enabled without any other configuration:
|
||||||
|
|
||||||
|
```
|
||||||
|
STARTUP_SONG // plays when the keyboard starts up (audio.c)
|
||||||
|
GOODBYE_SONG // plays when you press the RESET key (quantum.c)
|
||||||
|
AG_NORM_SONG // plays when you press AG_NORM (quantum.c)
|
||||||
|
AG_SWAP_SONG // plays when you press AG_SWAP (quantum.c)
|
||||||
|
MUSIC_ON_SONG // plays when music mode is activated (process_music.c)
|
||||||
|
MUSIC_OFF_SONG // plays when music mode is deactivated (process_music.c)
|
||||||
|
CHROMATIC_SONG // plays when the chromatic music mode is selected (process_music.c)
|
||||||
|
GUITAR_SONG // plays when the guitar music mode is selected (process_music.c)
|
||||||
|
VIOLIN_SONG // plays when the violin music mode is selected (process_music.c)
|
||||||
|
MAJOR_SONG // plays when the major music mode is selected (process_music.c)
|
||||||
|
```
|
||||||
|
|
||||||
|
You can override the default songs by doing something like this in your `config.h`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
#define STARTUP_SONG SONG(STARTUP_SOUND)
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
A full list of sounds can be found in [quantum/audio/song_list.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/song_list.h) - feel free to add your own to this list! All available notes can be seen in [quantum/audio/musical_notes.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/musical_notes.h).
|
||||||
|
|
||||||
|
To play a custom sound at a particular time, you can define a song like this (near the top of the file):
|
||||||
|
|
||||||
|
```c
|
||||||
|
float my_song[][2] = SONG(QWERTY_SOUND);
|
||||||
|
```
|
||||||
|
|
||||||
|
And then play your song like this:
|
||||||
|
|
||||||
|
```c
|
||||||
|
PLAY_SONG(my_song);
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, you can play it in a loop like this:
|
||||||
|
|
||||||
|
```c
|
||||||
|
PLAY_LOOP(my_song);
|
||||||
|
```
|
||||||
|
|
||||||
|
It's advised that you wrap all audio features in `#ifdef AUDIO_ENABLE` / `#endif` to avoid causing problems when audio isn't built into the keyboard.
|
||||||
|
|
||||||
|
## Music mode
|
||||||
|
|
||||||
|
The music mode maps your columns to a chromatic scale, and your rows to octaves. This works best with ortholinear keyboards, but can be made to work with others. All keycodes less than `0xFF` get blocked, so you won't type while playing notes - if you have special keys/mods, those will still work. A work-around for this is to jump to a different layer with KC_NOs before (or after) enabling music mode.
|
||||||
|
|
||||||
|
Recording is experimental due to some memory issues - if you experience some weird behavior, unplugging/replugging your keyboard will fix things.
|
||||||
|
|
||||||
|
Keycodes available:
|
||||||
|
|
||||||
|
* `MU_ON` - Turn music mode on
|
||||||
|
* `MU_OFF` - Turn music mode off
|
||||||
|
* `MU_TOG` - Toggle music mode
|
||||||
|
* `MU_MOD` - Cycle through the music modes:
|
||||||
|
* `CHROMATIC_MODE` - Chromatic scale, row changes the octave
|
||||||
|
* `GUITAR_MODE` - Chromatic scale, but the row changes the string (+5 st)
|
||||||
|
* `VIOLIN_MODE` - Chromatic scale, but the row changes the string (+7 st)
|
||||||
|
* `MAJOR_MODE` - Major scale
|
||||||
|
|
||||||
|
In music mode, the following keycodes work differently, and don't pass through:
|
||||||
|
|
||||||
|
* `LCTL` - start a recording
|
||||||
|
* `LALT` - stop recording/stop playing
|
||||||
|
* `LGUI` - play recording
|
||||||
|
* `KC_UP` - speed-up playback
|
||||||
|
* `KC_DOWN` - slow-down playback
|
||||||
|
|
||||||
|
By default, `MUSIC_MASK` is set to `keycode < 0xFF` which means keycodes less than `0xFF` are turned into notes, and don't output anything. You can change this by defining this in your `config.h` like this:
|
||||||
|
|
||||||
|
#define MUSIC_MASK keycode != KC_NO
|
||||||
|
|
||||||
|
Which will capture all keycodes - be careful, this will get you stuck in music mode until you restart your keyboard!
|
||||||
|
|
||||||
|
The pitch standard (`PITCH_STANDARD_A`) is 440.0f by default - to change this, add something like this to your `config.h`:
|
||||||
|
|
||||||
|
#define PITCH_STANDARD_A 432.0f
|
||||||
|
|
||||||
|
## MIDI functionalty
|
||||||
|
|
||||||
|
This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile.
|
||||||
|
|
||||||
|
<!-- FIXME: this formatting needs work
|
||||||
|
|
||||||
|
## Audio
|
||||||
|
|
||||||
|
```c
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
AU_ON,
|
||||||
|
AU_OFF,
|
||||||
|
AU_TOG,
|
||||||
|
|
||||||
|
#ifdef FAUXCLICKY_ENABLE
|
||||||
|
FC_ON,
|
||||||
|
FC_OFF,
|
||||||
|
FC_TOG,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Music mode on/off/toggle
|
||||||
|
MU_ON,
|
||||||
|
MU_OFF,
|
||||||
|
MU_TOG,
|
||||||
|
|
||||||
|
// Music voice iterate
|
||||||
|
MUV_IN,
|
||||||
|
MUV_DE,
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
### Midi
|
||||||
|
|
||||||
|
#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
|
||||||
|
MI_ON, // send midi notes when music mode is enabled
|
||||||
|
MI_OFF, // don't send midi notes when music mode is enabled
|
||||||
|
#endif
|
||||||
|
|
||||||
|
MIDI_TONE_MIN,
|
||||||
|
MIDI_TONE_MAX
|
||||||
|
|
||||||
|
MI_C = MIDI_TONE_MIN,
|
||||||
|
MI_Cs,
|
||||||
|
MI_Db = MI_Cs,
|
||||||
|
MI_D,
|
||||||
|
MI_Ds,
|
||||||
|
MI_Eb = MI_Ds,
|
||||||
|
MI_E,
|
||||||
|
MI_F,
|
||||||
|
MI_Fs,
|
||||||
|
MI_Gb = MI_Fs,
|
||||||
|
MI_G,
|
||||||
|
MI_Gs,
|
||||||
|
MI_Ab = MI_Gs,
|
||||||
|
MI_A,
|
||||||
|
MI_As,
|
||||||
|
MI_Bb = MI_As,
|
||||||
|
MI_B,
|
||||||
|
|
||||||
|
MIDI_TONE_KEYCODE_OCTAVES > 1
|
||||||
|
|
||||||
|
where x = 1-5:
|
||||||
|
MI_C_x,
|
||||||
|
MI_Cs_x,
|
||||||
|
MI_Db_x = MI_Cs_x,
|
||||||
|
MI_D_x,
|
||||||
|
MI_Ds_x,
|
||||||
|
MI_Eb_x = MI_Ds_x,
|
||||||
|
MI_E_x,
|
||||||
|
MI_F_x,
|
||||||
|
MI_Fs_x,
|
||||||
|
MI_Gb_x = MI_Fs_x,
|
||||||
|
MI_G_x,
|
||||||
|
MI_Gs_x,
|
||||||
|
MI_Ab_x = MI_Gs_x,
|
||||||
|
MI_A_x,
|
||||||
|
MI_As_x,
|
||||||
|
MI_Bb_x = MI_As_x,
|
||||||
|
MI_B_x,
|
||||||
|
|
||||||
|
MI_OCT_Nx 1-2
|
||||||
|
MI_OCT_x 0-7
|
||||||
|
MIDI_OCTAVE_MIN = MI_OCT_N2,
|
||||||
|
MIDI_OCTAVE_MAX = MI_OCT_7,
|
||||||
|
MI_OCTD, // octave down
|
||||||
|
MI_OCTU, // octave up
|
||||||
|
|
||||||
|
MI_TRNS_Nx 1-6
|
||||||
|
MI_TRNS_x 0-6
|
||||||
|
MIDI_TRANSPOSE_MIN = MI_TRNS_N6,
|
||||||
|
MIDI_TRANSPOSE_MAX = MI_TRNS_6,
|
||||||
|
MI_TRNSD, // transpose down
|
||||||
|
MI_TRNSU, // transpose up
|
||||||
|
|
||||||
|
MI_VEL_x 1-10
|
||||||
|
MIDI_VELOCITY_MIN = MI_VEL_1,
|
||||||
|
MIDI_VELOCITY_MAX = MI_VEL_9,
|
||||||
|
MI_VELD, // velocity down
|
||||||
|
MI_VELU, // velocity up
|
||||||
|
|
||||||
|
MI_CHx 1-16
|
||||||
|
MIDI_CHANNEL_MIN = MI_CH1
|
||||||
|
MIDI_CHANNEL_MAX = MI_CH16,
|
||||||
|
MI_CHD, // previous channel
|
||||||
|
MI_CHU, // next channel
|
||||||
|
|
||||||
|
MI_ALLOFF, // all notes off
|
||||||
|
|
||||||
|
MI_SUS, // sustain
|
||||||
|
MI_PORT, // portamento
|
||||||
|
MI_SOST, // sostenuto
|
||||||
|
MI_SOFT, // soft pedal
|
||||||
|
MI_LEG, // legato
|
||||||
|
|
||||||
|
MI_MOD, // modulation
|
||||||
|
MI_MODSD, // decrease modulation speed
|
||||||
|
MI_MODSU, // increase modulation speed
|
||||||
|
#endif // MIDI_ADVANCED
|
||||||
|
|
||||||
|
-->
|
17
docs/feature_backlight.md
Normal file
17
docs/feature_backlight.md
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Backlighting
|
||||||
|
|
||||||
|
<!-- FIXME: Describe how backlighting works in QMK -->
|
||||||
|
|
||||||
|
## Backlight Keycodes
|
||||||
|
|
||||||
|
These keycodes control the backlight. Most keyboards use this for single color in-switch lighting.
|
||||||
|
|
||||||
|
|Name|Description|
|
||||||
|
|----|-----------|
|
||||||
|
|`BL_x`|Set a specific backlight level between 0-9|
|
||||||
|
|`BL_ON`|An alias for `BL_9`|
|
||||||
|
|`BL_OFF`|An alias for `BL_0`|
|
||||||
|
|`BL_DEC`|Turn the backlight level down by 1|
|
||||||
|
|`BL_INC`|Turn the backlight level up by 1|
|
||||||
|
|`BL_TOGG`|Toggle the backlight on or off|
|
||||||
|
|`BL_STEP`|Step through backlight levels, wrapping around to 0 when you reach the top.|
|
17
docs/feature_bluetooth.md
Normal file
17
docs/feature_bluetooth.md
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Bluetooth
|
||||||
|
|
||||||
|
## Bluetooth functionality
|
||||||
|
|
||||||
|
This requires [some hardware changes](https://www.reddit.com/r/MechanicalKeyboards/comments/3psx0q/the_planck_keyboard_with_bluetooth_guide_and/?ref=search_posts), but can be enabled via the Makefile. The firmware will still output characters via USB, so be aware of this when charging via a computer. It would make sense to have a switch on the Bluefruit to turn it off at will.
|
||||||
|
|
||||||
|
<!-- FIXME: Document bluetooth support more completely. -->
|
||||||
|
|
||||||
|
## Bluetooth Keycodes
|
||||||
|
|
||||||
|
This is used when multiple keyboard outputs can be selected. Currently this only allows for switching between USB and Bluetooth on keyboards that support both.
|
||||||
|
|
||||||
|
|Name|Description|
|
||||||
|
|----|-----------|
|
||||||
|
|`OUT_AUTO`|auto mode|
|
||||||
|
|`OUT_USB`|usb only|
|
||||||
|
|`OUT_BT`|bluetooth|
|
29
docs/feature_bootmagic.md
Normal file
29
docs/feature_bootmagic.md
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
# 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 backslack 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|
|
163
docs/feature_common_shortcuts.md
Normal file
163
docs/feature_common_shortcuts.md
Normal file
|
@ -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 multually 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).
|
238
docs/feature_ps2_mouse.md
Normal file
238
docs/feature_ps2_mouse.md
Normal file
|
@ -0,0 +1,238 @@
|
||||||
|
## PS/2 Mouse Support
|
||||||
|
|
||||||
|
Its possible to hook up a PS/2 mouse (for example touchpads or trackpoints) to your keyboard as a composite device.
|
||||||
|
|
||||||
|
To hook up a Trackpoint, you need to obtain a Trackpoint module (i.e. harvest from a Thinkpad keyboard), identify the function of each pin of the module, and make the necessary circuitry between controller and Trackpoint module. For more information, please refer to [Trackpoint Hardware](https://deskthority.net/wiki/TrackPoint_Hardware) page on Deskthority Wiki.
|
||||||
|
|
||||||
|
There are three available modes for hooking up PS/2 devices: USART (best), interrupts (better) or busywait (not recommended).
|
||||||
|
|
||||||
|
### Busywait version
|
||||||
|
|
||||||
|
Note: This is not recommended, you may encounter jerky movement or unsent inputs. Please use interrupt or USART version if possible.
|
||||||
|
|
||||||
|
In rules.mk:
|
||||||
|
|
||||||
|
```
|
||||||
|
PS2_MOUSE_ENABLE = yes
|
||||||
|
PS2_USE_BUSYWAIT = yes
|
||||||
|
```
|
||||||
|
|
||||||
|
In your keyboard config.h:
|
||||||
|
|
||||||
|
```
|
||||||
|
#ifdef PS2_USE_BUSYWAIT
|
||||||
|
# define PS2_CLOCK_PORT PORTD
|
||||||
|
# define PS2_CLOCK_PIN PIND
|
||||||
|
# define PS2_CLOCK_DDR DDRD
|
||||||
|
# define PS2_CLOCK_BIT 1
|
||||||
|
# define PS2_DATA_PORT PORTD
|
||||||
|
# define PS2_DATA_PIN PIND
|
||||||
|
# define PS2_DATA_DDR DDRD
|
||||||
|
# define PS2_DATA_BIT 2
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
### Interrupt version
|
||||||
|
|
||||||
|
The following example uses D2 for clock and D5 for data. You can use any INT or PCINT pin for clock, and any pin for data.
|
||||||
|
|
||||||
|
In rules.mk:
|
||||||
|
|
||||||
|
```
|
||||||
|
PS2_MOUSE_ENABLE = yes
|
||||||
|
PS2_USE_INT = yes
|
||||||
|
```
|
||||||
|
|
||||||
|
In your keyboard config.h:
|
||||||
|
|
||||||
|
```
|
||||||
|
#ifdef PS2_USE_INT
|
||||||
|
#define PS2_CLOCK_PORT PORTD
|
||||||
|
#define PS2_CLOCK_PIN PIND
|
||||||
|
#define PS2_CLOCK_DDR DDRD
|
||||||
|
#define PS2_CLOCK_BIT 2
|
||||||
|
#define PS2_DATA_PORT PORTD
|
||||||
|
#define PS2_DATA_PIN PIND
|
||||||
|
#define PS2_DATA_DDR DDRD
|
||||||
|
#define PS2_DATA_BIT 5
|
||||||
|
|
||||||
|
#define PS2_INT_INIT() do { \
|
||||||
|
EICRA |= ((1<<ISC21) | \
|
||||||
|
(0<<ISC20)); \
|
||||||
|
} while (0)
|
||||||
|
#define PS2_INT_ON() do { \
|
||||||
|
EIMSK |= (1<<INT2); \
|
||||||
|
} while (0)
|
||||||
|
#define PS2_INT_OFF() do { \
|
||||||
|
EIMSK &= ~(1<<INT2); \
|
||||||
|
} while (0)
|
||||||
|
#define PS2_INT_VECT INT2_vect
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
### USART version
|
||||||
|
|
||||||
|
To use USART on the ATMega32u4, you have to use PD5 for clock and PD2 for data. If one of those are unavailable, you need to use interrupt version.
|
||||||
|
|
||||||
|
In rules.mk:
|
||||||
|
|
||||||
|
```
|
||||||
|
PS2_MOUSE_ENABLE = yes
|
||||||
|
PS2_USE_USART = yes
|
||||||
|
```
|
||||||
|
|
||||||
|
In your keyboard config.h:
|
||||||
|
|
||||||
|
```
|
||||||
|
#ifdef PS2_USE_USART
|
||||||
|
#define PS2_CLOCK_PORT PORTD
|
||||||
|
#define PS2_CLOCK_PIN PIND
|
||||||
|
#define PS2_CLOCK_DDR DDRD
|
||||||
|
#define PS2_CLOCK_BIT 5
|
||||||
|
#define PS2_DATA_PORT PORTD
|
||||||
|
#define PS2_DATA_PIN PIND
|
||||||
|
#define PS2_DATA_DDR DDRD
|
||||||
|
#define PS2_DATA_BIT 2
|
||||||
|
|
||||||
|
/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
|
||||||
|
/* set DDR of CLOCK as input to be slave */
|
||||||
|
#define PS2_USART_INIT() do { \
|
||||||
|
PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
|
||||||
|
PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
|
||||||
|
UCSR1C = ((1 << UMSEL10) | \
|
||||||
|
(3 << UPM10) | \
|
||||||
|
(0 << USBS1) | \
|
||||||
|
(3 << UCSZ10) | \
|
||||||
|
(0 << UCPOL1)); \
|
||||||
|
UCSR1A = 0; \
|
||||||
|
UBRR1H = 0; \
|
||||||
|
UBRR1L = 0; \
|
||||||
|
} while (0)
|
||||||
|
#define PS2_USART_RX_INT_ON() do { \
|
||||||
|
UCSR1B = ((1 << RXCIE1) | \
|
||||||
|
(1 << RXEN1)); \
|
||||||
|
} while (0)
|
||||||
|
#define PS2_USART_RX_POLL_ON() do { \
|
||||||
|
UCSR1B = (1 << RXEN1); \
|
||||||
|
} while (0)
|
||||||
|
#define PS2_USART_OFF() do { \
|
||||||
|
UCSR1C = 0; \
|
||||||
|
UCSR1B &= ~((1 << RXEN1) | \
|
||||||
|
(1 << TXEN1)); \
|
||||||
|
} while (0)
|
||||||
|
#define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
|
||||||
|
#define PS2_USART_RX_DATA UDR1
|
||||||
|
#define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
|
||||||
|
#define PS2_USART_RX_VECT USART1_RX_vect
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
### Additional Settings
|
||||||
|
|
||||||
|
#### PS/2 mouse features
|
||||||
|
|
||||||
|
These enable settings supported by the PS/2 mouse protocol: http://www.computer-engineering.org/ps2mouse/
|
||||||
|
|
||||||
|
```
|
||||||
|
/* Use remote mode instead of the default stream mode (see link) */
|
||||||
|
#define PS2_MOUSE_USE_REMOTE_MODE
|
||||||
|
|
||||||
|
/* Enable the scrollwheel or scroll gesture on your mouse or touchpad */
|
||||||
|
#define PS2_MOUSE_ENABLE_SCROLLING
|
||||||
|
|
||||||
|
/* Some mice will need a scroll mask to be configured. The default is 0xFF. */
|
||||||
|
#define PS2_MOUSE_SCROLL_MASK 0x0F
|
||||||
|
|
||||||
|
/* Applies a transformation to the movement before sending to the host (see link) */
|
||||||
|
#define PS2_MOUSE_USE_2_1_SCALING
|
||||||
|
|
||||||
|
/* The time to wait after initializing the ps2 host */
|
||||||
|
#define PS2_MOUSE_INIT_DELAY 1000 /* Default */
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also call the following functions from ps2_mouse.h
|
||||||
|
|
||||||
|
```
|
||||||
|
void ps2_mouse_disable_data_reporting(void);
|
||||||
|
|
||||||
|
void ps2_mouse_enable_data_reporting(void);
|
||||||
|
|
||||||
|
void ps2_mouse_set_remote_mode(void);
|
||||||
|
|
||||||
|
void ps2_mouse_set_stream_mode(void);
|
||||||
|
|
||||||
|
void ps2_mouse_set_scaling_2_1(void);
|
||||||
|
|
||||||
|
void ps2_mouse_set_scaling_1_1(void);
|
||||||
|
|
||||||
|
void ps2_mouse_set_resolution(ps2_mouse_resolution_t resolution);
|
||||||
|
|
||||||
|
void ps2_mouse_set_sample_rate(ps2_mouse_sample_rate_t sample_rate);
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Fine control
|
||||||
|
|
||||||
|
Use the following defines to change the sensitivity and speed of the mouse.
|
||||||
|
Note: you can also use `ps2_mouse_set_resolution` for the same effect (not supported on most touchpads).
|
||||||
|
|
||||||
|
```
|
||||||
|
#define PS2_MOUSE_X_MULTIPLIER 3
|
||||||
|
#define PS2_MOUSE_Y_MULTIPLIER 3
|
||||||
|
#define PS2_MOUSE_V_MULTIPLIER 1
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Scroll button
|
||||||
|
|
||||||
|
If you're using a trackpoint, you will likely want to be able to use it for scrolling.
|
||||||
|
Its possible to enable a "scroll button/s" that when pressed will cause the mouse to scroll instead of moving.
|
||||||
|
To enable the feature, you must set a scroll button mask as follows:
|
||||||
|
|
||||||
|
```
|
||||||
|
#define PS2_MOUSE_SCROLL_BTN_MASK (1<<PS2_MOUSE_BUTTON_MIDDLE) /* Default */
|
||||||
|
```
|
||||||
|
|
||||||
|
To disable the scroll button feature:
|
||||||
|
|
||||||
|
```
|
||||||
|
#define PS2_MOUSE_SCROLL_BTN_MASK 0
|
||||||
|
```
|
||||||
|
|
||||||
|
The available buttons are:
|
||||||
|
|
||||||
|
```
|
||||||
|
#define PS2_MOUSE_BTN_LEFT 0
|
||||||
|
#define PS2_MOUSE_BTN_RIGHT 1
|
||||||
|
#define PS2_MOUSE_BTN_MIDDLE 2
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also combine buttons in the mask by `|`ing them together.
|
||||||
|
|
||||||
|
Once you've configured your scroll button mask, you must configure the scroll button send interval.
|
||||||
|
This is the interval before which if the scroll buttons were released they would be sent to the host.
|
||||||
|
After this interval, they will cause the mouse to scroll and will not be sent.
|
||||||
|
|
||||||
|
```
|
||||||
|
#define PS2_MOUSE_SCROLL_BTN_SEND 300 /* Default */
|
||||||
|
```
|
||||||
|
|
||||||
|
To disable sending the scroll buttons:
|
||||||
|
```
|
||||||
|
#define PS2_MOUSE_SCROLL_BTN_SEND 0
|
||||||
|
```
|
||||||
|
|
||||||
|
Fine control over the scrolling is supported with the following defines:
|
||||||
|
|
||||||
|
```
|
||||||
|
#define PS2_MOUSE_SCROLL_DIVISOR_H 2
|
||||||
|
#define PS2_MOUSE_SCROLL_DIVISOR_V 2
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Debug settings
|
||||||
|
|
||||||
|
To debug the mouse, add `debug_mouse = true` or enable via bootmagic.
|
||||||
|
|
||||||
|
```
|
||||||
|
/* To debug the mouse reports */
|
||||||
|
#define PS2_MOUSE_DEBUG_HID
|
||||||
|
#define PS2_MOUSE_DEBUG_RAW
|
||||||
|
```
|
49
docs/feature_rgblight.md
Normal file
49
docs/feature_rgblight.md
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# RGB Lighting
|
||||||
|
|
||||||
|
<!-- FIXME: Describe how to use RGB Lighting here. -->
|
||||||
|
|
||||||
|
## RGB Under Glow Mod
|
||||||
|
|
||||||
|
![Planck with RGB Underglow](https://raw.githubusercontent.com/qmk/qmk_firmware/master/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg)
|
||||||
|
|
||||||
|
Here is a quick demo on Youtube (with NPKC KC60) (https://www.youtube.com/watch?v=VKrpPAHlisY).
|
||||||
|
|
||||||
|
For this mod, you need an unused pin wiring to DI of WS2812 strip. After wiring the VCC, GND, and DI, you can enable the underglow in your Makefile.
|
||||||
|
|
||||||
|
RGBLIGHT_ENABLE = yes
|
||||||
|
|
||||||
|
In order to use the underglow animation functions, you need to have `#define RGBLIGHT_ANIMATIONS` in your `config.h`.
|
||||||
|
|
||||||
|
Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default:
|
||||||
|
|
||||||
|
#define RGB_DI_PIN F4 // The pin your RGB strip is wired to
|
||||||
|
#define RGBLIGHT_ANIMATIONS // Require for fancier stuff (not compatible with audio)
|
||||||
|
#define RGBLED_NUM 14 // Number of LEDs
|
||||||
|
#define RGBLIGHT_HUE_STEP 10
|
||||||
|
#define RGBLIGHT_SAT_STEP 17
|
||||||
|
#define RGBLIGHT_VAL_STEP 17
|
||||||
|
|
||||||
|
You'll need to edit `RGB_DI_PIN` to the pin you have your `DI` on your RGB strip wired to.
|
||||||
|
|
||||||
|
The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. For details, please check this keymap. `keyboards/planck/keymaps/yang/keymap.c`
|
||||||
|
|
||||||
|
### WS2812 Wiring
|
||||||
|
|
||||||
|
![WS2812 Wiring](https://raw.githubusercontent.com/qmk/qmk_firmware/master/keyboards/planck/keymaps/yang/WS2812-wiring.jpg)
|
||||||
|
|
||||||
|
Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20.
|
||||||
|
|
||||||
|
## RGB Lighting Keycodes
|
||||||
|
|
||||||
|
This controls the RGB Lighting functionality. Most keyboards use WS2812 (and compatible) LEDs for underlight or case lighting.
|
||||||
|
|
||||||
|
|Name|Description|
|
||||||
|
|----|-----------|
|
||||||
|
|`RGB_TOG`|toggle on/off|
|
||||||
|
|`RGB_MOD`|cycle through modes|
|
||||||
|
|`RGB_HUI`|hue increase|
|
||||||
|
|`RGB_HUD`|hue decrease|
|
||||||
|
|`RGB_SAI`|saturation increase|
|
||||||
|
|`RGB_SAD`|saturation decrease|
|
||||||
|
|`RGB_VAI`|value increase|
|
||||||
|
|`RGB_VAD`|value decrease|
|
10
docs/feature_thermal_printer.md
Normal file
10
docs/feature_thermal_printer.md
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Thermal Printer
|
||||||
|
|
||||||
|
<!-- FIXME: Describe thermal printers support here. -->
|
||||||
|
|
||||||
|
## Thermal Printer Keycodes
|
||||||
|
|
||||||
|
|Name|Description|
|
||||||
|
|----|-----------|
|
||||||
|
|`PRINT_ON`|Start printing everything the user types|
|
||||||
|
|`PRINT_OFF`|Stop printing everything the user types|
|
|
@ -1,19 +1,5 @@
|
||||||
# Quantum Mechanical Keyboard Firmware
|
# QMK Features
|
||||||
|
|
||||||
You have found the QMK Firmware documentation site. This is a keyboard firmware based on the [tmk\_keyboard firmware](http://github.com/tmk/tmk_keyboard) \([view differences](differences_from_tmk.md)\) with some useful features for Atmel AVR controllers, and more specifically, the [OLKB product line](http://olkb.com), the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard, and the [Clueboard product line](http://clueboard.co/). It has also been ported to ARM chips using ChibiOS. You can use it to power your own hand-wired or custom keyboard PCB.
|
|
||||||
|
|
||||||
# Getting started
|
|
||||||
|
|
||||||
Before you are able to compile, you'll need to install an environment for AVR or ARM development. You'll find the instructions for any OS below. If you find another/better way to set things up from scratch, please consider [making a pull request](https://github.com/qmk/qmk_firmware/pulls) with your changes!
|
|
||||||
|
|
||||||
* [Build Environment Setup](build_environment_setup.md)
|
|
||||||
* [QMK Overview](qmk_overview.md)
|
|
||||||
|
|
||||||
# Configuring QMK Firmware
|
|
||||||
|
|
||||||
The QMK Firmware can be configured via the `keymaps` array data. For simply generating a [basic keycode](keycodes.md), you add it as an element of your `keymaps` array data. For more complicated actions, there are more advanced keycodes that are organized carefully to represent common operations, some of which can be found on the [Key Functions](key_functions.md) page.
|
|
||||||
|
|
||||||
For more details of the `keymaps` array, see [Keymap Overview](keymap.md) page.
|
|
||||||
|
|
||||||
## Space Cadet Shift: The future, built in
|
## Space Cadet Shift: The future, built in
|
||||||
|
|
||||||
|
@ -21,7 +7,7 @@ Steve Losh [described](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/)
|
||||||
|
|
||||||
## The Leader key: A new kind of modifier
|
## 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](leader_key.md) page.
|
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
|
## Tap Dance: A single key can do 3, 5, or 100 different things
|
||||||
|
|
||||||
|
@ -117,18 +103,3 @@ case MACRO_RAISED:
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Other firmware shortcut keycodes
|
|
||||||
|
|
||||||
* `RESET` - puts the MCU in DFU mode for flashing new firmware \(with `make dfu`\)
|
|
||||||
* `DEBUG` - the firmware into debug mode - you'll need hid\_listen to see things
|
|
||||||
* `BL_ON` - turns the backlight on
|
|
||||||
* `BL_OFF` - turns the backlight off
|
|
||||||
* `BL_<n>` - sets the backlight to level _n_
|
|
||||||
* `BL_INC` - increments the backlight level by one
|
|
||||||
* `BL_DEC` - decrements the backlight level by one
|
|
||||||
* `BL_TOGG` - toggles the backlight
|
|
||||||
* `BL_STEP` - steps through the backlight levels
|
|
||||||
|
|
||||||
Enable the backlight from the Makefile.
|
|
||||||
|
|
|
@ -1,65 +1,10 @@
|
||||||
### Windows 10
|
# Installing Build Tools
|
||||||
|
|
||||||
#### Creators Update
|
This page describes setting up the build environment for QMK. These instructions cover AVR processors (such as the atmega32u4.)
|
||||||
If you have Windows 10 with Creators Update or later, you can build and flash the firmware directly. Before the Creators Update, only building was possible. If you don't have it yet or if are unsure, follow [these instructions](https://support.microsoft.com/en-us/instantanswers/d4efb316-79f0-1aa1-9ef3-dcada78f3fa0/get-the-windows-10-creators-update).
|
|
||||||
|
|
||||||
#### Windows Subsystem for Linux
|
<!-- FIXME: We should have ARM instructions somewhere. -->
|
||||||
In addition to the Creators Update, you need Windows 10 Subystem for Linux, so install it following [these instructions](http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/). If you already have the Windows 10 Subsystem for Linux from the Anniversary update it's recommended that you [upgrade](https://betanews.com/2017/04/14/upgrade-windows-subsystem-for-linux/) it to 16.04LTS, because some keyboards don't compile with the toolchains included in 14.04LTS. Note that you need to know what your are doing if you chose the `sudo do-release-upgrade` method.
|
|
||||||
|
|
||||||
#### Git
|
## Linux
|
||||||
If you already have cloned the repository on your Windows file system you can ignore this section.
|
|
||||||
|
|
||||||
You will need to clone the repository to your Windows file system using the normal Git for Windows and **not** the WSL Git. So if you haven't installed Git before, [download](https://git-scm.com/download/win) and install it. Then [set it up](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup), it's important that you setup the e-mail and user name, especially if you are planning to contribute.
|
|
||||||
|
|
||||||
Once Git is installed, open the Git bash command and change the directory to where you want to clone QMK, note that you have to use forward slashes, and that your c drive is accessed like this `/c/path/to/where/you/want/to/go`. Then run `git clone --recurse-submodules https://github.com/qmk/qmk_firmware`, this will create a new folder `qmk_firmware` as a subfolder of the current one.
|
|
||||||
|
|
||||||
#### Toolchain setup
|
|
||||||
The Toolchain setup is done through the Windows Subsystem for Linux, and the process is fully automated. If you want to do everything manually, there are no other instructions than the scripts themselves, but you can always open issues and ask for more information.
|
|
||||||
|
|
||||||
1. Open "Bash On Ubuntu On Windows" from the start menu.
|
|
||||||
2. Go to the directory where you cloned `qmk_firmware`. Note that the paths start with `/mnt/` in the WSL, so you have to write for example `cd /mnt/c/path/to/qmk_firmware`.
|
|
||||||
3. Run `util/wsl_install.sh` and follow the on-screen instructions.
|
|
||||||
4. Close the Bash command window, and re-open it.
|
|
||||||
5. You are ready to compile and flash the firmware!
|
|
||||||
|
|
||||||
#### Some important things to keep in mind
|
|
||||||
* You can run `util/wsl_install.sh` again to get all the newest updates.
|
|
||||||
* Your QMK repository need to be on a Windows file system path, since WSL can't run executables outside it.
|
|
||||||
* The WSL Git is **not** compatible with the Windows Git, so use the Windows Git Bash or a windows Git GUI for all Git operations
|
|
||||||
* You can edit files either inside WSL or normally using Windows, but note that if you edit makefiles or shell scripts, make sure you are using an editor that saves the files with Unix line endings. Otherwise the compilation might not work.
|
|
||||||
|
|
||||||
### Windows (Vista and later)
|
|
||||||
1. If you have ever installed WinAVR, uninstall it.
|
|
||||||
2. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**.
|
|
||||||
3. If you are going to flash Infinity based keyboards you will need to install dfu-util, refer to the instructions by [Input Club](https://github.com/kiibohd/controller/wiki/Loading-DFU-Firmware).
|
|
||||||
4. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location.
|
|
||||||
5. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/qmk/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer.
|
|
||||||
6. Open the `\util` folder.
|
|
||||||
7. Double-click on the `1-setup-path-win` batch script to run it. You'll need to accept a User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up.
|
|
||||||
8. Right-click on the `2-setup-environment-win` batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete!
|
|
||||||
|
|
||||||
If you have trouble and want to ask for help, it is useful to generate a *Win_Check_Output.txt* file by running `Win_Check.bat` in the `\util` folder.
|
|
||||||
|
|
||||||
### Mac
|
|
||||||
If you're using [homebrew,](http://brew.sh/) you can use the following commands:
|
|
||||||
|
|
||||||
brew tap osx-cross/avr
|
|
||||||
brew install avr-libc
|
|
||||||
brew install dfu-programmer
|
|
||||||
|
|
||||||
This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of avr-libc can take over 20 minutes and exhibit high CPU usage.
|
|
||||||
|
|
||||||
You can also try these instructions:
|
|
||||||
|
|
||||||
1. Install Xcode from the App Store.
|
|
||||||
2. Install the Command Line Tools from `Xcode->Preferences->Downloads`.
|
|
||||||
3. Install [DFU-Programmer](https://dfu-programmer.github.io/).
|
|
||||||
|
|
||||||
If you are going to flash Infinity based keyboards you will also need dfu-util
|
|
||||||
|
|
||||||
brew install dfu-util
|
|
||||||
|
|
||||||
### Linux
|
|
||||||
|
|
||||||
To ensure you are always up to date, you can just run `sudo util/install_dependencies.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.**
|
To ensure you are always up to date, you can just run `sudo util/install_dependencies.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.**
|
||||||
|
|
||||||
|
@ -91,7 +36,72 @@ Debian/Ubuntu example:
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi
|
sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi
|
||||||
|
|
||||||
### Docker
|
# Mac
|
||||||
|
If you're using [homebrew,](http://brew.sh/) you can use the following commands:
|
||||||
|
|
||||||
|
brew tap osx-cross/avr
|
||||||
|
brew install avr-libc
|
||||||
|
brew install dfu-programmer
|
||||||
|
|
||||||
|
This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of avr-libc can take over 20 minutes and exhibit high CPU usage.
|
||||||
|
|
||||||
|
## Windows with msys2 (recommended)
|
||||||
|
|
||||||
|
The best environment to use, for Windows Vista through any later version (tested on 7 and 10,) is [msys2](http://www.msys2.org).
|
||||||
|
|
||||||
|
* Install msys2 by downloading and following the instructions here: http://www.msys2.org
|
||||||
|
* Open the "MSYS2 MingGW 64-bit" shortcut
|
||||||
|
* Navigate to your qmk checkout. For example, if it's in the root of your c drive:
|
||||||
|
* `$ cd /c/qmk_firmware`
|
||||||
|
* Run `util/msys2_install.sh` and follow the prompts
|
||||||
|
|
||||||
|
## Windows 10 (deprecated)
|
||||||
|
These are the old instructions for Windows 10. We recommend you use [MSYS2 as outlined above](#windows-with-msys2-recommended).
|
||||||
|
|
||||||
|
### Creators Update
|
||||||
|
If you have Windows 10 with Creators Update or later, you can build and flash the firmware directly. Before the Creators Update, only building was possible. If you don't have it yet or if are unsure, follow [these instructions](https://support.microsoft.com/en-us/instantanswers/d4efb316-79f0-1aa1-9ef3-dcada78f3fa0/get-the-windows-10-creators-update).
|
||||||
|
|
||||||
|
### Windows Subsystem for Linux
|
||||||
|
In addition to the Creators Update, you need Windows 10 Subystem for Linux, so install it following [these instructions](http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/). If you already have the Windows 10 Subsystem for Linux from the Anniversary update it's recommended that you [upgrade](https://betanews.com/2017/04/14/upgrade-windows-subsystem-for-linux/) it to 16.04LTS, because some keyboards don't compile with the toolchains included in 14.04LTS. Note that you need to know what your are doing if you chose the `sudo do-release-upgrade` method.
|
||||||
|
|
||||||
|
### Git
|
||||||
|
If you already have cloned the repository on your Windows file system you can ignore this section.
|
||||||
|
|
||||||
|
You will need to clone the repository to your Windows file system using the normal Git for Windows and **not** the WSL Git. So if you haven't installed Git before, [download](https://git-scm.com/download/win) and install it. Then [set it up](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup), it's important that you setup the e-mail and user name, especially if you are planning to contribute.
|
||||||
|
|
||||||
|
Once Git is installed, open the Git bash command and change the directory to where you want to clone QMK, note that you have to use forward slashes, and that your c drive is accessed like this `/c/path/to/where/you/want/to/go`. Then run `git clone --recurse-submodules https://github.com/qmk/qmk_firmware`, this will create a new folder `qmk_firmware` as a subfolder of the current one.
|
||||||
|
|
||||||
|
### Toolchain setup
|
||||||
|
The Toolchain setup is done through the Windows Subsystem for Linux, and the process is fully automated. If you want to do everything manually, there are no other instructions than the scripts themselves, but you can always open issues and ask for more information.
|
||||||
|
|
||||||
|
1. Open "Bash On Ubuntu On Windows" from the start menu.
|
||||||
|
2. Go to the directory where you cloned `qmk_firmware`. Note that the paths start with `/mnt/` in the WSL, so you have to write for example `cd /mnt/c/path/to/qmk_firmware`.
|
||||||
|
3. Run `util/wsl_install.sh` and follow the on-screen instructions.
|
||||||
|
4. Close the Bash command window, and re-open it.
|
||||||
|
5. You are ready to compile and flash the firmware!
|
||||||
|
|
||||||
|
### Some important things to keep in mind
|
||||||
|
* You can run `util/wsl_install.sh` again to get all the newest updates.
|
||||||
|
* Your QMK repository need to be on a Windows file system path, since WSL can't run executables outside it.
|
||||||
|
* The WSL Git is **not** compatible with the Windows Git, so use the Windows Git Bash or a windows Git GUI for all Git operations
|
||||||
|
* You can edit files either inside WSL or normally using Windows, but note that if you edit makefiles or shell scripts, make sure you are using an editor that saves the files with Unix line endings. Otherwise the compilation might not work.
|
||||||
|
|
||||||
|
## Windows (Vista and later) (Deprecated)
|
||||||
|
|
||||||
|
These are the old instructions for Windows Vista and later. We recommend you use [MSYS2 as outlined above](#windows-with-msys2-recommended).
|
||||||
|
|
||||||
|
1. If you have ever installed WinAVR, uninstall it.
|
||||||
|
2. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**.
|
||||||
|
3. If you are going to flash Infinity based keyboards you will need to install dfu-util, refer to the instructions by [Input Club](https://github.com/kiibohd/controller/wiki/Loading-DFU-Firmware).
|
||||||
|
4. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location.
|
||||||
|
5. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/qmk/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer.
|
||||||
|
6. Open the `\util` folder.
|
||||||
|
7. Double-click on the `1-setup-path-win` batch script to run it. You'll need to accept a User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up.
|
||||||
|
8. Right-click on the `2-setup-environment-win` batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete!
|
||||||
|
|
||||||
|
If you have trouble and want to ask for help, it is useful to generate a *Win_Check_Output.txt* file by running `Win_Check.bat` in the `\util` folder.
|
||||||
|
|
||||||
|
## Docker
|
||||||
|
|
||||||
If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker](https://www.docker.com/products/docker), run the following command at the root of the QMK folder to build a keyboard/keymap:
|
If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker](https://www.docker.com/products/docker), run the following command at the root of the QMK folder to build a keyboard/keymap:
|
||||||
|
|
||||||
|
@ -109,11 +119,5 @@ docker run -e keymap=default -e subproject=ez -e keyboard=ergobox --rm -v D:/Use
|
||||||
|
|
||||||
This will compile the targeted keyboard/keymap and leave it in your QMK directory for you to flash.
|
This will compile the targeted keyboard/keymap and leave it in your QMK directory for you to flash.
|
||||||
|
|
||||||
### Vagrant
|
## Vagrant
|
||||||
If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [vagrant guide](vagrant_guide.md).
|
If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [vagrant guide](vagrant_guide.md).
|
||||||
|
|
||||||
## Verify Your Installation
|
|
||||||
1. If you haven't already, obtain this repository ([https://github.com/qmk/qmk_firmware](https://github.com/qmk/qmk_firmware)). You can either download it as a zip file and extract it, or clone it using the command line tool git or the Github Desktop application.
|
|
||||||
2. Open up a terminal or command prompt and navigate to the `qmk_firmware` folder using the `cd` command. The command prompt will typically open to your home directory. If, for example, you cloned the repository to your Documents folder, then you would type `cd Documents/qmk_firmware`. If you extracted the file from a zip, then it may be named `qmk_firmware-master` instead.
|
|
||||||
3. To confirm that you're in the correct location, you can display the contents of your current folder using the `dir` command on Windows, or the `ls` command on Linux or Mac. You should see several files, including `readme.md` and a `quantum` folder. From here, you need to navigate to the appropriate folder under `keyboards/`. For example, if you're building for a Planck, run `cd keyboards/planck`.
|
|
||||||
4. Once you're in the correct keyboard-specific folder, run the `make` command. This should output a lot of information about the build process. More information about the `make` command can be found below.
|
|
63
docs/getting_started_github.md
Normal file
63
docs/getting_started_github.md
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
# How to use Github with QMK
|
||||||
|
|
||||||
|
Github can be a little tricky to those that aren't familiar with it - this guide will walk through each step of forking, cloning, and submitting a pull request with QMK.
|
||||||
|
|
||||||
|
{% hint style='info' %}
|
||||||
|
This guide assumes you're somewhat comfortable with running things at the command line, and have git installed on your system.
|
||||||
|
{% endhint %}
|
||||||
|
|
||||||
|
Start on the [QMK Github page](https://github.com/qmk/qmk_firmware), and you'll see a button in the upper right that says "Fork":
|
||||||
|
|
||||||
|
![Fork on Github](http://i.imgur.com/8Toomz4.jpg)
|
||||||
|
|
||||||
|
If you're apart of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button:
|
||||||
|
|
||||||
|
![Download from Github](http://i.imgur.com/N1NYcSz.jpg)
|
||||||
|
|
||||||
|
And be sure to select "HTTPS", and select the link and copy it:
|
||||||
|
|
||||||
|
![HTTPS link](http://i.imgur.com/eGO0ohO.jpg)
|
||||||
|
|
||||||
|
From here, enter `git clone ` into the command line, and then paste your link:
|
||||||
|
|
||||||
|
```
|
||||||
|
**[terminal]
|
||||||
|
**[prompt you@computer]**[path ~]**[delimiter $ ]**[command git clone https://github.com/whoeveryouare/qmk_firmware.git]
|
||||||
|
Cloning into 'qmk_firmware'...
|
||||||
|
remote: Counting objects: 46625, done.
|
||||||
|
remote: Compressing objects: 100% (2/2), done.
|
||||||
|
remote: Total 46625 (delta 0), reused 0 (delta 0), pack-reused 46623
|
||||||
|
Receiving objects: 100% (46625/46625), 84.47 MiB | 3.14 MiB/s, done.
|
||||||
|
Resolving deltas: 100% (29362/29362), done.
|
||||||
|
Checking out files: 100% (2799/2799), done.
|
||||||
|
```
|
||||||
|
|
||||||
|
You now have your QMK fork on your local machine, and you can add your keymap, compile it and flash it to your board. Once you're happy with your changes, you can add, commit, and push them to your fork like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
**[terminal]
|
||||||
|
**[prompt you@computer]**[path ~/qmk_firmware]**[delimiter $ ]**[command git add .]
|
||||||
|
**[prompt you@computer]**[path ~/qmk_firmware]**[delimiter $ ]**[command git commit -m "adding my keymap"]
|
||||||
|
[master cccb1608] adding my keymap
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
create mode 100644 keyboards/planck/keymaps/mine/keymap.c
|
||||||
|
**[prompt you@computer]**[path ~/qmk_firmware]**[delimiter $ ]**[command git push]
|
||||||
|
Counting objects: 1, done.
|
||||||
|
Delta compression using up to 4 threads.
|
||||||
|
Compressing objects: 100% (1/1), done.
|
||||||
|
Writing objects: 100% (1/1), 1.64 KiB | 0 bytes/s, done.
|
||||||
|
Total 1 (delta 1), reused 0 (delta 0)
|
||||||
|
remote: Resolving deltas: 100% (1/1), completed with 1 local objects.
|
||||||
|
To https://github.com/whoeveryouare/qmk_firmware.git
|
||||||
|
+ 20043e64...7da94ac5 master -> master
|
||||||
|
```
|
||||||
|
|
||||||
|
Your changes now exist on your fork on Github - if you go back there (https://github.com/<whoeveryouare>/qmk_firmware), you can create a "New Pull Request" by clicking this button:
|
||||||
|
|
||||||
|
![New Pull Request](http://i.imgur.com/DxMHpJ8.jpg)
|
||||||
|
|
||||||
|
Here you'll be able to see exactly what you've committed - if it all looks good, you can finalize it by clicking "Create Pull Request":
|
||||||
|
|
||||||
|
![Create Pull Request](http://i.imgur.com/Ojydlaj.jpg)
|
||||||
|
|
||||||
|
After submitting, we may talk to you about your changes, ask that you make changes, and eventually accept it! Thanks for contributing to QMK :)
|
47
docs/getting_started_instroduction.md
Normal file
47
docs/getting_started_instroduction.md
Normal file
|
@ -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
|
||||||
|
```
|
|
@ -21,7 +21,7 @@ As mentioned above, there are some shortcuts, when you are in a:
|
||||||
* `keyboard` folder, the command will automatically fill the `<keyboard>` part. So you only need to type `<subproject>-<keymap>-<target>`
|
* `keyboard` folder, the command will automatically fill the `<keyboard>` part. So you only need to type `<subproject>-<keymap>-<target>`
|
||||||
* `subproject` folder, it will fill in both `<keyboard>` and `<subproject>`
|
* `subproject` folder, it will fill in both `<keyboard>` and `<subproject>`
|
||||||
* `keymap` folder, then `<keyboard>` and `<keymap>` will be filled in. If you need to specify the `<subproject>` use the following syntax `<subproject>-<target>`
|
* `keymap` folder, then `<keyboard>` and `<keymap>` will be filled in. If you need to specify the `<subproject>` use the following syntax `<subproject>-<target>`
|
||||||
* Note in order to support this shortcut, the keymap needs its own Makefile (see the example [here](https://github.com/qmk/qmk_firmware/blob/master/doc/keymap_makefile_example.mk))
|
* Note in order to support this shortcut, the keymap needs its own Makefile
|
||||||
* `keymap` folder of a `subproject`, then everything except the `<target>` will be filled in
|
* `keymap` folder of a `subproject`, then everything except the `<target>` will be filled in
|
||||||
|
|
||||||
The `<target>` means the following
|
The `<target>` means the following
|
||||||
|
@ -48,7 +48,7 @@ Here are some examples commands
|
||||||
* `make ergodox-infinity-algernon-clean` will clean the build output of the Ergodox Infinity keyboard. This example uses the full syntax and can be run from any folder with a `Makefile`
|
* `make ergodox-infinity-algernon-clean` will clean the build output of the Ergodox Infinity keyboard. This example uses the full syntax and can be run from any folder with a `Makefile`
|
||||||
* `make dfu COLOR=false` from within a keymap folder, builds and uploads the keymap, but without color output.
|
* `make dfu COLOR=false` from within a keymap folder, builds and uploads the keymap, but without color output.
|
||||||
|
|
||||||
## The `Makefile`
|
# The `Makefile`
|
||||||
|
|
||||||
There are 5 different `make` and `Makefile` locations:
|
There are 5 different `make` and `Makefile` locations:
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ The root contains the code used to automatically figure out which keymap or keym
|
||||||
|
|
||||||
For keyboards and subprojects, the make files are split in two parts `Makefile` and `rules.mk`. All settings can be found in the `rules.mk` file, while the `Makefile` is just there for support and including the root `Makefile`. Keymaps contain just one `Makefile` for simplicity.
|
For keyboards and subprojects, the make files are split in two parts `Makefile` and `rules.mk`. All settings can be found in the `rules.mk` file, while the `Makefile` is just there for support and including the root `Makefile`. Keymaps contain just one `Makefile` for simplicity.
|
||||||
|
|
||||||
### Makefile options
|
## Makefile options
|
||||||
|
|
||||||
Set these variables to `no` to disable them, and `yes` to enable them.
|
Set these variables to `no` to disable them, and `yes` to enable them.
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ This allows you to interface with a Bluefruit EZ-key to send keycodes wirelessly
|
||||||
|
|
||||||
`AUDIO_ENABLE`
|
`AUDIO_ENABLE`
|
||||||
|
|
||||||
This allows you output audio on the C6 pin (needs abstracting). See the [audio section](#audio-output-from-a-speaker) for more information.
|
This allows you output audio on the C6 pin (needs abstracting). See the [audio page](feature_audio.md) for more information.
|
||||||
|
|
||||||
`FAUXCLICKY_ENABLE`
|
`FAUXCLICKY_ENABLE`
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ Uses buzzer to emulate clicky switches. A cheap imitation of the Cherry blue swi
|
||||||
|
|
||||||
`VARIABLE_TRACE`
|
`VARIABLE_TRACE`
|
||||||
|
|
||||||
Use this to debug changes to variable values, see the [tracing variables](#tracing-variables) section for more information.
|
Use this to debug changes to variable values, see the [tracing variables](unit_testing.md#tracing-variables) section of the Unit Testing page for more information.
|
||||||
|
|
||||||
`API_SYSEX_ENABLE`
|
`API_SYSEX_ENABLE`
|
||||||
|
|
||||||
|
@ -158,7 +158,11 @@ This enables using the Quantum SYSEX API to send strings (somewhere?)
|
||||||
|
|
||||||
This consumes about 5390 bytes.
|
This consumes about 5390 bytes.
|
||||||
|
|
||||||
### Customizing Makefile options on a per-keymap basis
|
`KEY_LOCK_ENABLE`
|
||||||
|
|
||||||
|
This enables [key lock](key_lock.md). This consumes an additional 260 bytes.
|
||||||
|
|
||||||
|
## Customizing Makefile options on a per-keymap basis
|
||||||
|
|
||||||
If your keymap directory has a file called `Makefile` (note the filename), any Makefile options you set in that file will take precedence over other Makefile options for your particular keyboard.
|
If your keymap directory has a file called `Makefile` (note the filename), any Makefile options you set in that file will take precedence over other Makefile options for your particular keyboard.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Quick Start Directions
|
# Vagrant Quick Start
|
||||||
|
|
||||||
This project includes a Vagrantfile that will allow you to build a new firmware for your keyboard very easily without major changes to your primary operating system. This also ensures that when you clone the project and perform a build, you have the exact same environment as anyone else using the Vagrantfile to build. This makes it much easier for people to help you troubleshoot any issues you encounter.
|
This project includes a Vagrantfile that will allow you to build a new firmware for your keyboard very easily without major changes to your primary operating system. This also ensures that when you clone the project and perform a build, you have the exact same environment as anyone else using the Vagrantfile to build. This makes it much easier for people to help you troubleshoot any issues you encounter.
|
||||||
|
|
||||||
|
@ -8,20 +8,14 @@ Using the `/Vagrantfile` in this repository requires you have [Vagrant](http://w
|
||||||
|
|
||||||
*COMPATIBILITY NOTICE* Certain versions of Virtualbox 5 appear to have an incompatibility with the Virtualbox extensions installed in the boxes in this Vagrantfile. If you encounter any issues with the /vagrant mount not succeeding, please upgrade your version of Virtualbox to at least 5.0.12. **Alternately, you can try running the following command:** `vagrant plugin install vagrant-vbguest`
|
*COMPATIBILITY NOTICE* Certain versions of Virtualbox 5 appear to have an incompatibility with the Virtualbox extensions installed in the boxes in this Vagrantfile. If you encounter any issues with the /vagrant mount not succeeding, please upgrade your version of Virtualbox to at least 5.0.12. **Alternately, you can try running the following command:** `vagrant plugin install vagrant-vbguest`
|
||||||
|
|
||||||
|
|
||||||
Other than having Vagrant and Virtualbox installed and possibly a restart of your computer afterwards, you can simple run a 'vagrant up' anywhere inside the folder where you checked out this project and it will start a Linux virtual machine that contains all the tools required to build this project. There is a post Vagrant startup hint that will get you off on the right foot, otherwise you can also reference the build documentation below.
|
Other than having Vagrant and Virtualbox installed and possibly a restart of your computer afterwards, you can simple run a 'vagrant up' anywhere inside the folder where you checked out this project and it will start a Linux virtual machine that contains all the tools required to build this project. There is a post Vagrant startup hint that will get you off on the right foot, otherwise you can also reference the build documentation below.
|
||||||
|
|
||||||
Build Firmware and Program Controller
|
# Flashing the firmware
|
||||||
-------------------------------------
|
|
||||||
See [build_guide.md](build_guide.md), or the readme in the particular keyboards/* folder.
|
|
||||||
|
|
||||||
Change your keymap
|
The "easy" way to flash the firmware is using a tool from your host OS:
|
||||||
------------------
|
|
||||||
See [keymap.md](keymap.md).
|
|
||||||
|
|
||||||
## Flashing the firmware
|
* [QMK Flasher](https://github.com/qmk/qmk_flasher)
|
||||||
|
* [Teensy Loader](https://www.pjrc.com/teensy/loader.html)
|
||||||
The "easy" way to flash the firmware is using a tool from your host OS like the Teensy programming app. [ErgoDox EZ](/keyboards/ergodox/readme.md) gives a great example.
|
* [Atmel FLIP](http://www.atmel.com/tools/flip.aspx)
|
||||||
|
|
||||||
If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version.
|
If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version.
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
## Update core branch procedure
|
|
||||||
git co master
|
|
||||||
git subtree split -P tmk_core -b <tmp_branch>
|
|
||||||
git co core
|
|
||||||
git merge <tmp_branch>
|
|
||||||
git co master
|
|
||||||
git subtree merge -P tmk_core --squash
|
|
Binary file not shown.
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 793 B |
170
docs/glossary.md
Normal file
170
docs/glossary.md
Normal file
|
@ -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. :)
|
|
@ -100,9 +100,9 @@ Things act as they should! Which will get us the following data:
|
||||||
|
|
||||||
The firmware can then use this correct data to detect what it should do, and eventually, what signals it needs to send to the OS.
|
The firmware can then use this correct data to detect what it should do, and eventually, what signals it needs to send to the OS.
|
||||||
|
|
||||||
## The actual hand-wiring
|
# The actual hand-wiring
|
||||||
|
|
||||||
### Getting things in place
|
## Getting things in place
|
||||||
|
|
||||||
When starting this, you should have all of your stabilisers and keyswitches already installed (and optionally keycaps). If you're using a Cherry-type stabiliser (plate-mounted only, obviously), you'll need to install that before your keyswitches. If you're using Costar ones, you can installed them afterwards.
|
When starting this, you should have all of your stabilisers and keyswitches already installed (and optionally keycaps). If you're using a Cherry-type stabiliser (plate-mounted only, obviously), you'll need to install that before your keyswitches. If you're using Costar ones, you can installed them afterwards.
|
||||||
|
|
||||||
|
@ -112,27 +112,31 @@ Get your soldering iron heated-up and collect the rest of the materials from the
|
||||||
|
|
||||||
Before continuing, plan out where you're going to place your Teensy. If you're working with a board that has a large (6.25u) spacebar, it may be a good idea to place it in-between switches against the plate. Otherwise, you may want to trim some of the leads on the keyswitches where you plan on putting it - this will make it a little harder to solder the wire/diodes, but give you more room to place the Teensy.
|
Before continuing, plan out where you're going to place your Teensy. If you're working with a board that has a large (6.25u) spacebar, it may be a good idea to place it in-between switches against the plate. Otherwise, you may want to trim some of the leads on the keyswitches where you plan on putting it - this will make it a little harder to solder the wire/diodes, but give you more room to place the Teensy.
|
||||||
|
|
||||||
### Preparing the diodes
|
## Preparing the diodes
|
||||||
|
|
||||||
It's a little easier to solder the diodes in place if you bend them at a 90º angle immediately after the black line - this will help to make sure you put them on the right way (direction matters), and in the correct position. The diodes will look like this when bent (with longer leads):
|
It's a little easier to solder the diodes in place if you bend them at a 90º angle immediately after the black line - this will help to make sure you put them on the right way (direction matters), and in the correct position. The diodes will look like this when bent (with longer leads):
|
||||||
|
|
||||||
|
```
|
||||||
┌─────┬─┐
|
┌─────┬─┐
|
||||||
───┤ │ ├─┐
|
───┤ │ ├─┐
|
||||||
└─────┴─┘ │
|
└─────┴─┘ │
|
||||||
│
|
│
|
||||||
|
```
|
||||||
|
|
||||||
We'll be using the long lead at the bent end to connect it to the elbow (bent part) of the next diode, creating the row.
|
We'll be using the long lead at the bent end to connect it to the elbow (bent part) of the next diode, creating the row.
|
||||||
|
|
||||||
### Soldering the diodes
|
## Soldering the diodes
|
||||||
|
|
||||||
Starting at the top-left switch, place the diode (with tweezers if you have them) on the switch so that the diode itself is vertically aligned, and the black line is facing toward you. The straight end of the diode should be touching the left contact on the switch, and the bent end should be facing to the right and resting on the switch there, like this:
|
Starting at the top-left switch, place the diode (with tweezers if you have them) on the switch so that the diode itself is vertically aligned, and the black line is facing toward you. The straight end of the diode should be touching the left contact on the switch, and the bent end should be facing to the right and resting on the switch there, like this:
|
||||||
|
|
||||||
|
```
|
||||||
│o
|
│o
|
||||||
┌┴┐ o
|
┌┴┐ o
|
||||||
│ │ O
|
│ │ O
|
||||||
├─┤
|
├─┤
|
||||||
└┬┘
|
└┬┘
|
||||||
└─────────────
|
└─────────────
|
||||||
|
```
|
||||||
|
|
||||||
Letting the diode rest, grab your solder, and touch both it and the soldering iron to the left contact at the same time - the rosin in the solder should make it easy for the solder to flow over both the diode and the keyswitch contact. The diode may move a little, and if it does, carefully position it back it place by grabbing the bent end of the diode - the other end will become hot very quickly. If you find that it's moving too much, using needle-nose pliers of some sort may help to keep the diode still when soldering.
|
Letting the diode rest, grab your solder, and touch both it and the soldering iron to the left contact at the same time - the rosin in the solder should make it easy for the solder to flow over both the diode and the keyswitch contact. The diode may move a little, and if it does, carefully position it back it place by grabbing the bent end of the diode - the other end will become hot very quickly. If you find that it's moving too much, using needle-nose pliers of some sort may help to keep the diode still when soldering.
|
||||||
|
|
||||||
|
@ -142,18 +146,20 @@ After soldering things in place, it may be helpful to blow on the joint to push
|
||||||
|
|
||||||
When the first diode is complete, the next one will need to be soldered to both the keyswitch, and the previous diode at the new elbow. That will look something like this:
|
When the first diode is complete, the next one will need to be soldered to both the keyswitch, and the previous diode at the new elbow. That will look something like this:
|
||||||
|
|
||||||
|
```
|
||||||
│o │o
|
│o │o
|
||||||
┌┴┐ o ┌┴┐ o
|
┌┴┐ o ┌┴┐ o
|
||||||
│ │ O │ │ O
|
│ │ O │ │ O
|
||||||
├─┤ ├─┤
|
├─┤ ├─┤
|
||||||
└┬┘ └┬┘
|
└┬┘ └┬┘
|
||||||
└────────────────┴─────────────
|
└────────────────┴─────────────
|
||||||
|
```
|
||||||
|
|
||||||
After completing a row, use the wire cutters to trim the excess wire from the tops of the diodes, and from the right side on the final switch. This process will need to completed for each row you have.
|
After completing a row, use the wire cutters to trim the excess wire from the tops of the diodes, and from the right side on the final switch. This process will need to completed for each row you have.
|
||||||
|
|
||||||
When all of the diodes are completely soldered, it's a good idea to quickly inspect each one to ensure that your solder joints are solid and sturdy - repairing things after this is possible, but more difficult.
|
When all of the diodes are completely soldered, it's a good idea to quickly inspect each one to ensure that your solder joints are solid and sturdy - repairing things after this is possible, but more difficult.
|
||||||
|
|
||||||
### Soldering the columns
|
## Soldering the columns
|
||||||
|
|
||||||
You'll have some options in the next process - it's a good idea to insulate the column wires (since the diodes aren't), but if you're careful enough, you can use exposed wires for the columns - it's not recommended, though. If you're using single-cored wire, stripping the plastic off of the whole wire and feeding it back on is probably the best option, but can be difficult depending on the size and materials. You'll want to leave parts of the wire exposed where you're going to be solder it onto the keyswitch.
|
You'll have some options in the next process - it's a good idea to insulate the column wires (since the diodes aren't), but if you're careful enough, you can use exposed wires for the columns - it's not recommended, though. If you're using single-cored wire, stripping the plastic off of the whole wire and feeding it back on is probably the best option, but can be difficult depending on the size and materials. You'll want to leave parts of the wire exposed where you're going to be solder it onto the keyswitch.
|
||||||
|
|
||||||
|
@ -163,7 +169,7 @@ Before beginning to solder, it helps to have your wire pre-bent (if using single
|
||||||
|
|
||||||
If you're not using any insulation, you can try to keep the column wires elevated, and solder them near the tips of the keyswitch contacts - if the wires are sturdy enough, they won't short out to the row wiring an diodes.
|
If you're not using any insulation, you can try to keep the column wires elevated, and solder them near the tips of the keyswitch contacts - if the wires are sturdy enough, they won't short out to the row wiring an diodes.
|
||||||
|
|
||||||
### Wiring things to the Teensy
|
## Wiring things to the Teensy
|
||||||
|
|
||||||
Now that the matrix itself is complete, it's time to connect what you've done to the Teensy. You'll be needing the number of pins equal to your number of columns + your number of rows. There are some pins on the Teensy that are special, like D6 (the LED on the chip), or some of the UART, SPI, I2C, or PWM channels, but only avoid those if you're planning something in addition to a keyboard. If you're unsure about wanting to add something later, you should have enough pins in total to avoid a couple.
|
Now that the matrix itself is complete, it's time to connect what you've done to the Teensy. You'll be needing the number of pins equal to your number of columns + your number of rows. There are some pins on the Teensy that are special, like D6 (the LED on the chip), or some of the UART, SPI, I2C, or PWM channels, but only avoid those if you're planning something in addition to a keyboard. If you're unsure about wanting to add something later, you should have enough pins in total to avoid a couple.
|
||||||
|
|
||||||
|
@ -179,48 +185,55 @@ When you're done with the columns, start with the rows in the same process, from
|
||||||
|
|
||||||
As you move along, be sure that the Teensy is staying in place - recutting and soldering the wires is a pain!
|
As you move along, be sure that the Teensy is staying in place - recutting and soldering the wires is a pain!
|
||||||
|
|
||||||
### Getting some basic firmware set-up
|
# Getting some basic firmware set-up
|
||||||
|
|
||||||
From here, you should have a working keyboard with the correct firmware. Before we attach the Teensy permanently to the keyboard, let's quickly get some firmware loaded onto the Teensy so we can test each keyswitch.
|
From here, you should have a working keyboard once you program a firmware. Before we attach the Teensy permanently to the keyboard, let's quickly get some firmware loaded onto the Teensy so we can test each keyswitch.
|
||||||
|
|
||||||
To start out, download [the firmware](https://github.com/qmk/qmk_firmware/) - we'll be using my (Jack's) fork of TMK called QMK/Quantum. We'll be doing a lot from the Terminal/command prompt, so get that open, along with a decent text editor like [Sublime Text](http://www.sublimetext.com/).
|
To start out, download [the firmware](https://github.com/qmk/qmk_firmware/) - we'll be using my (Jack's) fork of TMK called QMK/Quantum. We'll be doing a lot from the Terminal/command prompt, so get that open, along with a decent text editor like [Sublime Text](http://www.sublimetext.com/).
|
||||||
|
|
||||||
The first thing we're going to do is create a new project using the script in the root directory of the firmware. In your terminal, run this command with `<project_name>` replaced by the name of your project - it'll need to be different from any other project in the `keyboards/` folder:
|
The first thing we're going to do is create a new project using the script in the root directory of the firmware. In your terminal, run this command with `<project_name>` replaced by the name of your project - it'll need to be different from any other project in the `keyboards/` folder:
|
||||||
|
|
||||||
|
```
|
||||||
util/new_project.sh <project_name>
|
util/new_project.sh <project_name>
|
||||||
|
```
|
||||||
|
|
||||||
You'll want to navigate to the `keyboards/<project_name>/` folder by typing, like the print-out from the script specifies:
|
You'll want to navigate to the `keyboards/<project_name>/` folder by typing, like the print-out from the script specifies:
|
||||||
|
|
||||||
cd keyboards/<project_name>
|
cd keyboards/<project_name>
|
||||||
|
|
||||||
#### config.h
|
### config.h
|
||||||
|
|
||||||
The first thing you're going to want to modify is the `config.h` file. Find `MATRIX_ROWS` and `MATRIX_COLS` and change their definitions to match the dimensions of your keyboard's matrix.
|
The first thing you're going to want to modify is the `config.h` file. Find `MATRIX_ROWS` and `MATRIX_COLS` and change their definitions to match the dimensions of your keyboard's matrix.
|
||||||
|
|
||||||
Farther down are `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`. Change their definitions to match how you wired up your matrix (looking from the top of the keyboard, the rows run top-to-bottom and the columns run left-to-right). Likewise, change the definition of `UNUSED_PINS` to match the pins you did not use (this will save power).
|
Farther down are `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`. Change their definitions to match how you wired up your matrix (looking from the top of the keyboard, the rows run top-to-bottom and the columns run left-to-right). Likewise, change the definition of `UNUSED_PINS` to match the pins you did not use (this will save power).
|
||||||
|
|
||||||
#### \<project_name\>.h
|
### \<project_name\>.h
|
||||||
|
|
||||||
The next file you'll want to look at is `<project_name>.h`. You're going to want to rewrite the `KEYMAP` definition - the format and syntax here is extremely important, so pay attention to how things are setup. The first half of the definition are considered the arguments - this is the format that you'll be following in your keymap later on, so you'll want to have as many k*xy* variables here as you do keys. The second half is the part that the firmware actually looks at, and will contain gaps depending on how you wired your matrix.
|
The next file you'll want to look at is `<project_name>.h`. You're going to want to rewrite the `KEYMAP` definition - the format and syntax here is extremely important, so pay attention to how things are setup. The first half of the definition are considered the arguments - this is the format that you'll be following in your keymap later on, so you'll want to have as many k*xy* variables here as you do keys. The second half is the part that the firmware actually looks at, and will contain gaps depending on how you wired your matrix.
|
||||||
|
|
||||||
We'll dive into how this will work with the following example. Say we have a keyboard like this:
|
We'll dive into how this will work with the following example. Say we have a keyboard like this:
|
||||||
|
|
||||||
|
```
|
||||||
┌───┬───┬───┐
|
┌───┬───┬───┐
|
||||||
│ │ │ │
|
│ │ │ │
|
||||||
├───┴─┬─┴───┤
|
├───┴─┬─┴───┤
|
||||||
│ │ │
|
│ │ │
|
||||||
└─────┴─────┘
|
└─────┴─────┘
|
||||||
|
```
|
||||||
|
|
||||||
This can be described by saying the top row is 3 1u keys, and the bottom row is 2 1.5u keys. The difference between the two rows is important, because the bottom row has an unused column spot (3 v 2). Let's say that this is how we wired the columns:
|
This can be described by saying the top row is 3 1u keys, and the bottom row is 2 1.5u keys. The difference between the two rows is important, because the bottom row has an unused column spot (3 v 2). Let's say that this is how we wired the columns:
|
||||||
|
|
||||||
|
```
|
||||||
┌───┬───┬───┐
|
┌───┬───┬───┐
|
||||||
│ ┋ │ ┋ │ ┋ │
|
│ ┋ │ ┋ │ ┋ │
|
||||||
├─┋─┴─┬─┴─┋─┤
|
├─┋─┴─┬─┴─┋─┤
|
||||||
│ ┋ │ ┋ │
|
│ ┋ │ ┋ │
|
||||||
└─────┴─────┘
|
└─────┴─────┘
|
||||||
|
```
|
||||||
|
|
||||||
The middle column is unused on the bottom row in this example. Our `KEYMAP` definition would look like this:
|
The middle column is unused on the bottom row in this example. Our `KEYMAP` definition would look like this:
|
||||||
|
|
||||||
|
```
|
||||||
#define KEYMAP( \
|
#define KEYMAP( \
|
||||||
k00, k01, k02, \
|
k00, k01, k02, \
|
||||||
k10, k11, \
|
k10, k11, \
|
||||||
|
@ -229,19 +242,23 @@ The middle column is unused on the bottom row in this example. Our `KEYMAP` defi
|
||||||
{ k00, k01, k02 }, \
|
{ k00, k01, k02 }, \
|
||||||
{ k10, KC_NO, k11 }, \
|
{ k10, KC_NO, k11 }, \
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Notice how the top half is spaced to resemble our physical layout - this helps us understand which keys are associated with which columns. The bottom half uses the keycode `KC_NO` where there is no keyswitch wired in. It's easiest to keep the bottom half aligned in a grid to help us make sense of how the firmware actually sees the wiring.
|
Notice how the top half is spaced to resemble our physical layout - this helps us understand which keys are associated with which columns. The bottom half uses the keycode `KC_NO` where there is no keyswitch wired in. It's easiest to keep the bottom half aligned in a grid to help us make sense of how the firmware actually sees the wiring.
|
||||||
|
|
||||||
Let's say that instead, we wired our keyboard like this (a fair thing to do):
|
Let's say that instead, we wired our keyboard like this (a fair thing to do):
|
||||||
|
|
||||||
|
```
|
||||||
┌───┬───┬───┐
|
┌───┬───┬───┐
|
||||||
│ ┋ │ ┋│ ┋ │
|
│ ┋ │ ┋│ ┋ │
|
||||||
├─┋─┴─┬┋┴───┤
|
├─┋─┴─┬┋┴───┤
|
||||||
│ ┋ │┋ │
|
│ ┋ │┋ │
|
||||||
└─────┴─────┘
|
└─────┴─────┘
|
||||||
|
```
|
||||||
|
|
||||||
This would require our `KEYMAP` definition to look like this:
|
This would require our `KEYMAP` definition to look like this:
|
||||||
|
|
||||||
|
```
|
||||||
#define KEYMAP( \
|
#define KEYMAP( \
|
||||||
k00, k01, k02, \
|
k00, k01, k02, \
|
||||||
k10, k11, \
|
k10, k11, \
|
||||||
|
@ -250,10 +267,11 @@ This would require our `KEYMAP` definition to look like this:
|
||||||
{ k00, k01, k02 }, \
|
{ k00, k01, k02 }, \
|
||||||
{ k10, k11, KC_NO }, \
|
{ k10, k11, KC_NO }, \
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Notice how the `k11` and `KC_NO` switched places to represent the wiring, and the unused final column on the bottom row. Sometimes it'll make more sense to put a keyswitch on a particular column, but in the end, it won't matter, as long as all of them are accounted for. You can use this process to write out the `KEYMAP` for your entire keyboard - be sure to remember that your keyboard is actually backwards when looking at the underside of it.
|
Notice how the `k11` and `KC_NO` switched places to represent the wiring, and the unused final column on the bottom row. Sometimes it'll make more sense to put a keyswitch on a particular column, but in the end, it won't matter, as long as all of them are accounted for. You can use this process to write out the `KEYMAP` for your entire keyboard - be sure to remember that your keyboard is actually backwards when looking at the underside of it.
|
||||||
|
|
||||||
#### keymaps/default.c
|
### keymaps/default.c
|
||||||
|
|
||||||
This is the actual keymap for your keyboard, and the main place you'll make changes as you perfect your layout. `default.c` is the file that gets pull by default when typing `make`, but you can make other files as well, and specify them by typing `make KEYMAP=<variant>`, which will pull `keymaps/<variant>.c`.
|
This is the actual keymap for your keyboard, and the main place you'll make changes as you perfect your layout. `default.c` is the file that gets pull by default when typing `make`, but you can make other files as well, and specify them by typing `make KEYMAP=<variant>`, which will pull `keymaps/<variant>.c`.
|
||||||
|
|
||||||
|
@ -261,34 +279,38 @@ The basis of a keymap is its layers - by default, layer 0 is active. You can act
|
||||||
|
|
||||||
Using our previous example, let's say we want to create the following layout:
|
Using our previous example, let's say we want to create the following layout:
|
||||||
|
|
||||||
|
```
|
||||||
┌───┬───┬───┐
|
┌───┬───┬───┐
|
||||||
│ A │ 1 │ H │
|
│ A │ 1 │ H │
|
||||||
├───┴─┬─┴───┤
|
├───┴─┬─┴───┤
|
||||||
│ TAB │ SPC │
|
│ TAB │ SPC │
|
||||||
└─────┴─────┘
|
└─────┴─────┘
|
||||||
|
```
|
||||||
|
|
||||||
This can be accomplished by using the following `keymaps` definition:
|
This can be accomplished by using the following `keymaps` definition:
|
||||||
|
|
||||||
|
```
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[0] = KEYMAP( /* Base */
|
[0] = KEYMAP( /* Base */
|
||||||
KC_A, KC_1, KC_H, \
|
KC_A, KC_1, KC_H, \
|
||||||
KC_TAB, KC_SPC \
|
KC_TAB, KC_SPC \
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
```
|
||||||
|
|
||||||
Note that the layout of the keycodes is similar to the physical layout of our keyboard - this make it much easier to see what's going on. A lot of the keycodes should be fairly obvious, but for a full list of them, check out [tmk_code/doc/keycode.txt](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/doc/keycode.txt) - there are also a lot of aliases to condense your keymap file.
|
Note that the layout of the keycodes is similar to the physical layout of our keyboard - this make it much easier to see what's going on. A lot of the keycodes should be fairly obvious, but for a full list of them, check out [Keycodes](keycodes.md) - there are also a lot of aliases to condense your keymap file.
|
||||||
|
|
||||||
It's also important to use the `KEYMAP` function we defined earlier - this is what allows the firmware to associate our intended readable keymap with the actual wiring.
|
It's also important to use the `KEYMAP` function we defined earlier - this is what allows the firmware to associate our intended readable keymap with the actual wiring.
|
||||||
|
|
||||||
#### Compiling your firmware
|
## Compiling your firmware
|
||||||
|
|
||||||
After you've written out your entire keymap, you're ready to get the firmware compiled and onto your Teensy. Before compiling, you'll need to get your [development environment set-up](build_guide.md) - you can skip the dfu-programmer instructions, but you'll need to download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html) to get the firmware on your Teensy.
|
After you've written out your entire keymap, you're ready to get the firmware compiled and onto your Teensy. Before compiling, you'll need to get your [development environment set-up](getting_started_build_tools.md) - you can skip the dfu-programmer instructions, but you'll need to download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html) to get the firmware on your Teensy.
|
||||||
|
|
||||||
Once everything is installed, running `make` in the terminal should get you some output, and eventually a `<project_name>.hex` file in that folder. If you're having trouble with this step, see the end of the guide for the trouble-shooting section.
|
Once everything is installed, running `make` in the terminal should get you some output, and eventually a `<project_name>.hex` file in that folder. If you're having trouble with this step, see the end of the guide for the trouble-shooting section.
|
||||||
|
|
||||||
Once you have your `<project_name>.hex` file, open up the Teensy loader application, and click the file icon. From here, navigate to your `QMK/keyboards/<project_name>/` folder, and select the `<project_name>.hex` file. Plug in your keyboard and press the button on the Teensy - you should see the LED on the device turn off once you do. The Teensy Loader app will change a little, and the buttons should be clickable - click the download button (down arrow), and then the reset button (right arrow), and your keyboard should be ready to go!
|
Once you have your `<project_name>.hex` file, open up the Teensy loader application, and click the file icon. From here, navigate to your `QMK/keyboards/<project_name>/` folder, and select the `<project_name>.hex` file. Plug in your keyboard and press the button on the Teensy - you should see the LED on the device turn off once you do. The Teensy Loader app will change a little, and the buttons should be clickable - click the download button (down arrow), and then the reset button (right arrow), and your keyboard should be ready to go!
|
||||||
|
|
||||||
#### Testing your firmware
|
## Testing your firmware
|
||||||
|
|
||||||
Carefully flip your keyboard over, open up a new text document, and try typing - you should get the characters that you put into your keymap. Test each key, and note the ones that aren't working. Here's a quick trouble-shooting guide for non-working keys:
|
Carefully flip your keyboard over, open up a new text document, and try typing - you should get the characters that you put into your keymap. Test each key, and note the ones that aren't working. Here's a quick trouble-shooting guide for non-working keys:
|
||||||
|
|
||||||
|
@ -302,20 +324,8 @@ Carefully flip your keyboard over, open up a new text document, and try typing -
|
||||||
|
|
||||||
If you've done all of these things, keep in mind that sometimes you might have had multiple things affecting the keyswitch, so it doesn't hurt to test the keyswitch by shorting it out at the end.
|
If you've done all of these things, keep in mind that sometimes you might have had multiple things affecting the keyswitch, so it doesn't hurt to test the keyswitch by shorting it out at the end.
|
||||||
|
|
||||||
#### Securing the Teensy, finishing your hardware, getting fancier firmware
|
# Securing the Teensy, finishing your hardware, getting fancier firmware
|
||||||
|
|
||||||
Now that you have a working board, it's time to get things in their permanent positions. I've often used liberal amounts of hot glue to secure and insulate things, so if that's your style, start spreading that stuff like butter. Otherwise, double-sided tape is always an elegant solution, and electrical tape is a distant second. Due to the nature of these builds, a lot of this part is up to you and how you planned (or didn't plan) things out.
|
Now that you have a working board, it's time to get things in their permanent positions. I've often used liberal amounts of hot glue to secure and insulate things, so if that's your style, start spreading that stuff like butter. Otherwise, double-sided tape is always an elegant solution, and electrical tape is a distant second. Due to the nature of these builds, a lot of this part is up to you and how you planned (or didn't plan) things out.
|
||||||
|
|
||||||
There are a lot of possibilities inside the firmware - check out the [readme](https://github.com/qmk/qmk_firmware/blob/master/readme.md) for a full feature list, and dive into the different project (Planck, Ergodox EZ, etc) to see how people use all of them. You can always stop by [the OLKB subreddit for help!](http://reddit.com/r/olkb)
|
There are a lot of possibilities inside the firmware - explore [docs.qmk.fm](http://docs.qmk.fm) for a full feature list, and dive into the different project (Planck, Clueboard, Ergodox EZ, etc) to see how people use all of them. You can always stop by [the OLKB subreddit for help!](http://reddit.com/r/olkb)
|
||||||
|
|
||||||
## Trouble-shooting compiling
|
|
||||||
|
|
||||||
### Windows
|
|
||||||
|
|
||||||
#### fork: Resource temporarily unavailable
|
|
||||||
|
|
||||||
http://www.avrfreaks.net/forum/windows-81-compilation-error
|
|
||||||
|
|
||||||
### Mac
|
|
||||||
|
|
||||||
### Linux
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
# Alternative Controller for HHKB
|
|
||||||
|
|
||||||
* [Geekhack.org thread](https://geekhack.org/index.php?topic=12047.0)
|
|
||||||
|
|
||||||
* [Connector unmate](https://geekhack.org/index.php?topic=12047.msg1543860#msg1543860)
|
|
|
@ -23,20 +23,14 @@ in the next sections.
|
||||||
Whenever you press a key, the firmware of your keyboard can register this event.
|
Whenever you press a key, the firmware of your keyboard can register this event.
|
||||||
It can register when the key is pressed, held and released.
|
It can register when the key is pressed, held and released.
|
||||||
|
|
||||||
This usually happens with a [periodic scan of key presses with a frequency around 100 hz](https://github.com/benblazak/ergodox-firmware/blob/master/references.md#typical-keyboard-information).
|
This usually happens with a periodic scan of key presses. This speed often is limited by the mechanical key response time, the protocol to transfer those key presses (here USB HID), and by the software it is used in.
|
||||||
This speed often is limited by the mechanical key response time, the protocol
|
|
||||||
to transfer those key presses (here USB HID), and by the software it is used in.
|
|
||||||
|
|
||||||
## 2. What the Firmware Sends
|
## 2. What the Firmware Sends
|
||||||
|
|
||||||
The [HID specification](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf)
|
The [HID specification](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) tells what a keyboard can actually send through USB to have a chance to be properly recognised. This includes a pre-defined list of scancodes which are simple numbers from `0x00` to `0xE7`. The firmware assigns a scancode to each key of the keyboard.
|
||||||
tells what a keyboard can actually send through USB to have a chance to be
|
|
||||||
properly recognised. This includes a pre-defined list of keycodes which are
|
|
||||||
simple numbers from `0x00` to `0xE7`. The firmware assigns a keycode to each
|
|
||||||
key of the keyboard.
|
|
||||||
|
|
||||||
The firmware does not send actually letters or characters, but only keycodes.
|
The firmware does not send actually letters or characters, but only scancodes.
|
||||||
Thus, by modifying the firmware, you only can modify what keycode is sent over
|
Thus, by modifying the firmware, you only can modify what scancode is sent over
|
||||||
USB for a given key.
|
USB for a given key.
|
||||||
|
|
||||||
## 3. What the Operating System Does
|
## 3. What the Operating System Does
|
||||||
|
@ -45,9 +39,8 @@ Once the keycode reaches the operating system, a piece of software has to have
|
||||||
it match an actual character thanks to a keyboard layout. For example, if your
|
it match an actual character thanks to a keyboard layout. For example, if your
|
||||||
layout is set to QWERTY, a sample of the matching table is as follow:
|
layout is set to QWERTY, a sample of the matching table is as follow:
|
||||||
|
|
||||||
``` text
|
|
||||||
| keycode | character |
|
| keycode | character |
|
||||||
|---------+-----------|
|
|---------|-----------|
|
||||||
| 0x04 | a/A |
|
| 0x04 | a/A |
|
||||||
| 0x05 | b/B |
|
| 0x05 | b/B |
|
||||||
| 0x06 | c/C |
|
| 0x06 | c/C |
|
||||||
|
@ -55,39 +48,22 @@ layout is set to QWERTY, a sample of the matching table is as follow:
|
||||||
| 0x1C | y/Y |
|
| 0x1C | y/Y |
|
||||||
| 0x1D | z/Z |
|
| 0x1D | z/Z |
|
||||||
| ... | ... |
|
| ... | ... |
|
||||||
|---------+-----------|
|
|
||||||
```
|
|
||||||
|
|
||||||
## Back to the firmware
|
## Back to the firmware
|
||||||
|
|
||||||
As the layout is generally fixed (unless you create your own), the firmware can
|
As the layout is generally fixed (unless you create your own), the firmware can actually call a keycode by its layout name directly to ease things for you. This is exactly what is done here with `KC_A` actually representing `0x04` in QWERTY. The full list can be found in [keycodes](keycodes.md).
|
||||||
actually call a keycode by its layout name directly to ease things for you.
|
|
||||||
|
|
||||||
This is exactly what is done here with `KC_A` actually representing `0x04` in
|
|
||||||
QWERTY. The full list can be found in `keycode.txt`.
|
|
||||||
|
|
||||||
## List of Characters You Can Send
|
## List of Characters You Can Send
|
||||||
|
|
||||||
Putting aside shortcuts, having a limited set of keycodes mapped to a limited
|
Putting aside shortcuts, having a limited set of keycodes mapped to a limited layout means that **the list of characters you can assign to a given key only is the ones present in the layout**.
|
||||||
layout means that **the list of characters you can assign to a given key only
|
|
||||||
is the ones present in the layout**.
|
|
||||||
|
|
||||||
For example, this means that if you have a QWERTY US layout, and you want to
|
For example, this means that if you have a QWERTY US layout, and you want to assign 1 key to produce `€` (euro currency symbol), you are unable to do so, because the QWERTY US layout does not have such mapping. You could fix that by using a QWERTY UK layout, or a QWERTY US International.
|
||||||
assign 1 key to produce `€` (euro currency symbol), you are unable to do so,
|
|
||||||
because the QWERTY US layout does not have such mapping. You could fix that by
|
|
||||||
using a QWERTY UK layout, or a QWERTY US International.
|
|
||||||
|
|
||||||
You may wonder why a keyboard layout containing all of Unicode is not devised
|
You may wonder why a keyboard layout containing all of Unicode is not devised then? The limited number of keycode available through USB simply disallow such a thing.
|
||||||
then? The limited number of keycode available through USB simply disallow such
|
|
||||||
a thing.
|
|
||||||
|
|
||||||
## How to (Maybe) Enter Unicode Characters
|
## How to (Maybe) Enter Unicode Characters
|
||||||
|
|
||||||
You can have the firmware send *sequences of keys* to use the [software Unicode
|
You can have the firmware send *sequences of keys* to use the [software Unicode Input Method](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input) of the target operating system, thus effectively entering characters independently of the layout defined in the OS.
|
||||||
Input
|
|
||||||
Method](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input) of
|
|
||||||
the target operating system, thus effectively entering characters independently
|
|
||||||
of the layout defined in the OS.
|
|
||||||
|
|
||||||
Yet, it does come with multiple disadvantages:
|
Yet, it does come with multiple disadvantages:
|
||||||
|
|
|
@ -1,121 +0,0 @@
|
||||||
# Quick Aliases To Common Actions
|
|
||||||
|
|
||||||
Your keymap can include shortcuts to common operations (called "function actions" in tmk).
|
|
||||||
|
|
||||||
These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk `ACTION_*` functions, please see the [TMK documentation](keymap.md#2-action).
|
|
||||||
|
|
||||||
Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` - the benefit here is being able to use more than 32 function actions (up to 4096), if you happen to need them.
|
|
||||||
|
|
||||||
### Limits of these aliases
|
|
||||||
|
|
||||||
Currently, the keycodes able to used with these functions are limited to the TMK ones, 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 this list](keycode.txt).
|
|
||||||
|
|
||||||
### Switching and toggling layers
|
|
||||||
|
|
||||||
`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. When you apply this to a key, that same key must be set as `KC_TRNS` on the destination layer. Otherwise, you won't make it back to the original layer when you release the key (and you'll get a keycode sent). You can only switch to layers *above* your current layer. If you're on layer 0 and you use `MO(1)`, that will switch to layer 1 just fine. But if you include `MO(3)` on layer 5, that won't do anything for you -- because layer 3 is lower than layer 5 on the stack.
|
|
||||||
|
|
||||||
`OSL(layer)` - momentary switch to *layer*, as a one-shot operation. So if you have a key that's defined as `OSL(1)`, and you tap that key, then only the very next keystroke would come from layer 1. You would drop back to layer zero immediately after that one keystroke. That's handy if you have a layer full of custom shortcuts -- for example, a dedicated key for closing a window. So you tap your one-shot layer mod, then tap that magic 'close window' key, and keep typing like a boss. Layer 1 would remain active as long as you hold that key down, too (so you can use it like a momentary toggle-layer key with extra powers).
|
|
||||||
|
|
||||||
`LT(layer, kc)` - momentary switch to *layer* when held, and *kc* when tapped. Like `MO()`, this only works upwards in the layer stack (`layer` must be higher than the current layer).
|
|
||||||
|
|
||||||
`TG(layer)` - toggles a layer on or off. As with `MO()`, you should set this key as `KC_TRNS` in the destination layer so that tapping it again actually toggles back to the original layer. Only works upwards in the layer stack.
|
|
||||||
|
|
||||||
`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 1` for just one tap.
|
|
||||||
|
|
||||||
|
|
||||||
### Fun with modifier keys
|
|
||||||
|
|
||||||
* `LSFT(kc)` - applies left Shift to *kc* (keycode) - `S(kc)` is an alias
|
|
||||||
* `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.
|
|
||||||
|
|
||||||
The following shortcuts automatically add `LSFT()` to keycodes to get commonly used symbols. Their long names are also available and documented in `quantum/quantum_keycodes.h`.
|
|
||||||
|
|
||||||
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 :
|
|
||||||
|
|
||||||
`OSM(mod)` - this is a "one shot" modifier. So let's say you have your left Shift key defined as `OSM(MOD_LSFT)`. Tap it, let go, and Shift is "on" -- but only for the next character you'll type. So to write "The", you don't need to hold down Shift -- you tap it, tap t, and move on with life. And if you hold down the left Shift key, it just works as a left Shift key, as you would expect (so you could type THE). There's also a magical, secret way to "lock" a modifier by tapping it multiple times. If you want to learn more about that, open an issue. :)
|
|
||||||
|
|
||||||
`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.
|
|
||||||
|
|
||||||
##### 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. As described in the PR:
|
|
||||||
|
|
||||||
Without this, if you let go of a held key inside the tapping term, it won't register.
|
|
||||||
|
|
||||||
Example: (Tapping Term = 200)
|
|
||||||
|
|
||||||
- SHFT_T(KC_A) Down
|
|
||||||
- KC_X Down
|
|
||||||
- KC_X Up
|
|
||||||
- SHFT_T(KC_A) Up
|
|
||||||
|
|
||||||
With permissive hold, if above is typed within tapping term, this will emit `X` (so, Shift+X).
|
|
||||||
|
|
||||||
With defaults, if above is typed within tapping term, this will emit `ax`, which I doubt is what anyone really wants
|
|
11
docs/key_lock.md
Normal file
11
docs/key_lock.md
Normal file
|
@ -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.
|
531
docs/keycodes.md
531
docs/keycodes.md
|
@ -1,228 +1,315 @@
|
||||||
# Overview
|
# Overview
|
||||||
|
|
||||||
When defining a [keymap](keymap.md) each key needs a valid key definition.
|
When defining a [keymap](keymap.md) each key needs a valid key definition. This page documents the symbols that correspond to keycodes that are available to you in QMK. This is a reference only. Where possible keys link to the page documenting their functionality.
|
||||||
|
|
||||||
This page documents the symbols that correspond to keycodes that are available to you in QMK.
|
## Keycode Index
|
||||||
|
|
||||||
To customize your board, they can be used by themselves or as **action codes** in combination with one of the [many C macros](https://github.com/qmk/qmk_firmware/wiki#c-macros-for-action-code).
|
|
||||||
|
|
||||||
The source of truth for these codes is [tmk_core/common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h) file in the qmk source code.
|
|
||||||
|
|
||||||
# The Keycodes
|
|
||||||
|
|
||||||
Keycodes in QMK are based on [HID Usage Keyboard/Keypad Page(0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) with following exceptions:
|
|
||||||
|
|
||||||
* `KC_NO` = 0 for no action
|
|
||||||
* `KC_TRNS` = 1 for layer transparency
|
|
||||||
* internal special keycodes in the `0xA5-DF` range (tmk heritage).
|
|
||||||
|
|
||||||
## Letters and Numbers
|
|
||||||
|
|
||||||
|KC_1|KC_2|KC_3|KC_4|KC_5|KC_6|KC_7|KC_8|
|
|
||||||
|----|----|----|----|----|----|----|----|
|
|
||||||
|KC_9|KC_0|KC_F1|KC_F2|KC_F3|KC_F4|KC_F5|KC_F6|
|
|
||||||
|KC_F7|KC_F8|KC_F9|KC_F10|KC_F11|KC_F12|KC_F13|KC_F14|
|
|
||||||
|KC_F15|KC_F16|KC_F17|KC_F18|KC_F19|KC_F20|KC_F21|KC_F22|
|
|
||||||
|KC_F23|KC_F24|KC_A|KC_B|KC_C|KC_D|KC_E|KC_F|
|
|
||||||
|KC_G|KC_H|KC_I|KC_J|KC_K|KC_L|KC_M|KC_N|
|
|
||||||
|KC_O|KC_P|KC_Q|KC_R|KC_S|KC_T|KC_U|KC_V|
|
|
||||||
|KC_W|KC_X|KC_Y|KC_Z|||||
|
|
||||||
|
|
||||||
## Punctuation
|
|
||||||
|
|
||||||
|Long Name|Short Name|Description|
|
|Long Name|Short Name|Description|
|
||||||
|---------|----------|-----------|
|
|---------|----------|-----------|
|
||||||
|KC_ENTER|KC_ENT|`Return (ENTER)`|
|
|`KC_1`||||
|
||||||
|KC_ESCAPE|KC_ESC|`ESCAPE`|
|
|`KC_2`||||
|
||||||
|KC_BSPACE|KC_BSPC|`DELETE (Backspace)`|
|
|`KC_3`||||
|
||||||
|KC_TAB||`Tab`|
|
|`KC_4`||||
|
||||||
|KC_SPACE|KC_SPC|Spacebar|
|
|`KC_5`||||
|
||||||
|KC_MINUS|KC_MINS|`-` and `_`|
|
|`KC_6`||||
|
||||||
|KC_EQUAL|KC_EQL|`=` and `+`|
|
|`KC_7`||||
|
||||||
|KC_LBRACKET|KC_LBRC|`[` and `{`|
|
|`KC_8`||||
|
||||||
|KC_RBRACKET|KC_RBRC|`]` and `}`|
|
|`KC_9`||||
|
||||||
|KC_BSLASH|KC_BSLS|`\` and <code>|</code> |
|
|`KC_0`||||
|
||||||
|KC_NONUS_HASH|KC_NUHS|Non-US `#` and `~`|
|
|`KC_F1`||||
|
||||||
|KC_NONUS_BSLASH|KC_NUBS|Non-US `\` and <code>|</code> |
|
|`KC_F2`||||
|
||||||
|KC_INT1|KC_RO|JIS `\` and <code>|</code> |
|
|`KC_F3`||||
|
||||||
|KC_INT2|KC_KANA|International216|
|
|`KC_F4`||||
|
||||||
|KC_INT3|KC_JYEN|Yen Symbol (`¥`)|
|
|`KC_F5`||||
|
||||||
|KC_SCOLON|KC_SCLN|`;` and `:`|
|
|`KC_F6`||||
|
||||||
|KC_QUOTE|KC_QUOT|`‘` and `“`|
|
|`KC_F7`||||
|
||||||
|KC_GRAVE|KC_GRV|Grave Accent and Tilde|
|
|`KC_F8`||||
|
||||||
|KC_COMMA|KC_COMM|`,` and `<`|
|
|`KC_F9`||||
|
||||||
|KC_DOT||`.` and `>`|
|
|`KC_F10`||||
|
||||||
|KC_SLASH|KC_SLSH|`/` and `?`|
|
|`KC_F11`||||
|
||||||
|KC_CAPSLOCK|KC_CAPS|Caps Lock|
|
|`KC_F12`||||
|
||||||
|
|`KC_F13`||||
|
||||||
## Modifiers
|
|`KC_F14`||||
|
||||||
|
|`KC_F15`||||
|
||||||
|Long Name|Short Name|Description|
|
|`KC_F16`||||
|
||||||
|---------|----------|-----------|
|
|`KC_F17`||||
|
||||||
|KC_LCTRL|KC_LCTL|LeftControl|
|
|`KC_F18`||||
|
||||||
|KC_LSHIFT|KC_LSFT|LeftShift|
|
|`KC_F19`||||
|
||||||
|KC_LALT||LeftAlt|
|
|`KC_F20`||||
|
||||||
|KC_LGUI||Left GUI(Windows/Apple/Meta key)|
|
|`KC_F21`||||
|
||||||
|KC_RCTRL|KC_RCTL|RightControl|
|
|`KC_F22`||||
|
||||||
|KC_RSHIFT|KC_RSFT|RightShift|
|
|`KC_F23`||||
|
||||||
|KC_RALT||RightAlt|
|
|`KC_F24`||||
|
||||||
|KC_RGUI||Right GUI(Windows/Apple/Meta key)|
|
|`KC_A`||||
|
||||||
|KC_LOCKING_CAPS||Locking Caps Lock|
|
|`KC_B`||||
|
||||||
|KC_LOCKING_NUM||Locking Num Lock|
|
|`KC_C`||||
|
||||||
|KC_LOCKING_SCROLL||Locking Scroll Lock|
|
|`KC_D`||||
|
||||||
|KC_INT4|KC_HENK|JIS Henken|
|
|`KC_E`||||
|
||||||
|KC_INT5|KC_MHEN|JIS Muhenken|
|
|`KC_F`||||
|
||||||
|
|`KC_G`||||
|
||||||
## Commands
|
|`KC_H`||||
|
||||||
|
|`KC_I`||||
|
||||||
|Long Name|Short Name|Description|
|
|`KC_J`||||
|
||||||
|---------|----------|-----------|
|
|`KC_K`||||
|
||||||
|KC_PSCREEN|KC_PSCR|PrintScreen|
|
|`KC_L`||||
|
||||||
|KC_SCROLLLOCK|KC_SLCK|Scroll Lock|
|
|`KC_M`||||
|
||||||
|KC_PAUSE|KC_PAUS|Pause|
|
|`KC_N`||||
|
||||||
|KC_INSERT|KC_INS|Insert|
|
|`KC_O`||||
|
||||||
|KC_HOME||Home|
|
|`KC_P`||||
|
||||||
|KC_PGUP||PageUp|
|
|`KC_Q`||||
|
||||||
|KC_DELETE|KC_DEL|Delete Forward|
|
|`KC_R`||||
|
||||||
|KC_END||End|
|
|`KC_S`||||
|
||||||
|KC_PGDOWN|KC_PGDN|PageDown|
|
|`KC_T`||||
|
||||||
|KC_RIGHT|KC_RGHT|RightArrow|
|
|`KC_U`||||
|
||||||
|KC_LEFT||LeftArrow|
|
|`KC_V`||||
|
||||||
|KC_DOWN||DownArrow|
|
|`KC_W`||||
|
||||||
|KC_UP||UpArrow|
|
|`KC_X`||||
|
||||||
|KC_APPLICATION|KC_APP|Application|
|
|`KC_Y`||||
|
||||||
|KC_POWER||Power|
|
|`KC_Z`||||
|
||||||
|KC_EXECUTE||Execute|
|
|`KC_ENTER`|`KC_ENT`|`Return (ENTER)`|
|
||||||
|KC_HELP||Help|
|
|`KC_ESCAPE`|`KC_ESC`|`ESCAPE`|
|
||||||
|KC_MENU||Menu|
|
|`KC_BSPACE`|`KC_BSPC`|`DELETE (Backspace)`|
|
||||||
|KC_SELECT||Select|
|
|`KC_TAB`||`Tab`|
|
||||||
|KC_AGAIN||Again|
|
|`KC_SPACE`|`KC_SPC`|Spacebar|
|
||||||
|KC_UNDO||Undo|
|
|`KC_MINUS`|`KC_MINS`|`-` and `_`|
|
||||||
|KC_CUT||Cut|
|
|`KC_EQUAL`|`KC_EQL`|`=` and `+`|
|
||||||
|KC_COPY||Copy|
|
|`KC_LBRACKET`|`KC_LBRC`|`[` and `{`|
|
||||||
|KC_PASTE||Paste|
|
|`KC_RBRACKET`|`KC_RBRC`|`]` and `}`|
|
||||||
|KC_FIND||Find|
|
|`KC_BSLASH`|`KC_BSLS`|`\` and <code>|</code> |
|
||||||
|KC_ALT_ERASE||Alternate Erase|
|
|`KC_NONUS_HASH`|`KC_NUHS`|Non-US `#` and `~`|
|
||||||
|KC_SYSREQ||SysReq/Attention|
|
|`KC_NONUS_BSLASH`|`KC_NUBS`|Non-US `\` and <code>|</code> |
|
||||||
|KC_CANCEL||Cancel|
|
|`KC_INT1`|`KC_RO`|JIS `\` and <code>|</code> |
|
||||||
|KC_CLEAR||Clear|
|
|`KC_INT2`|`KC_KANA`|International216|
|
||||||
|KC_PRIOR||Prior|
|
|`KC_INT3`|`KC_JYEN`|Yen Symbol (`¥`)|
|
||||||
|KC_RETURN||Return|
|
|`KC_SCOLON`|`KC_SCLN`|`;` and `:`|
|
||||||
|KC_SEPARATOR||Separator|
|
|`KC_QUOTE`|`KC_QUOT`|`‘` and `“`|
|
||||||
|KC_OUT||Out|
|
|`KC_GRAVE`|`KC_GRV`|Grave Accent and Tilde|
|
||||||
|KC_OPER||Oper|
|
|`KC_COMMA`|`KC_COMM`|`,` and `<`|
|
||||||
|KC_CLEAR_AGAIN||Clear/Again|
|
|`KC_DOT`||`.` and `>`|
|
||||||
|KC_CRSEL||CrSel/Props|
|
|`KC_SLASH`|`KC_SLSH`|`/` and `?`|
|
||||||
|KC_EXSEL||ExSel|
|
|`KC_CAPSLOCK`|`KC_CAPS`|Caps Lock|
|
||||||
|KC_SYSTEM_POWER|KC_PWR|System Power Down|
|
|`KC_LCTRL`|`KC_LCTL`|LeftControl|
|
||||||
|KC_SYSTEM_SLEEP|KC_SLEP|System Sleep|
|
|`KC_LSHIFT`|`KC_LSFT`|LeftShift|
|
||||||
|KC_SYSTEM_WAKE|KC_WAKE|System Wake|
|
|`KC_LALT`||LeftAlt|
|
||||||
|KC_MAIL|KC_MAIL||
|
|`KC_LGUI`||Left GUI(Windows/Apple/Meta key)|
|
||||||
|KC_CALCULATOR|KC_CALC||
|
|`KC_RCTRL`|`KC_RCTL`|RightControl|
|
||||||
|KC_MY_COMPUTER|KC_MYCM||
|
|`KC_RSHIFT`|`KC_RSFT`|RightShift|
|
||||||
|KC_WWW_SEARCH|KC_WSCH||
|
|`KC_RALT`||RightAlt|
|
||||||
|KC_WWW_HOME|KC_WHOM||
|
|`KC_RGUI`||Right GUI(Windows/Apple/Meta key)|
|
||||||
|KC_WWW_BACK|KC_WBAK||
|
|`KC_LOCKING_CAPS`|`KC_LCAP`|Locking Caps Lock|
|
||||||
|KC_WWW_FORWARD|KC_WFWD||
|
|`KC_LOCKING_NUM`|`KC_LNUM`|Locking Num Lock|
|
||||||
|KC_WWW_STOP|KC_WSTP||
|
|`KC_LOCKING_SCROLL`|`KC_LSCR`|Locking Scroll Lock|
|
||||||
|KC_WWW_REFRESH|KC_WREF||
|
|`KC_INT4`|`KC_HENK`|JIS Henken|
|
||||||
|KC_WWW_FAVORITES|KC_WFAV||
|
|`KC_INT5`|`KC_MHEN`|JIS Muhenken|
|
||||||
|
|`KC_PSCREEN`|`KC_PSCR`|PrintScreen|
|
||||||
## Media Keys
|
|`KC_SCROLLLOCK`|`KC_SLCK`|Scroll Lock|
|
||||||
|
|`KC_PAUSE`|`KC_PAUS`|Pause|
|
||||||
Windows and Mac use different key codes for next track and previous track. Make sure you choose the keycode that corresponds to your OS.
|
|`KC_INSERT`|`KC_INS`|Insert|
|
||||||
|
|`KC_HOME`||Home|
|
||||||
|Long Name|Short Name|Description|
|
|`KC_PGUP`||PageUp|
|
||||||
|---------|----------|-----------|
|
|`KC_DELETE`|`KC_DEL`|Delete Forward|
|
||||||
|KC_STOP||Stop|
|
|`KC_END`||End|
|
||||||
|KC__MUTE||Mute|
|
|`KC_PGDOWN`|`KC_PGDN`|PageDown|
|
||||||
|KC__VOLUP||Volume Up|
|
|`KC_RIGHT`|`KC_RGHT`|RightArrow|
|
||||||
|KC__VOLDOWN||Volume Down|
|
|`KC_LEFT`||LeftArrow|
|
||||||
|KC_AUDIO_MUTE|KC_MUTE||
|
|`KC_DOWN`||DownArrow|
|
||||||
|KC_AUDIO_VOL_UP|KC_VOLU||
|
|`KC_UP`||UpArrow|
|
||||||
|KC_AUDIO_VOL_DOWN|KC_VOLD||
|
|`KC_APPLICATION`|`KC_APP`|Application|
|
||||||
|KC_MEDIA_NEXT_TRACK|KC_MNXT|Next Track (Windows)|
|
|`KC_POWER`||Power|
|
||||||
|KC_MEDIA_PREV_TRACK|KC_MPRV|Previous Track (Windows)|
|
|`KC_EXECUTE`||Execute|
|
||||||
|KC_MEDIA_FAST_FORWARD|KC_MFFD|Next Track (macOS)|
|
|`KC_HELP`||Help|
|
||||||
|KC_MEDIA_REWIND|KC_MRWD|Previous Track (macOS)|
|
|`KC_MENU`||Menu|
|
||||||
|KC_MEDIA_STOP|KC_MSTP||
|
|`KC_SELECT`||Select|
|
||||||
|KC_MEDIA_PLAY_PAUSE|KC_MPLY||
|
|`KC_AGAIN`||Again|
|
||||||
|KC_MEDIA_SELECT|KC_MSEL||
|
|`KC_UNDO`||Undo|
|
||||||
|
|`KC_CUT`||Cut|
|
||||||
## Numpad
|
|`KC_COPY`||Copy|
|
||||||
|
|`KC_PASTE`||Paste|
|
||||||
|Long Name|Short Name|Description|
|
|`KC_FIND`||Find|
|
||||||
|---------|----------|-----------|
|
|`KC_ALT_ERASE`||Alternate Erase|
|
||||||
|KC_NUMLOCK|KC_NLCK|Keypad Num Lock and Clear|
|
|`KC_SYSREQ`||SysReq/Attention|
|
||||||
|KC_KP_SLASH|KC_PSLS|Keypad /|
|
|`KC_CANCEL`||Cancel|
|
||||||
|KC_KP_ASTERISK|KC_PAST|Keypad *|
|
|`KC_CLEAR`||Clear|
|
||||||
|KC_KP_MINUS|KC_PMNS|Keypad -|
|
|`KC_PRIOR`||Prior|
|
||||||
|KC_KP_PLUS|KC_PPLS|Keypad +|
|
|`KC_RETURN`||Return|
|
||||||
|KC_KP_ENTER|KC_PENT|Keypad ENTER|
|
|`KC_SEPARATOR`||Separator|
|
||||||
|KC_KP_1|KC_P1|Keypad 1 and End|
|
|`KC_OUT`||Out|
|
||||||
|KC_KP_2|KC_P2|Keypad 2 and Down Arrow|
|
|`KC_OPER`||Oper|
|
||||||
|KC_KP_3|KC_P3|Keypad 3 and PageDn|
|
|`KC_CLEAR_AGAIN`||Clear/Again|
|
||||||
|KC_KP_4|KC_P4|Keypad 4 and Left Arrow|
|
|`KC_CRSEL`||CrSel/Props|
|
||||||
|KC_KP_5|KC_P5|Keypad 5|
|
|`KC_EXSEL`||ExSel|
|
||||||
|KC_KP_6|KC_P6|Keypad 6 and Right Arrow|
|
|`KC_SYSTEM_POWER`|`KC_PWR`|System Power Down|
|
||||||
|KC_KP_7|KC_P7|Keypad 7 and Home|
|
|`KC_SYSTEM_SLEEP`|`KC_SLEP`|System Sleep|
|
||||||
|KC_KP_8|KC_P8|Keypad 8 and Up Arrow|
|
|`KC_SYSTEM_WAKE`|`KC_WAKE`|System Wake|
|
||||||
|KC_KP_9|KC_P9|Keypad 9 and PageUp|
|
|`KC_MAIL`|`KC_MAIL`||
|
||||||
|KC_KP_0|KC_P0|Keypad 0 and Insert|
|
|`KC_CALCULATOR`|`KC_CALC`||
|
||||||
|KC_KP_DOT|KC_PDOT|Keypad . and Delete|
|
|`KC_MY_COMPUTER`|`KC_MYCM`||
|
||||||
|KC_KP_EQUAL|KC_PEQL|Keypad =|
|
|`KC_WWW_SEARCH`|`KC_WSCH`||
|
||||||
|KC_KP_COMMA|KC_PCMM|Keypad Comma|
|
|`KC_WWW_HOME`|`KC_WHOM`||
|
||||||
|KC_KP_EQUAL_AS400||Keypad Equal Sign|
|
|`KC_WWW_BACK`|`KC_WBAK`||
|
||||||
|
|`KC_WWW_FORWARD`|`KC_WFWD`||
|
||||||
## Special Keys
|
|`KC_WWW_STOP`|`KC_WSTP`||
|
||||||
|
|`KC_WWW_REFRESH`|`KC_WREF`||
|
||||||
|Long Name|Short Name|Description|
|
|`KC_WWW_FAVORITES`|`KC_WFAV`||
|
||||||
|---------|----------|-----------|
|
|`KC_STOP`||Stop|
|
||||||
|KC_NO||Ignore this key. (NOOP) |
|
|`KC__MUTE`||Mute|
|
||||||
|
|`KC__VOLUP`||Volume Up|
|
||||||
## Mousekey
|
|`KC__VOLDOWN`||Volume Down|
|
||||||
|
|`KC_AUDIO_MUTE`|`KC_MUTE`||
|
||||||
|Long Name|Short Name|Description|
|
|`KC_AUDIO_VOL_UP`|`KC_VOLU`||
|
||||||
|---------|----------|-----------|
|
|`KC_AUDIO_VOL_DOWN`|`KC_VOLD`||
|
||||||
|KC_MS_UP|KC_MS_U|Mouse Cursor Up|
|
|`KC_MEDIA_NEXT_TRACK`|`KC_MNXT`|Next Track (Windows)|
|
||||||
|KC_MS_DOWN|KC_MS_D|Mouse Cursor Down|
|
|`KC_MEDIA_PREV_TRACK`|`KC_MPRV`|Previous Track (Windows)|
|
||||||
|KC_MS_LEFT|KC_MS_L|Mouse Cursor Left|
|
|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track (macOS)|
|
||||||
|KC_MS_RIGHT|KC_MS_R|Mouse Cursor Right|
|
|`KC_MEDIA_REWIND`|`KC_MRWD`|Previous Track (macOS)|
|
||||||
|KC_MS_BTN1|KC_BTN1|Mouse Button 1|
|
|`KC_MEDIA_STOP`|`KC_MSTP`||
|
||||||
|KC_MS_BTN2|KC_BTN2|Mouse Button 2|
|
|`KC_MEDIA_PLAY_PAUSE`|`KC_MPLY`||
|
||||||
|KC_MS_BTN3|KC_BTN3|Mouse Button 3|
|
|`KC_MEDIA_SELECT`|`KC_MSEL`||
|
||||||
|KC_MS_BTN4|KC_BTN4|Mouse Button 4|
|
|`KC_NUMLOCK`|`KC_NLCK`|Keypad Num Lock and Clear|
|
||||||
|KC_MS_BTN5|KC_BTN5|Mouse Button 5|
|
|`KC_KP_SLASH`|`KC_PSLS`|Keypad /|
|
||||||
|KC_MS_WH_UP|KC_WH_U|Mouse Wheel Up|
|
|`KC_KP_ASTERISK`|`KC_PAST`|Keypad *|
|
||||||
|KC_MS_WH_DOWN|KC_WH_D|Mouse Wheel Down|
|
|`KC_KP_MINUS`|`KC_PMNS`|Keypad -|
|
||||||
|KC_MS_WH_LEFT|KC_WH_L|Mouse Wheel Left|
|
|`KC_KP_PLUS`|`KC_PPLS`|Keypad +|
|
||||||
|KC_MS_WH_RIGHT|KC_WH_R|Mouse Wheel Right|
|
|`KC_KP_ENTER`|`KC_PENT`|Keypad ENTER`|
|
||||||
|KC_MS_ACCEL0|KC_ACL0|Mouse Acceleration 0|
|
|`KC_KP_1`|`KC_P1`|Keypad 1 and End|
|
||||||
|KC_MS_ACCEL1|KC_ACL1|Mouse Acceleration 1|
|
|`KC_KP_2`|`KC_P2`|Keypad 2 and Down Arrow|
|
||||||
|KC_MS_ACCEL2|KC_ACL2|Mouse Acceleration 2|
|
|`KC_KP_3`|`KC_P3`|Keypad 3 and PageDn|
|
||||||
|
|`KC_KP_4`|`KC_P4`|Keypad 4 and Left Arrow|
|
||||||
## Magic Keys
|
|`KC_KP_5`|`KC_P5`|Keypad 5|
|
||||||
|
|`KC_KP_6`|`KC_P6`|Keypad 6 and Right Arrow|
|
||||||
The following keys can be used to turn on and off various "Magic" features. These include Boot Magic (holding certain keys down while plugging the keyboard in) and the Magic Key.
|
|`KC_KP_7`|`KC_P7`|Keypad 7 and Home|
|
||||||
|
|`KC_KP_8`|`KC_P8`|Keypad 8 and Up Arrow|
|
||||||
|Long Name|Short Name|Description|
|
|`KC_KP_9`|`KC_P9`|Keypad 9 and PageUp|
|
||||||
|---------|----------|-----------|
|
|`KC_KP_0`|`KC_P0`|Keypad 0 and Insert|
|
||||||
|MAGIC_SWAP_CONTROL_CAPSLOCK||Swap Capslock and Control|
|
|`KC_KP_DOT`|`KC_PDOT`|Keypad . and Delete|
|
||||||
|MAGIC_CAPSLOCK_TO_CONTROL||Change Capslock to Control|
|
|`KC_KP_EQUAL`|`KC_PEQL`|Keypad =|
|
||||||
|MAGIC_SWAP_ALT_GUI||Swap ALT and GUI|
|
|`KC_KP_COMMA`|`KC_PCMM`|Keypad Comma|
|
||||||
|MAGIC_SWAP_LALT_LGUI||Swap LALT and LGUI|
|
|`KC_KP_EQUAL_AS400`||Keypad Equal Sign|
|
||||||
|MAGIC_SWAP_RALT_RGUI||Swap RALT and RGUI|
|
|`KC_NO`||Ignore this key. (NOOP) |
|
||||||
|MAGIC_NO_GUI||Disable off the GUI key|
|
|`KC_TRNS`||Make this key transparent to find the key on a lower layer.|
|
||||||
|MAGIC_SWAP_GRAVE_ESC||Swap the GRAVE (~ `) and Esc keys|
|
|[`KC_MS_UP`](mouse_keys.md)|`KC_MS_U`|Mouse Cursor Up|
|
||||||
|MAGIC_SWAP_BACKSLASH_BACKSPACE||Swap Backslash and Backspace|
|
|[`KC_MS_DOWN`](mouse_keys.md)|`KC_MS_D`|Mouse Cursor Down|
|
||||||
|MAGIC_UNSWAP_CONTROL_CAPSLOCK||Disable the Control/Caps Swap|
|
|[`KC_MS_LEFT`](mouse_keys.md)|`KC_MS_L`|Mouse Cursor Left|
|
||||||
|MAGIC_UNCAPSLOCK_TO_CONTROL||Turn Capslock back into Capslock|
|
|[`KC_MS_RIGHT`](mouse_keys.md)|`KC_MS_R`|Mouse Cursor Right|
|
||||||
|MAGIC_UNSWAP_ALT_GUI||Turn the ALT/GUI swap off|
|
|[`KC_MS_BTN1`](mouse_keys.md)|`KC_BTN1`|Mouse Button 1|
|
||||||
|MAGIC_UNSWAP_LALT_LGUI||Turn the LALT/LGUI swap off|
|
|[`KC_MS_BTN2`](mouse_keys.md)|`KC_BTN2`|Mouse Button 2|
|
||||||
|MAGIC_UNSWAP_RALT_RGUI||Turn the RALT/RGUI swap off|
|
|[`KC_MS_BTN3`](mouse_keys.md)|`KC_BTN3`|Mouse Button 3|
|
||||||
|MAGIC_UNNO_GUI||Enable the GUI key|
|
|[`KC_MS_BTN4`](mouse_keys.md)|`KC_BTN4`|Mouse Button 4|
|
||||||
|MAGIC_UNSWAP_GRAVE_ESC||Turn the GRAVE/ESC swap off|
|
|[`KC_MS_BTN5`](mouse_keys.md)|`KC_BTN5`|Mouse Button 5|
|
||||||
|MAGIC_UNSWAP_BACKSLASH_BACKSPACE||Turn the Backslash/Backspace swap off|
|
|[`KC_MS_WH_UP`](mouse_keys.md)|`KC_WH_U`|Mouse Wheel Up|
|
||||||
|MAGIC_HOST_NKRO||Turn NKRO on|
|
|[`KC_MS_WH_DOWN`](mouse_keys.md)|`KC_WH_D`|Mouse Wheel Down|
|
||||||
|MAGIC_UNHOST_NKRO||Turn NKRO off|
|
|[`KC_MS_WH_LEFT`](mouse_keys.md)|`KC_WH_L`|Mouse Wheel Left|
|
||||||
|MAGIC_TOGGLE_NKRO||Toggle NKRO on or off|
|
|[`KC_MS_WH_RIGHT`](mouse_keys.md)|`KC_WH_R`|Mouse Wheel Right|
|
||||||
|
|[`KC_MS_ACCEL0`](mouse_keys.md)|`KC_ACL0`|Mouse Acceleration 0|
|
||||||
|
|[`KC_MS_ACCEL1`](mouse_keys.md)|`KC_ACL1`|Mouse Acceleration 1|
|
||||||
|
|[`KC_MS_ACCEL2`](mouse_keys.md)|`KC_ACL2`|Mouse Acceleration 2|
|
||||||
|
|[`RESET`](quantum_keycodes.md#qmk-keycodes)||Put the keyboard into DFU mode for flashing|
|
||||||
|
|[`DEBUG`](quantum_keycodes.md#qmk-keycodes)||Toggles debug mode|
|
||||||
|
|[`KC_GESC`](quantum_keycodes.md#qmk-keycodes)|`GRAVE_ESC`|Acts as escape when pressed normally but when pressed with Shift or GUI will send a `~`|
|
||||||
|
|[`KC_LSPO`](quantum_keycodes.md#qmk-keycodes)||Left shift when held, open paranthesis when tapped|
|
||||||
|
|[`KC_RSPC`](quantum_keycodes.md#qmk-keycodes)||Right shift when held, close paranthesis when tapped|
|
||||||
|
|[`KC_LEAD`](feature_leader_key.md)||The leader key|
|
||||||
|
|[`FUNC(n)`](quantum_keycodes.md#qmk-keycodes)|`F(n)`|Call `fn_action(n)`|
|
||||||
|
|[`M(n)`](quantum_keycodes.md#qmk-keycodes)||to call macro n|
|
||||||
|
|[`MACROTAP(n)`](quantum_keycodes.md#qmk-keycodes)||to macro-tap n idk FIXME`|
|
||||||
|
|[`MAGIC_SWAP_CONTROL_CAPSLOCK`](feature_bootmagic.md)||Swap Capslock and Left Control|
|
||||||
|
|[`MAGIC_CAPSLOCK_TO_CONTROL`](feature_bootmagic.md)||Treat Capslock like a Control Key|
|
||||||
|
|[`MAGIC_SWAP_LALT_LGUI`](feature_bootmagic.md)||Swap the left Alt and GUI keys|
|
||||||
|
|[`MAGIC_SWAP_RALT_RGUI`](feature_bootmagic.md)||Swap the right Alt and GUI keys|
|
||||||
|
|[`MAGIC_NO_GUI`](feature_bootmagic.md)||Disable the GUI key|
|
||||||
|
|[`MAGIC_SWAP_GRAVE_ESC`](feature_bootmagic.md)||Swap the Grave and Esc key.|
|
||||||
|
|[`MAGIC_SWAP_BACKSLASH_BACKSPACE`](feature_bootmagic.md)||Swap backslack and backspace|
|
||||||
|
|[`MAGIC_HOST_NKRO`](feature_bootmagic.md)||Force NKRO on|
|
||||||
|
|[`MAGIC_SWAP_ALT_GUI`/`AG_SWAP`](feature_bootmagic.md)||Swap Alt and Gui on both sides|
|
||||||
|
|[`MAGIC_UNSWAP_CONTROL_CAPSLOCK`](feature_bootmagic.md)||Disable the Control/Capslock swap|
|
||||||
|
|[`MAGIC_UNCAPSLOCK_TO_CONTROL`](feature_bootmagic.md)||Disable treating Capslock like Control |
|
||||||
|
|[`MAGIC_UNSWAP_LALT_LGUI`](feature_bootmagic.md)||Disable Left Alt and GUI switching|
|
||||||
|
|[`MAGIC_UNSWAP_RALT_RGUI`](feature_bootmagic.md)||Disable Right Alt and GUI switching|
|
||||||
|
|[`MAGIC_UNNO_GUI`](feature_bootmagic.md)||Enable the GUI key |
|
||||||
|
|[`MAGIC_UNSWAP_GRAVE_ESC`](feature_bootmagic.md)||Disable the Grave/Esc swap |
|
||||||
|
|[`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`](feature_bootmagic.md)||Disable the backslash/backspace swap|
|
||||||
|
|[`MAGIC_UNHOST_NKRO`](feature_bootmagic.md)||Force NKRO off|
|
||||||
|
|[`MAGIC_UNSWAP_ALT_GUI`/`AG_NORM`](feature_bootmagic.md)||Disable the Alt/GUI switching|
|
||||||
|
|[`MAGIC_TOGGLE_NKRO`](feature_bootmagic.md)||Turn NKRO on or off|
|
||||||
|
|[`BL_x`](feature_backlight.md)||Set a specific backlight level between 0-9|
|
||||||
|
|[`BL_ON`](feature_backlight.md)||An alias for `BL_9`|
|
||||||
|
|[`BL_OFF`](feature_backlight.md)||An alias for `BL_0`|
|
||||||
|
|[`BL_DEC`](feature_backlight.md)||Turn the backlight level down by 1|
|
||||||
|
|[`BL_INC`](feature_backlight.md)||Turn the backlight level up by 1|
|
||||||
|
|[`BL_TOGG`](feature_backlight.md)||Toggle the backlight on or off|
|
||||||
|
|[`BL_STEP`](feature_backlight.md)||Step through backlight levels, wrapping around to 0 when you reach the top.|
|
||||||
|
|[`RGB_TOG`](feature_rgblight.md)||toggle on/off|
|
||||||
|
|[`RGB_MOD`](feature_rgblight.md)||cycle through modes|
|
||||||
|
|[`RGB_HUI`](feature_rgblight.md)||hue increase|
|
||||||
|
|[`RGB_HUD`](feature_rgblight.md)||hue decrease|
|
||||||
|
|[`RGB_SAI`](feature_rgblight.md)||saturation increase|
|
||||||
|
|[`RGB_SAD`](feature_rgblight.md)||saturation decrease|
|
||||||
|
|[`RGB_VAI`](feature_rgblight.md)||value increase|
|
||||||
|
|[`RGB_VAD`](feature_rgblight.md)||value decrease|
|
||||||
|
|[`PRINT_ON`](feature_thermal_printer.md)||Start printing everything the user types|
|
||||||
|
|[`PRINT_OFF`](feature_thermal_printer.md)||Stop printing everything the user types|
|
||||||
|
|[`OUT_AUTO`](feature_bluetooth.md)||auto mode|
|
||||||
|
|[`OUT_USB`](feature_bluetooth.md)||usb only|
|
||||||
|
|[`OUT_BT`](feature_bluetooth.md)||bluetooth (when `BLUETOOTH_ENABLE`)|
|
||||||
|
|[`KC_HYPR`](quantum_keycodes.md#modifiers)||Hold down LCTL + LSFT + LALT + LGUI`|
|
||||||
|
|[`KC_MEH`](quantum_keycodes.md#modifiers)||Hold down LCTL + LSFT + LALT`|
|
||||||
|
|[`LCTL(kc)`](quantum_keycodes.md#modifiers)||`LCTL` + `kc`|
|
||||||
|
|[`LSFT(kc)`](quantum_keycodes.md#modifiers)|[`S(kc)`](quantum_keycodes.md#modifiers)|`LSFT` + `kc`|
|
||||||
|
|[`LALT(kc)`](quantum_keycodes.md#modifiers)||`LALT` + `kc`|
|
||||||
|
|[`LGUI(kc)`](quantum_keycodes.md#modifiers)||`LGUI` + `kc`|
|
||||||
|
|[`RCTL(kc)`](quantum_keycodes.md#modifiers)||`RCTL` + `kc`|
|
||||||
|
|[`RSFT(kc)`](quantum_keycodes.md#modifiers)||`RSFT` + `kc`|
|
||||||
|
|[`RALT(kc)`](quantum_keycodes.md#modifiers)||`RALT` + `kc`|
|
||||||
|
|[`RGUI(kc)`](quantum_keycodes.md#modifiers)||`RGUI` + `kc`|
|
||||||
|
|[`HYPR(kc)`](quantum_keycodes.md#modifiers)||`LCTL` + `LSFT` + `LALT` + `LGUI` + `kc`|
|
||||||
|
|[`MEH(kc)`](quantum_keycodes.md#modifiers)||`LCTL` + `LSFT` + `LALT` + `kc`|
|
||||||
|
|[`LCAG(kc)`](quantum_keycodes.md#modifiers)||`LCTL` + `LALT` + `LGUI` + `kc`|
|
||||||
|
|[`ALTG(kc)`](quantum_keycodes.md#modifiers)||`RCTL` + `RALT` + `kc`|
|
||||||
|
|[`SCMD(kc)`](quantum_keycodes.md#modifiers)|[`SWIN(kc)`](quantum_keycodes.md#modifiers)|`LGUI` + `LSFT` + `kc`|
|
||||||
|
|[`LCA(kc)`](quantum_keycodes.md#modifiers)||`LCTL` + `LALT` + `kc`|
|
||||||
|
|[`CTL_T(kc)`](quantum_keycodes.md#mod-tap-keys)|[`LCTL_T(kc)`](quantum_keycodes.md#mod-tap-keys)|`LCTL` when held, `kc` when tapped|
|
||||||
|
|[`RCTL_T(kc)`](quantum_keycodes.md#mod-tap-keys)||[`RCTL` when held, `kc` when tapped|
|
||||||
|
|[`SFT_T(kc)`](quantum_keycodes.md#mod-tap-keys)|[`LSFT_T(kc)`](quantum_keycodes.md#mod-tap-keys)|`LSFT` when held, `kc` when tapped|
|
||||||
|
|[`RSFT_T(kc)`](quantum_keycodes.md#mod-tap-keys)||[`RSFT` when held, `kc` when tapped|
|
||||||
|
|[`ALT_T(kc)`](quantum_keycodes.md#mod-tap-keys)|[`LALT_T(kc)`](quantum_keycodes.md#mod-tap-keys)|`LALT` when held, `kc` when tapped|
|
||||||
|
|[`RALT_T(kc)`](quantum_keycodes.md#mod-tap-keys)|[`ALGR_T(kc)`](quantum_keycodes.md#mod-tap-keys)|`RALT` when held, `kc` when tapped|
|
||||||
|
|[`GUI_T(kc)`](quantum_keycodes.md#mod-tap-keys)|[`LGUI_T(kc)`](quantum_keycodes.md#mod-tap-keys)|`LGUI` when held, `kc` when tapped|
|
||||||
|
|[`RGUI_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`RGUI` when held, `kc` when tapped|
|
||||||
|
|[`C_S_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`LCTL` + `LSFT` when held, `kc` when tapped|
|
||||||
|
|[`MEH_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`LCTL` + `LSFT` + `LALT` when held, `kc` when tapped|
|
||||||
|
|[`LCAG_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`LCTL` + `LALT` + `LGUI` when held, `kc` when tapped|
|
||||||
|
|[`RCAG_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`RCTL` + `RALT` + `RGUI` when held, `kc` when tapped|
|
||||||
|
|[`ALL_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`LCTL` + `LSFT` + `LALT` + `LGUI` when held, `kc` when tapped [more info](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)|
|
||||||
|
|[`SCMD_T(kc)`](quantum_keycodes.md#mod-tap-keys)|[`SWIN_T(kc)`](quantum_keycodes.md#mod-tap-keys)|`LGUI` + `LSFT` when held, `kc` when tapped|
|
||||||
|
|[`LCA_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`LCTL` + `LALT` when held, `kc` when tapped|
|
||||||
|
|[`KC_TILD`](keycodes_us_ansi_shifted.md)|`KC_TILDE`|tilde `~`|
|
||||||
|
|[`KC_EXLM`](keycodes_us_ansi_shifted.md)|`KC_EXCLAIM`|exclamation mark `!`|
|
||||||
|
|[`KC_AT`](keycodes_us_ansi_shifted.md)||at sign `@`|
|
||||||
|
|[`KC_HASH`](keycodes_us_ansi_shifted.md)||hash sign `#`|
|
||||||
|
|[`KC_DLR`](keycodes_us_ansi_shifted.md)|`KC_DOLLAR`|dollar sign `$`|
|
||||||
|
|[`KC_PERC`](keycodes_us_ansi_shifted.md)|`KC_PERCENT`|percent sign `%`|
|
||||||
|
|[`KC_CIRC`](keycodes_us_ansi_shifted.md)|`KC_CIRCUMFLEX`|circumflex `^`|
|
||||||
|
|[`KC_AMPR`](keycodes_us_ansi_shifted.md)|`KC_AMPERSAND`|ampersand `&`|
|
||||||
|
|[`KC_ASTR`](keycodes_us_ansi_shifted.md)|`KC_ASTERISK`|asterisk `*`|
|
||||||
|
|[`KC_LPRN`](keycodes_us_ansi_shifted.md)|`KC_LEFT_PAREN`|left parenthesis `(`|
|
||||||
|
|[`KC_RPRN`](keycodes_us_ansi_shifted.md)|`KC_RIGHT_PAREN`|right parenthesis `)`|
|
||||||
|
|[`KC_UNDS`](keycodes_us_ansi_shifted.md)|`KC_UNDERSCORE`|underscore `_`|
|
||||||
|
|[`KC_PLUS`](keycodes_us_ansi_shifted.md)||plus sign `+`|
|
||||||
|
|[`KC_LCBR`](keycodes_us_ansi_shifted.md)|`KC_LEFT_CURLY_BRACE`|left curly brace `{`|
|
||||||
|
|[`KC_RCBR`](keycodes_us_ansi_shifted.md)|`KC_RIGHT_CURLY_BRACE`|right curly brace `}`|
|
||||||
|
|[`KC_LT`/`KC_LABK`](keycodes_us_ansi_shifted.md)|`KC_LEFT_ANGLE_BRACKET`|left angle bracket `<`|
|
||||||
|
|[`KC_GT`/`KC_RABK`](keycodes_us_ansi_shifted.md)|`KC_RIGHT_ANGLE_BRACKET`|right angle bracket `>`|
|
||||||
|
|[`KC_COLN`](keycodes_us_ansi_shifted.md)|`KC_COLON`|colon `:`|
|
||||||
|
|[`KC_PIPE`](keycodes_us_ansi_shifted.md)||pipe `\|`|
|
||||||
|
|[`KC_QUES`](keycodes_us_ansi_shifted.md)|`KC_QUESTION`|question mark `?`|
|
||||||
|
|[`KC_DQT`/`KC_DQUO`](keycodes_us_ansi_shifted.md)|`KC_DOUBLE_QUOTE`|double quote `"`|
|
||||||
|
|[`LT(layer, kc)`](feature_common_shortcuts.md#switching-and-toggling-layers)||turn on layer (0-15) when held, kc ([basic keycodes](keycodes_basic.md)) when tapped|
|
||||||
|
|[`TO(layer)`](feature_common_shortcuts.md#switching-and-toggling-layers)||turn on layer when depressed|
|
||||||
|
|[`MO(layer)`](feature_common_shortcuts.md#switching-and-toggling-layers)||momentarily turn on layer when depressed (requires `KC_TRNS` on destination layer)|
|
||||||
|
|[`DF(layer)`](feature_common_shortcuts.md#switching-and-toggling-layers)||sets the base (default) layer|
|
||||||
|
|[`TG(layer)`](feature_common_shortcuts.md#switching-and-toggling-layers)||toggle layer on/off|
|
||||||
|
|[`TT(layer)`](feature_common_shortcuts.md#switching-and-toggling-layers)||tap toggle? idk FIXME`|
|
||||||
|
|[`OSM(mod)`](quantum_keycodes.md#one-shot-keys)||hold mod for one keypress|
|
||||||
|
|[`OSL(layer)`](quantum_keycodes.md#one-shot-keys)||switch to layer for one keypress|
|
||||||
|
|[`UNICODE(n)`](unicode.md)|[`UC(n)`](unicode.md)|if `UNICODE_ENABLE`, this will send characters up to `0x7FFF`|
|
||||||
|
|[`X(n)`](unicode.md)||if `UNICODEMAP_ENABLE`, also sends unicode via a different method|
|
||||||
|
|
192
docs/keycodes_basic.md
Normal file
192
docs/keycodes_basic.md
Normal file
|
@ -0,0 +1,192 @@
|
||||||
|
# Basic keycodes
|
||||||
|
|
||||||
|
Basic keycodes are based on [HID Usage Keyboard/Keypad Page(0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) with following exceptions:
|
||||||
|
|
||||||
|
* `KC_NO` = 0 for no action
|
||||||
|
* `KC_TRNS` = 1 for layer transparency
|
||||||
|
* internal special keycodes in the `0xA5-DF` range (tmk heritage).
|
||||||
|
|
||||||
|
## Letters and Numbers
|
||||||
|
|
||||||
|
|KC_1|KC_2|KC_3|KC_4|KC_5|KC_6|KC_7|KC_8|
|
||||||
|
|----|----|----|----|----|----|----|----|
|
||||||
|
|KC_9|KC_0|KC_F1|KC_F2|KC_F3|KC_F4|KC_F5|KC_F6|
|
||||||
|
|KC_F7|KC_F8|KC_F9|KC_F10|KC_F11|KC_F12|KC_F13|KC_F14|
|
||||||
|
|KC_F15|KC_F16|KC_F17|KC_F18|KC_F19|KC_F20|KC_F21|KC_F22|
|
||||||
|
|KC_F23|KC_F24|KC_A|KC_B|KC_C|KC_D|KC_E|KC_F|
|
||||||
|
|KC_G|KC_H|KC_I|KC_J|KC_K|KC_L|KC_M|KC_N|
|
||||||
|
|KC_O|KC_P|KC_Q|KC_R|KC_S|KC_T|KC_U|KC_V|
|
||||||
|
|KC_W|KC_X|KC_Y|KC_Z|||||
|
||||||
|
|
||||||
|
## Punctuation
|
||||||
|
|
||||||
|
|Long Name|Short Name|Description|
|
||||||
|
|---------|----------|-----------|
|
||||||
|
|KC_ENTER|KC_ENT|`Return (ENTER)`|
|
||||||
|
|KC_ESCAPE|KC_ESC|`ESCAPE`|
|
||||||
|
|KC_BSPACE|KC_BSPC|`DELETE (Backspace)`|
|
||||||
|
|KC_TAB||`Tab`|
|
||||||
|
|KC_SPACE|KC_SPC|Spacebar|
|
||||||
|
|KC_MINUS|KC_MINS|`-` and `_`|
|
||||||
|
|KC_EQUAL|KC_EQL|`=` and `+`|
|
||||||
|
|KC_LBRACKET|KC_LBRC|`[` and `{`|
|
||||||
|
|KC_RBRACKET|KC_RBRC|`]` and `}`|
|
||||||
|
|KC_BSLASH|KC_BSLS|`\` and <code>|</code> |
|
||||||
|
|KC_NONUS_HASH|KC_NUHS|Non-US `#` and `~`|
|
||||||
|
|KC_NONUS_BSLASH|KC_NUBS|Non-US `\` and <code>|</code> |
|
||||||
|
|KC_INT1|KC_RO|JIS `\` and <code>|</code> |
|
||||||
|
|KC_INT2|KC_KANA|International216|
|
||||||
|
|KC_INT3|KC_JYEN|Yen Symbol (`¥`)|
|
||||||
|
|KC_SCOLON|KC_SCLN|`;` and `:`|
|
||||||
|
|KC_QUOTE|KC_QUOT|`‘` and `“`|
|
||||||
|
|KC_GRAVE|KC_GRV|Grave Accent and Tilde|
|
||||||
|
|KC_COMMA|KC_COMM|`,` and `<`|
|
||||||
|
|KC_DOT||`.` and `>`|
|
||||||
|
|KC_SLASH|KC_SLSH|`/` and `?`|
|
||||||
|
|KC_CAPSLOCK|KC_CAPS|Caps Lock|
|
||||||
|
|
||||||
|
## Modifiers
|
||||||
|
|
||||||
|
|Long Name|Short Name|Description|
|
||||||
|
|---------|----------|-----------|
|
||||||
|
|KC_LCTRL|KC_LCTL|LeftControl|
|
||||||
|
|KC_LSHIFT|KC_LSFT|LeftShift|
|
||||||
|
|KC_LALT||LeftAlt|
|
||||||
|
|KC_LGUI||Left GUI(Windows/Apple/Meta key)|
|
||||||
|
|KC_RCTRL|KC_RCTL|RightControl|
|
||||||
|
|KC_RSHIFT|KC_RSFT|RightShift|
|
||||||
|
|KC_RALT||RightAlt|
|
||||||
|
|KC_RGUI||Right GUI(Windows/Apple/Meta key)|
|
||||||
|
|KC_LOCKING_CAPS|KC_LCAP|Locking Caps Lock|
|
||||||
|
|KC_LOCKING_NUM|KC_LNUM|Locking Num Lock|
|
||||||
|
|KC_LOCKING_SCROLL|KC_LSCR|Locking Scroll Lock|
|
||||||
|
|KC_INT4|KC_HENK|JIS Henken|
|
||||||
|
|KC_INT5|KC_MHEN|JIS Muhenken|
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
|Long Name|Short Name|Description|
|
||||||
|
|---------|----------|-----------|
|
||||||
|
|KC_PSCREEN|KC_PSCR|PrintScreen|
|
||||||
|
|KC_SCROLLLOCK|KC_SLCK|Scroll Lock|
|
||||||
|
|KC_PAUSE|KC_PAUS|Pause|
|
||||||
|
|KC_INSERT|KC_INS|Insert|
|
||||||
|
|KC_HOME||Home|
|
||||||
|
|KC_PGUP||PageUp|
|
||||||
|
|KC_DELETE|KC_DEL|Delete Forward|
|
||||||
|
|KC_END||End|
|
||||||
|
|KC_PGDOWN|KC_PGDN|PageDown|
|
||||||
|
|KC_RIGHT|KC_RGHT|RightArrow|
|
||||||
|
|KC_LEFT||LeftArrow|
|
||||||
|
|KC_DOWN||DownArrow|
|
||||||
|
|KC_UP||UpArrow|
|
||||||
|
|KC_APPLICATION|KC_APP|Application|
|
||||||
|
|KC_POWER||Power|
|
||||||
|
|KC_EXECUTE||Execute|
|
||||||
|
|KC_HELP||Help|
|
||||||
|
|KC_MENU||Menu|
|
||||||
|
|KC_SELECT||Select|
|
||||||
|
|KC_AGAIN||Again|
|
||||||
|
|KC_UNDO||Undo|
|
||||||
|
|KC_CUT||Cut|
|
||||||
|
|KC_COPY||Copy|
|
||||||
|
|KC_PASTE||Paste|
|
||||||
|
|KC_FIND||Find|
|
||||||
|
|KC_ALT_ERASE||Alternate Erase|
|
||||||
|
|KC_SYSREQ||SysReq/Attention|
|
||||||
|
|KC_CANCEL||Cancel|
|
||||||
|
|KC_CLEAR||Clear|
|
||||||
|
|KC_PRIOR||Prior|
|
||||||
|
|KC_RETURN||Return|
|
||||||
|
|KC_SEPARATOR||Separator|
|
||||||
|
|KC_OUT||Out|
|
||||||
|
|KC_OPER||Oper|
|
||||||
|
|KC_CLEAR_AGAIN||Clear/Again|
|
||||||
|
|KC_CRSEL||CrSel/Props|
|
||||||
|
|KC_EXSEL||ExSel|
|
||||||
|
|KC_SYSTEM_POWER|KC_PWR|System Power Down|
|
||||||
|
|KC_SYSTEM_SLEEP|KC_SLEP|System Sleep|
|
||||||
|
|KC_SYSTEM_WAKE|KC_WAKE|System Wake|
|
||||||
|
|KC_MAIL|KC_MAIL||
|
||||||
|
|KC_CALCULATOR|KC_CALC||
|
||||||
|
|KC_MY_COMPUTER|KC_MYCM||
|
||||||
|
|KC_WWW_SEARCH|KC_WSCH||
|
||||||
|
|KC_WWW_HOME|KC_WHOM||
|
||||||
|
|KC_WWW_BACK|KC_WBAK||
|
||||||
|
|KC_WWW_FORWARD|KC_WFWD||
|
||||||
|
|KC_WWW_STOP|KC_WSTP||
|
||||||
|
|KC_WWW_REFRESH|KC_WREF||
|
||||||
|
|KC_WWW_FAVORITES|KC_WFAV||
|
||||||
|
|
||||||
|
## Media Keys
|
||||||
|
|
||||||
|
Windows and Mac use different key codes for next track and previous track. Make sure you choose the keycode that corresponds to your OS.
|
||||||
|
|
||||||
|
|Long Name|Short Name|Description|
|
||||||
|
|---------|----------|-----------|
|
||||||
|
|KC_STOP||Stop|
|
||||||
|
|KC__MUTE||Mute|
|
||||||
|
|KC__VOLUP||Volume Up|
|
||||||
|
|KC__VOLDOWN||Volume Down|
|
||||||
|
|KC_AUDIO_MUTE|KC_MUTE||
|
||||||
|
|KC_AUDIO_VOL_UP|KC_VOLU||
|
||||||
|
|KC_AUDIO_VOL_DOWN|KC_VOLD||
|
||||||
|
|KC_MEDIA_NEXT_TRACK|KC_MNXT|Next Track (Windows)|
|
||||||
|
|KC_MEDIA_PREV_TRACK|KC_MPRV|Previous Track (Windows)|
|
||||||
|
|KC_MEDIA_FAST_FORWARD|KC_MFFD|Next Track (macOS)|
|
||||||
|
|KC_MEDIA_REWIND|KC_MRWD|Previous Track (macOS)|
|
||||||
|
|KC_MEDIA_STOP|KC_MSTP||
|
||||||
|
|KC_MEDIA_PLAY_PAUSE|KC_MPLY||
|
||||||
|
|KC_MEDIA_SELECT|KC_MSEL||
|
||||||
|
|
||||||
|
## Numpad
|
||||||
|
|
||||||
|
|Long Name|Short Name|Description|
|
||||||
|
|---------|----------|-----------|
|
||||||
|
|KC_NUMLOCK|KC_NLCK|Keypad Num Lock and Clear|
|
||||||
|
|KC_KP_SLASH|KC_PSLS|Keypad /|
|
||||||
|
|KC_KP_ASTERISK|KC_PAST|Keypad *|
|
||||||
|
|KC_KP_MINUS|KC_PMNS|Keypad -|
|
||||||
|
|KC_KP_PLUS|KC_PPLS|Keypad +|
|
||||||
|
|KC_KP_ENTER|KC_PENT|Keypad ENTER|
|
||||||
|
|KC_KP_1|KC_P1|Keypad 1 and End|
|
||||||
|
|KC_KP_2|KC_P2|Keypad 2 and Down Arrow|
|
||||||
|
|KC_KP_3|KC_P3|Keypad 3 and PageDn|
|
||||||
|
|KC_KP_4|KC_P4|Keypad 4 and Left Arrow|
|
||||||
|
|KC_KP_5|KC_P5|Keypad 5|
|
||||||
|
|KC_KP_6|KC_P6|Keypad 6 and Right Arrow|
|
||||||
|
|KC_KP_7|KC_P7|Keypad 7 and Home|
|
||||||
|
|KC_KP_8|KC_P8|Keypad 8 and Up Arrow|
|
||||||
|
|KC_KP_9|KC_P9|Keypad 9 and PageUp|
|
||||||
|
|KC_KP_0|KC_P0|Keypad 0 and Insert|
|
||||||
|
|KC_KP_DOT|KC_PDOT|Keypad . and Delete|
|
||||||
|
|KC_KP_EQUAL|KC_PEQL|Keypad =|
|
||||||
|
|KC_KP_COMMA|KC_PCMM|Keypad Comma|
|
||||||
|
|KC_KP_EQUAL_AS400||Keypad Equal Sign|
|
||||||
|
|
||||||
|
## Special Keys
|
||||||
|
|
||||||
|
|Long Name|Short Name|Description|
|
||||||
|
|---------|----------|-----------|
|
||||||
|
|KC_NO||Ignore this key. (NOOP) |
|
||||||
|
|
||||||
|
## Mousekey
|
||||||
|
|
||||||
|
|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|Mouse Acceleration 0|
|
||||||
|
|KC_MS_ACCEL1|KC_ACL1|Mouse Acceleration 1|
|
||||||
|
|KC_MS_ACCEL2|KC_ACL2|Mouse Acceleration 2|
|
31
docs/keycodes_us_ansi_shifted.md
Normal file
31
docs/keycodes_us_ansi_shifted.md
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|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 `"`|
|
|
@ -215,8 +215,7 @@ To actually handle the keypress event we define an `action_function()`. This fun
|
||||||
|
|
||||||
This should have given you a basic overview for creating your own keymap. For more details see the following resources:
|
This should have given you a basic overview for creating your own keymap. For more details see the following resources:
|
||||||
|
|
||||||
* https://github.com/qmk/qmk_firmware/wiki/Keycodes
|
* [Keycodes](keycodes.md)
|
||||||
* https://github.com/qmk/qmk_firmware/wiki/FAQ-Keymap
|
* [Keymap FAQ](faq_keymap.md)
|
||||||
* https://github.com/qmk/qmk_firmware/wiki/Keymap-examples
|
|
||||||
|
|
||||||
We are actively working to improve these docs. If you have suggestions for how they could be made better please [file an issue](https://github.com/qmk/qmk_firmware/issues/new)!
|
We are actively working to improve these docs. If you have suggestions for how they could be made better please [file an issue](https://github.com/qmk/qmk_firmware/issues/new)!
|
|
@ -1,37 +0,0 @@
|
||||||
# Share your keymap idea here!
|
|
||||||
https://github.com/tmk/tmk_keyboard/issues/265
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Reverse-shifted for numbers
|
|
||||||
With pressing Shift and '1' key you get **1** while with just '1' key you get **!**.
|
|
||||||
- https://geekhack.org/index.php?topic=41989.msg1959718#msg1959718
|
|
||||||
|
|
||||||
|
|
||||||
## KBT Pure layout
|
|
||||||
Keymap code on Alps64
|
|
||||||
https://github.com/thisisshi/tmk_keyboard/blob/15fe63e8d181a8a95988dcc71929f0024df55caa/keyboard/alps64/keymap_pure.c
|
|
||||||
|
|
||||||
and guide.
|
|
||||||
https://github.com/thisisshi/tmk_keyboard/blob/77ac0805ade565fb23657e3644c920ada71edccf/keyboard/alps64/Guide.md
|
|
||||||
|
|
||||||
## Prevent stuck modifiers
|
|
||||||
|
|
||||||
Consider the following scenario:
|
|
||||||
|
|
||||||
1. Layer 0 has a key defined as Shift.
|
|
||||||
2. The same key is defined on layer 1 as the letter A.
|
|
||||||
3. User presses Shift.
|
|
||||||
4. User switches to layer 1 for whatever reason.
|
|
||||||
5. User releases Shift, or rather the letter A.
|
|
||||||
6. User switches back to layer 0.
|
|
||||||
|
|
||||||
Shift was actually never released and is still considered pressed.
|
|
||||||
|
|
||||||
If such situation bothers you add this to your `config.h`:
|
|
||||||
|
|
||||||
#define PREVENT_STUCK_MODIFIERS
|
|
||||||
|
|
||||||
This option uses 5 bytes of memory per every 8 keys on the keyboard
|
|
||||||
rounded up (5 bits per key). For example on Planck (48 keys) it uses
|
|
||||||
(48/8)\*5 = 30 bytes.
|
|
|
@ -1,685 +0,0 @@
|
||||||
Keymap framework - how to define your keymap
|
|
||||||
============================================
|
|
||||||
***NOTE: This is updated for QMK but this is still work in progress. This may still be inconsistent with the source code.***
|
|
||||||
|
|
||||||
QMK is based on TMK. Understanding the essential changes made should help you understand variable names etc.
|
|
||||||
|
|
||||||
## TMK vs. QMK
|
|
||||||
|
|
||||||
| Firmware |TMK |QMK |
|
|
||||||
|---------------------------|-----------------------|-------------------------|
|
|
||||||
| Maintainer |hasu |Jack Humbert et al. |
|
|
||||||
| Build path customization | `TMK_DIR = ...` | `include .../Makefile` |
|
|
||||||
| `keymaps` data | 3D array of `uint8_t` holding **keycode** | 3D array of `uint16_t` holding **action code** |
|
|
||||||
| `fn_actions` data | 1D array of `uint16_t` holding **action code** | 1D array of `uint16_t` holding **action code** |
|
|
||||||
|
|
||||||
Since QMK is based on TMK and uses major portion of TMK code as is, understanding the essential changes made should help you understand the code.
|
|
||||||
|
|
||||||
## 0. Keymap and layers
|
|
||||||
In QMK, **`const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]`** holds multiple **layers** of keymap information in **16 bit** data holding the **action code**. You can define **32 layers** at most.
|
|
||||||
|
|
||||||
For trivial key definitions, the higher 8 bits of the **action code** are all 0 and the lower 8 bits holds the USB HID usage code generated by the key as **keycode**.
|
|
||||||
|
|
||||||
Respective layers can be validated simultaneously. Layers are indexed with 0 to 31 and higher layer has precedence.
|
|
||||||
|
|
||||||
Keymap: 32 Layers Layer: action code matrix
|
|
||||||
----------------- ---------------------
|
|
||||||
stack of layers array_of_action_code[row][column]
|
|
||||||
____________ precedence _______________________
|
|
||||||
/ / | high / ESC / F1 / F2 / F3 ....
|
|
||||||
31 /___________// | /-----/-----/-----/-----
|
|
||||||
30 /___________// | / TAB / Q / W / E ....
|
|
||||||
29 /___________/ | /-----/-----/-----/-----
|
|
||||||
: _:_:_:_:_:__ | : /LCtrl/ A / S / D ....
|
|
||||||
: / : : : : : / | : / : : : :
|
|
||||||
2 /___________// | 2 `--------------------------
|
|
||||||
1 /___________// | 1 `--------------------------
|
|
||||||
0 /___________/ V low 0 `--------------------------
|
|
||||||
|
|
||||||
|
|
||||||
Sometimes, the action code stored in keymap may be referred as keycode in some documents due to the TMK history.
|
|
||||||
|
|
||||||
### 0.1 Keymap layer status
|
|
||||||
Keymap layer has its state in two 32 bit parameters:
|
|
||||||
|
|
||||||
* **`default_layer_state`** indicates a base keymap layer(0-31) which is always valid and to be referred.
|
|
||||||
* **`layer_state`** () has current on/off status of the layer on its each bit.
|
|
||||||
|
|
||||||
Keymap has its state in two parameter **`default_layer`** indicates a base keymap layer(0-31) which is always valid and to be referred, **`keymap_stat`** is 16bit variable which has current on/off status of layers on its each bit.
|
|
||||||
Keymap layer '0' is usually `default_layer` and which is the only valid layer and other layers is initially off after boot up firmware, though, you can configured them in `config.h`.
|
|
||||||
To change `default_layer` will be useful when you switch key layout completely, say you want Colmak instead of Qwerty.
|
|
||||||
|
|
||||||
Initial state of Keymap Change base layout
|
|
||||||
----------------------- ------------------
|
|
||||||
|
|
||||||
31 31
|
|
||||||
30 30
|
|
||||||
29 29
|
|
||||||
: :
|
|
||||||
: : ____________
|
|
||||||
2 ____________ 2 / /
|
|
||||||
1 / / ,->1 /___________/
|
|
||||||
,->0 /___________/ | 0
|
|
||||||
| |
|
|
||||||
`--- default_layer = 0 `--- default_layer = 1
|
|
||||||
layer_state = 0x00000001 layer_state = 0x00000002
|
|
||||||
|
|
||||||
On the other hand, you shall change `layer_state` to overlay base layer with some layers for feature such as navigation keys, function key(F1-F12), media keys or special actions.
|
|
||||||
|
|
||||||
Overlay feature layer
|
|
||||||
--------------------- bit|status
|
|
||||||
____________ ---+------
|
|
||||||
31 / / 31 | 0
|
|
||||||
30 /___________// -----> 30 | 1
|
|
||||||
29 /___________/ -----> 29 | 1
|
|
||||||
: : | :
|
|
||||||
: ____________ : | :
|
|
||||||
2 / / 2 | 0
|
|
||||||
,->1 /___________/ -----> 1 | 1
|
|
||||||
| 0 0 | 0
|
|
||||||
| +
|
|
||||||
`--- default_layer = 1 |
|
|
||||||
layer_state = 0x60000002 <-'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 0.2 Layer Precedence and Transparency
|
|
||||||
Note that ***higher layer has higher priority on stack of layers***, namely firmware falls down from top layer to bottom to look up keycode. Once it spots keycode other than **`KC_TRNS`**(transparent) on a layer it stops searching and lower layers aren't referred.
|
|
||||||
|
|
||||||
You can place `KC_TRANS` on overlay layer changes just part of layout to fall back on lower or base layer.
|
|
||||||
Key with `KC_TRANS` (`KC_TRNS` and `_______` are the alias) doesn't has its own keycode and refers to lower valid layers for keycode, instead.
|
|
||||||
See example below.
|
|
||||||
|
|
||||||
|
|
||||||
### 0.3 Keymap Example
|
|
||||||
Keymap in this QMK is **`static const uint16_t PROGMEM keymaps[]`** C array in fact and you can define layers in it with **`KEYMAP()`** C macro and keycodes. To use complex actions you need to define `Fn` keycode in **`fn_actions[]`** array. It holds the 16 bit quantum keycode (action code).
|
|
||||||
|
|
||||||
> Please note that keymap in the TMK, which QMK was forked from, is **`static const uint8_t PROGMEM keymaps[]`** C array which holds the 8 bit keycode (~USB HID usage code).
|
|
||||||
|
|
||||||
This is a keymap example for [HHKB](http://en.wikipedia.org/wiki/Happy_Hacking_Keyboard) keyboard.
|
|
||||||
This example has three layers, 'QWERTY' as base layer, 'FN' and 'MOUSE'.
|
|
||||||
|
|
||||||
In this example,
|
|
||||||
|
|
||||||
`MO(layer)` is a **momentary layer switching** key.
|
|
||||||
|
|
||||||
You can find other keymap definitions in file `keymap.c` located on project directories.
|
|
||||||
```
|
|
||||||
/*
|
|
||||||
* dbroqua HHKB Layout
|
|
||||||
*/
|
|
||||||
#include "hhkb.h"
|
|
||||||
|
|
||||||
#define BASE 0
|
|
||||||
#define FN 1
|
|
||||||
#define MOUSE 2
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
||||||
/* BASE Level: Default Layer
|
|
||||||
* ,-----------------------------------------------------------------------------------------.
|
|
||||||
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|
|
||||||
* |-----------------------------------------------------------------------------------------+
|
|
||||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp |
|
|
||||||
* |-----------------------------------------------------------------------------------------+
|
|
||||||
* | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
|
||||||
* |-----------------------------------------------------------------------------------------+
|
|
||||||
* | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | fn |
|
|
||||||
* +-----------------------------------------------------------------------------------------+
|
|
||||||
* | Gui | Alt | Space | AltGr |Mouse|
|
|
||||||
* `----------------------------------------------------------------´
|
|
||||||
*/
|
|
||||||
[BASE] = KEYMAP(
|
|
||||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \
|
|
||||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
|
|
||||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(FN), \
|
|
||||||
KC_LGUI, KC_LALT, /* */ KC_SPC, KC_RALT, MO(MOUSE)
|
|
||||||
),
|
|
||||||
|
|
||||||
/* FN Layer
|
|
||||||
* ,-----------------------------------------------------------------------------------------.
|
|
||||||
* | Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F0 | F11 | F12 | Ins | Del|
|
|
||||||
* |-----------------------------------------------------------------------------------------+
|
|
||||||
* | Caps | | | | | | | |PrtSc| Slck| Paus| Up | | |
|
|
||||||
* |-----------------------------------------------------------------------------------------+
|
|
||||||
* | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left |Right| |
|
|
||||||
* |-----------------------------------------------------------------------------------------+
|
|
||||||
* | | Prev| Play| Next| | | + | - | End |PgDwn| Down| | |
|
|
||||||
* +-----------------------------------------------------------------------------------------+
|
|
||||||
* | | | | Stop | |
|
|
||||||
* `----------------------------------------------------------------´
|
|
||||||
*/
|
|
||||||
[FN] = KEYMAP(
|
|
||||||
KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
|
|
||||||
KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, \
|
|
||||||
KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, \
|
|
||||||
KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \
|
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_TRNS
|
|
||||||
),
|
|
||||||
|
|
||||||
/* MOUSE Layer
|
|
||||||
* ,-----------------------------------------------------------------------------------------.
|
|
||||||
* | | | | | | | | | | | | | | | |
|
|
||||||
* |-----------------------------------------------------------------------------------------+
|
|
||||||
* | | | WUp | | | | | | | | Btn1| Up | Btn2| |
|
|
||||||
* |-----------------------------------------------------------------------------------------+
|
|
||||||
* | | WLt | WDn | WRt | | | | | | | Left |Right| |
|
|
||||||
* |-----------------------------------------------------------------------------------------+
|
|
||||||
* | | | | | | | | | | Btn3| Down| | |
|
|
||||||
* +-----------------------------------------------------------------------------------------+
|
|
||||||
* | | | | | |
|
|
||||||
* `----------------------------------------------------------------´
|
|
||||||
*/
|
|
||||||
[MOUSE] = KEYMAP(
|
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
|
||||||
KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, \
|
|
||||||
KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_R, KC_TRNS, \
|
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_MS_D, KC_TRNS, KC_TRNS, \
|
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
|
||||||
)
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint16_t PROGMEM fn_actions[] = {
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
||||||
{
|
|
||||||
// MACRODOWN only works in this function
|
|
||||||
switch(id) {
|
|
||||||
case 0:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
register_code(KC_RSFT);
|
|
||||||
} else {
|
|
||||||
unregister_code(KC_RSFT);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return MACRO_NONE;
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## 1. Keycode
|
|
||||||
See [`tmk_core/common/keycode.h`](../tmk_core/common/keycode.h) or keycode table below for the detail. Keycode is internal **8bit code** to indicate action performed on key in keymap. Keycodes are based on [HID Usage Keyboard/Keypad Page(0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) plus special codes in the `0xA5-DF` range.
|
|
||||||
|
|
||||||
Keycode has `KC_` prefixed symbol respectively. Most of keycodes like `KC_A` have simple action registers key to host on press and unregister on release, while some of other keycodes has some special actions like `Fn` keys, Media control keys, System control keys and Mousekeys.
|
|
||||||
|
|
||||||
keymaps[]
|
|
||||||
|
|
||||||
In `KEYMAP()` macro, TMK recommends you to keep prefix part `KC_` of keycode to keep keymap compact. For example, just use `A` instead you place `KC_A` in `KEYMAP()`. But this doesn't apply for QMK.
|
|
||||||
|
|
||||||
The `KEYMAP()` macro defines correspondence between the physical key location to the electrical key connection.
|
|
||||||
|
|
||||||
Some keycodes has 7-letter **short name** such as `KC_COMM` in addition to descriptive name `KC_COMMA`, you'll prefer short one in `KEYMAP()`.
|
|
||||||
|
|
||||||
### 1.0 Other key
|
|
||||||
- `KC_NO` for no action
|
|
||||||
- `KC_TRNS` for layer transparency (See above)
|
|
||||||
|
|
||||||
### 1.1 Normal key
|
|
||||||
- `KC_A` to `KC_Z`, `KC_1` to `KC_0` for alpha numeric key
|
|
||||||
- `KC_MINS`, `KC_EQL`, `KC_GRV`, `KC_RBRC`, `KC_LBRC`, `KC_COMM`, `KC_DOT`, `KC_BSLS`, `KC_SLSH`, `KC_SCLN`, `KC_QUOT`
|
|
||||||
- `KC_ESC`, `KC_TAB`, `KC_SPC`, `KC_BSPC`, `KC_ENT`, `KC_DEL`, `KC_INS`
|
|
||||||
- `KC_UP`, `KC_DOWN`, `KC_RGHT`, `KC_LEFT`, `KC_PGUP`, `KC_PGDN`, `KC_HOME`, `KC_END`
|
|
||||||
- `KC_CAPS`, `KC_NLCK`, `KC_SLCK`, `KC_PSCR`, `KC_PAUS`, `KC_APP`, `KC_F1` to `KC_F24`
|
|
||||||
- `KC_P1` to `KC_P0`, `KC_PDOT`, `KC_PCMM`, `KC_PSLS`, `KC_PAST`, `KC_PMNS`, `KC_PPLS`, `KC_PEQL`, `KC_PENT` for keypad.
|
|
||||||
|
|
||||||
### 1.2 Modifier
|
|
||||||
There are 8 modifiers which has discrimination between left and right.
|
|
||||||
|
|
||||||
- `KC_LCTL` and `KC_RCTL` for Control
|
|
||||||
- `KC_LSFT` and `KC_RSFT` for Shift
|
|
||||||
- `KC_LALT` and `KC_RALT` for Alt
|
|
||||||
- `KC_LGUI` and `KC_RGUI` for Windows key or Command key in Mac
|
|
||||||
|
|
||||||
### 1.3 Mousekey
|
|
||||||
- `KC_MS_U`, `KC_MS_D`, `KC_MS_L`, `KC_MS_R` for mouse cursor
|
|
||||||
- `KC_WH_U`, `KC_WH_D`, `KC_WH_L`, `KC_WH_R` for mouse wheel
|
|
||||||
- `KC_BTN1`, `KC_BTN2`, `KC_BTN3`, `KC_BTN4`, `KC_BTN5` for mouse buttons
|
|
||||||
|
|
||||||
### 1.4 System & Media key
|
|
||||||
- `KC_PWR`, `KC_SLEP`, `KC_WAKE` for Power, Sleep, Wake
|
|
||||||
- `KC_MUTE`, `KC_VOLU`, `KC_VOLD` for audio volume control
|
|
||||||
- `KC_MNXT`, `KC_MPRV`, `KC_MSTP`, `KC_MPLY`, `KC_MSEL` for media control
|
|
||||||
- `KC_MAIL`, `KC_CALC`, `KC_MYCM` for application launch
|
|
||||||
- `KC_WSCH`, `KC_WHOM`, `KC_WBAK`, `KC_WFWD`, `KC_WSTP`, `KC_WREF`, `KC_WFAV` for web browser operation
|
|
||||||
|
|
||||||
### 1.5 Fn key
|
|
||||||
You don't need to use this functionality under QMK since this is a backward compatibility functionality. Unlike TMK, you can write action code itself directly in **`static const uint16_t PROGMEM keymaps[]`** C array using `MO(layer)`, etc.
|
|
||||||
|
|
||||||
`KC_FNnn` are keycodes for `Fn` key which not given any actions at the beginning unlike most of keycodes has its own inborn action. To use these keycodes in `KEYMAP()` you need to assign action you want at first. Action of `Fn` key is defined in `fn_actions[]` and its index of the array is identical with number part of `KC_FNnn`. Thus `KC_FN0` keycode indicates the action defined in first element of the array. ***Only 32 `Fn` keys can be defined at most.***
|
|
||||||
|
|
||||||
|
|
||||||
### 1.6 Keycode Table
|
|
||||||
See keycode table in [`doc/keycode.txt`](./keycode.txt) for description of keycodes.
|
|
||||||
|
|
||||||
In regard to implementation side most of keycodes are identical with [HID usage][HID_usage](pdf) sent to host for real and some virtual keycodes are defined to support special actions.
|
|
||||||
[HID_usage]: http://www.usb.org/developers/hidpage/Hut1_12v2.pdf
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 2. Action
|
|
||||||
See [`common/action_code.h`](../common/action_code.h). Action is a **16bit code** and defines function to perform on events of a key like press, release, holding and tapping.
|
|
||||||
|
|
||||||
Most of keys just register 8bit scancode to host, but to support other complex features needs 16bit extended action codes internally. However, using 16bit action codes in keymap results in double size in memory compared to using just keycodes. To avoid this waste 8bit keycodes are used in `KEYMAP()` instead of action codes.
|
|
||||||
|
|
||||||
***You can just use keycodes of `Normal key`, `Modifier`, `Mousekey` and `System & Media key` in keymap*** to indicate corresponding actions instead of using action codes. While ***to use other special actions you should use keycode of `Fn` key defined in `fn_actions[]`.***
|
|
||||||
|
|
||||||
|
|
||||||
### 2.1 Key Action
|
|
||||||
This is a simple action that registers scancodes(HID usage in fact) to host on press event of key and unregister on release.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
+ **mods**: { ` MOD_LCTL`, ` MOD_LSFT`, ` MOD_LALT`, ` MOD_LGUI`,
|
|
||||||
` MOD_RCTL`, ` MOD_RSFT`, ` MOD_RALT`, ` MOD_RGUI` }
|
|
||||||
+ **key**: keycode
|
|
||||||
|
|
||||||
|
|
||||||
#### 2.1.1 Normal key and Modifier
|
|
||||||
***This action usually won't be used expressly in keymap*** because you can just use keycodes in `KEYMAP()` instead.
|
|
||||||
|
|
||||||
You can define these actions on *'A'* key and *'left shift'* modifier with:
|
|
||||||
|
|
||||||
ACTION_KEY(KC_A)
|
|
||||||
ACTION_KEY(KC_LSFT)
|
|
||||||
|
|
||||||
#### 2.1.2 Modified key
|
|
||||||
This action is comprised of strokes of modifiers and a key. `Macro` action is needed if you want more complex key strokes.
|
|
||||||
|
|
||||||
Say you want to assign a key to `Shift + 1` to get character *'!'* or `Alt + Tab` to switch application windows.
|
|
||||||
|
|
||||||
ACTION_MODS_KEY(MOD_LSFT, KC_1)
|
|
||||||
ACTION_MODS_KEY(MOD_LALT, KC_TAB)
|
|
||||||
|
|
||||||
Or `Alt,Shift + Tab` can be defined. `ACTION_MODS_KEY(mods, key)` requires **4-bit modifier state** and a **keycode** as arguments. See `keycode.h` for `MOD_BIT()` macro.
|
|
||||||
|
|
||||||
ACTION_MODS_KEY(MOD_LALT | MOD_LSFT, KC_TAB)
|
|
||||||
|
|
||||||
#### 2.1.3 Multiple Modifiers
|
|
||||||
Registers multiple modifiers with pressing a key. To specify multiple modifiers use `|`.
|
|
||||||
|
|
||||||
ACTION_MODS(MOD_ALT | MOD_LSFT)
|
|
||||||
|
|
||||||
#### 2.1.3 Modifier with Tap key([Dual role][dual_role])
|
|
||||||
Works as a modifier key while holding, but registers a key on tap(press and release quickly).
|
|
||||||
|
|
||||||
|
|
||||||
ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENT)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 2.2 Layer Action
|
|
||||||
These actions operate layers of keymap.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
You can specify a **target layer** of action and **when the action is executed**. Some actions take a **bit value** for bitwise operation.
|
|
||||||
|
|
||||||
|
|
||||||
+ **layer**: `0`-`31`
|
|
||||||
+ **on**: { `ON_PRESS` | `ON_RELEASE` | `ON_BOTH` }
|
|
||||||
+ **bits**: 4-bit value and 1-bit mask bit
|
|
||||||
|
|
||||||
|
|
||||||
#### 2.2.1 Default Layer
|
|
||||||
Default Layer is a layer which always is valid and referred to when actions is not defined on other overlay layers.
|
|
||||||
|
|
||||||
This sets Default Layer to given parameter `layer` and activate it.
|
|
||||||
|
|
||||||
ACTION_DEFAULT_LAYER_SET(layer)
|
|
||||||
|
|
||||||
|
|
||||||
#### 2.2.2 Momentary
|
|
||||||
Turns on `layer` momentarily while holding, in other words it activates when key is pressed and deactivate when released.
|
|
||||||
|
|
||||||
ACTION_LAYER_MOMENTARY(layer)
|
|
||||||
|
|
||||||
|
|
||||||
#### 2.2.3 Toggle Switch
|
|
||||||
Turns on `layer` with first type(press and release) and turns off with next.
|
|
||||||
|
|
||||||
ACTION_LAYER_TOGGLE(layer)
|
|
||||||
|
|
||||||
|
|
||||||
#### 2.2.4 Momentary Switch with tap key
|
|
||||||
Turns on `layer` momentary while holding, but registers key on tap(press and release quickly).
|
|
||||||
|
|
||||||
ACTION_LAYER_TAP_KEY(layer, key)
|
|
||||||
|
|
||||||
|
|
||||||
#### 2.2.5 Momentary Switch with tap toggle
|
|
||||||
Turns on `layer` momentary while holding and toggles it with serial taps.
|
|
||||||
|
|
||||||
ACTION_LAYER_TAP_TOGGLE(layer)
|
|
||||||
|
|
||||||
|
|
||||||
#### 2.2.6 Invert state of layer
|
|
||||||
Inverts current state of `layer`. If the layer is on it becomes off with this action.
|
|
||||||
|
|
||||||
ACTION_LAYER_INVERT(layer, on)
|
|
||||||
|
|
||||||
|
|
||||||
#### 2.2.7 Turn On layer
|
|
||||||
Turns on layer state.
|
|
||||||
|
|
||||||
ACTION_LAYER_ON(layer, on)
|
|
||||||
|
|
||||||
Turns on layer state on press and turns off on release.
|
|
||||||
|
|
||||||
ACTION_LAYER_ON_OFF(layer)
|
|
||||||
|
|
||||||
|
|
||||||
#### 2.2.8 Turn Off layer
|
|
||||||
Turns off layer state.
|
|
||||||
|
|
||||||
ACTION_LAYER_OFF(layer, on)
|
|
||||||
|
|
||||||
Turns off layer state on press and activates on release.
|
|
||||||
|
|
||||||
ACTION_LAYER_OFF_ON(layer)
|
|
||||||
|
|
||||||
|
|
||||||
#### 2.2.9 Set layer
|
|
||||||
Turn on layer only.
|
|
||||||
`layer_state = (1<<layer) [layer: 0-31]`
|
|
||||||
|
|
||||||
ACTION_LAYER_SET(layer, on)
|
|
||||||
|
|
||||||
Turns on layer only and clear all layer on release..
|
|
||||||
|
|
||||||
ACTION_LAYER_SET_CLEAR(layer)
|
|
||||||
|
|
||||||
|
|
||||||
#### 2.2.10 Bitwise operation
|
|
||||||
|
|
||||||
**part** indicates which part of 32bit layer state(0-7). **bits** is 5-bit value. **on** indicates when the action is executed.
|
|
||||||
|
|
||||||
ACTION_LAYER_BIT_AND(part, bits, on)
|
|
||||||
ACTION_LAYER_BIT_OR(part, bits, on)
|
|
||||||
ACTION_LAYER_BIT_XOR(part, bits, on)
|
|
||||||
ACTION_LAYER_BIT_SET(part, bits, on)
|
|
||||||
|
|
||||||
These actions works with parameters as following code.
|
|
||||||
|
|
||||||
uint8_t shift = part*4;
|
|
||||||
uint32_t mask = (bits&0x10) ? ~(0xf<<shift) : 0;
|
|
||||||
uint32_t layer_state = layer_state <bitop> ((bits<<shift)|mask);
|
|
||||||
|
|
||||||
|
|
||||||
Default Layer also has bitwise operations, they are executed when key is released.
|
|
||||||
|
|
||||||
ACTION_DEFAULT_LAYER_BIT_AND(part, bits)
|
|
||||||
ACTION_DEFAULT_LAYER_BIT_OR(part, bits)
|
|
||||||
ACTION_DEFAULT_LAYER_BIT_XOR(part, bits)
|
|
||||||
ACTION_DEFAULT_LAYER_BIT_SET(part, bits)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 2.3 Macro action
|
|
||||||
***TBD***
|
|
||||||
|
|
||||||
`Macro` action indicates complex key strokes.
|
|
||||||
|
|
||||||
MACRO( D(LSHIFT), D(D), END )
|
|
||||||
MACRO( U(D), U(LSHIFT), END )
|
|
||||||
MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END )
|
|
||||||
|
|
||||||
#### 2.3.1 Macro Commands
|
|
||||||
- **I()** change interval of stroke.
|
|
||||||
- **D()** press key
|
|
||||||
- **U()** release key
|
|
||||||
- **T()** type key(press and release)
|
|
||||||
- **W()** wait
|
|
||||||
- **END** end mark
|
|
||||||
|
|
||||||
#### 2.3.2 Examples
|
|
||||||
|
|
||||||
***TODO: sample implementation***
|
|
||||||
See `keyboards/hhkb/keymap.c` for sample.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 2.4 Function action
|
|
||||||
***TBD***
|
|
||||||
|
|
||||||
There are two type of action, normal `Function` and tappable `Function`.
|
|
||||||
These actions call user defined function with `id`, `opt`, and key event information as arguments.
|
|
||||||
|
|
||||||
#### 2.4.1 Function
|
|
||||||
To define normal `Function` action in keymap use this.
|
|
||||||
|
|
||||||
ACTION_FUNCTION(id, opt)
|
|
||||||
|
|
||||||
#### 2.4.2 Function with tap
|
|
||||||
To define tappable `Function` action in keymap use this.
|
|
||||||
|
|
||||||
ACTION_FUNCTION_TAP(id, opt)
|
|
||||||
|
|
||||||
#### 2.4.3 Implement user function
|
|
||||||
`Function` actions can be defined freely with C by user in callback function:
|
|
||||||
|
|
||||||
void keymap_call_function(keyrecord_t *event, uint8_t id, uint8_t opt)
|
|
||||||
|
|
||||||
This C function is called every time key is operated, argument `id` selects action to be performed and `opt` can be used for option. Function `id` can be 0-255 and `opt` can be 0-15.
|
|
||||||
|
|
||||||
`keyrecord_t` is comprised of key event and tap count. `keyevent_t` indicates which and when key is pressed or released. From `tap_count` you can know tap state, 0 means no tap. These information will be used in user function to decide how action of key is performed.
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
keyevent_t event;
|
|
||||||
uint8_t tap_count;
|
|
||||||
} keyrecord_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
key_t key;
|
|
||||||
bool pressed;
|
|
||||||
uint16_t time;
|
|
||||||
} keyevent_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint8_t col;
|
|
||||||
uint8_t row;
|
|
||||||
} key_t;
|
|
||||||
|
|
||||||
***TODO: sample implementation***
|
|
||||||
See `keyboards/hhkb/keymap.c` for sample.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 2.5 Backlight Action
|
|
||||||
These actions control the backlight.
|
|
||||||
|
|
||||||
#### 2.5.1 Change backlight level
|
|
||||||
Increase backlight level.
|
|
||||||
|
|
||||||
ACTION_BACKLIGHT_INCREASE()
|
|
||||||
|
|
||||||
Decrease backlight level.
|
|
||||||
|
|
||||||
ACTION_BACKLIGHT_DECREASE()
|
|
||||||
|
|
||||||
Step through backlight levels.
|
|
||||||
|
|
||||||
ACTION_BACKLIGHT_STEP()
|
|
||||||
|
|
||||||
Turn a specific backlight level on or off.
|
|
||||||
|
|
||||||
ACTION_BACKLIGHT_LEVEL(1)
|
|
||||||
|
|
||||||
#### 2.5.2 Turn on / off backlight
|
|
||||||
Turn the backlight on and off without changing level.
|
|
||||||
|
|
||||||
ACTION_BACKLIGHT_TOGGLE()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 2.6 Swap-Hands Action
|
|
||||||
The swap-hands action allows support for one-handed keyboards without requiring a separate layer. Set `ONEHAND_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`
|
|
||||||
|
|
||||||
### 2.6.1 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:
|
|
||||||
|
|
||||||
```
|
|
||||||
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).
|
|
||||||
|
|
||||||
### 2.6.2 Advanced Swap Commands
|
|
||||||
- **`ACTION_SWAP_HANDS()`** Swaps hands when pressed, returns to normal when released (momentary).
|
|
||||||
- **`ACTION_SWAP_HANDS_TOGGLE()`** Toggles swap on and off with every keypress.
|
|
||||||
- **`ACTION_SWAP_HANDS_TAP_TOGGLE()`** Toggles with a tap; momentary when held.
|
|
||||||
- **`ACTION_SWAP_HANDS_TAP_KEY(key)`** Sends `key` with a tap; momentary swap when held.
|
|
||||||
- **`ACTION_SWAP_HANDS_ON_OFF()`** Alias for `ACTION_SWAP_HANDS()`
|
|
||||||
- **`ACTION_SWAP_HANDS_OFF_ON()`** Momentarily turns off swap.
|
|
||||||
- **`ACTION_SWAP_HANDS_ON()`** Turns on swapping and leaves it on.
|
|
||||||
- **`ACTION_SWAP_HANDS_OFF()`** Turn off swapping and leaves it off. Good for returning to a known state.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 3. Layer switching Example
|
|
||||||
There are some ways to switch layer with 'Layer' actions.
|
|
||||||
|
|
||||||
### 3.1 Momentary switching
|
|
||||||
Momentary switching changes layer only while holding Fn key.
|
|
||||||
|
|
||||||
This action makes 'Layer 1' active(valid) on key press event and inactive on release event. Namely you can overlay a layer on lower layers or default layer temporarily with this action.
|
|
||||||
|
|
||||||
ACTION_LAYER_MOMENTARY(1)
|
|
||||||
|
|
||||||
|
|
||||||
Note that after switching on press the actions on destination layer(Layer 1) are performed.
|
|
||||||
***Thus you shall need to place an action to go back on destination layer***, or you will be stuck in destination layer without way to get back. Usually you need to place same action or 'KC_TRNS` on destination layer to get back.
|
|
||||||
|
|
||||||
|
|
||||||
### 3.2 Toggle switching
|
|
||||||
Toggle switching performed after releasing a key. With this action you can keep staying on the destination layer until you type the key again to return.
|
|
||||||
|
|
||||||
This performs toggle switching action of 'Layer 2'.
|
|
||||||
|
|
||||||
ACTION_LAYER_TOGGLE(2)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 3.3 Momentary switching with Tap key
|
|
||||||
These actions switch a layer only while holding a key but register the key on tap. **Tap** means to press and release a key quickly.
|
|
||||||
|
|
||||||
ACTION_LAYER_TAP_KEY(2, KC_SCLN)
|
|
||||||
|
|
||||||
With this you can place a layer switching action on normal key like ';' without losing its original key register function. This action allows you to have layer switching action without necessity of a dedicated key. It means you can have it even on home row of keyboard.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 3.4 Momentary switching with Tap Toggle
|
|
||||||
This switches layer only while holding a key but toggle layer with several taps. **Tap** means to press and release key quickly.
|
|
||||||
|
|
||||||
ACTION_LAYER_TAP_TOGGLE(1)
|
|
||||||
|
|
||||||
Number of taps can be configured with `TAPPING_TOGGLE` in `config.h`, `5` by default.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 3.5 Momentary switching with Modifiers
|
|
||||||
This registers modifier key(s) simultaneously with layer switching.
|
|
||||||
|
|
||||||
ACTION_LAYER_MODS(2, MOD_LSFT | MOD_LALT)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 4. Tapping
|
|
||||||
Tapping is to press and release a key quickly. Tapping speed is determined with setting of `TAPPING_TERM`, which can be defined in `config.h`, 200ms by default.
|
|
||||||
|
|
||||||
### 4.1 Tap Key
|
|
||||||
This is a feature to assign normal key action and modifier including layer switching to just same one physical key. This is a kind of [Dual role key][dual_role]. It works as modifier when holding the key but registers normal key when tapping.
|
|
||||||
|
|
||||||
Modifier with tap key:
|
|
||||||
|
|
||||||
ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRV)
|
|
||||||
|
|
||||||
Layer switching with tap key:
|
|
||||||
|
|
||||||
ACTION_LAYER_TAP_KEY(2, KC_SCLN)
|
|
||||||
|
|
||||||
[dual_role]: http://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys
|
|
||||||
|
|
||||||
When user hold a key after tap, it repeat the tapped key rather to hold a modifier key.
|
|
||||||
If you prefer to hold a modifier instead, define `TAPPING_FORCE_HOLD` in `config.h`.
|
|
||||||
See https://github.com/qmk/qmk_firmware/issues/889 for the detail.
|
|
||||||
|
|
||||||
### 4.2 Tap Toggle
|
|
||||||
This is a feature to assign both toggle layer and momentary switch layer action to just same one physical key. It works as momentary layer switch when holding a key but toggle switch with several taps.
|
|
||||||
|
|
||||||
ACTION_LAYER_TAP_TOGGLE(1)
|
|
||||||
|
|
||||||
|
|
||||||
### 4.3 Oneshot Modifier
|
|
||||||
This runs onetime effects which modify only on just one following key. It works as normal modifier key when holding down while oneshot modifier when tapping. The behavior of oneshot modifiers is similar to the [sticky keys](https://en.wikipedia.org/wiki/StickyKeys) functionality found in most operating systems.
|
|
||||||
|
|
||||||
ACTION_MODS_ONESHOT(MOD_LSFT)
|
|
||||||
|
|
||||||
Oneshot layer key:
|
|
||||||
|
|
||||||
ACTION_LAYER_ONESHOT(MY_LAYER)
|
|
||||||
|
|
||||||
Say you want to type 'The', you have to push and hold Shift key before type 't' then release it before type 'h' and 'e', otherwise you'll get 'THe' or 'the' unintentionally. With Oneshot Modifier you can tap Shift then type 't', 'h' and 'e' normally, you don't need to holding Shift key properly here. This mean you can release Shift before 't' is pressed down.
|
|
||||||
|
|
||||||
Oneshot effect is cancel unless following key is pressed down within `ONESHOT_TIMEOUT` of `config.h`. No timeout when it is `0` or not defined.
|
|
||||||
|
|
||||||
Most implementations of sticky keys allow you to lock a modifier by double tapping the modifier. The layer then remains locked untill the modifier is tapped again. To enable this behaviour for oneshot modifiers set `ONESHOT_TAP_TOGGLE` to the number taps required. The feature is disabled if `ONESHOT_TAP_TOGGLE<2` or not defined.
|
|
||||||
|
|
||||||
|
|
||||||
### 4.4 Tap Toggle Mods
|
|
||||||
Similar to layer tap toggle, this works as a momentary modifier when holding, but toggles on with several taps. A single tap will 'unstick' the modifier again.
|
|
||||||
|
|
||||||
ACTION_MODS_TAP_TOGGLE(MOD_LSFT)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 5. Legacy Keymap
|
|
||||||
In QMK, `tmk_core/common/keymap.c` is missing and its replacement `quantum/keymap_common.c` lacks Legacy Keymap support.
|
|
||||||
|
|
||||||
Legacy Keymap uses two arrays `fn_layer[]` and `fn_keycode[]` to define Fn key. The index of arrays corresponds with postfix number of `Fn` key. Array `fn_layer[]` indicates destination layer to switch and `fn_keycode[]` has keycodes to send when tapping `Fn` key.
|
|
||||||
|
|
||||||
In the following legacy keymap setting example, `Fn0`, `Fn1` and `Fn2` switch layer to 1, 2 and 2 respectively. `Fn2` registers `Space` key when tapping while `Fn0` and `Fn1` doesn't send any key.
|
|
||||||
|
|
||||||
static const uint8_t PROGMEM fn_layer[] = {
|
|
||||||
1, // Fn0
|
|
||||||
2, // Fn1
|
|
||||||
2, // Fn2
|
|
||||||
};
|
|
||||||
|
|
||||||
static const uint8_t PROGMEM fn_keycode[] = {
|
|
||||||
KC_NO, // Fn0
|
|
||||||
KC_NO, // Fn1
|
|
||||||
KC_SPC, // Fn2
|
|
||||||
};
|
|
||||||
|
|
||||||
Under QMK, these can be realized using action code ACTION_LAYER_TAP_KEY(1, KC_NO), ACTION_LAYER_TAP_KEY(2, KC_NO), and ACTION_LAYER_TAP_KEY(2, KC_SPC) in the `keymaps` directly.
|
|
||||||
|
|
||||||
## 6. Terminology
|
|
||||||
***TBD***
|
|
||||||
### keymap
|
|
||||||
is comprised of multiple layers.
|
|
||||||
### layer
|
|
||||||
is matrix of keycodes.
|
|
||||||
### key
|
|
||||||
is physical button on keyboard or logical switch on software.
|
|
||||||
### keycode
|
|
||||||
is codes used on firmware.
|
|
||||||
### action
|
|
||||||
is a function assigned on a key.
|
|
||||||
### layer transparency
|
|
||||||
Using transparent keycode one layer can refer key definition on other lower layer.
|
|
||||||
### layer precedence
|
|
||||||
Top layer has higher precedence than lower layers.
|
|
||||||
### tapping
|
|
||||||
is to press and release a key quickly.
|
|
||||||
### Fn key
|
|
||||||
is key which executes a special action like layer switching, mouse key, macro or etc.
|
|
||||||
### dual role key
|
|
||||||
<http://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys>
|
|
|
@ -1,29 +0,0 @@
|
||||||
== KLL vs TMK
|
|
||||||
1. **Shift** = Memontary
|
|
||||||
1. Latch = One shot
|
|
||||||
1. Lock = Toggle
|
|
||||||
|
|
||||||
## KLL terminology
|
|
||||||
### Fall-through
|
|
||||||
When a key is undefined on a particular layer, the key
|
|
||||||
definition on the previously stacked layer will be used. Eventually
|
|
||||||
the key definition will be set to using the default layer. If the None
|
|
||||||
keyword is used, then the fall-through will stop and no action will
|
|
||||||
take place.
|
|
||||||
###Latch
|
|
||||||
When referring to keyboards, a key function that is only enabled
|
|
||||||
until the release of the next keypress.
|
|
||||||
###Lock
|
|
||||||
When referring to keyboards, a key function that is enabled until
|
|
||||||
that key is pressed again (e.g. Caps Lock).
|
|
||||||
### NKRO
|
|
||||||
N-Key Rollover is the capability to press N number of keys at the
|
|
||||||
same time on a keyboard and have them all register on the OS simultaneously.
|
|
||||||
### Scan Code
|
|
||||||
Row x Column code or native protocol code used by the keyboard.
|
|
||||||
### Shift
|
|
||||||
When referring to keyboards, a key function that is enabled while
|
|
||||||
that key is held.
|
|
||||||
### USB Code
|
|
||||||
Keyboard Press/Release codes as defined by the USB HID
|
|
||||||
Spec.
|
|
|
@ -1,38 +0,0 @@
|
||||||
# Overview
|
|
||||||
|
|
||||||
As raised in #1038 and other issues, the licensing status of QMK is not clear. In an effort to remove ambiguity and to clarify the licensing status of the quantum code we are identifying the providence of our source code files and clarifying what license applies to each one.
|
|
||||||
|
|
||||||
# Signoff
|
|
||||||
|
|
||||||
This section documents the people who need to sign off on applying the GPL to one or more of their contributions. If your name appears below and you consent to applying the GPL to your contributions, please put today's date in the last field of your row. Please stick to the following date format: 2017 Jan 28
|
|
||||||
|
|
||||||
Username | Files | Sign Off Date |
|
|
||||||
---------|-------|---------------|
|
|
||||||
@0xdec | quantum/rgblight.c | 2017 Jan 29 |
|
|
||||||
@algernon | quantum/quantum.c<br>quantum/quantum.h<br>quantum/process_keycode/process_tap_dance.c<br>quantum/process_keycode/process_tap_dance.h<br>quantum/process_keycode/process_unicode.c<br>quantum/process_keycode/process_unicode.h | 2017 Jan 29 |
|
|
||||||
@cdlm | quantum/template/template.c<br>quantum/template/template.h | 2017 Feb 03 |
|
|
||||||
@DidierLoiseau | quantum/keymap_extras/keymap_canadian_multilingual.h<br>quantum/keymap_extras/keymap_bepo.h |2017 Jan 29 |
|
|
||||||
@eltang | quantum/config_common.h<br>quantum/matrix.c<br>quantum/quantum.c<br>quantum/quantum.h<br>quantum/rgblight.c<br>quantum/rgblight.h<br>quantum/template/config.h | 2017 Feb 28 |
|
|
||||||
@ezuk | quantum/matrix.c<br>quantum/quantum.c<br>quantum/quantum.h<br>quantum/quantum_keycodes.h<br>quantum/rgblight.c<br>quantum/rgblight.h<br>quantum/keymap_extras/keymap_colemak.h<br>quantum/keymap_extras/keymap_nordic.h | 2017 Jan 31 |
|
|
||||||
@fredizzimo | quantum/config_common.h<br>quantum/keycode_config.h<br>quantum/keymap.h<br>quantum/keymap_common.c<br>quantum/keymap_common.c<br>quantum/matrix.c<br>quantum/quantum.h<br>quantum/rgblight.c<br>quantum/rgblight.h<br>quantum/api/api_sysex.c | 2017 Jan 29 |
|
|
||||||
@h-youhei | quantum/keymap_extras/keymap_jp.h | 2017 Jan 28 |
|
|
||||||
@heartsekai | quantum/keymap_extras/keymap_german_ch.h | 2017 Jan 29 |
|
|
||||||
@IBnobody | quantum/keycode_config.h<br>quantum/matrix.c<br>quantum/quantum.c<br>quantum/audio/audio.c<br>quantum/audio/audio.h<br>quantum/audio/audio_pwm.c<br>quantum/audio/audio_pwm.c<br>quantum/audio/voices.c<br>quantum/audio/voices.h<br>quantum/template/config.h<br>quantum/template/template.c | 2017 Jan 30 |
|
|
||||||
@jackhumbert | quantum/config_common.h<br>quantum/keycode_config.h<br>quantum/keymap.h<br>quantum/keymap_common.c<br>quantum/light_ws2812.c<br>quantum/light_ws2812.h<br>quantum/matrix.c<br>quantum/quantum.c<br>quantum/quantum.h<br>quantum/quantum_keycodes.h<br>quantum/rgblight.c<br>quantum/rgblight.h<br>quantum/api/api_sysex.c<br>quantum/audio/audio.c<br>quantum/audio/audio.h<br>quantum/audio/audio_pwm.c<br>quantum/audio/audio_pwm.c<br>quantum/audio/voices.c<br>quantum/audio/voices.h<br>quantum/keymap_extras/keymap_colemak.h<br>quantum/keymap_extras/keymap_dvorak.h<br>quantum/keymap_extras/keymap_fr_ch.h<br>quantum/keymap_extras/keymap_french.h<br>quantum/keymap_extras/keymap_french_osx.h<br>quantum/keymap_extras/keymap_german.h<br>quantum/keymap_extras/keymap_german_ch.h<br>quantum/keymap_extras/keymap_german_osx.h<br>quantum/keymap_extras/keymap_neo2.h<br>quantum/keymap_extras/keymap_nordic.h<br>quantum/keymap_extras/keymap_plover.h<br>quantum/keymap_extras/keymap_spanish.h<br>quantum/keymap_extras/keymap_uk.h<br>quantum/process_keycode/process_midi.c<br>quantum/process_keycode/process_music.c<br>quantum/process_keycode/process_tap_dance.c<br>quantum/process_keycode/process_tap_dance.h<br>quantum/process_keycode/process_unicode.c<br>quantum/process_keycode/process_unicode.h<br>quantum/template/config.h<br>quantum/template/template.c<br>quantum/template/template.h | 2017-01-29 |
|
|
||||||
@jakllsch | quantum/keymap_extras/keymap_dvorak.h<br>quantum/keymap_extras/keymap_fr_ch.h<br>quantum/keymap_extras/keymap_french.h<br>quantum/keymap_extras/keymap_german.h<br>quantum/keymap_extras/keymap_german_ch.h<br>quantum/keymap_extras/keymap_nordic.h<br>quantum/keymap_extras/keymap_spanish.h<br>quantum/keymap_extras/keymap_uk.h | 2017 Jan 29 |
|
|
||||||
kuel | quantum/keymap_extras/keymap_unicode_cyrillic.h<br>quantum/keymap_extras/keymap_russian.h | |
|
|
||||||
@lindhe | quantum/keymap_extras/keymap_nordic.h<br>quantum/keymap_extras/keymap_norwegian.h | 2017 Jan 30 |
|
|
||||||
@matzebond | quantum/keymap_extras/keymap_german.h<br>quantum/keymap_extras/keymap_neo2.h | 2017 Jan 30 |
|
|
||||||
@plgruener | quantum/keymap_extras/keymap_german.h<br>quantum/keymap_extras/keymap_neo2.h | 2017 Jan 30 |
|
|
||||||
@priyadi | quantum/quantum.c<br>quantum/process_keycode/process_unicode.c<br>quantum/process_keycode/process_unicode.h | 2017 Jan 31 |
|
|
||||||
@pvinis | quantum/quantum.c<br>quantum/quantum.h<br>quantum/process_keycode/process_tap_dance.c<br>quantum/process_keycode/process_tap_dance.h | 2017 Jan 29 |
|
|
||||||
@Smilliam | quantum/quantum.c | 2017 Feb 25 |
|
|
||||||
@sperochon | quantum/keymap_extras/keymap_french_osx.h | 2017 Jan 30 |
|
|
||||||
stephan . bosebeck at holidayinsider.com | quantum/keymap_extras/keymap_german_osx.h | 2017 Feb 15 |
|
|
||||||
@TerryMathews | quantum/quantum.c | 2017 Jan 29 |
|
|
||||||
@Twey | quantum/keymap_extras/keymap_plover.h | |
|
|
||||||
@Vifon | quantum/dynamic_macro.h<br>quantum/quantum.c | 2017 Feb 09 |
|
|
||||||
@vincent-pochet | quantum/keymap_extras/keymap_fr_ch.h | 2017 Feb 09 |
|
|
||||||
@wez | quantum/dynamic_macro.h | 2017 Jan 29 |
|
|
||||||
@Wilba6582 | quantum/keymap.h<br>quantum/keymap_common.c<br>quantum/quantum_keycodes.h | 2017 Feb 15 |
|
|
||||||
@yangliu | quantum/light_ws2812.c<br>quantum/light_ws2812.h<br>quantum/rgblight.c<br>quantum/rgblight.h | 2017 Jan 30 |
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,8 +1,10 @@
|
||||||
# Macros - Send multiple keystrokes when pressing just one key
|
# Macros
|
||||||
|
|
||||||
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.
|
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.
|
**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 %}
|
||||||
|
|
||||||
# Macro Definitions
|
# Macro Definitions
|
||||||
|
|
||||||
|
@ -22,7 +24,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
This defines two macros which will be run when the key they are assigned to is pressed. If you'd like them to run when the release is released instead you can change the if statement:
|
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:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
if (!record->event.pressed) {
|
if (!record->event.pressed) {
|
||||||
|
@ -41,7 +43,7 @@ A macro can include the following commands:
|
||||||
|
|
||||||
## Sending strings
|
## Sending strings
|
||||||
|
|
||||||
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 instead of having to build a `MACRO()`. Right now it assumes a US keymap with a QWERTY layout, so if you are using something else it may not behave as you expect.
|
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 instead of having to build a `MACRO()`.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
|
@ -58,6 +60,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
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>
|
||||||
|
```
|
||||||
|
|
||||||
## Mapping a Macro to a key
|
## 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:
|
Use the `M()` function within your `KEYMAP()` to call a macro. For example, here is the keymap for a 2-key keyboard:
|
||||||
|
@ -135,7 +143,7 @@ This will clear all mods currently pressed.
|
||||||
|
|
||||||
This will clear all keys besides the mods currently pressed.
|
This will clear all keys besides the mods currently pressed.
|
||||||
|
|
||||||
# Advanced Example: Single-key copy/paste (hold to copy, tap to paste)
|
# Advanced Example: Single-key copy/paste
|
||||||
|
|
||||||
This example defines a macro which sends `Ctrl-C` when pressed down, and `Ctrl-V` when released.
|
This example defines a macro which sends `Ctrl-C` when pressed down, and `Ctrl-V` when released.
|
||||||
|
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
## supported projects
|
|
||||||
### PS/2 converter
|
|
||||||
Confirmed it works on NXP LPC11U35.
|
|
||||||
- http://developer.mbed.org/platforms/TG-LPC11U35-501/
|
|
||||||
|
|
||||||
### Infinity keyboard
|
|
||||||
It runs on Freescale MK20DX128.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## compile error: cstddef
|
|
||||||
Experienced this with arm-none-eabi-gcc (4.8.2-14ubuntu1+6) 4.8.2 on ubuntu 14.04.
|
|
||||||
|
|
||||||
And resolved with 4.9.3 installed from:
|
|
||||||
- https://launchpad.net/gcc-arm-embedded
|
|
||||||
- https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded
|
|
||||||
|
|
||||||
```
|
|
||||||
$ make -f Makefile.mbed
|
|
||||||
mkdir -p build/.
|
|
||||||
arm-none-eabi-g++ -include config_mbed.h -mcpu=cortex-m0 -mthumb -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer -fshort-wchar -fno-builtin -MMD -MP -DNDEBUG -Os -DTARGET_LPC11U35_401 -DTARGET_M0 -DTARGET_NXP -DTARGET_LPC11UXX -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -D__CORTEX_M0 -DARM_MATH_CM0 -DMBED_BUILD_TIMESTAMP=1399108688.49 -D__MBED__=1 -std=gnu++98 -I. -I../../mbed-sdk/libraries/mbed/targets -I../../mbed-sdk/libraries/mbed/targets/cmsis -I../../mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP -I../../mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX -I../../mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM -I../../mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM/TARGET_LPC11U35_501 -I../../mbed-sdk/libraries/mbed/targets/hal -I../../mbed-sdk/libraries/mbed/targets/hal/TARGET_NXP -I../../mbed-sdk/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX -I../../mbed-sdk/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/TARGET_MCU_LPC11U35_501 -I../../mbed-sdk/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/TARGET_MCU_LPC11U35_501/TARGET_LPC11U35_501 -I../../mbed-sdk/libraries/mbed -I../../mbed-sdk/libraries/mbed/hal -I../../mbed-sdk/libraries/mbed/api -I../../mbed-sdk/libraries/mbed/common -I../../mbed-sdk/libraries/USBDevice -I../../mbed-sdk/libraries/USBDevice/USBHID -I../../mbed-sdk/libraries/USBDevice/USBDevice -I../../mbed-sdk/libraries/USBDevice/USBAudio -I../../mbed-sdk/libraries/USBDevice/USBSerial -I../../mbed-sdk/libraries/USBDevice/USBMSD -I../../mbed-sdk/libraries/USBDevice/USBMIDI -I../../protocol/mbed -I../../common -I../../protocol -o build/./main.o main.cpp
|
|
||||||
In file included from ../../mbed-sdk/libraries/mbed/api/mbed.h:21:0,
|
|
||||||
from main.cpp:1:
|
|
||||||
../../mbed-sdk/libraries/mbed/api/platform.h:25:19: fatal error: cstddef: No such file or directory
|
|
||||||
#include <cstddef>
|
|
||||||
^
|
|
||||||
compilation terminated.
|
|
||||||
make: *** [build/./main.o] Error 1
|
|
||||||
|
|
||||||
[13:13] noname@desk:/mnt/old_root/home/noname/tmp/tmk_keyboard/converter/ps2_usb
|
|
||||||
$ arm-none-eabi-gcc --version
|
|
||||||
arm-none-eabi-gcc (4.8.2-14ubuntu1+6) 4.8.2
|
|
||||||
Copyright (C) 2013 Free Software Foundation, Inc.
|
|
||||||
This is free software; see the source for copying conditions. There is NO
|
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
```
|
|
|
@ -1,21 +0,0 @@
|
||||||
In rare circumstances, your keyboard/device can become unwritable, and `dfu-programmer` will give you an error like this:
|
|
||||||
|
|
||||||
Erasing flash... Success
|
|
||||||
Checking memory from 0x0 to 0x6FFF... Empty.
|
|
||||||
Checking memory from 0x0 to 0x607F... Empty.
|
|
||||||
0% 100% Programming 0x6080 bytes...
|
|
||||||
[ X ERROR
|
|
||||||
Memory write error, use debug for more info.
|
|
||||||
|
|
||||||
Currently the only way to solve this is to [reprogram the chip via ISP](https://www.reddit.com/r/olkb/comments/4rjzen/flashing_error_on_mac_os_x/d52rj8o/). This requires another device to be hooked up to a couple of exposed pins on the PCB. __[We now have a guide on ISP flashing](isp_flashing_guide.md)__ and [this is where things are on the Planck PCB](http://imgur.com/lvbxbHt).
|
|
||||||
|
|
||||||
An example command to flash the board once things are hooked up is:
|
|
||||||
|
|
||||||
avrdude -c usbtiny -p m32u4 -U flash:w:planck_default_rev4.hex
|
|
||||||
|
|
||||||
Research is still being done on why this happens, but here are some cases:
|
|
||||||
|
|
||||||
* [`make -f Makefile.rn42 dfu` and not the dfu-programmer commands worked for @tybenz](https://github.com/tmk/tmk_keyboard/issues/316) - also see [the hhkb keyboard on tmk](https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hhkb)
|
|
||||||
* [Doing a force erase works here](https://geekhack.org/index.php?topic=12047.msg1520147#msg1520147)
|
|
||||||
* [`dfu-programmer atmega32u4 erase --force` works here as well](https://forum.fhem.de/index.php?topic=29777.0) [DE]
|
|
||||||
* [Unresolved, but some data dumps](https://github.com/dfu-programmer/dfu-programmer/issues/29)
|
|
|
@ -1,388 +0,0 @@
|
||||||
|
|
||||||
## Audio output from a speaker
|
|
||||||
|
|
||||||
Your keyboard can make sounds! If you've got a Planck, Preonic, or basically any keyboard that allows access to the C6 or B5 port (`#define C6_AUDIO` and `#define B5_AUDIO`), you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes.
|
|
||||||
|
|
||||||
The audio code lives in [quantum/audio/audio.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/audio.h) and in the other files in the audio directory. It's enabled by default on the Planck [stock keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/default/keymap.c). Here are the important bits:
|
|
||||||
|
|
||||||
```
|
|
||||||
#include "audio.h"
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, lower down the file:
|
|
||||||
|
|
||||||
```
|
|
||||||
float tone_startup[][2] = {
|
|
||||||
ED_NOTE(_E7 ),
|
|
||||||
E__NOTE(_CS7),
|
|
||||||
E__NOTE(_E6 ),
|
|
||||||
E__NOTE(_A6 ),
|
|
||||||
M__NOTE(_CS7, 20)
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
This is how you write a song. Each of these lines is a note, so we have a little ditty composed of five notes here.
|
|
||||||
|
|
||||||
Then, we have this chunk:
|
|
||||||
|
|
||||||
```
|
|
||||||
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
|
||||||
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
|
||||||
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
|
|
||||||
float tone_plover[][2] = SONG(PLOVER_SOUND);
|
|
||||||
float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
|
|
||||||
|
|
||||||
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
|
|
||||||
float goodbye[][2] = SONG(GOODBYE_SOUND);
|
|
||||||
```
|
|
||||||
|
|
||||||
Wherein we bind predefined songs (from [quantum/audio/song_list.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/song_list.h)) into named variables. This is one optimization that helps save on memory: These songs only take up memory when you reference them in your keymap, because they're essentially all preprocessor directives.
|
|
||||||
|
|
||||||
So now you have something called `tone_plover` for example. How do you make it play the Plover tune, then? If you look further down the keymap, you'll see this:
|
|
||||||
|
|
||||||
```
|
|
||||||
PLAY_NOTE_ARRAY(tone_plover, false, 0); // Signature is: Song name, repeat, rest style
|
|
||||||
```
|
|
||||||
|
|
||||||
This is inside one of the macros. So when that macro executes, your keyboard plays that particular chime.
|
|
||||||
|
|
||||||
"Rest style" in the method signature above (the last parameter) specifies if there's a rest (a moment of silence) between the notes.
|
|
||||||
|
|
||||||
## Music mode
|
|
||||||
|
|
||||||
The music mode maps your columns to a chromatic scale, and your rows to octaves. This works best with ortholinear keyboards, but can be made to work with others. All keycodes less than `0xFF` get blocked, so you won't type while playing notes - if you have special keys/mods, those will still work. A work-around for this is to jump to a different layer with KC_NOs before (or after) enabling music mode.
|
|
||||||
|
|
||||||
Recording is experimental due to some memory issues - if you experience some weird behavior, unplugging/replugging your keyboard will fix things.
|
|
||||||
|
|
||||||
Keycodes available:
|
|
||||||
|
|
||||||
* `MU_ON` - Turn music mode on
|
|
||||||
* `MU_OFF` - Turn music mode off
|
|
||||||
* `MU_TOG` - Toggle music mode
|
|
||||||
|
|
||||||
In music mode, the following keycodes work differently, and don't pass through:
|
|
||||||
|
|
||||||
* `LCTL` - start a recording
|
|
||||||
* `LALT` - stop recording/stop playing
|
|
||||||
* `LGUI` - play recording
|
|
||||||
* `KC_UP` - speed-up playback
|
|
||||||
* `KC_DOWN` - slow-down playback
|
|
||||||
|
|
||||||
## MIDI functionalty
|
|
||||||
|
|
||||||
This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile.
|
|
||||||
|
|
||||||
## Bluetooth functionality
|
|
||||||
|
|
||||||
This requires [some hardware changes](https://www.reddit.com/r/MechanicalKeyboards/comments/3psx0q/the_planck_keyboard_with_bluetooth_guide_and/?ref=search_posts), but can be enabled via the Makefile. The firmware will still output characters via USB, so be aware of this when charging via a computer. It would make sense to have a switch on the Bluefruit to turn it off at will.
|
|
||||||
|
|
||||||
## RGB Under Glow Mod
|
|
||||||
|
|
||||||
![Planck with RGB Underglow](https://raw.githubusercontent.com/qmk/qmk_firmware/master/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg)
|
|
||||||
|
|
||||||
Here is a quick demo on Youtube (with NPKC KC60) (https://www.youtube.com/watch?v=VKrpPAHlisY).
|
|
||||||
|
|
||||||
For this mod, you need an unused pin wiring to DI of WS2812 strip. After wiring the VCC, GND, and DI, you can enable the underglow in your Makefile.
|
|
||||||
|
|
||||||
RGBLIGHT_ENABLE = yes
|
|
||||||
|
|
||||||
In order to use the underglow animation functions, you need to have `#define RGBLIGHT_ANIMATIONS` in your `config.h`.
|
|
||||||
|
|
||||||
Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default:
|
|
||||||
|
|
||||||
#define RGB_DI_PIN F4 // The pin your RGB strip is wired to
|
|
||||||
#define RGBLIGHT_ANIMATIONS // Require for fancier stuff (not compatible with audio)
|
|
||||||
#define RGBLED_NUM 14 // Number of LEDs
|
|
||||||
#define RGBLIGHT_HUE_STEP 10
|
|
||||||
#define RGBLIGHT_SAT_STEP 17
|
|
||||||
#define RGBLIGHT_VAL_STEP 17
|
|
||||||
|
|
||||||
You'll need to edit `RGB_DI_PIN` to the pin you have your `DI` on your RGB strip wired to.
|
|
||||||
|
|
||||||
The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. For details, please check this keymap. `keyboards/planck/keymaps/yang/keymap.c`
|
|
||||||
|
|
||||||
### WS2812 Wiring
|
|
||||||
|
|
||||||
![WS2812 Wiring](https://raw.githubusercontent.com/qmk/qmk_firmware/master/keyboards/planck/keymaps/yang/WS2812-wiring.jpg)
|
|
||||||
|
|
||||||
Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20.
|
|
||||||
|
|
||||||
## PS/2 Mouse Support
|
|
||||||
|
|
||||||
Its possible to hook up a PS/2 mouse (for example touchpads or trackpoints) to your keyboard as a composite device.
|
|
||||||
|
|
||||||
To hook up a Trackpoint, you need to obtain a Trackpoint module (i.e. harvest from a Thinkpad keyboard), identify the function of each pin of the module, and make the necessary circuitry between controller and Trackpoint module. For more information, please refer to [Trackpoint Hardware](https://deskthority.net/wiki/TrackPoint_Hardware) page on Deskthority Wiki.
|
|
||||||
|
|
||||||
There are three available modes for hooking up PS/2 devices: USART (best), interrupts (better) or busywait (not recommended).
|
|
||||||
|
|
||||||
### Busywait version
|
|
||||||
|
|
||||||
Note: This is not recommended, you may encounter jerky movement or unsent inputs. Please use interrupt or USART version if possible.
|
|
||||||
|
|
||||||
In rules.mk:
|
|
||||||
|
|
||||||
```
|
|
||||||
PS2_MOUSE_ENABLE = yes
|
|
||||||
PS2_USE_BUSYWAIT = yes
|
|
||||||
```
|
|
||||||
|
|
||||||
In your keyboard config.h:
|
|
||||||
|
|
||||||
```
|
|
||||||
#ifdef PS2_USE_BUSYWAIT
|
|
||||||
# define PS2_CLOCK_PORT PORTD
|
|
||||||
# define PS2_CLOCK_PIN PIND
|
|
||||||
# define PS2_CLOCK_DDR DDRD
|
|
||||||
# define PS2_CLOCK_BIT 1
|
|
||||||
# define PS2_DATA_PORT PORTD
|
|
||||||
# define PS2_DATA_PIN PIND
|
|
||||||
# define PS2_DATA_DDR DDRD
|
|
||||||
# define PS2_DATA_BIT 2
|
|
||||||
#endif
|
|
||||||
```
|
|
||||||
|
|
||||||
### Interrupt version
|
|
||||||
|
|
||||||
The following example uses D2 for clock and D5 for data. You can use any INT or PCINT pin for clock, and any pin for data.
|
|
||||||
|
|
||||||
In rules.mk:
|
|
||||||
|
|
||||||
```
|
|
||||||
PS2_MOUSE_ENABLE = yes
|
|
||||||
PS2_USE_INT = yes
|
|
||||||
```
|
|
||||||
|
|
||||||
In your keyboard config.h:
|
|
||||||
|
|
||||||
```
|
|
||||||
#ifdef PS2_USE_INT
|
|
||||||
#define PS2_CLOCK_PORT PORTD
|
|
||||||
#define PS2_CLOCK_PIN PIND
|
|
||||||
#define PS2_CLOCK_DDR DDRD
|
|
||||||
#define PS2_CLOCK_BIT 2
|
|
||||||
#define PS2_DATA_PORT PORTD
|
|
||||||
#define PS2_DATA_PIN PIND
|
|
||||||
#define PS2_DATA_DDR DDRD
|
|
||||||
#define PS2_DATA_BIT 5
|
|
||||||
|
|
||||||
#define PS2_INT_INIT() do { \
|
|
||||||
EICRA |= ((1<<ISC21) | \
|
|
||||||
(0<<ISC20)); \
|
|
||||||
} while (0)
|
|
||||||
#define PS2_INT_ON() do { \
|
|
||||||
EIMSK |= (1<<INT2); \
|
|
||||||
} while (0)
|
|
||||||
#define PS2_INT_OFF() do { \
|
|
||||||
EIMSK &= ~(1<<INT2); \
|
|
||||||
} while (0)
|
|
||||||
#define PS2_INT_VECT INT2_vect
|
|
||||||
#endif
|
|
||||||
```
|
|
||||||
|
|
||||||
### USART version
|
|
||||||
|
|
||||||
To use USART on the ATMega32u4, you have to use PD5 for clock and PD2 for data. If one of those are unavailable, you need to use interrupt version.
|
|
||||||
|
|
||||||
In rules.mk:
|
|
||||||
|
|
||||||
```
|
|
||||||
PS2_MOUSE_ENABLE = yes
|
|
||||||
PS2_USE_USART = yes
|
|
||||||
```
|
|
||||||
|
|
||||||
In your keyboard config.h:
|
|
||||||
|
|
||||||
```
|
|
||||||
#ifdef PS2_USE_USART
|
|
||||||
#define PS2_CLOCK_PORT PORTD
|
|
||||||
#define PS2_CLOCK_PIN PIND
|
|
||||||
#define PS2_CLOCK_DDR DDRD
|
|
||||||
#define PS2_CLOCK_BIT 5
|
|
||||||
#define PS2_DATA_PORT PORTD
|
|
||||||
#define PS2_DATA_PIN PIND
|
|
||||||
#define PS2_DATA_DDR DDRD
|
|
||||||
#define PS2_DATA_BIT 2
|
|
||||||
|
|
||||||
/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
|
|
||||||
/* set DDR of CLOCK as input to be slave */
|
|
||||||
#define PS2_USART_INIT() do { \
|
|
||||||
PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
|
|
||||||
PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
|
|
||||||
UCSR1C = ((1 << UMSEL10) | \
|
|
||||||
(3 << UPM10) | \
|
|
||||||
(0 << USBS1) | \
|
|
||||||
(3 << UCSZ10) | \
|
|
||||||
(0 << UCPOL1)); \
|
|
||||||
UCSR1A = 0; \
|
|
||||||
UBRR1H = 0; \
|
|
||||||
UBRR1L = 0; \
|
|
||||||
} while (0)
|
|
||||||
#define PS2_USART_RX_INT_ON() do { \
|
|
||||||
UCSR1B = ((1 << RXCIE1) | \
|
|
||||||
(1 << RXEN1)); \
|
|
||||||
} while (0)
|
|
||||||
#define PS2_USART_RX_POLL_ON() do { \
|
|
||||||
UCSR1B = (1 << RXEN1); \
|
|
||||||
} while (0)
|
|
||||||
#define PS2_USART_OFF() do { \
|
|
||||||
UCSR1C = 0; \
|
|
||||||
UCSR1B &= ~((1 << RXEN1) | \
|
|
||||||
(1 << TXEN1)); \
|
|
||||||
} while (0)
|
|
||||||
#define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
|
|
||||||
#define PS2_USART_RX_DATA UDR1
|
|
||||||
#define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
|
|
||||||
#define PS2_USART_RX_VECT USART1_RX_vect
|
|
||||||
#endif
|
|
||||||
```
|
|
||||||
|
|
||||||
### Additional Settings
|
|
||||||
|
|
||||||
#### PS/2 mouse features
|
|
||||||
|
|
||||||
These enable settings supported by the PS/2 mouse protocol: http://www.computer-engineering.org/ps2mouse/
|
|
||||||
|
|
||||||
```
|
|
||||||
/* Use remote mode instead of the default stream mode (see link) */
|
|
||||||
#define PS2_MOUSE_USE_REMOTE_MODE
|
|
||||||
|
|
||||||
/* Enable the scrollwheel or scroll gesture on your mouse or touchpad */
|
|
||||||
#define PS2_MOUSE_ENABLE_SCROLLING
|
|
||||||
|
|
||||||
/* Some mice will need a scroll mask to be configured. The default is 0xFF. */
|
|
||||||
#define PS2_MOUSE_SCROLL_MASK 0x0F
|
|
||||||
|
|
||||||
/* Applies a transformation to the movement before sending to the host (see link) */
|
|
||||||
#define PS2_MOUSE_USE_2_1_SCALING
|
|
||||||
|
|
||||||
/* The time to wait after initializing the ps2 host */
|
|
||||||
#define PS2_MOUSE_INIT_DELAY 1000 /* Default */
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also call the following functions from ps2_mouse.h
|
|
||||||
|
|
||||||
```
|
|
||||||
void ps2_mouse_disable_data_reporting(void);
|
|
||||||
|
|
||||||
void ps2_mouse_enable_data_reporting(void);
|
|
||||||
|
|
||||||
void ps2_mouse_set_remote_mode(void);
|
|
||||||
|
|
||||||
void ps2_mouse_set_stream_mode(void);
|
|
||||||
|
|
||||||
void ps2_mouse_set_scaling_2_1(void);
|
|
||||||
|
|
||||||
void ps2_mouse_set_scaling_1_1(void);
|
|
||||||
|
|
||||||
void ps2_mouse_set_resolution(ps2_mouse_resolution_t resolution);
|
|
||||||
|
|
||||||
void ps2_mouse_set_sample_rate(ps2_mouse_sample_rate_t sample_rate);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Fine control
|
|
||||||
|
|
||||||
Use the following defines to change the sensitivity and speed of the mouse.
|
|
||||||
Note: you can also use `ps2_mouse_set_resolution` for the same effect (not supported on most touchpads).
|
|
||||||
|
|
||||||
```
|
|
||||||
#define PS2_MOUSE_X_MULTIPLIER 3
|
|
||||||
#define PS2_MOUSE_Y_MULTIPLIER 3
|
|
||||||
#define PS2_MOUSE_V_MULTIPLIER 1
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Scroll button
|
|
||||||
|
|
||||||
If you're using a trackpoint, you will likely want to be able to use it for scrolling.
|
|
||||||
Its possible to enable a "scroll button/s" that when pressed will cause the mouse to scroll instead of moving.
|
|
||||||
To enable the feature, you must set a scroll button mask as follows:
|
|
||||||
|
|
||||||
```
|
|
||||||
#define PS2_MOUSE_SCROLL_BTN_MASK (1<<PS2_MOUSE_BUTTON_MIDDLE) /* Default */
|
|
||||||
```
|
|
||||||
|
|
||||||
To disable the scroll button feature:
|
|
||||||
|
|
||||||
```
|
|
||||||
#define PS2_MOUSE_SCROLL_BTN_MASK 0
|
|
||||||
```
|
|
||||||
|
|
||||||
The available buttons are:
|
|
||||||
|
|
||||||
```
|
|
||||||
#define PS2_MOUSE_BTN_LEFT 0
|
|
||||||
#define PS2_MOUSE_BTN_RIGHT 1
|
|
||||||
#define PS2_MOUSE_BTN_MIDDLE 2
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also combine buttons in the mask by `|`ing them together.
|
|
||||||
|
|
||||||
Once you've configured your scroll button mask, you must configure the scroll button send interval.
|
|
||||||
This is the interval before which if the scroll buttons were released they would be sent to the host.
|
|
||||||
After this interval, they will cause the mouse to scroll and will not be sent.
|
|
||||||
|
|
||||||
```
|
|
||||||
#define PS2_MOUSE_SCROLL_BTN_SEND 300 /* Default */
|
|
||||||
```
|
|
||||||
|
|
||||||
To disable sending the scroll buttons:
|
|
||||||
```
|
|
||||||
#define PS2_MOUSE_SCROLL_BTN_SEND 0
|
|
||||||
```
|
|
||||||
|
|
||||||
Fine control over the scrolling is supported with the following defines:
|
|
||||||
|
|
||||||
```
|
|
||||||
#define PS2_MOUSE_SCROLL_DIVISOR_H 2
|
|
||||||
#define PS2_MOUSE_SCROLL_DIVISOR_V 2
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Debug settings
|
|
||||||
|
|
||||||
To debug the mouse, add `debug_mouse = true` or enable via bootmagic.
|
|
||||||
|
|
||||||
```
|
|
||||||
/* To debug the mouse reports */
|
|
||||||
#define PS2_MOUSE_DEBUG_HID
|
|
||||||
#define PS2_MOUSE_DEBUG_RAW
|
|
||||||
```
|
|
||||||
|
|
||||||
## Safety Considerations
|
|
||||||
|
|
||||||
You probably don't want to "brick" your keyboard, making it impossible
|
|
||||||
to rewrite firmware onto it. Here are some of the parameters to show
|
|
||||||
what things are (and likely aren't) too risky.
|
|
||||||
|
|
||||||
- If your keyboard map does not include RESET, then, to get into DFU
|
|
||||||
mode, you will need to press the reset button on the PCB, which
|
|
||||||
requires unscrewing the bottom.
|
|
||||||
- Messing with tmk_core / common files might make the keyboard
|
|
||||||
inoperable
|
|
||||||
- Too large a .hex file is trouble; `make dfu` will erase the block,
|
|
||||||
test the size (oops, wrong order!), which errors out, failing to
|
|
||||||
flash the keyboard, leaving it in DFU mode.
|
|
||||||
- To this end, note that the maximum .hex file size on Planck is
|
|
||||||
7000h (28672 decimal)
|
|
||||||
|
|
||||||
```
|
|
||||||
Linking: .build/planck_rev4_cbbrowne.elf [OK]
|
|
||||||
Creating load file for Flash: .build/planck_rev4_cbbrowne.hex [OK]
|
|
||||||
|
|
||||||
Size after:
|
|
||||||
text data bss dec hex filename
|
|
||||||
0 22396 0 22396 577c planck_rev4_cbbrowne.hex
|
|
||||||
```
|
|
||||||
|
|
||||||
- The above file is of size 22396/577ch, which is less than
|
|
||||||
28672/7000h
|
|
||||||
- As long as you have a suitable alternative .hex file around, you
|
|
||||||
can retry, loading that one
|
|
||||||
- Some of the options you might specify in your keyboard's Makefile
|
|
||||||
consume extra memory; watch out for BOOTMAGIC_ENABLE,
|
|
||||||
MOUSEKEY_ENABLE, EXTRAKEY_ENABLE, CONSOLE_ENABLE, API_SYSEX_ENABLE
|
|
||||||
- DFU tools do /not/ allow you to write into the bootloader (unless
|
|
||||||
you throw in extra fruitsalad of options), so there is little risk
|
|
||||||
there.
|
|
||||||
- EEPROM has around a 100000 write cycle. You shouldn't rewrite the
|
|
||||||
firmware repeatedly and continually; that'll burn the EEPROM
|
|
||||||
eventually.
|
|
||||||
|
|
|
@ -1,17 +1,81 @@
|
||||||
# Can I increase the speed of the mouse keys?
|
# Mousekeys
|
||||||
|
|
||||||
**Q:** The default speed for controlling the mouse with the keyboard is slow. I've tried increasing the mouse's sensitivity at work using xset m and it worked, although sometimes it changes by itself for some reason. At home, on Arch Linux, this does not change ti. I've looked through the forums and resolved to use libinput using xinput but using that I only manage to change the speed of the mouse using the actual mouse. The speed of the mouse using the keyboard controls remained unchanged.
|
|
||||||
Is there perhaps something I can input in the keymap.c to change the sensitivity? Or some other surefire way of increasing the speed?
|
|
||||||
Thanks!
|
|
||||||
|
|
||||||
**A:** In your keymap's config.h:
|
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`:
|
||||||
|
|
||||||
```
|
```
|
||||||
#define MOUSEKEY_INTERVAL 20
|
MOUSEKEY_ENABLE = yes
|
||||||
#define MOUSEKEY_DELAY 0
|
|
||||||
#define MOUSEKEY_TIME_TO_MAX 60
|
|
||||||
#define MOUSEKEY_MAX_SPEED 7
|
|
||||||
#define MOUSEKEY_WHEEL_DELAY 0
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Tweak away. A lower interval or higher max speed will effectively make the mouse move faster. Time-to-max controls acceleration. (See [this Reddit thread for the original discussion](https://www.reddit.com/r/ErgoDoxEZ/comments/61fwr2/a_reliable_way_to_increase_the_speed_of_the_mouse/)).
|
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,62 +0,0 @@
|
||||||
Other Keyboard Firmware Projects
|
|
||||||
================================
|
|
||||||
## PJRC USB Keyboard/Mouse Example[USB][PJRC][Teensy][AVR]
|
|
||||||
- <http://www.pjrc.com/teensy/usb_keyboard.html>
|
|
||||||
- <http://www.pjrc.com/teensy/usb_mouse.html>
|
|
||||||
|
|
||||||
## kbupgrade[USB][V-USB][AVR]
|
|
||||||
- <http://github.com/rhomann/kbupgrade>
|
|
||||||
- <http://geekhack.org/showwiki.php?title=Island:8406>
|
|
||||||
|
|
||||||
## c64key[USB][V-USB][AVR]
|
|
||||||
- <http://symlink.dk/projects/c64key/>
|
|
||||||
|
|
||||||
## rump[USB][V-USB][AVR]
|
|
||||||
- <http://mg8.org/rump/>
|
|
||||||
- <http://github.com/clee/rump>
|
|
||||||
|
|
||||||
## dulcimer[USB][V-USB][AVR]
|
|
||||||
- <http://www.schatenseite.de/dulcimer.html>
|
|
||||||
|
|
||||||
## humblehacker-keyboard[USB][LUFA][AVR][Ergo]
|
|
||||||
- <http://github.com/humblehacker>
|
|
||||||
- <http://www.humblehacker.com/keyboard/>
|
|
||||||
- <http://geekhack.org/showwiki.php?title=Island:6292>
|
|
||||||
|
|
||||||
## ps2avr[PS/2][AVR]
|
|
||||||
- <http://sourceforge.net/projects/ps2avr/>
|
|
||||||
|
|
||||||
## ErgoDox[Ergo][Split][USB][AVR]
|
|
||||||
- <http://geekhack.org/index.php?topic=22780.0>
|
|
||||||
- <https://github.com/benblazak/ergodox-firmware>
|
|
||||||
- <https://github.com/cub-uanic/tmk_keyboard>
|
|
||||||
|
|
||||||
## Suka's keyboard collection[Ergo][Split][3DPrinting][USB][AVR]
|
|
||||||
- <http://deskthority.net/workshop-f7/my-diy-keyboard-collection-or-how-i-became-a-kb-geek-t2534.html>
|
|
||||||
- <https://github.com/frobiac/adnw>
|
|
||||||
|
|
||||||
## bpiphany's AVR-Keyboard[PJRC][AVR][USB]
|
|
||||||
- <https://github.com/BathroomEpiphanies/AVR-Keyboard>
|
|
||||||
- <http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions>
|
|
||||||
- <http://deskthority.net/wiki/Phantom>
|
|
||||||
|
|
||||||
## USB-USB keyboard remapper[converter][USB-USB][AVR][Arduino]
|
|
||||||
- <http://forum.colemak.com/viewtopic.php?pid=10837>
|
|
||||||
- <https://github.com/darkytoothpaste/keymapper>
|
|
||||||
|
|
||||||
## USB-USB converter threads[converter][USB-USB]
|
|
||||||
- <http://deskthority.net/workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841-30.html>
|
|
||||||
- <http://geekhack.org/index.php?topic=19458.0>
|
|
||||||
|
|
||||||
## kbdbabel.org[converter][vintage][protocol][8051]
|
|
||||||
Great resource of vintage keyboard protocol information and code
|
|
||||||
|
|
||||||
- <http://www.kbdbabel.org/>
|
|
||||||
|
|
||||||
## Haata's kiibohd Controller[converter][vintage][protocol][AVR][PJRC][Cortex]
|
|
||||||
A lots of vintage keyboard protocol supports
|
|
||||||
|
|
||||||
- <http://gitorious.org/kiibohd-controller>
|
|
||||||
|
|
||||||
## Kinesis ergonomic keyboard firmware replacement[V-USB][LUFA][Ergo]
|
|
||||||
- <https://github.com/chrisandreae/kinesis-firmware>
|
|
|
@ -1,151 +0,0 @@
|
||||||
# Planck Firmware Guide
|
|
||||||
|
|
||||||
## Setting up the environment
|
|
||||||
|
|
||||||
### Windows
|
|
||||||
1. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**.
|
|
||||||
2. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location.
|
|
||||||
3. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/qmk/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer.
|
|
||||||
4. Right-click on the 1-setup-path-win batch script, select "Run as administrator", and accept the User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up.
|
|
||||||
5. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete!
|
|
||||||
|
|
||||||
|
|
||||||
### Mac
|
|
||||||
|
|
||||||
If you're using homebrew, you can use the following commands:
|
|
||||||
|
|
||||||
brew tap osx-cross/avr
|
|
||||||
brew install avr-libc
|
|
||||||
brew install dfu-programmer
|
|
||||||
|
|
||||||
Otherwise, these instructions will work:
|
|
||||||
|
|
||||||
1. Install Xcode from the App Store.
|
|
||||||
2. Install the Command Line Tools from `Xcode->Preferences->Downloads`.
|
|
||||||
3. Install [DFU-Programmer][dfu-prog].
|
|
||||||
|
|
||||||
### Linux
|
|
||||||
1. Install AVR GCC with your favorite package manager.
|
|
||||||
2. Install [DFU-Programmer][dfu-prog].
|
|
||||||
|
|
||||||
Note that, since it will be directly accessing USB hardware, the
|
|
||||||
`dfu-programmer` program needs to be run as root.
|
|
||||||
|
|
||||||
## Verify Your Installation
|
|
||||||
1. Clone the following repository: https://github.com/qmk/qmk_firmware
|
|
||||||
2. Open a Terminal and `cd` into `qmk_firmware/keyboards/planck`
|
|
||||||
3. Run `make`. This should output a lot of information about the build process.
|
|
||||||
|
|
||||||
## Using the built-in functions
|
|
||||||
|
|
||||||
Here is a list of some of the functions available from the command line:
|
|
||||||
|
|
||||||
* `make clean`: clean the environment - may be required in-between builds
|
|
||||||
* `make`: compile the code
|
|
||||||
* `make KEYMAP=<keymap>`: compile with the extended keymap file `extended_keymaps/extended_keymap_<keymap>.c`
|
|
||||||
* `make dfu`: build and flash the layout to the PCB
|
|
||||||
* `make dfu-force`: build and force-flash the layout to the PCB (may be require for first flash)
|
|
||||||
|
|
||||||
Generally, the instructions to flash the PCB are as follows:
|
|
||||||
|
|
||||||
1. Make changes to the appropriate keymap file
|
|
||||||
2. Save the file
|
|
||||||
3. `make clean`
|
|
||||||
4. Press the reset button on the PCB/press the key with the `RESET` keycode
|
|
||||||
5. `make <arguments> dfu` - use the necessary `KEYMAP=<keymap>` and/or `COMMON=true` arguments here.
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
If you see something like this
|
|
||||||
|
|
||||||
0 [main] sh 13384 sync_with_child: child 9716(0x178) died before initialization with status code 0xC0000142
|
|
||||||
440 [main] sh 13384 sync_with_child: *** child state waiting for longjmp
|
|
||||||
/usr/bin/sh: fork: Resource temporarily unavailable
|
|
||||||
|
|
||||||
after running 'make' on Windows than you are encountering a very popular issue with WinAVR on Windows 8.1 and 10.
|
|
||||||
You can easily fix this problem by replacing msys-1.0.dll in WinAVR/utils/bin with [this one](http://www.madwizard.org/download/electronics/msys-1.0-vista64.zip).
|
|
||||||
Restart your system and everything should work fine!
|
|
||||||
|
|
||||||
|
|
||||||
If you see this
|
|
||||||
|
|
||||||
dfu-programmer atmega32u4 erase
|
|
||||||
process_begin: CreateProcess(NULL, dfu-programmer atmega32u4 erase, ...) failed.
|
|
||||||
make (e=2): The system cannot find the file specified.
|
|
||||||
make: *** [dfu] Error 2
|
|
||||||
|
|
||||||
when trying to 'make dfu' on Windows you need to copy the dfu-programmer.exe to qmk_firmware/keyboards/planck.
|
|
||||||
|
|
||||||
|
|
||||||
## Quantum MK Firmware
|
|
||||||
|
|
||||||
### Keymap
|
|
||||||
|
|
||||||
Unlike the other keymaps, prefixing the keycodes with `KC_` is required. A full list of the keycodes is available [here](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/doc/keycode.txt). For the keycodes available only in the extended keymap, see this [header file](https://github.com/qmk/qmk_firmware/blob/master/quantum/keymap_common.h).
|
|
||||||
|
|
||||||
You can use modifiers with keycodes like this:
|
|
||||||
|
|
||||||
LCTL(KC_C)
|
|
||||||
|
|
||||||
Which will generate Ctrl+c. These are daisy-chainable, meaning you can do things like:
|
|
||||||
|
|
||||||
LCTL(LALT(KC_C))
|
|
||||||
|
|
||||||
That will generate Ctrl+Alt+c. The entire list of these functions is here:
|
|
||||||
|
|
||||||
* `LCTL()`: Left control
|
|
||||||
* `LSFT()` / `S()`: Left shift
|
|
||||||
* `LALT()`: Left alt/opt
|
|
||||||
* `LGUI()`: Left win/cmd
|
|
||||||
* `RCTL()`: Right control
|
|
||||||
* `RSFT()`: Right shift
|
|
||||||
* `RALT()`: Right alt/opt
|
|
||||||
* `RGUI()`: Right win/cmd
|
|
||||||
|
|
||||||
`S(KC_1)`-like entries are useful in writing keymaps for the Planck.
|
|
||||||
|
|
||||||
### Other keycodes
|
|
||||||
|
|
||||||
A number of other keycodes have been added that you may find useful:
|
|
||||||
|
|
||||||
* `CM_<key>`: the Colemak equivalent of a key (in place of `KC_<key>`), when using Colemak in software (`CM_O` generates `KC_SCLN`)
|
|
||||||
* `RESET`: jump to bootloader for flashing (same as press the reset button)
|
|
||||||
* `BL_STEP`: step through the backlight brightnesses
|
|
||||||
* `BL_<0-15>`: set backlight brightness to 0-15
|
|
||||||
* `BL_DEC`: lower the backlight brightness
|
|
||||||
* `BL_INC`: raise the backlight brightness
|
|
||||||
* `BL_TOGG`: toggle the backlight on/off
|
|
||||||
|
|
||||||
### Function layers
|
|
||||||
|
|
||||||
The extended keymap extends the number of function layers from 32 to the near-infinite value of 256. Rather than using `FN<num>` notation (still available, but limited to `FN0`-`FN31`), you can use the `FUNC(<num>)` notation. `F(<num>)` is a shortcut for this.
|
|
||||||
|
|
||||||
The function actions are unchanged, and you can see the full list of them [here](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action_code.h). They are explained in detail [here](keymap.md#2-action).
|
|
||||||
|
|
||||||
### Macros
|
|
||||||
|
|
||||||
Macros have been setup in the `keymaps/keymap_default.c` file so that you can use `M(<num>)` to access a macro in the `action_get_macro` section on your keymap. The switch/case structure you see here is required, and is setup for `M(0)` - you'll need to copy and paste the code to look like this (e.g. to support `M(3)`):
|
|
||||||
|
|
||||||
switch(id) {
|
|
||||||
case 0:
|
|
||||||
return MACRODOWN(TYPE(KC_A), END);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
return MACRODOWN(TYPE(KC_B), END);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
return MACRODOWN(TYPE(KC_C), END);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
return MACRODOWN(TYPE(KC_D), END);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return MACRO_NONE;
|
|
||||||
|
|
||||||
`MACRODOWN()` is a shortcut for `(record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE)` which tells the macro to execute when the key is pressed. Without this, the macro will be executed on both the down and up stroke.
|
|
||||||
|
|
||||||
[cygwin]: https://www.cygwin.com/
|
|
||||||
[mingw]: http://www.mingw.org/
|
|
||||||
[mhv]: https://infernoembedded.com/products/avr-tools
|
|
||||||
[winavr]: http://winavr.sourceforge.net/
|
|
||||||
[crosspack]: http://www.obdev.at/products/crosspack/index.html
|
|
||||||
[dfu-prog]: http://dfu-programmer.sourceforge.net/
|
|
|
@ -20,7 +20,7 @@ For the `DIODE_DIRECTION`, most hand-wiring guides will instruct you to wire the
|
||||||
|
|
||||||
`BACKLIGHT_LEVELS` is how many levels exist for your backlight - max is 15, and they are computed automatically from this number.
|
`BACKLIGHT_LEVELS` is how many levels exist for your backlight - max is 15, and they are computed automatically from this number.
|
||||||
|
|
||||||
## `/keyboards/<keyboard>/Makefile`
|
## `/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`.
|
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`.
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ The values at the top likely won't need to be changed, since most boards use the
|
||||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
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](#makefile-options).
|
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`
|
## `/keyboards/<keyboard>/readme.md`
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ This is where you'll describe your keyboard - please write as much as you can ab
|
||||||
|
|
||||||
## `/keyboards/<keyboard>/<keyboard>.c`
|
## `/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-for-keyboards-and-keymaps)
|
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`
|
## `/keyboards/<keyboard>/<keyboard>.h`
|
||||||
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
= Previously Asked Questions
|
|
||||||
:toc:
|
|
||||||
:toc-placement: preamble
|
|
||||||
|
|
||||||
toc::[]
|
|
||||||
|
|
||||||
= Question thread
|
|
||||||
http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177-270.html
|
|
||||||
|
|
||||||
= Questions
|
|
||||||
== Columns beyond 16(uint16_t) cannot be read
|
|
||||||
* https://github.com/tmk/tmk_keyboard/wiki/FAQ#cant-read-comlumn-of-matrix-beyond-16
|
|
||||||
* http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177-270.html#p247051
|
|
||||||
* http://deskthority.net/workshop-f7/rebuilding-and-redesigning-a-classic-thinkpad-keyboard-t6181-60.html#p146279
|
|
|
@ -1,75 +0,0 @@
|
||||||
# QMK Overview
|
|
||||||
|
|
||||||
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
|
|
||||||
* `Makefile`: the features of QMK that are enabled, required to run `make` in your keymap folder
|
|
||||||
* `readme.md`: a description of your keymap, how others might use it, and explanations of features
|
|
||||||
* Other files: Some people choose to include an image depicting the layout, and other files that help people to use or understand a particular keymap.
|
|
||||||
|
|
||||||
# The `make` command
|
|
||||||
|
|
||||||
The `make` command is how you compile the firmware into a .hex file, which can be loaded by a dfu programmer (like dfu-progammer via `make dfu`) or the [Teensy loader](https://www.pjrc.com/teensy/loader.html) (only used with Teensys). It it recommended that you always run make from within the `root` folder.
|
|
||||||
|
|
||||||
**NOTE:** To abort a make command press `Ctrl-c`
|
|
||||||
|
|
||||||
For more details on the QMK build process see [Make Instructions](make_instructions.md).
|
|
||||||
|
|
||||||
### Simple instructions for building and uploading a keyboard
|
|
||||||
|
|
||||||
**Most keyboards have more specific instructions in the keyboard specific readme.md file, so please check that first**
|
|
||||||
|
|
||||||
1. Enter the `root` folder
|
|
||||||
2. Run `make <keyboard>-<subproject>-<keymap>-<programmer>`
|
|
||||||
|
|
||||||
In the above commands, replace:
|
|
||||||
|
|
||||||
* `<keyboard>` with the name of your keyboard
|
|
||||||
* `<keymap>` with the name of your keymap
|
|
||||||
* `<subproject>` with the name of the subproject (revision or sub-model of your keyboard). For example, for Ergodox it can be `ez` or `infinity`, and for Planck `rev3` or `rev4`.
|
|
||||||
* If the keyboard doesn't have a subproject, or if you are happy with the default (defined in `rules.mk` file of the `keyboard` folder), you can leave it out. But remember to also remove the dash (`-`) from the command.
|
|
||||||
* `<programmer>` The programmer to use. Most keyboards use `dfu`, but some use `teensy`. Infinity keyboards use `dfu-util`. Check the readme file in the keyboard folder to find out which programmer to use.
|
|
||||||
* If you don't add `-<programmer` to the command line, the firmware will be still be compiled into a hex file, but the upload will be skipped.
|
|
||||||
|
|
||||||
**NOTE:** Some operating systems will refuse to program unless you run the make command as root for example `sudo make clueboard-default-dfu`
|
|
||||||
|
|
||||||
## Make Examples
|
|
||||||
|
|
||||||
* Build all Clueboard keymaps: `make clueboard`
|
|
||||||
* Build the default Planck keymap: `make planck-rev4-default`
|
|
||||||
* Build and flash your ergodox-ez: `make ergodox-ez-default-teensy`
|
|
||||||
|
|
||||||
# The `config.h` file
|
|
||||||
|
|
||||||
There are 2 `config.h` locations:
|
|
||||||
|
|
||||||
* keyboard (`/keyboards/<keyboard>/`)
|
|
||||||
* keymap (`/keyboards/<keyboard>/keymaps/<keymap>/`)
|
|
||||||
|
|
||||||
The keyboard `config.h` is included only if the keymap one doesn't exist. The format to use for your custom one [is here](https://github.com/qmk/qmk_firmware/blob/master/doc/keymap_config_h_example.h). If you want to override a setting from the parent `config.h` file, you need to do this:
|
|
||||||
|
|
||||||
```c
|
|
||||||
#undef MY_SETTING
|
|
||||||
#define MY_SETTING 4
|
|
||||||
```
|
|
||||||
|
|
||||||
For a value of `4` for this imaginary setting. So we `undef` it first, then `define` it.
|
|
||||||
|
|
||||||
You can then override any settings, rather than having to copy and paste the whole thing.
|
|
22
docs/quantum_keycodes.md
Normal file
22
docs/quantum_keycodes.md
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# Quantum Keycodes
|
||||||
|
|
||||||
|
Quantum keycodes allow for easier customisation of your keymap than the basic ones provide, without having to define custom actions.
|
||||||
|
|
||||||
|
All keycodes within quantum are numbers between `0x0000` and `0xFFFF`. Within your `keymap.c` it may look like you have functions and other special cases, but ultimately the C preprocessor will translate those into a single 4 byte integer. QMK has reserved `0x0000` through `0x00FF` for standard keycodes. These are keycodes such as `KC_A`, `KC_1`, and `KC_LCTL`, which are basic keys defined in the USB HID specification.
|
||||||
|
|
||||||
|
On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are used to implement advanced quantum features. If you define your own custom keycodes they will be put into this range as well.
|
||||||
|
|
||||||
|
## QMK keycodes
|
||||||
|
|
||||||
|
|Name|Description|
|
||||||
|
|----|-----------|
|
||||||
|
|`RESET`|Put the keyboard into DFU mode for flashing|
|
||||||
|
|`DEBUG`|Toggles debug mode|
|
||||||
|
|`KC_GESC`/`GRAVE_ESC`|Acts as escape when pressed normally but when pressed with Shift or GUI will send a ```|
|
||||||
|
|`KC_LSPO`|Left shift when held, open paranthesis when tapped|
|
||||||
|
|`KC_RSPC`|Right shift when held, close paranthesis when tapped|
|
||||||
|
|`KC_LEAD`|The [leader key](feature_leader_key.md)|
|
||||||
|
|`KC_LOCK`|The [lock key](key_lock.md)|
|
||||||
|
|`FUNC(n)`/`F(n)`|Call `fn_action(n)` (deprecated)|
|
||||||
|
|`M(n)`|to call macro n|
|
||||||
|
|`MACROTAP(n)`|to macro-tap n idk FIXME|
|
|
@ -1 +0,0 @@
|
||||||
# Get Report Descriptor with lsusb
|
|
108
docs/stenography.md
Normal file
108
docs/stenography.md
Normal file
|
@ -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 should also diable mousekeys to prevent conflicts.
|
||||||
|
|
||||||
|
```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)|
|
|
@ -1,5 +1,7 @@
|
||||||
# Tap Dance: A single key can do 3, 5, or 100 different things
|
# 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:
|
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.
|
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.
|
||||||
|
@ -34,7 +36,9 @@ Our next stop is `matrix_scan_tap_dance()`. This handles the timeout of tap-danc
|
||||||
|
|
||||||
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.
|
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
|
# Examples
|
||||||
|
|
||||||
|
## Simple Example
|
||||||
|
|
||||||
Here's a simple example for a single definition:
|
Here's a simple example for a single definition:
|
||||||
|
|
||||||
|
@ -59,6 +63,8 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
TD(TD_ESC_CAPS)
|
TD(TD_ESC_CAPS)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Complex Example
|
||||||
|
|
||||||
Here's a more complex example involving custom actions:
|
Here's a more complex example involving custom actions:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.Makefile
|
|
||||||
[source,Makefile]
|
|
||||||
----
|
|
||||||
# Build Options
|
|
||||||
# comment out to disable the options.
|
|
||||||
#
|
|
||||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
|
||||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
|
||||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
|
||||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
|
||||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
|
||||||
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
|
||||||
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
|
|
||||||
----
|
|
|
@ -1,34 +0,0 @@
|
||||||
## TMK based projects
|
|
||||||
Add your project here!
|
|
||||||
See https://github.com/tmk/tmk_keyboard/issues/173
|
|
||||||
|
|
||||||
### keyboards
|
|
||||||
**S60-X**: [DIY 60% keyboard](https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open) designed by [VinnyCordeiro](https://github.com/VinnyCordeiro) for Sentraq:
|
|
||||||
- https://github.com/VinnyCordeiro/tmk_keyboard
|
|
||||||
|
|
||||||
**Octagon V1**: Korean custom keyboard designed by Duck.
|
|
||||||
- https://github.com/xauser/tmk_keyboard/tree/xauser
|
|
||||||
|
|
||||||
**Compact L3**: Custom keyboard designed by LifeZone and LeeKu.
|
|
||||||
- https://github.com/xauser/tmk_keyboard/tree/xauser
|
|
||||||
|
|
||||||
**KMAC, 1,2 and Happy**: Custom keyboard designed by kbdmania.
|
|
||||||
- https://github.com/ageaenes/tmk_keyboard
|
|
||||||
|
|
||||||
**P60**: [DIY wired 60% keyboard](https://imgur.com/a/zwsDN) by [p3lim](https://github.com/p3lim).
|
|
||||||
- https://github.com/p3lim/keyboard_firmware
|
|
||||||
|
|
||||||
**Nerd, Kitten Paw, Lightsaber, Phantom, Lightpad, Ergodox** on [xauser](https://github.com/xauser)'s repository
|
|
||||||
- https://github.com/xauser/tmk_keyboard/tree/xauser
|
|
||||||
|
|
||||||
**ErgoDox** on [cub-unanic](https://github.com/cub-uanic)'s repository
|
|
||||||
- https://github.com/cub-uanic/tmk_keyboard/tree/master/keyboard/ergodox
|
|
||||||
|
|
||||||
**Atreus** by [technomancy](https://atreus.technomancy.us)
|
|
||||||
- https://github.com/technomancy/tmk_keyboard/tree/atreus/keyboard/atreus
|
|
||||||
|
|
||||||
**[mcdox](https://github.com/DavidMcEwan/mcdox)**
|
|
||||||
- https://github.com/DavidMcEwan/tmk_keyboard/tree/master/keyboard/mcdox
|
|
||||||
|
|
||||||
|
|
||||||
### converters
|
|
|
@ -1,69 +0,0 @@
|
||||||
## TMK own projects by hasu
|
|
||||||
Located in [tmk_keyboard](https://github.com/tmk/tmk_keyboard/tree/master/) repository.
|
|
||||||
|
|
||||||
### converter
|
|
||||||
* [ps2_usb] - [PS/2 keyboard to USB][GH_ps2]
|
|
||||||
* [adb_usb] - [ADB keyboard to USB][GH_adb]
|
|
||||||
* [m0110_usb] - [Macintosh 128K/512K/Plus keyboard to USB][GH_m0110]
|
|
||||||
* [terminal_usb] - [IBM Model M terminal keyboard(PS/2 scancode set3) to USB][GH_terminal]
|
|
||||||
* [news_usb] - [Sony NEWS keyboard to USB][GH_news]
|
|
||||||
* [x68k_usb] - [Sharp X68000 keyboard to USB][GH_x68k]
|
|
||||||
* [sun_usb] - [Sun] to USB(type4, 5 and 3?)
|
|
||||||
* [pc98_usb] - [PC98] to USB
|
|
||||||
* [usb_usb] - USB to USB(experimental)
|
|
||||||
* [ascii_usb] - ASCII(Serial console terminal) to USB
|
|
||||||
* [ibm4704_usb] - [IBM 4704 keyboard Converter][GH_ibm4704]
|
|
||||||
|
|
||||||
### keyboard
|
|
||||||
* [hhkb] - [Happy Hacking Keyboard pro][GH_hhkb]
|
|
||||||
* [gh60] - [GH60][GH60_diy] DIY 60% keyboard [prototype][GH60_proto]
|
|
||||||
* [hbkb] - [Happy Buckling spring keyboard][GH_hbkb](IBM Model M 60% mod)
|
|
||||||
* [hid_liber] - [HID liberation][HID_liber] controller (by alaricljs)
|
|
||||||
* [phantom] - [Phantom] keyboard (by Tranquilite)
|
|
||||||
* [IIgs_Standard] - Apple [IIGS] keyboard mod(by JeffreySung)
|
|
||||||
* [macway] - [Compact keyboard mod][GH_macway] [retired]
|
|
||||||
* [KMAC] - Korean custom keyboard
|
|
||||||
* [Lightsaber] - Korean custom keyboard
|
|
||||||
|
|
||||||
[ps2_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/ps2_usb/
|
|
||||||
[adb_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb/
|
|
||||||
[m0110_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/m0110_usb
|
|
||||||
[terminal_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/terminal_usb/
|
|
||||||
[news_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/news_usb/
|
|
||||||
[x68k_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/x68k_usb/
|
|
||||||
[sun_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/sun_usb/
|
|
||||||
[pc98_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/pc98_usb/
|
|
||||||
[usb_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb/
|
|
||||||
[ascii_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/ascii_usb/
|
|
||||||
[ibm4704_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/ibm4704_usb
|
|
||||||
[hhkb]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hhkb/
|
|
||||||
[gh60]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/gh60/
|
|
||||||
[hbkb]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hbkb/
|
|
||||||
[hid_liber]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hid_liber/
|
|
||||||
[phantom]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/phantom/
|
|
||||||
[IIgs_Standard]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/IIgs/
|
|
||||||
[macway]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/macway/
|
|
||||||
[KMAC]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/kmac/
|
|
||||||
[Lightsaber]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/lightsaber/
|
|
||||||
|
|
||||||
[GH_macway]: http://geekhack.org/showwiki.php?title=Island:11930
|
|
||||||
[GH_hhkb]: http://geekhack.org/showwiki.php?title=Island:12047
|
|
||||||
[GH_ps2]: http://geekhack.org/showwiki.php?title=Island:14618
|
|
||||||
[GH_adb]: http://geekhack.org/showwiki.php?title=Island:14290
|
|
||||||
[GH_hhkb_bt]: http://geekhack.org/showwiki.php?title=Island:20851
|
|
||||||
[GH_m0110]: http://geekhack.org/showwiki.php?title=Island:24965
|
|
||||||
[GH_news]: http://geekhack.org/showwiki.php?title=Island:25759
|
|
||||||
[GH_terminal]: http://geekhack.org/showwiki.php?title=Island:27272
|
|
||||||
[GH_x68k]: http://geekhack.org/showwiki.php?title=Island:29060
|
|
||||||
[GH_hbkb]: http://geekhack.org/showwiki.php?title=Island:29483
|
|
||||||
[GH_ibm4704]: http://geekhack.org/index.php?topic=54706.0
|
|
||||||
[HID_liber]: http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions
|
|
||||||
[Phantom]: http://geekhack.org/index.php?topic=26742
|
|
||||||
[GH60_diy]: http://geekhack.org/index.php?topic=34959
|
|
||||||
[GH60_proto]: http://geekhack.org/index.php?topic=37570.0
|
|
||||||
[PC98]: http://en.wikipedia.org/wiki/NEC_PC-9801
|
|
||||||
[Sun]: http://en.wikipedia.org/wiki/Sun-3
|
|
||||||
[IIGS]: http://en.wikipedia.org/wiki/Apple_IIGS
|
|
||||||
|
|
||||||
|
|
||||||
See other [[TMK Based Projects]]
|
|
|
@ -1,243 +0,0 @@
|
||||||
# TMK Documenation
|
|
||||||
|
|
||||||
Features
|
|
||||||
--------
|
|
||||||
These features can be used in your keyboard.
|
|
||||||
|
|
||||||
* Multi-layer Keymap - Multiple keyboard layouts with layer switching
|
|
||||||
* Mouse key - Mouse control with keyboard
|
|
||||||
* System Control Key - Power Down, Sleep, Wake Up and USB Remote Wake up
|
|
||||||
* Media Control Key - Volume Down/Up, Mute, Next/Prev track, Play, Stop and etc
|
|
||||||
* USB NKRO - 120 keys(+ 8 modifiers) simultaneously
|
|
||||||
* PS/2 mouse support - PS/2 mouse(TrackPoint) as composite device
|
|
||||||
* Keyboard protocols - PS/2, ADB, M0110, Sun and other old keyboard protocols
|
|
||||||
* User Function - Customizable function of key with writing code
|
|
||||||
* Macro - Very primitive at this time
|
|
||||||
* Keyboard Tricks - Oneshot modifier and modifier with tapping feature
|
|
||||||
* Debug Console - Messages for debug and interaction with firmware
|
|
||||||
* Virtual DIP Switch - Configurations stored EEPROM(Boot Magic)
|
|
||||||
* Locking CapsLock - Mechanical switch support for CapsLock
|
|
||||||
* Breathing Sleep LED - Sleep indicator with charm during USB suspend
|
|
||||||
* Backlight - Control backlight levels
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Projects
|
|
||||||
--------
|
|
||||||
You can find some keyboard specific projects under `converter` and `keyboard` directory.
|
|
||||||
|
|
||||||
## Main projects
|
|
||||||
|
|
||||||
### OLKB products
|
|
||||||
* [planck](keyboards/planck/) - [Planck] Ortholinear 40% keyboard
|
|
||||||
* [preonic](keyboards/preonic/) - [Preonic] Ortholinear 50% keyboard
|
|
||||||
* [atomic](keyboards/atomic/) - [Atomic] Ortholinear 60% keyboard
|
|
||||||
|
|
||||||
### Ergodox EZ
|
|
||||||
* [ergodox_ez](keyboards/ergodox/ez) - [Ergodox_EZ] Assembled split keyboard
|
|
||||||
|
|
||||||
## Other projects
|
|
||||||
|
|
||||||
### converter
|
|
||||||
* [ps2_usb](converter/ps2_usb/) - [PS/2 keyboard to USB][GH_ps2]
|
|
||||||
* [adb_usb](converter/adb_usb/) - [ADB keyboard to USB][GH_adb]
|
|
||||||
* [m0110_usb](converter/m0110_usb) - [Macintosh 128K/512K/Plus keyboard to USB][GH_m0110]
|
|
||||||
* [terminal_usb](converter/terminal_usb/) - [IBM Model M terminal keyboard(PS/2 scancode set3) to USB][GH_terminal]
|
|
||||||
* [news_usb](converter/news_usb/) - [Sony NEWS keyboard to USB][GH_news]
|
|
||||||
* [x68k_usb](converter/x68k_usb/) - [Sharp X68000 keyboard to USB][GH_x68k]
|
|
||||||
* [sun_usb](converter/sun_usb/) - [Sun] to USB(type4, 5 and 3?)
|
|
||||||
* [pc98_usb](converter/pc98_usb/) - [PC98] to USB
|
|
||||||
* [usb_usb](converter/usb_usb/) - USB to USB(experimental)
|
|
||||||
* [ascii_usb](converter/ascii_usb/) - ASCII(Serial console terminal) to USB
|
|
||||||
* [ibm4704_usb](converter/ibm4704_usb) - [IBM 4704 keyboard Converter][GH_ibm4704]
|
|
||||||
|
|
||||||
### keyboard
|
|
||||||
* [hhkb](keyboards/hhkb/) - [Happy Hacking Keyboard pro][GH_hhkb] hasu's main board
|
|
||||||
* [gh60](keyboards/gh60/) - [GH60] DIY 60% keyboard [prototype][GH60_proto] hasu's second board
|
|
||||||
* [hbkb](keyboards/hbkb/) - [Happy Buckling spring keyboard][GH_hbkb](IBM Model M 60% mod)
|
|
||||||
* [hid_liber](keyboards/hid_liber/) - [HID liberation][HID_liber] controller (by alaricljs)
|
|
||||||
* [phantom](keyboards/phantom/) - [Phantom] keyboard (by Tranquilite)
|
|
||||||
* [IIgs_Standard](keyboards/IIgs/) - Apple [IIGS] keyboard mod(by JeffreySung)
|
|
||||||
* [macway](keyboards/macway/) - [Compact keyboard mod][GH_macway] [retired]
|
|
||||||
* [KMAC](keyboards/kmac/) - Korean custom keyboard
|
|
||||||
* [Lightsaber](keyboards/lightsaber/) - Korean custom keyboard
|
|
||||||
* [Infinity](keyboards/infinity/) - Massdrop [Infinity keyboard][Infinity]
|
|
||||||
* [NerD](keyboards/nerd/) - Korean custom keyboard
|
|
||||||
* [KittenPaw](keyboards/kitten_paw) - Custom Majestouch controller
|
|
||||||
* [Lightpad](keyboards/lightpad) - Korean custom keypad
|
|
||||||
* [ghost_squid](keyboards/ghost_squid/) - [The Ghost Squid][ghost_squid] controller for [Cooler Master QuickFire XT][cmxt]
|
|
||||||
|
|
||||||
### Extenal projects using tmk_keyboard
|
|
||||||
* [ErgoDox_cub-uanic][cub-uanic] - Split Ergonomic Keyboard [ErgoDox][ergodox_org]
|
|
||||||
* [mcdox][mcdox_tmk] - [mcdox][mcdox]
|
|
||||||
|
|
||||||
|
|
||||||
[GH_macway]: http://geekhack.org/showwiki.php?title=Island:11930
|
|
||||||
[GH_hhkb]: http://geekhack.org/showwiki.php?title=Island:12047
|
|
||||||
[GH_ps2]: http://geekhack.org/showwiki.php?title=Island:14618
|
|
||||||
[GH_adb]: http://geekhack.org/showwiki.php?title=Island:14290
|
|
||||||
[GH_hhkb_bt]: http://geekhack.org/showwiki.php?title=Island:20851
|
|
||||||
[GH_m0110]: http://geekhack.org/showwiki.php?title=Island:24965
|
|
||||||
[GH_news]: http://geekhack.org/showwiki.php?title=Island:25759
|
|
||||||
[GH_terminal]: http://geekhack.org/showwiki.php?title=Island:27272
|
|
||||||
[GH_x68k]: http://geekhack.org/showwiki.php?title=Island:29060
|
|
||||||
[GH_hbkb]: http://geekhack.org/showwiki.php?title=Island:29483
|
|
||||||
[GH_ibm4704]: http://geekhack.org/index.php?topic=54706.0
|
|
||||||
[HID_liber]: http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions
|
|
||||||
[Phantom]: http://geekhack.org/index.php?topic=26742
|
|
||||||
[GH60]: http://geekhack.org/index.php?topic=34959
|
|
||||||
[GH60_proto]: http://geekhack.org/index.php?topic=37570.0
|
|
||||||
[PC98]: http://en.wikipedia.org/wiki/NEC_PC-9801
|
|
||||||
[Sun]: http://en.wikipedia.org/wiki/Sun-3
|
|
||||||
[IIGS]: http://en.wikipedia.org/wiki/Apple_IIGS
|
|
||||||
[Infinity]: https://www.massdrop.com/buy/infinity-keyboard-kit
|
|
||||||
[ghost_squid]: http://deskthority.net/wiki/Costar_replacement_controllers#The_Ghost_Squid
|
|
||||||
[cmxt]: http://gaming.coolermaster.com/en/products/keyboard/quickfirext/
|
|
||||||
[ergodox_org]: http://ergodox.org/
|
|
||||||
[cub-uanic]: https://github.com/cub-uanic/tmk_keyboard/tree/master/keyboard/ergodox
|
|
||||||
[mcdox]: https://github.com/DavidMcEwan/mcdox
|
|
||||||
[mcdox_tmk]: https://github.com/DavidMcEwan/tmk_keyboard/tree/master/keyboard/mcdox
|
|
||||||
[Planck]: http://olkb.co/planck
|
|
||||||
[Preonic]: http://olkb.co/preonic
|
|
||||||
[Atomic]: http://olkb.co/atomic
|
|
||||||
[Ergodox_EZ]: https://www.indiegogo.com/projects/ergodox-ez-an-incredible-mechanical-keyboard
|
|
||||||
|
|
||||||
|
|
||||||
License
|
|
||||||
-------
|
|
||||||
**GPLv2** or later. Some protocol files are under **Modified BSD License**.
|
|
||||||
|
|
||||||
Third party libraries like LUFA, PJRC and V-USB have their own license respectively.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Build Firmware and Program Controller
|
|
||||||
-------------------------------------
|
|
||||||
See [build environment setup](build_environment_setup.md), or the readme in the particular keyboards/* folder.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Change your keymap
|
|
||||||
------------------
|
|
||||||
See [keymap.md](keymap.md).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Magic Commands
|
|
||||||
--------------
|
|
||||||
To see help press `Magic` + `H`.
|
|
||||||
|
|
||||||
`Magic` key combination is `LShift` + `RShift` in many project, but `Power` key on ADB converter.
|
|
||||||
`Magic` keybind can be vary on each project, check `config.h` in project directory.
|
|
||||||
|
|
||||||
Following commands can be also executed with `Magic` + key. In console mode `Magic` keybind is not needed.
|
|
||||||
|
|
||||||
----- Command Help -----
|
|
||||||
c: enter console mode
|
|
||||||
d: toggle debug enable
|
|
||||||
x: toggle matrix debug
|
|
||||||
k: toggle keyboard debug
|
|
||||||
m: toggle mouse debug
|
|
||||||
v: print device version & info
|
|
||||||
t: print timer count
|
|
||||||
s: print status
|
|
||||||
e: print eeprom config
|
|
||||||
n: toggle NKRO
|
|
||||||
0/F10: switch to Layer0
|
|
||||||
1/F1: switch to Layer1
|
|
||||||
2/F2: switch to Layer2
|
|
||||||
3/F3: switch to Layer3
|
|
||||||
4/F4: switch to Layer4
|
|
||||||
PScr: power down/remote wake-up
|
|
||||||
Caps: Lock Keyboard(Child Proof)
|
|
||||||
Paus: jump to bootloader
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Boot Magic Configuration - Virtual DIP Switch
|
|
||||||
---------------------------------------------
|
|
||||||
Boot Magic are executed during boot up time. Press Magic key below then plug in keyboard cable.
|
|
||||||
Note that you must use keys of **Layer 0** as Magic keys. These settings are stored in EEPROM so that retain your configure over power cycles.
|
|
||||||
|
|
||||||
To avoid configuring accidentally additive salt key `KC_SPACE` also needs to be pressed along with the following configuration keys. The salt key is configurable in `config.h`. See [tmk_core/common/bootmagic.h](/tmk_core/common/bootmagic.h).
|
|
||||||
|
|
||||||
#### General
|
|
||||||
- Skip reading EEPROM to start with default configuration(`ESC`)
|
|
||||||
- Clear configuration stored in EEPROM to reset configuration(`Backspace`)
|
|
||||||
|
|
||||||
#### Bootloader
|
|
||||||
- Kick up Bootloader(`B`)
|
|
||||||
|
|
||||||
#### Debug
|
|
||||||
- Debug enable(`D`)
|
|
||||||
- Debug matrix enable(`D`+`X`)
|
|
||||||
- Debug keyboard enable(`D`+`K`)
|
|
||||||
- Debug mouse enable(`D`+`M`)
|
|
||||||
|
|
||||||
#### Keymap
|
|
||||||
- Swap Control and CapsLock(`Left Control`)
|
|
||||||
- Change CapsLock to Control(`Caps Lock`)
|
|
||||||
- Swap LeftAlt and Gui(`Left Alt`)
|
|
||||||
- Swap RightAlt and Gui(`Right Alt`)
|
|
||||||
- Disable Gui(`Left Gui`)
|
|
||||||
- Swap Grave and Escape(`Grave`)
|
|
||||||
- Swap BackSlash and BackSpace(`Back Slash`)
|
|
||||||
- Enable NKRO on boot(`N`)
|
|
||||||
|
|
||||||
#### Default Layer
|
|
||||||
- Set Default Layer to 0(`0`)
|
|
||||||
- Set Default Layer to 1(`1`)
|
|
||||||
- Set Default Layer to 2(`2`)
|
|
||||||
- Set Default Layer to 3(`3`)
|
|
||||||
- Set Default Layer to 4(`4`)
|
|
||||||
- Set Default Layer to 5(`5`)
|
|
||||||
- Set Default Layer to 6(`6`)
|
|
||||||
- Set Default Layer to 7(`7`)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Mechanical Locking support
|
|
||||||
--------------------------
|
|
||||||
This feature makes it possible for you to use mechanical locking switch for `CapsLock`, `NumLock`
|
|
||||||
or `ScrollLock`. To enable this feature define these macros in `config.h` and use `KC_LCAP`, `KC_LN
|
|
||||||
UM` or `KC_LSCR` in keymap for locking key instead of normal `KC_CAPS`, `KC_NLCK` or `KC_SLCK`. Res
|
|
||||||
ync option tries to keep switch state consistent with keyboard LED state.
|
|
||||||
|
|
||||||
#define LOCKING_SUPPORT_ENABLE
|
|
||||||
#define LOCKING_RESYNC_ENABLE
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Start Your Own Project
|
|
||||||
-----------------------
|
|
||||||
**TBD**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Debugging
|
|
||||||
--------
|
|
||||||
Use PJRC's `hid_listen` to see debug messages. You can use the tool for debug even if firmware use LUFA stack.
|
|
||||||
|
|
||||||
You can use xprintf() to display debug info on `hid_listen`, see `tmk_core/common/xprintf.h`.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Files and Directories
|
|
||||||
-------------------
|
|
||||||
### Top
|
|
||||||
* tmk_core/ - core library
|
|
||||||
* keyboards/ - keyboard projects
|
|
||||||
* converter/ - protocol converter projects
|
|
||||||
* doc/ - documents
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Coding Style
|
|
||||||
-------------
|
|
||||||
- Doesn't use Tab to indent, use 4-spaces instead.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Other Keyboard Firmware Projects
|
|
||||||
------------------
|
|
||||||
You can learn a lot about keyboard firmware from these. See [docs/other_projects.md](other_projects.md).
|
|
172
docs/understanding_qmk.md
Normal file
172
docs/understanding_qmk.md
Normal file
|
@ -0,0 +1,172 @@
|
||||||
|
# Understanding QMK's Code
|
||||||
|
|
||||||
|
This document attempts to explain how the QMK firmware works from a very high level. It assumes you understand basic programming concepts but does not (except where needed to demonstrate) assume familiarity with C. It assumes that you have a basic understanding of the following documents:
|
||||||
|
|
||||||
|
* [QMK Overview](qmk_overview.md)
|
||||||
|
* [How Keyboards Work](how_keyboards_work.md)
|
||||||
|
* [FAQ](faq.md)
|
||||||
|
|
||||||
|
## Startup
|
||||||
|
|
||||||
|
You can think of QMK as no different from any other computer program. It is started, performs its tasks, and then ends. The entry point for the program is the `main()` function, just like it is on any other C program. However, for a newcomer to QMK it can be confusing because the `main()` function appears in multiple places, and it can be hard to tell which one to look at.
|
||||||
|
|
||||||
|
The reason for this is the different platforms that QMK supports. The most common platform is `lufa`, which runs on AVR processors such at the atmega32u4. We also support `chibios` and `vusb`.
|
||||||
|
|
||||||
|
We'll focus on AVR processors for the moment, which use the `lufa` platform. You can find the `main()` function in [tmk_core/protocol/lufa/lufa.c](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/lufa.c#L1129). If you browse through that function you'll find that it initializes any hardware that has been configured (including USB to the host) and then it starts the core part of the program with a [`while(1)`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/lufa.c#L1182). This is [The Main Loop](#the_main_loop).
|
||||||
|
|
||||||
|
## The Main Loop
|
||||||
|
|
||||||
|
This section of code is called "The Main Loop" because it's responsible for looping over the same set of instructions forever. This is where QMK dispatches out to the functions responsible for making the keyboard do everything it is supposed to do. At first glance it can look like a lot of functionality but most of the time the code will be disabled by `#define`'s.
|
||||||
|
|
||||||
|
```
|
||||||
|
keyboard_task();
|
||||||
|
```
|
||||||
|
|
||||||
|
This is where all the keyboard specific functionality is dispatched. The source code for `keyboard_task()` can be found in [tmk_core/common/keyboard.c](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keyboard.c#L154), and it is responsible for detecting changes in the matrix and turning status LED's on and off.
|
||||||
|
|
||||||
|
Within `keyboard_task()` you'll find code to handle:
|
||||||
|
|
||||||
|
* [Matrix Scanning](#matrix-scanning)
|
||||||
|
* Mouse Handling
|
||||||
|
* Serial Link(s)
|
||||||
|
* Visualizer
|
||||||
|
* Keyboard status LED's (Caps Lock, Num Lock, Scroll Lock)
|
||||||
|
|
||||||
|
#### Matrix Scanning
|
||||||
|
|
||||||
|
Matrix scanning is the core function of a keyboard firmware. It is the process of detecting which keys are currently pressed, and your keyboard runs this function many times a second. It's no exaggeration to say that 99% of your firmware's CPU time is spent on matrix scanning.
|
||||||
|
|
||||||
|
While there are different strategies for doing the actual matrix detection, they are out of scope for this document. It is sufficient to treat matrix scanning as a black box, you ask for the matrix's current state and get back a datastructure that looks like this:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
{0,0,0,0},
|
||||||
|
{0,0,0,0},
|
||||||
|
{0,0,0,0},
|
||||||
|
{0,0,0,0},
|
||||||
|
{0,0,0,0}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
That datastructure is a direct representation of the matrix for a 4 row by 5 column numpad. When a key is pressed that key's position within the matrix will be returned as `1` instead of `0`.
|
||||||
|
|
||||||
|
Matrix Scanning runs many times per second. The exact rate varies but typically it runs at least 10 times per second to avoid perceptible lag.
|
||||||
|
|
||||||
|
##### Matrix to Physical Layout Map
|
||||||
|
|
||||||
|
Once we know the state of every switch on our keyboard we have to map that to a keycode. In QMK this is done by making use of C macros to allow us to separate the definition of the physical layout from the definition of keycodes.
|
||||||
|
|
||||||
|
At the keyboard level we define a C macro (typically named `KEYMAP()`) which maps our keyboard's matrix to physical keys. Sometimes the matrix does not have a switch in every location, and we can use this macro to pre-populate those with KC_NO, making the keymap definition easier to work with. Here's an example `KEYMAP()` macro for a numpad:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define KEYMAP( \
|
||||||
|
k00, k01, k02, k03, \
|
||||||
|
k10, k11, k12, k13, \
|
||||||
|
k20, k21, k22, \
|
||||||
|
k30, k31, k32, k33, \
|
||||||
|
k40, k42 \
|
||||||
|
) { \
|
||||||
|
{ k00, k01, k02, k03, }, \
|
||||||
|
{ k10, k11, k12, k13, }, \
|
||||||
|
{ k20, k21, k22, KC_NO, }, \
|
||||||
|
{ k30, k31, k32, k33, }, \
|
||||||
|
{ k40, KC_NO, k42, KC_NO } \
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Notice how the second block of our `KEYMAP()` macro matches the Matrix Scanning array above? This macro is what will map the matrix scanning array to keycodes. However, if you look at a 17 key numpad you'll notice that it has 3 places where the matrix could have a switch but doesn't, due to larger keys. We have populated those spaces with `KC_NO` so that our keymap definition doesn't have to.
|
||||||
|
|
||||||
|
You can also use this macro to handle unusual matrix layouts, for example the [Clueboard rev 2](https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/rev2/rev2.h). Explaining that is outside the scope of this document.
|
||||||
|
|
||||||
|
##### Keycode Assignment
|
||||||
|
|
||||||
|
At the keymap level we make use of our `KEYMAP()` macro above to map keycodes to physical locations to matrix locations. It looks like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = KEYMAP(
|
||||||
|
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
||||||
|
KC_P7, KC_P8, KC_P9, KC_PPLS, \
|
||||||
|
KC_P4, KC_P5, KC_P6, \
|
||||||
|
KC_P1, KC_P2, KC_P3, KC_PENT, \
|
||||||
|
KC_P0, KC_PDOT)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Notice how all of these arguments match up with the first half of the `KEYMAP()` macro from the last section? This is how we take a keycode and map it to our Matrix Scan from earlier.
|
||||||
|
|
||||||
|
##### State Change Detection
|
||||||
|
|
||||||
|
The matrix scanning described above tells us the state of the matrix at a given moment, but your computer only wants to know about changes, it doesn't care about the current state. QMK stores the results from the last matrix scan and compares the results from this matrix to determine when a key has been pressed or released.
|
||||||
|
|
||||||
|
Let's look at an example. We'll hop into the middle of a keyboard scanning loop to find that our previous scan looks like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
{0,0,0,0},
|
||||||
|
{0,0,0,0},
|
||||||
|
{0,0,0,0},
|
||||||
|
{0,0,0,0},
|
||||||
|
{0,0,0,0}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
And when our current scan completes it will look like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
{1,0,0,0},
|
||||||
|
{0,0,0,0},
|
||||||
|
{0,0,0,0},
|
||||||
|
{0,0,0,0},
|
||||||
|
{0,0,0,0}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Comparing against our keymap we can see that the pressed key is KC_NLCK. From here we dispatch to the `process_record` set of functions.
|
||||||
|
|
||||||
|
<!-- FIXME: Magic happens between here and process_record -->
|
||||||
|
|
||||||
|
##### Process Record
|
||||||
|
|
||||||
|
The `process_record()` function itself is deceptively simple, but hidden within is a gateway to overriding functionality at various levels of QMK. The chain of events is described below, using cluecard whenever we need to look at the keyboard/keymap level functions.
|
||||||
|
|
||||||
|
* [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action.c#L128)
|
||||||
|
* [`bool process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c#L140)
|
||||||
|
* [Map this record to a keycode](https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c#L143)
|
||||||
|
* [`bool process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/keyboards/cluecard/cluecard.c#L20)
|
||||||
|
* [`bool process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/keyboards/cluecard/keymaps/default/keymap.c#L58)
|
||||||
|
* [`bool process_midi(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_midi.c#L102)
|
||||||
|
* [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_audio.c#L10)
|
||||||
|
* [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_music.c#L69)
|
||||||
|
* [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_tap_dance.c#L75)
|
||||||
|
* [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_leader.c#L32)
|
||||||
|
* [`bool process_chording(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_chording.c#L41)
|
||||||
|
* [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_combo.c#L115)
|
||||||
|
* [`bool process_unicode(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicode.c#L22)
|
||||||
|
* [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_ucis.c#L91)
|
||||||
|
* [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_printer.c#L77)
|
||||||
|
* [`bool process_unicode_map(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicodemap.c#L47)
|
||||||
|
* [Identify and process quantum specific keycodes](https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c#L211)
|
||||||
|
|
||||||
|
At any step during this chain of events a function (such as `process_record_kb()`) can `return false` to halt all further processing.
|
||||||
|
|
||||||
|
<!--
|
||||||
|
#### Mouse Handling
|
||||||
|
|
||||||
|
FIXME: This needs to be written
|
||||||
|
|
||||||
|
#### Serial Link(s)
|
||||||
|
|
||||||
|
FIXME: This needs to be written
|
||||||
|
|
||||||
|
#### Visualizer
|
||||||
|
|
||||||
|
FIXME: This needs to be written
|
||||||
|
|
||||||
|
#### Keyboard state LED's (Caps Lock, Num Lock, Scroll Lock)
|
||||||
|
|
||||||
|
FIXME: This needs to be written
|
||||||
|
|
||||||
|
-->
|
|
@ -1,20 +1,20 @@
|
||||||
## Unicode support
|
# Unicode support
|
||||||
|
|
||||||
There are three Unicode keymap definition method available in QMK:
|
There are three Unicode keymap definition method available in QMK:
|
||||||
|
|
||||||
### UNICODE_ENABLE
|
## UNICODE_ENABLE
|
||||||
|
|
||||||
Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in
|
Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in
|
||||||
keymap file, where *n* is a 4 digit hexadecimal.
|
keymap file, where *n* is a 4 digit hexadecimal.
|
||||||
|
|
||||||
### UNICODEMAP_ENABLE
|
## UNICODEMAP_ENABLE
|
||||||
|
|
||||||
Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping
|
Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping
|
||||||
table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file.
|
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
|
The keycode function is `X(n)` where *n* is the array index of the mapping
|
||||||
table.
|
table.
|
||||||
|
|
||||||
### UCIS_ENABLE
|
## UCIS_ENABLE
|
||||||
|
|
||||||
TBD
|
TBD
|
||||||
|
|
||||||
|
@ -28,11 +28,11 @@ This is the current list of Unicode input method in QMK:
|
||||||
* 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_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.
|
* 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
|
# 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.
|
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
|
# International Characters on Windows
|
||||||
|
|
||||||
[AutoHotkey](https://autohotkey.com) allows Windows users to create custom hotkeys among others.
|
[AutoHotkey](https://autohotkey.com) allows Windows users to create custom hotkeys among others.
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
# Getting Report Descriptor
|
|
||||||
```
|
|
||||||
$ cd /sys/bus/usb/drivers/usbhid
|
|
||||||
$ ls
|
|
||||||
1-1.3.4:1.0 1-1.3.4:1.2 bind new_id uevent
|
|
||||||
1-1.3.4:1.1 1-1.3.4:1.3 module remove_id unbind
|
|
||||||
$ echo -n 1-1.4\:1.0 | sudo tee unbind
|
|
||||||
$ sudo lsusb -vvv -d 046d:c01d
|
|
||||||
$ echo -n 1-1.4\:1.0 | sudo tee bind
|
|
||||||
```
|
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
#ifdef SSD1306OLED
|
#ifdef SSD1306OLED
|
||||||
|
|
||||||
#include "ssd1306.h"
|
#include "ssd1306.h"
|
||||||
#include "config.h"
|
|
||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "print.h"
|
#include "print.h"
|
||||||
#include "lets_split.h"
|
#include "glcdfont.c"
|
||||||
#include "common/glcdfont.c"
|
|
||||||
#ifdef ADAFRUIT_BLE_ENABLE
|
#ifdef ADAFRUIT_BLE_ENABLE
|
||||||
#include "adafruit_ble.h"
|
#include "adafruit_ble.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -14,18 +12,7 @@
|
||||||
#include "lufa.h"
|
#include "lufa.h"
|
||||||
#endif
|
#endif
|
||||||
#include "sendchar.h"
|
#include "sendchar.h"
|
||||||
#include "pincontrol.h"
|
#include "timer.h"
|
||||||
|
|
||||||
//assign the right code to your layers
|
|
||||||
#define _BASE 0
|
|
||||||
#define _LOWER 8
|
|
||||||
#define _RAISE 16
|
|
||||||
#define _FNLAYER 64
|
|
||||||
#define _NUMLAY 128
|
|
||||||
#define _NLOWER 136
|
|
||||||
#define _NFNLAYER 192
|
|
||||||
#define _MOUSECURSOR 256
|
|
||||||
#define _ADJUST 65560
|
|
||||||
|
|
||||||
// Set this to 1 to help diagnose early startup problems
|
// Set this to 1 to help diagnose early startup problems
|
||||||
// when testing power-on with ble. Turn it off otherwise,
|
// when testing power-on with ble. Turn it off otherwise,
|
||||||
|
@ -33,26 +20,6 @@
|
||||||
// with the matrix scan, causing keys to drop.
|
// with the matrix scan, causing keys to drop.
|
||||||
#define DEBUG_TO_SCREEN 0
|
#define DEBUG_TO_SCREEN 0
|
||||||
|
|
||||||
// Controls the SSD1306 128x32 OLED display via i2c
|
|
||||||
|
|
||||||
#define i2cAddress 0x3C
|
|
||||||
|
|
||||||
#define DisplayHeight 32
|
|
||||||
#define DisplayWidth 128
|
|
||||||
|
|
||||||
#define FontHeight 8
|
|
||||||
#define FontWidth 6
|
|
||||||
|
|
||||||
#define MatrixRows (DisplayHeight / FontHeight)
|
|
||||||
#define MatrixCols (DisplayWidth / FontWidth)
|
|
||||||
|
|
||||||
struct CharacterMatrix {
|
|
||||||
uint8_t display[MatrixRows][MatrixCols];
|
|
||||||
uint8_t *cursor;
|
|
||||||
bool dirty;
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct CharacterMatrix display;
|
|
||||||
//static uint16_t last_battery_update;
|
//static uint16_t last_battery_update;
|
||||||
//static uint32_t vbat;
|
//static uint32_t vbat;
|
||||||
//#define BatteryUpdateInterval 10000 /* milliseconds */
|
//#define BatteryUpdateInterval 10000 /* milliseconds */
|
||||||
|
@ -62,54 +29,13 @@ static uint8_t displaying;
|
||||||
#endif
|
#endif
|
||||||
static uint16_t last_flush;
|
static uint16_t last_flush;
|
||||||
|
|
||||||
enum ssd1306_cmds {
|
|
||||||
DisplayOff = 0xAE,
|
|
||||||
DisplayOn = 0xAF,
|
|
||||||
|
|
||||||
SetContrast = 0x81,
|
|
||||||
DisplayAllOnResume = 0xA4,
|
|
||||||
|
|
||||||
DisplayAllOn = 0xA5,
|
|
||||||
NormalDisplay = 0xA6,
|
|
||||||
InvertDisplay = 0xA7,
|
|
||||||
SetDisplayOffset = 0xD3,
|
|
||||||
SetComPins = 0xda,
|
|
||||||
SetVComDetect = 0xdb,
|
|
||||||
SetDisplayClockDiv = 0xD5,
|
|
||||||
SetPreCharge = 0xd9,
|
|
||||||
SetMultiPlex = 0xa8,
|
|
||||||
SetLowColumn = 0x00,
|
|
||||||
SetHighColumn = 0x10,
|
|
||||||
SetStartLine = 0x40,
|
|
||||||
|
|
||||||
SetMemoryMode = 0x20,
|
|
||||||
ColumnAddr = 0x21,
|
|
||||||
PageAddr = 0x22,
|
|
||||||
|
|
||||||
ComScanInc = 0xc0,
|
|
||||||
ComScanDec = 0xc8,
|
|
||||||
SegRemap = 0xa0,
|
|
||||||
SetChargePump = 0x8d,
|
|
||||||
ExternalVcc = 0x01,
|
|
||||||
SwitchCapVcc = 0x02,
|
|
||||||
|
|
||||||
ActivateScroll = 0x2f,
|
|
||||||
DeActivateScroll = 0x2e,
|
|
||||||
SetVerticalScrollArea = 0xa3,
|
|
||||||
RightHorizontalScroll = 0x26,
|
|
||||||
LeftHorizontalScroll = 0x27,
|
|
||||||
VerticalAndRightHorizontalScroll = 0x29,
|
|
||||||
VerticalAndLeftHorizontalScroll = 0x2a,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Write command sequence.
|
// Write command sequence.
|
||||||
// Returns true on success.
|
// Returns true on success.
|
||||||
static inline bool _send_cmd1(uint8_t cmd) {
|
static inline bool _send_cmd1(uint8_t cmd) {
|
||||||
bool res = false;
|
bool res = false;
|
||||||
|
|
||||||
if (i2c_start_write(i2cAddress)) {
|
if (i2c_start_write(SSD1306_ADDRESS)) {
|
||||||
xprintf("failed to start write to %d\n", i2cAddress);
|
xprintf("failed to start write to %d\n", SSD1306_ADDRESS);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,8 +80,6 @@ static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) {
|
||||||
#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;}
|
#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;}
|
||||||
#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;}
|
#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;}
|
||||||
|
|
||||||
static void matrix_clear(struct CharacterMatrix *matrix);
|
|
||||||
|
|
||||||
static void clear_display(void) {
|
static void clear_display(void) {
|
||||||
matrix_clear(&display);
|
matrix_clear(&display);
|
||||||
|
|
||||||
|
@ -164,7 +88,7 @@ static void clear_display(void) {
|
||||||
send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1);
|
send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1);
|
||||||
send_cmd3(ColumnAddr, 0, DisplayWidth - 1);
|
send_cmd3(ColumnAddr, 0, DisplayWidth - 1);
|
||||||
|
|
||||||
if (i2c_start_write(i2cAddress)) {
|
if (i2c_start_write(SSD1306_ADDRESS)) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (i2c_master_write(0x40)) {
|
if (i2c_master_write(0x40)) {
|
||||||
|
@ -210,14 +134,17 @@ bool iota_gfx_init(void) {
|
||||||
send_cmd2(SetChargePump, 0x14 /* Enable */);
|
send_cmd2(SetChargePump, 0x14 /* Enable */);
|
||||||
send_cmd2(SetMemoryMode, 0 /* horizontal addressing */);
|
send_cmd2(SetMemoryMode, 0 /* horizontal addressing */);
|
||||||
|
|
||||||
/// Flips the display orientation 0 degrees
|
#ifdef OLED_ROTATE180
|
||||||
send_cmd1(SegRemap | 0x1);
|
|
||||||
send_cmd1(ComScanDec);
|
|
||||||
/*
|
|
||||||
// the following Flip the display orientation 180 degrees
|
// the following Flip the display orientation 180 degrees
|
||||||
send_cmd1(SegRemap);
|
send_cmd1(SegRemap);
|
||||||
send_cmd1(ComScanInc);
|
send_cmd1(ComScanInc);
|
||||||
// end flip */
|
#endif
|
||||||
|
#ifndef OLED_ROTATE180
|
||||||
|
// Flips the display orientation 0 degrees
|
||||||
|
send_cmd1(SegRemap | 0x1);
|
||||||
|
send_cmd1(ComScanDec);
|
||||||
|
#endif
|
||||||
|
|
||||||
send_cmd2(SetComPins, 0x2);
|
send_cmd2(SetComPins, 0x2);
|
||||||
send_cmd2(SetContrast, 0x8f);
|
send_cmd2(SetContrast, 0x8f);
|
||||||
send_cmd2(SetPreCharge, 0xf1);
|
send_cmd2(SetPreCharge, 0xf1);
|
||||||
|
@ -263,7 +190,7 @@ done:
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) {
|
void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) {
|
||||||
*matrix->cursor = c;
|
*matrix->cursor = c;
|
||||||
++matrix->cursor;
|
++matrix->cursor;
|
||||||
|
|
||||||
|
@ -276,7 +203,7 @@ static void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) {
|
void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) {
|
||||||
matrix->dirty = true;
|
matrix->dirty = true;
|
||||||
|
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
|
@ -297,7 +224,7 @@ void iota_gfx_write_char(uint8_t c) {
|
||||||
matrix_write_char(&display, c);
|
matrix_write_char(&display, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void matrix_write(struct CharacterMatrix *matrix, const char *data) {
|
void matrix_write(struct CharacterMatrix *matrix, const char *data) {
|
||||||
const char *end = data + strlen(data);
|
const char *end = data + strlen(data);
|
||||||
while (data < end) {
|
while (data < end) {
|
||||||
matrix_write_char(matrix, *data);
|
matrix_write_char(matrix, *data);
|
||||||
|
@ -309,7 +236,7 @@ void iota_gfx_write(const char *data) {
|
||||||
matrix_write(&display, data);
|
matrix_write(&display, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void matrix_write_P(struct CharacterMatrix *matrix, const char *data) {
|
void matrix_write_P(struct CharacterMatrix *matrix, const char *data) {
|
||||||
while (true) {
|
while (true) {
|
||||||
uint8_t c = pgm_read_byte(data);
|
uint8_t c = pgm_read_byte(data);
|
||||||
if (c == 0) {
|
if (c == 0) {
|
||||||
|
@ -324,7 +251,7 @@ void iota_gfx_write_P(const char *data) {
|
||||||
matrix_write_P(&display, data);
|
matrix_write_P(&display, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void matrix_clear(struct CharacterMatrix *matrix) {
|
void matrix_clear(struct CharacterMatrix *matrix) {
|
||||||
memset(matrix->display, ' ', sizeof(matrix->display));
|
memset(matrix->display, ' ', sizeof(matrix->display));
|
||||||
matrix->cursor = &matrix->display[0][0];
|
matrix->cursor = &matrix->display[0][0];
|
||||||
matrix->dirty = true;
|
matrix->dirty = true;
|
||||||
|
@ -334,7 +261,7 @@ void iota_gfx_clear_screen(void) {
|
||||||
matrix_clear(&display);
|
matrix_clear(&display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void matrix_render(struct CharacterMatrix *matrix) {
|
void matrix_render(struct CharacterMatrix *matrix) {
|
||||||
last_flush = timer_read();
|
last_flush = timer_read();
|
||||||
iota_gfx_on();
|
iota_gfx_on();
|
||||||
#if DEBUG_TO_SCREEN
|
#if DEBUG_TO_SCREEN
|
||||||
|
@ -345,7 +272,7 @@ static void matrix_render(struct CharacterMatrix *matrix) {
|
||||||
send_cmd3(PageAddr, 0, MatrixRows - 1);
|
send_cmd3(PageAddr, 0, MatrixRows - 1);
|
||||||
send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1);
|
send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1);
|
||||||
|
|
||||||
if (i2c_start_write(i2cAddress)) {
|
if (i2c_start_write(SSD1306_ADDRESS)) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (i2c_master_write(0x40)) {
|
if (i2c_master_write(0x40)) {
|
||||||
|
@ -380,84 +307,12 @@ void iota_gfx_flush(void) {
|
||||||
matrix_render(&display);
|
matrix_render(&display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void matrix_update(struct CharacterMatrix *dest,
|
__attribute__ ((weak))
|
||||||
const struct CharacterMatrix *source) {
|
void iota_gfx_task_user(void) {
|
||||||
if (memcmp(dest->display, source->display, sizeof(dest->display))) {
|
|
||||||
memcpy(dest->display, source->display, sizeof(dest->display));
|
|
||||||
dest->dirty = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void render_status_info(void) {
|
|
||||||
#if DEBUG_TO_SCREEN
|
|
||||||
if (debug_enable) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct CharacterMatrix matrix;
|
|
||||||
|
|
||||||
matrix_clear(&matrix);
|
|
||||||
matrix_write_P(&matrix, PSTR("USB: "));
|
|
||||||
#ifdef PROTOCOL_LUFA
|
|
||||||
switch (USB_DeviceState) {
|
|
||||||
case DEVICE_STATE_Unattached:
|
|
||||||
matrix_write_P(&matrix, PSTR("Unattached"));
|
|
||||||
break;
|
|
||||||
case DEVICE_STATE_Suspended:
|
|
||||||
matrix_write_P(&matrix, PSTR("Suspended"));
|
|
||||||
break;
|
|
||||||
case DEVICE_STATE_Configured:
|
|
||||||
matrix_write_P(&matrix, PSTR("Connected"));
|
|
||||||
break;
|
|
||||||
case DEVICE_STATE_Powered:
|
|
||||||
matrix_write_P(&matrix, PSTR("Powered"));
|
|
||||||
break;
|
|
||||||
case DEVICE_STATE_Default:
|
|
||||||
matrix_write_P(&matrix, PSTR("Default"));
|
|
||||||
break;
|
|
||||||
case DEVICE_STATE_Addressed:
|
|
||||||
matrix_write_P(&matrix, PSTR("Addressed"));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
matrix_write_P(&matrix, PSTR("Invalid"));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
|
|
||||||
|
|
||||||
char buf[40];
|
|
||||||
snprintf(buf,sizeof(buf), "Undef-%ld", layer_state);
|
|
||||||
matrix_write_P(&matrix, PSTR("\n\nLayer: "));
|
|
||||||
switch (layer_state) {
|
|
||||||
case _BASE:
|
|
||||||
matrix_write_P(&matrix, PSTR("Default"));
|
|
||||||
break;
|
|
||||||
case _RAISE:
|
|
||||||
matrix_write_P(&matrix, PSTR("Raise"));
|
|
||||||
break;
|
|
||||||
case _LOWER:
|
|
||||||
matrix_write_P(&matrix, PSTR("Lower"));
|
|
||||||
break;
|
|
||||||
case _ADJUST:
|
|
||||||
matrix_write_P(&matrix, PSTR("ADJUST"));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
matrix_write(&matrix, buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Host Keyboard LED Status
|
|
||||||
char led[40];
|
|
||||||
snprintf(led, sizeof(led), "\n%s %s %s",
|
|
||||||
(host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NUMLOCK" : " ",
|
|
||||||
(host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ",
|
|
||||||
(host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " ");
|
|
||||||
matrix_write(&matrix, led);
|
|
||||||
matrix_update(&display, &matrix);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void iota_gfx_task(void) {
|
void iota_gfx_task(void) {
|
||||||
render_status_info();
|
iota_gfx_task_user();
|
||||||
|
|
||||||
if (display.dirty) {
|
if (display.dirty) {
|
||||||
iota_gfx_flush();
|
iota_gfx_flush();
|
93
drivers/avr/ssd1306.h
Normal file
93
drivers/avr/ssd1306.h
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
#ifndef SSD1306_H
|
||||||
|
#define SSD1306_H
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "pincontrol.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
enum ssd1306_cmds {
|
||||||
|
DisplayOff = 0xAE,
|
||||||
|
DisplayOn = 0xAF,
|
||||||
|
|
||||||
|
SetContrast = 0x81,
|
||||||
|
DisplayAllOnResume = 0xA4,
|
||||||
|
|
||||||
|
DisplayAllOn = 0xA5,
|
||||||
|
NormalDisplay = 0xA6,
|
||||||
|
InvertDisplay = 0xA7,
|
||||||
|
SetDisplayOffset = 0xD3,
|
||||||
|
SetComPins = 0xda,
|
||||||
|
SetVComDetect = 0xdb,
|
||||||
|
SetDisplayClockDiv = 0xD5,
|
||||||
|
SetPreCharge = 0xd9,
|
||||||
|
SetMultiPlex = 0xa8,
|
||||||
|
SetLowColumn = 0x00,
|
||||||
|
SetHighColumn = 0x10,
|
||||||
|
SetStartLine = 0x40,
|
||||||
|
|
||||||
|
SetMemoryMode = 0x20,
|
||||||
|
ColumnAddr = 0x21,
|
||||||
|
PageAddr = 0x22,
|
||||||
|
|
||||||
|
ComScanInc = 0xc0,
|
||||||
|
ComScanDec = 0xc8,
|
||||||
|
SegRemap = 0xa0,
|
||||||
|
SetChargePump = 0x8d,
|
||||||
|
ExternalVcc = 0x01,
|
||||||
|
SwitchCapVcc = 0x02,
|
||||||
|
|
||||||
|
ActivateScroll = 0x2f,
|
||||||
|
DeActivateScroll = 0x2e,
|
||||||
|
SetVerticalScrollArea = 0xa3,
|
||||||
|
RightHorizontalScroll = 0x26,
|
||||||
|
LeftHorizontalScroll = 0x27,
|
||||||
|
VerticalAndRightHorizontalScroll = 0x29,
|
||||||
|
VerticalAndLeftHorizontalScroll = 0x2a,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Controls the SSD1306 128x32 OLED display via i2c
|
||||||
|
|
||||||
|
#ifndef SSD1306_ADDRESS
|
||||||
|
#define SSD1306_ADDRESS 0x3C
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define DisplayHeight 32
|
||||||
|
#define DisplayWidth 128
|
||||||
|
|
||||||
|
#define FontHeight 8
|
||||||
|
#define FontWidth 6
|
||||||
|
|
||||||
|
#define MatrixRows (DisplayHeight / FontHeight)
|
||||||
|
#define MatrixCols (DisplayWidth / FontWidth)
|
||||||
|
|
||||||
|
struct CharacterMatrix {
|
||||||
|
uint8_t display[MatrixRows][MatrixCols];
|
||||||
|
uint8_t *cursor;
|
||||||
|
bool dirty;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CharacterMatrix display;
|
||||||
|
|
||||||
|
bool iota_gfx_init(void);
|
||||||
|
void iota_gfx_task(void);
|
||||||
|
bool iota_gfx_off(void);
|
||||||
|
bool iota_gfx_on(void);
|
||||||
|
void iota_gfx_flush(void);
|
||||||
|
void iota_gfx_write_char(uint8_t c);
|
||||||
|
void iota_gfx_write(const char *data);
|
||||||
|
void iota_gfx_write_P(const char *data);
|
||||||
|
void iota_gfx_clear_screen(void);
|
||||||
|
|
||||||
|
void iota_gfx_task_user(void);
|
||||||
|
|
||||||
|
void matrix_clear(struct CharacterMatrix *matrix);
|
||||||
|
void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c);
|
||||||
|
void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c);
|
||||||
|
void matrix_write(struct CharacterMatrix *matrix, const char *data);
|
||||||
|
void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
|
||||||
|
void matrix_render(struct CharacterMatrix *matrix);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
2
quantum/light_ws2812.c → drivers/avr/ws2812.c
Executable file → Normal file
2
quantum/light_ws2812.c → drivers/avr/ws2812.c
Executable file → Normal file
|
@ -21,7 +21,7 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "light_ws2812.h"
|
#include "ws2812.h"
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
0
quantum/light_ws2812.h → drivers/avr/ws2812.h
Executable file → Normal file
0
quantum/light_ws2812.h → drivers/avr/ws2812.h
Executable file → Normal file
|
@ -22,9 +22,6 @@ static const I2CConfig i2ccfg = {
|
||||||
400000 // clock speed (Hz); 400kHz max for IS31
|
400000 // clock speed (Hz); 400kHz max for IS31
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GDISP_SCREEN_WIDTH 7
|
|
||||||
#define GDISP_SCREEN_HEIGHT 7
|
|
||||||
|
|
||||||
static const uint8_t led_mask[] = {
|
static const uint8_t led_mask[] = {
|
||||||
0xFF, 0x00, /* C1-1 -> C1-16 */
|
0xFF, 0x00, /* C1-1 -> C1-16 */
|
||||||
0xFF, 0x00, /* C2-1 -> C2-16 */
|
0xFF, 0x00, /* C2-1 -> C2-16 */
|
3
drivers/ugfx/gdisp/is31fl3731c/driver.mk
Normal file
3
drivers/ugfx/gdisp/is31fl3731c/driver.mk
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
GFXINC += drivers/ugfx/gdisp/is31fl3731c
|
||||||
|
GFXSRC += drivers/ugfx/gdisp/is31fl3731c/gdisp_is31fl3731c.c
|
||||||
|
GDISP_DRIVER_LIST += GDISPVMT_IS31FL3731C_QMK
|
|
@ -19,11 +19,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#if GFX_USE_GDISP
|
#if GFX_USE_GDISP
|
||||||
|
|
||||||
#define GDISP_DRIVER_VMT GDISPVMT_IS31FL3731C_ERGODOX
|
#define GDISP_DRIVER_VMT GDISPVMT_IS31FL3731C_QMK
|
||||||
#include "drivers/gdisp/IS31FL3731C/gdisp_lld_config.h"
|
#define GDISP_SCREEN_HEIGHT LED_HEIGHT
|
||||||
|
#define GDISP_SCREEN_WIDTH LED_WIDTH
|
||||||
|
|
||||||
|
#include "gdisp_lld_config.h"
|
||||||
#include "src/gdisp/gdisp_driver.h"
|
#include "src/gdisp/gdisp_driver.h"
|
||||||
|
|
||||||
#include "board_IS31FL3731C.h"
|
#include "board_is31fl3731c.h"
|
||||||
|
|
||||||
|
|
||||||
// Can't include led_tables from here
|
// Can't include led_tables from here
|
||||||
|
@ -33,12 +36,6 @@ extern const uint8_t CIE1931_CURVE[];
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#ifndef GDISP_SCREEN_HEIGHT
|
|
||||||
#define GDISP_SCREEN_HEIGHT 9
|
|
||||||
#endif
|
|
||||||
#ifndef GDISP_SCREEN_WIDTH
|
|
||||||
#define GDISP_SCREEN_WIDTH 16
|
|
||||||
#endif
|
|
||||||
#ifndef GDISP_INITIAL_CONTRAST
|
#ifndef GDISP_INITIAL_CONTRAST
|
||||||
#define GDISP_INITIAL_CONTRAST 0
|
#define GDISP_INITIAL_CONTRAST 0
|
||||||
#endif
|
#endif
|
||||||
|
@ -100,7 +97,6 @@ extern const uint8_t CIE1931_CURVE[];
|
||||||
#define IS31_PWM_SIZE 0x90
|
#define IS31_PWM_SIZE 0x90
|
||||||
|
|
||||||
#define IS31_LED_MASK_SIZE 0x12
|
#define IS31_LED_MASK_SIZE 0x12
|
||||||
#define IS31_SCREEN_WIDTH 16
|
|
||||||
|
|
||||||
#define IS31
|
#define IS31
|
||||||
|
|
3
drivers/ugfx/gdisp/st7565/driver.mk
Normal file
3
drivers/ugfx/gdisp/st7565/driver.mk
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
GFXINC += drivers/ugfx/gdisp/st7565
|
||||||
|
GFXSRC += drivers/ugfx/gdisp/st7565/gdisp_lld_ST7565.c
|
||||||
|
GDISP_DRIVER_LIST += GDISPVMT_ST7565_QMK
|
|
@ -9,21 +9,21 @@
|
||||||
|
|
||||||
#if GFX_USE_GDISP
|
#if GFX_USE_GDISP
|
||||||
|
|
||||||
#define GDISP_DRIVER_VMT GDISPVMT_ST7565_ERGODOX
|
#define GDISP_DRIVER_VMT GDISPVMT_ST7565_QMK
|
||||||
#include "drivers/gdisp/st7565ergodox/gdisp_lld_config.h"
|
#include "gdisp_lld_config.h"
|
||||||
#include "src/gdisp/gdisp_driver.h"
|
#include "src/gdisp/gdisp_driver.h"
|
||||||
|
|
||||||
#include "board_ST7565.h"
|
#include "board_st7565.h"
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#ifndef GDISP_SCREEN_HEIGHT
|
#ifndef GDISP_SCREEN_HEIGHT
|
||||||
#define GDISP_SCREEN_HEIGHT 32
|
#define GDISP_SCREEN_HEIGHT LCD_HEIGHT
|
||||||
#endif
|
#endif
|
||||||
#ifndef GDISP_SCREEN_WIDTH
|
#ifndef GDISP_SCREEN_WIDTH
|
||||||
#define GDISP_SCREEN_WIDTH 128
|
#define GDISP_SCREEN_WIDTH LCD_WIDTH
|
||||||
#endif
|
#endif
|
||||||
#ifndef GDISP_INITIAL_CONTRAST
|
#ifndef GDISP_INITIAL_CONTRAST
|
||||||
#define GDISP_INITIAL_CONTRAST 35
|
#define GDISP_INITIAL_CONTRAST 35
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0)
|
#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0)
|
||||||
|
|
||||||
#include "drivers/gdisp/st7565ergodox/st7565.h"
|
#include "st7565.h"
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver config defaults for backward compatibility. */
|
/* Driver config defaults for backward compatibility. */
|
|
@ -1,4 +1,14 @@
|
||||||
Alps64 keyboard firmware
|
Alps64
|
||||||
======================
|
===
|
||||||
|
|
||||||
TODO: to be updated.
|
An Alps-only 60% board designed by Hasu.
|
||||||
|
|
||||||
|
Keyboard Maintainer: QMK Community
|
||||||
|
Hardware Supported: Alps64 PCB
|
||||||
|
Hardware Availability: https://geekhack.org/index.php?topic=69666.0
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make alps64-default
|
||||||
|
|
||||||
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||||
|
|
3
keyboards/amj40/Makefile
Executable file
3
keyboards/amj40/Makefile
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
ifndef MAKEFILE_INCLUDED
|
||||||
|
include ../../Makefile
|
||||||
|
endif
|
30
keyboards/amj40/amj40.c
Executable file
30
keyboards/amj40/amj40.c
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#include "amj40.h"
|
||||||
|
#include "led.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// put your keyboard start-up code here
|
||||||
|
// runs once when the firmware starts up
|
||||||
|
matrix_init_user();
|
||||||
|
led_init_ports();
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
// put your looping keyboard code here
|
||||||
|
// runs every cycle (a lot)
|
||||||
|
matrix_scan_user();
|
||||||
|
};
|
||||||
|
|
||||||
|
void led_init_ports(void) {
|
||||||
|
// * Set our LED pins as output
|
||||||
|
DDRB |= (1<<2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||||
|
// Turn capslock on
|
||||||
|
PORTB &= ~(1<<2);
|
||||||
|
} else {
|
||||||
|
// Turn capslock off
|
||||||
|
PORTB |= (1<<2);
|
||||||
|
}
|
||||||
|
}
|
38
keyboards/amj40/amj40.h
Executable file
38
keyboards/amj40/amj40.h
Executable file
|
@ -0,0 +1,38 @@
|
||||||
|
#ifndef AMJ40_H
|
||||||
|
#define AMJ40_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
// readability
|
||||||
|
#define XXX KC_NO
|
||||||
|
|
||||||
|
/* AMJ40 ver2.0 layout1 配列一
|
||||||
|
* ,-----------------------------------------------------------.
|
||||||
|
* | 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 0A | 0B |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1B |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 2A | 2B |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | 30 | 31 | 32 | 34 | 35 | 39 | 3A | 3B |
|
||||||
|
* `-----------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
#define KEYMAP( \
|
||||||
|
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
|
||||||
|
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1b, \
|
||||||
|
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
|
||||||
|
k30, k31, k32, k34, k35, k39, k3a, k3b \
|
||||||
|
) { \
|
||||||
|
{k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b}, \
|
||||||
|
{k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, XXX, k1b}, \
|
||||||
|
{k20, XXX, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b}, \
|
||||||
|
{k30, k31, k32, XXX, k34, k35, XXX, XXX, XXX, k39, k3a, k3b} \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void matrix_init_user(void);
|
||||||
|
void matrix_scan_user(void);
|
||||||
|
|
||||||
|
#endif
|
94
keyboards/amj40/config.h
Executable file
94
keyboards/amj40/config.h
Executable file
|
@ -0,0 +1,94 @@
|
||||||
|
/*
|
||||||
|
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CONFIG_H
|
||||||
|
#define CONFIG_H
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x6072
|
||||||
|
#define DEVICE_VER 0x0002
|
||||||
|
#define MANUFACTURER Han Chen
|
||||||
|
#define PRODUCT AMJ40
|
||||||
|
#define DESCRIPTION qmk port of AMJ40 v2 PCB
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 4
|
||||||
|
#define MATRIX_COLS 12
|
||||||
|
|
||||||
|
// ROWS: Top to bottom, COLS: Left to right
|
||||||
|
|
||||||
|
#define MATRIX_ROW_PINS { F4, F5, F6, F7}
|
||||||
|
#define MATRIX_COL_PINS { F1, F0, E6, C7, C6, B0, D4, B1, B7, B5, B4, D7}
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
#define BACKLIGHT_PIN B6
|
||||||
|
|
||||||
|
/* COL2ROW or ROW2COL */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
/* define if matrix has ghost */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* Set 0 if debouncing isn't needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* key combination for command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/* Backlight configuration
|
||||||
|
*/
|
||||||
|
#define BACKLIGHT_LEVELS 4
|
||||||
|
|
||||||
|
/* Underlight configuration
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RGB_DI_PIN D3
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLED_NUM 4 // Number of LEDs
|
||||||
|
#define RGBLIGHT_HUE_STEP 10
|
||||||
|
#define RGBLIGHT_SAT_STEP 17
|
||||||
|
#define RGBLIGHT_VAL_STEP 17
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options
|
||||||
|
* These options are also useful to firmware size reduction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* disable debug print */
|
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */
|
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
//#define NO_ACTION_MACRO
|
||||||
|
//#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
#endif
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue