Compare commits
85 Commits
Author | SHA1 | Date | |
---|---|---|---|
06f196c589 | |||
9bb259b660 | |||
ab3dbd8daa | |||
1954ad1fd8 | |||
3276c4c56a | |||
3a1ce56aed | |||
2f24ed1046 | |||
50a4b3510b | |||
57bf00f28f | |||
b25338a809 | |||
78923cb884 | |||
a860d9d628 | |||
b5464cf20a | |||
383e508bc5 | |||
3f3fa07918 | |||
ad49db8cd2 | |||
d3fe6a0588 | |||
af4697cba5 | |||
b7bb923962 | |||
0f5928fdf4 | |||
ba4b3d9d72 | |||
aa660c1eb7 | |||
12b2e0ac73 | |||
bd642d08ab | |||
7f2882832e | |||
32f18cf616 | |||
1745f202cc | |||
115e49b2af | |||
e64313cdb3 | |||
066525ab9e | |||
e1bcb40e90 | |||
0b023ef67c | |||
800ec55dfc | |||
e5dc2253e2 | |||
6531d64ac7 | |||
f9f3afd767 | |||
c70b419ec0 | |||
bccf263cd0 | |||
e094cd42b5 | |||
598cb82655 | |||
74f51009a8 | |||
122525ee61 | |||
c037d4bb30 | |||
66f45c9e2e | |||
2cf697d0c8 | |||
4c0ff7b7ea | |||
db5afb05cf | |||
2db4ad2133 | |||
b3ad561b4f | |||
ee8860a733 | |||
966e2660cf | |||
109b2ae0bd | |||
b91ffba4be | |||
01ac8a6051 | |||
f88f042c04 | |||
e0e80c0dc1 | |||
34084b4ee6 | |||
f3e61afdc7 | |||
2cda124bc1 | |||
951285de67 | |||
56c2487223 | |||
c5f847a900 | |||
d6a446bf95 | |||
31808df294 | |||
cfd118d158 | |||
20031ab982 | |||
6d2cb1d9ac | |||
d8c62e4238 | |||
357d930f5a | |||
8d7cc11d72 | |||
18f78b6735 | |||
120089d917 | |||
d2bbfb9058 | |||
ee13228486 | |||
ea819268f3 | |||
e0834cfda9 | |||
c206650ed0 | |||
e446eddca9 | |||
0cc62459a7 | |||
29bcffb3f3 | |||
01bf8e1643 | |||
03de0c8575 | |||
1cd336dde4 | |||
cc52ac5b16 | |||
efbc4d2295 |
@ -11,14 +11,14 @@ env:
|
||||
global:
|
||||
- secure: vBTSL34BDPxDilKUuTXqU4CJ26Pv5hogD2nghatkxSQkI1/jbdnLj/DQdPUrMJFDIY6TK3AltsBx72MaMsLQ1JO/Ou24IeHINHXzUC1FlS9yQa48cpxnhX5kzXNyGs3oa0qaFbvnr7RgYRWtmD52n4bIZuSuW+xpBv05x2OCizdT2ZonH33nATaHGFasxROm4qYZ241VfzcUv766V6RVHgL4x9V08warugs+RENVkfzxxwhk3NmkrISabze0gSVJLHBPHxroZC6EUcf/ocobcuDrCwFqtEt90i7pNIAFUE7gZsN2uE75LmpzAWin21G7lLPcPL2k4FJVd8an1HiP2WmscJU6U89fOfMb2viObnKcCzebozBCmKGtHEuXZo9FcReOx49AnQSpmESJGs+q2dL/FApkTjQiyT4J6O5dJpoww0/r57Wx0cmmqjETKBb5rSgXM51Etk3wO09mvcPHsEwrT7qH8r9XWdyCDoEn7FCLX3/LYnf/D4SmZ633YPl5gv3v9XEwxR5+04akjgnvWDSNIaDbWBdxHNb7l4pMc+WR1bwCyMyA7KXj0RrftEGOrm9ZRLe6BkbT4cycA+j77nbPOMcyZChliV9pPQos+4TOJoTzcK2L8yWVoY409aDNVuAjdP6Yum0R2maBGl/etLmIMpJC35C5/lZ+dUNjJAM=
|
||||
before_install:
|
||||
- wget http://www.atmel.com/images/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
|
||||
- wget http://www.atmel.com/images/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz || wget http://qmk.fm/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
|
||||
install:
|
||||
- tar -zxf avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
|
||||
- export PATH="$PATH:$TRAVIS_BUILD_DIR/avr8-gnu-toolchain-linux_x86_64/bin"
|
||||
before_script:
|
||||
- avr-gcc --version
|
||||
script:
|
||||
- make test AUTOGEN=false
|
||||
- make test:all AUTOGEN=false
|
||||
- bash util/travis_build.sh
|
||||
addons:
|
||||
apt:
|
||||
|
1
autocomplete.sh
Normal file
1
autocomplete.sh
Normal file
File diff suppressed because one or more lines are too long
@ -6,18 +6,26 @@ endif
|
||||
|
||||
include common.mk
|
||||
|
||||
ifneq ($(SUBPROJECT),)
|
||||
TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP)
|
||||
KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)_$(SUBPROJECT)
|
||||
else
|
||||
TARGET ?= $(KEYBOARD)_$(KEYMAP)
|
||||
KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)
|
||||
endif
|
||||
# 5/4/3/2/1
|
||||
KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD)
|
||||
KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1)))
|
||||
KEYBOARD_FOLDER_PATH_3 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_2)))
|
||||
KEYBOARD_FOLDER_PATH_4 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_3)))
|
||||
KEYBOARD_FOLDER_PATH_5 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_4)))
|
||||
KEYBOARD_FOLDER_1 := $(notdir $(KEYBOARD_FOLDER_PATH_1))
|
||||
KEYBOARD_FOLDER_2 := $(notdir $(KEYBOARD_FOLDER_PATH_2))
|
||||
KEYBOARD_FOLDER_3 := $(notdir $(KEYBOARD_FOLDER_PATH_3))
|
||||
KEYBOARD_FOLDER_4 := $(notdir $(KEYBOARD_FOLDER_PATH_4))
|
||||
KEYBOARD_FOLDER_5 := $(notdir $(KEYBOARD_FOLDER_PATH_5))
|
||||
|
||||
KEYBOARD_FILESAFE := $(subst /,_,$(KEYBOARD))
|
||||
|
||||
TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP)
|
||||
KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE)
|
||||
|
||||
# Force expansion
|
||||
TARGET := $(TARGET)
|
||||
|
||||
|
||||
MASTER ?= left
|
||||
ifdef master
|
||||
MASTER = $(master)
|
||||
@ -31,28 +39,62 @@ $(error MASTER does not have a valid value(left/right))
|
||||
endif
|
||||
endif
|
||||
|
||||
KEYBOARD_PATH := keyboards/$(KEYBOARD)
|
||||
KEYBOARD_C := $(KEYBOARD_PATH)/$(KEYBOARD).c
|
||||
KEYBOARD_PATHS :=
|
||||
|
||||
ifneq ("$(wildcard $(KEYBOARD_C))","")
|
||||
include $(KEYBOARD_PATH)/rules.mk
|
||||
else
|
||||
$(error "$(KEYBOARD_C)" does not exist)
|
||||
KEYBOARD_PATH_1 := keyboards/$(KEYBOARD_FOLDER_PATH_1)
|
||||
KEYBOARD_PATH_2 := keyboards/$(KEYBOARD_FOLDER_PATH_2)
|
||||
KEYBOARD_PATH_3 := keyboards/$(KEYBOARD_FOLDER_PATH_3)
|
||||
KEYBOARD_PATH_4 := keyboards/$(KEYBOARD_FOLDER_PATH_4)
|
||||
KEYBOARD_PATH_5 := keyboards/$(KEYBOARD_FOLDER_PATH_5)
|
||||
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/rules.mk)","")
|
||||
KEYBOARD_PATHS += $(KEYBOARD_PATH_5)
|
||||
include $(KEYBOARD_PATH_5)/rules.mk
|
||||
endif
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD)
|
||||
|
||||
ifneq ($(SUBPROJECT),)
|
||||
SUBPROJECT_PATH := keyboards/$(KEYBOARD)/$(SUBPROJECT)
|
||||
SUBPROJECT_C := $(SUBPROJECT_PATH)/$(SUBPROJECT).c
|
||||
ifneq ("$(wildcard $(SUBPROJECT_C))","")
|
||||
OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT)
|
||||
include $(SUBPROJECT_PATH)/rules.mk
|
||||
else
|
||||
$(error "$(SUBPROJECT_PATH)/$(SUBPROJECT).c" does not exist)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/rules.mk)","")
|
||||
KEYBOARD_PATHS += $(KEYBOARD_PATH_4)
|
||||
include $(KEYBOARD_PATH_4)/rules.mk
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/rules.mk)","")
|
||||
KEYBOARD_PATHS += $(KEYBOARD_PATH_3)
|
||||
include $(KEYBOARD_PATH_3)/rules.mk
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/rules.mk)","")
|
||||
KEYBOARD_PATHS += $(KEYBOARD_PATH_2)
|
||||
include $(KEYBOARD_PATH_2)/rules.mk
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","")
|
||||
KEYBOARD_PATHS += $(KEYBOARD_PATH_1)
|
||||
include $(KEYBOARD_PATH_1)/rules.mk
|
||||
endif
|
||||
|
||||
# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA
|
||||
KEYBOARD_SRC :=
|
||||
|
||||
KEYBOARD_C_1 := $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).c
|
||||
KEYBOARD_C_2 := $(KEYBOARD_PATH_2)/$(KEYBOARD_FOLDER_2).c
|
||||
KEYBOARD_C_3 := $(KEYBOARD_PATH_3)/$(KEYBOARD_FOLDER_3).c
|
||||
KEYBOARD_C_4 := $(KEYBOARD_PATH_4)/$(KEYBOARD_FOLDER_4).c
|
||||
KEYBOARD_C_5 := $(KEYBOARD_PATH_5)/$(KEYBOARD_FOLDER_5).c
|
||||
|
||||
ifneq ("$(wildcard $(KEYBOARD_C_5))","")
|
||||
KEYBOARD_SRC += $(KEYBOARD_C_5)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_C_4))","")
|
||||
KEYBOARD_SRC += $(KEYBOARD_C_4)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_C_3))","")
|
||||
KEYBOARD_SRC += $(KEYBOARD_C_3)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_C_2))","")
|
||||
KEYBOARD_SRC += $(KEYBOARD_C_2)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_C_1))","")
|
||||
KEYBOARD_SRC += $(KEYBOARD_C_1)
|
||||
endif
|
||||
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE)
|
||||
|
||||
# We can assume a ChibiOS target When MCU_FAMILY is defined , since it's not used for LUFA
|
||||
ifdef MCU_FAMILY
|
||||
PLATFORM=CHIBIOS
|
||||
else
|
||||
@ -63,77 +105,110 @@ ifeq ($(PLATFORM),CHIBIOS)
|
||||
include $(TMK_PATH)/protocol/chibios.mk
|
||||
include $(TMK_PATH)/chibios.mk
|
||||
OPT_OS = chibios
|
||||
ifneq ("$(wildcard $(SUBPROJECT_PATH)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(SUBPROJECT_PATH)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_5)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_5)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_5)/boards/$(BOARD)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_4)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_4)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_4)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_4)/boards/$(BOARD)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_3)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_3)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_3)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_3)/boards/$(BOARD)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_2)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_2)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_2)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_2)/boards/$(BOARD)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_1)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_1)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_1)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_1)/boards/$(BOARD)/bootloader_defs.h
|
||||
endif
|
||||
endif
|
||||
|
||||
CONFIG_H = $(KEYBOARD_PATH)/config.h
|
||||
ifneq ($(SUBPROJECT),)
|
||||
ifneq ("$(wildcard $(SUBPROJECT_C))","")
|
||||
CONFIG_H = $(SUBPROJECT_PATH)/config.h
|
||||
endif
|
||||
CONFIG_H :=
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/config.h)","")
|
||||
CONFIG_H += $(KEYBOARD_PATH_5)/config.h
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/config.h)","")
|
||||
CONFIG_H += $(KEYBOARD_PATH_4)/config.h
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/config.h)","")
|
||||
CONFIG_H += $(KEYBOARD_PATH_3)/config.h
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/config.h)","")
|
||||
CONFIG_H += $(KEYBOARD_PATH_2)/config.h
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/config.h)","")
|
||||
CONFIG_H += $(KEYBOARD_PATH_1)/config.h
|
||||
endif
|
||||
|
||||
# Save the defines and includes here, so we don't include any keymap specific ones
|
||||
PROJECT_DEFS := $(OPT_DEFS)
|
||||
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(SUBPROJECT_PATH) $(KEYBOARD_PATH)
|
||||
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
|
||||
PROJECT_CONFIG := $(CONFIG_H)
|
||||
|
||||
MAIN_KEYMAP_PATH := $(KEYBOARD_PATH)/keymaps/$(KEYMAP)
|
||||
MAIN_KEYMAP_C := $(MAIN_KEYMAP_PATH)/keymap.c
|
||||
SUBPROJ_KEYMAP_PATH := $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)
|
||||
SUBPROJ_KEYMAP_C := $(SUBPROJ_KEYMAP_PATH)/keymap.c
|
||||
ifneq ("$(wildcard $(SUBPROJ_KEYMAP_C))","")
|
||||
-include $(SUBPROJ_KEYMAP_PATH)/rules.mk
|
||||
KEYMAP_C := $(SUBPROJ_KEYMAP_C)
|
||||
KEYMAP_PATH := $(SUBPROJ_KEYMAP_PATH)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_C))","")
|
||||
-include $(MAIN_KEYMAP_PATH)/rules.mk
|
||||
KEYMAP_C := $(MAIN_KEYMAP_C)
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH)
|
||||
MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP)
|
||||
MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP)
|
||||
MAIN_KEYMAP_PATH_3 := $(KEYBOARD_PATH_3)/keymaps/$(KEYMAP)
|
||||
MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP)
|
||||
MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
|
||||
|
||||
ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.c)","")
|
||||
-include $(MAIN_KEYMAP_PATH_5)/rules.mk
|
||||
KEYMAP_C := $(MAIN_KEYMAP_PATH_5)/keymap.c
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.c)","")
|
||||
-include $(MAIN_KEYMAP_PATH_4)/rules.mk
|
||||
KEYMAP_C := $(MAIN_KEYMAP_PATH_4)/keymap.c
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.c)","")
|
||||
-include $(MAIN_KEYMAP_PATH_3)/rules.mk
|
||||
KEYMAP_C := $(MAIN_KEYMAP_PATH_3)/keymap.c
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.c)","")
|
||||
-include $(MAIN_KEYMAP_PATH_2)/rules.mk
|
||||
KEYMAP_C := $(MAIN_KEYMAP_PATH_2)/keymap.c
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.c)","")
|
||||
-include $(MAIN_KEYMAP_PATH_1)/rules.mk
|
||||
KEYMAP_C := $(MAIN_KEYMAP_PATH_1)/keymap.c
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
|
||||
else ifneq ($(LAYOUTS),)
|
||||
include build_layout.mk
|
||||
else
|
||||
else
|
||||
$(error Could not find keymap)
|
||||
# this state should never be reached
|
||||
endif
|
||||
|
||||
# User space stuff
|
||||
USER_PATH := users/$(KEYMAP)
|
||||
-include $(USER_PATH)/rules.mk
|
||||
|
||||
# Object files directory
|
||||
# To put object files in current directory, use a dot (.), do NOT make
|
||||
# this an empty or blank macro!
|
||||
KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
|
||||
|
||||
|
||||
ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
|
||||
CONFIG_H = $(KEYMAP_PATH)/config.h
|
||||
CONFIG_H += $(KEYMAP_PATH)/config.h
|
||||
endif
|
||||
|
||||
# # project specific files
|
||||
SRC += $(KEYBOARD_C) \
|
||||
SRC += $(KEYBOARD_SRC) \
|
||||
$(KEYMAP_C) \
|
||||
$(QUANTUM_SRC)
|
||||
|
||||
ifneq ($(SUBPROJECT),)
|
||||
SRC += $(SUBPROJECT_C)
|
||||
endif
|
||||
|
||||
# Optimize size but this may cause error "relocation truncated to fit"
|
||||
#EXTRALDFLAGS = -Wl,--relax
|
||||
|
||||
# Search Path
|
||||
VPATH += $(KEYMAP_PATH)
|
||||
ifneq ($(SUBPROJECT),)
|
||||
VPATH += $(SUBPROJECT_PATH)
|
||||
endif
|
||||
VPATH += $(KEYBOARD_PATH)
|
||||
VPATH += $(KEYBOARD_PATHS)
|
||||
VPATH += $(COMMON_VPATH)
|
||||
VPATH += $(USER_PATH)
|
||||
|
||||
include common_features.mk
|
||||
include $(TMK_PATH)/protocol.mk
|
||||
@ -161,15 +236,15 @@ endif
|
||||
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
|
||||
$(KEYMAP_OUTPUT)_SRC := $(SRC)
|
||||
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) $(GFXDEFS) \
|
||||
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(KEYBOARD).h\" -DQMK_KEYBOARD_CONFIG_H=\"$(KEYBOARD_PATH)/config.h\" \
|
||||
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(KEYBOARD_FOLDER_1).h\" -DQMK_KEYBOARD_CONFIG_H=\"$(KEYBOARD_PATH_1)/config.h\" \
|
||||
-DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\" \
|
||||
-DQMK_SUBPROJECT=\"$(SUBPROJECT)\" -DQMK_SUBPROJECT_H=\"$(SUBPROJECT).h\" -DQMK_SUBPROJECT_CONFIG_H=\"$(SUBPROJECT_PATH)/config.h\"
|
||||
-DQMK_SUBPROJECT -DQMK_SUBPROJECT_H -DQMK_SUBPROJECT_CONFIG_H
|
||||
$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
|
||||
$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
|
||||
$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) $(GFXSRC)
|
||||
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) $(GFXDEFS)
|
||||
$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(GFXINC)
|
||||
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
|
||||
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
|
||||
|
||||
# Default target.
|
||||
all: build sizeafter
|
||||
|
@ -69,6 +69,10 @@ ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
|
||||
SRC += $(QUANTUM_DIR)/fauxclicky.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
|
||||
SRC += $(QUANTUM_DIR)/pointing_device.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(UCIS_ENABLE)), yes)
|
||||
OPT_DEFS += -DUCIS_ENABLE
|
||||
UNICODE_COMMON = yes
|
||||
@ -167,6 +171,10 @@ ifeq ($(strip $(TERMINAL_ENABLE)), yes)
|
||||
OPT_DEFS += -DTERMINAL_ENABLE
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(USB_HID_ENABLE)), yes)
|
||||
include $(TMK_DIR)/protocol/usb_hid.mk
|
||||
endif
|
||||
|
||||
QUANTUM_SRC:= \
|
||||
$(QUANTUM_DIR)/quantum.c \
|
||||
$(QUANTUM_DIR)/keymap_common.c \
|
||||
|
@ -14,11 +14,11 @@ Otherwise, you can either download it directly ([zip](https://github.com/qmk/qmk
|
||||
|
||||
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
|
||||
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:
|
||||
This would build the `rev4` revision of the `planck` with the `default` keymap. Not all keyboards have revisions (also called subprojects or folders), in which case, it can be omitted:
|
||||
|
||||
make preonic-default
|
||||
make preonic:default
|
||||
|
||||
## How to customize {#how-to-customize}
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
* [Install Build Tools](getting_started_build_tools.md)
|
||||
* Alternative: [Vagrant Guide](getting_started_vagrant_guide.md)
|
||||
* [Build/Compile instructions](getting_started_make_guide.md)
|
||||
* [Contributing to QMK](contributing.md)
|
||||
* [How to Use Github](getting_started_github.md)
|
||||
|
||||
* [FAQ](faq.md)
|
||||
@ -14,6 +15,7 @@
|
||||
* [Features](features.md)
|
||||
* [Layouts](feature_layouts.md)
|
||||
* [Common Shortcuts](feature_common_shortcuts.md)
|
||||
* [Userspace](feature_userspace.md)
|
||||
* [Backlight](feature_backlight.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* [Dynamic Macros](dynamic_macros.md)
|
||||
@ -21,6 +23,7 @@
|
||||
* [Leader Key](feature_leader_key.md)
|
||||
* [Macros](macros.md)
|
||||
* [Mouse keys](mouse_keys.md)
|
||||
* [Pointing Device](feature_pointing_device.md)
|
||||
* [PS2 Mouse](feature_ps2_mouse.md)
|
||||
* [Space Cadet](space_cadet_shift.md)
|
||||
* [Tap Dance](tap_dance.md)
|
||||
@ -51,11 +54,11 @@
|
||||
* [The `config.h` File](config_options.md)
|
||||
* [Customizing Functionality](custom_quantum_functions.md)
|
||||
* [Documentation Best Practices](documentation_best_practices.md)
|
||||
* [Documentation Templates](documentation_templates.md)
|
||||
* [Unit Testing](unit_testing.md)
|
||||
|
||||
* For Makers and Modders
|
||||
* [Adding a keyboard to QMK](adding_a_keyboard_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)
|
||||
* [Modding your keyboard](modding_your_keyboard.md)
|
||||
|
@ -4,7 +4,7 @@ We welcome all keyboard projects into QMK, but ask that you try to stick to a co
|
||||
|
||||
## Naming your directory/project
|
||||
|
||||
All names should be lowercase alphanumeric, and separated by an underscore (`_`), but not begin with one. Dashes (`-`) aren't allow by our build system, and will confuse it with keymaps/subprojects. Your directory and your `.h` and `.c` files should have exactly the same name. Subprojects/revision should follow the same format.
|
||||
All names should be lowercase alphanumeric, and separated by an underscore (`_`), but not begin with one. Your directory and your `.h` and `.c` files should have exactly the same name. All folders should follow the same format.
|
||||
|
||||
## `readme.md`
|
||||
|
||||
@ -26,7 +26,7 @@ When developing your keyboard, keep in mind that all warnings will be treated as
|
||||
|
||||
## Licenses
|
||||
|
||||
If you're adapting your keyboard's setup from another project, but not using the same code, but sure to update the copyright header at the top of the files to show your name, it this format:
|
||||
If you're adapting your keyboard's setup from another project, but not using the same code, but sure to update the copyright header at the top of the files to show your name, in this format:
|
||||
|
||||
Copyright 2017 Your Name <your@email.com>
|
||||
|
||||
|
@ -1,16 +0,0 @@
|
||||
# How To Add Features To QMK
|
||||
|
||||
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.
|
||||
* **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** - 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), we'd love to talk about how QMK can be improved.
|
@ -12,29 +12,25 @@ This is a c header file that is one of the first things included, and will persi
|
||||
|
||||
// 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.
|
||||
This file contains config options that should apply to the whole keyboard, and won't change in revisions, or most keymaps. The revision block here only applies to keyboards with revisions.
|
||||
|
||||
## Subproject
|
||||
## Revisions
|
||||
|
||||
```c
|
||||
#ifndef <subproject>_CONFIG_H
|
||||
#define <subproject>_CONFIG_H
|
||||
#ifndef <revision>_CONFIG_H
|
||||
#define <revision>_CONFIG_H
|
||||
|
||||
#include "../config.h"
|
||||
#include "config_common.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.
|
||||
For keyboards that have revisions, this file contains config options that should apply to only that revisions, and won't change in most keymaps.
|
||||
|
||||
## Keymap
|
||||
|
||||
@ -42,7 +38,7 @@ For keyboards that have subprojects, this file contains config options that shou
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
#include "config_common.h"
|
||||
|
||||
// config options
|
||||
|
||||
|
147
docs/contributing.md
Normal file
147
docs/contributing.md
Normal file
@ -0,0 +1,147 @@
|
||||
# How To Contribute
|
||||
|
||||
👍🎉 First off, thanks for taking the time to read this and contribute! 🎉👍
|
||||
|
||||
Third-party contributions help us grow and improve QMK. We want to make the pull request and contribution process useful and easy for both contributors and maintainers. To this end we've put together some guidelines for contributors to help your pull request be accepted without major changes.
|
||||
|
||||
* [Project Overview](#project-overview)
|
||||
* [Coding Conventions](#coding-conventions)
|
||||
* [General Guidelines](#general-guidelines)
|
||||
* [What does the Code of Conduct mean for me?](#what-does-the-code-of-conduct-mean-for-me)
|
||||
|
||||
## I Don't Want To Read This Whole Thing I Just Have a Question!
|
||||
|
||||
If you'd like to ask questions about QMK you can do so on the [OLKB Subreddit](https://reddit.com/r/olkb) or on [Gitter](https://gitter.im/qmk/qmk_firmware).
|
||||
|
||||
Please keep these things in mind:
|
||||
|
||||
* It may take several hours for someone to respond to your question. Please be patient!
|
||||
* Everyone involved with QMK is donating their time and energy. We don't get paid to work on or answer questions about QMK.
|
||||
* Try to ask your question so it's as easy to answer as possible. If you're not sure how to do that these are some good guides:
|
||||
* https://opensource.com/life/16/10/how-ask-technical-questions
|
||||
* http://www.catb.org/esr/faqs/smart-questions.html
|
||||
|
||||
# Project Overview
|
||||
|
||||
QMK is largely written in C, with specific features and parts written in C++. It targets embedded processors found in keyboards, particularly AVR ([LUFA](http://www.fourwalledcubicle.com/LUFA.php)) and ARM ([ChibiOS](http://www.chibios.com)). If you are already well versed in Arduino programming you'll find a lot of the concepts and limitations familiar. Prior experience with Arduino is not required to successfully contribute to QMK.
|
||||
|
||||
<!-- FIXME: We should include a list of resources for learning C here. -->
|
||||
|
||||
# Where can I go for help?
|
||||
|
||||
If you need help you can [open an issue](https://github.com/qmk/qmk_firmware/issues) or [chat on gitter](http://gitter.im/QMK/qmk_firmware).
|
||||
|
||||
# How Do I Make a Contribution?
|
||||
|
||||
Never made an open source contribution before? Wondering how contributions work in QMK? Here's a quick rundown!
|
||||
|
||||
0. Sign up for a [GitHub](https://github.com) account.
|
||||
1. Put together a keymap to contribute, [find an issue](https://github.com/qmk/qmk_firmware/issues) you are interested in addressing, or [a feature](https://github.com/qmk/qmk_firmware/issues?q=is%3Aopen+is%3Aissue+label%3Afeature) you would like to add.
|
||||
2. Fork the repository associated with the issue to your GitHub account. This means that you will have a copy of the repository under `your-GitHub-username/qmk_firmware`.
|
||||
3. Clone the repository to your local machine using `git clone https://github.com/github-username/repository-name.git`.
|
||||
4. If you're working on a new feature consider opening an issue to talk with us about the work you're about to undertake.
|
||||
5. Create a new branch for your fix using `git checkout -b branch-name-here`.
|
||||
6. Make the appropriate changes for the issue you are trying to address or the feature that you want to add.
|
||||
7. Use `git add insert-paths-of-changed-files-here` to add the file contents of the changed files to the "snapshot" git uses to manage the state of the project, also known as the index.
|
||||
8. Use `git commit -m "Insert a short message of the changes made here"` to store the contents of the index with a descriptive message.
|
||||
9. Push the changes to your repository on GitHub using `git push origin branch-name-here`.
|
||||
10. Submit a pull request to [QMK Firmware](https://github.com/qmk/qmk_firmware/pull/new/master).
|
||||
11. Title the pull request with a short description of the changes made and the issue or bug number associated with your change. For example, you can title an issue like so "Added more log outputting to resolve #4352".
|
||||
12. In the description of the pull request explain the changes that you made, any issues you think exist with the pull request you made, and any questions you have for the maintainer. It's OK if your pull request is not perfect (no pull request is), the reviewer will be able to help you fix any problems and improve it!
|
||||
13. Wait for the pull request to be reviewed by a maintainer.
|
||||
14. Make changes to the pull request if the reviewing maintainer recommends them.
|
||||
15. Celebrate your success after your pull request is merged!
|
||||
|
||||
# Coding conventions
|
||||
|
||||
Most of our style is pretty easy to pick up on, but right now it's not entirely consistent. You should match the style of the code surrounding your change, but if that code is inconsistent or unclear use the following guidelines:
|
||||
|
||||
* We indent using two spaces (soft tabs)
|
||||
* We use One True Brace Style
|
||||
* Opening Brace: At the end of the same line as the statement that opens the block
|
||||
* Closing Brace: Lined up with the first character of the statement that opens the block
|
||||
* Else If: Place the closing brace at the beginning of the line and the next opening brace at the end of the same line.
|
||||
* Optional Braces: Always include optional braces.
|
||||
* Good: if (condition) { return false; }
|
||||
* Bad: if (condition) return false;
|
||||
* We use C style comments: /* */
|
||||
* Think of them as a story describing the feature
|
||||
* Use them liberally to explain why particular decisions were made.
|
||||
* Do not write obvious comments
|
||||
* If you not sure if a comment is obvious, go ahead and include it.
|
||||
* In general we don't wrap lines, they can be as long as needed. If you do choose to wrap lines please do not wrap any wider than 76 columns.
|
||||
|
||||
# General Guidelines
|
||||
|
||||
We have a few different types of changes in QMK, each requiring a different level of rigor. We'd like you to keep the following guidelines in mind no matter what type of change you're making.
|
||||
|
||||
* Separate PR's into logical units. For example, do not submit one PR covering two separate features, instead submit a separate PR for each feature.
|
||||
* Check for unnecessary whitespace with `git diff --check` before committing.
|
||||
* Make sure your code change actually compiles.
|
||||
* Keymaps: Make sure that `make keyboard:your_new_keymap` does not return an error
|
||||
* Keyboards: Make sure that `make keyboard:all` does not return any errors
|
||||
* Core: Make sure that `make all` does not return any errors.
|
||||
* Make sure commit messages are understandable on their own. You should put a short description (no more than 70 characters) on the first line, the second line should be empty, and on the 3rd and later lines you should describe your commit in detail, if required. Example:
|
||||
|
||||
```
|
||||
Adjust the fronzlebop for the kerpleplork
|
||||
|
||||
The kerpleplork was intermittently failing with error code 23. The root cause was the fronzlebop setting, which causes the kerpleplork to activate every N iterations.
|
||||
|
||||
Limited experimentation on the devices I have available shows that 7 is high enough to avoid confusing the kerpleplork, but I'd like to get some feedback from people with ARM devices to be sure.
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation is one of the easiest ways to get started contributing to QMK. Finding places where the documentation is wrong or incomplete and fixing those is easy! We also very badly need someone to edit our documentation, so if you have editing skills but aren't sure where or how to jump in please [reach out for help](#where-can-i-go-for-help)!
|
||||
|
||||
You'll find all our documentation in the `qmk_firmware/docs` directory, or if you'd rather use a web based workflow you can click "Suggest An Edit" at the top of each page on http://docs.qmk.fm/.
|
||||
|
||||
## Keymaps
|
||||
|
||||
Most first-time QMK contributors start with their personal keymaps. We try to keep keymap standards pretty casual (keymaps, after all, reflect the personality of their creators) but we do ask that you follow these guidelines to make it easier for others to discover and learn from your keymap.
|
||||
|
||||
* Write a `readme.md` using [the template](https://docs.qmk.fm/documentation_templates.html#).
|
||||
* All Keymap PR's are squashed, so if you care about how your commits are squashed you should do it yourself
|
||||
* Do not lump features in with keymap PR's. Submit the feature first and then a second PR for the keymap.
|
||||
|
||||
## Keyboards
|
||||
|
||||
Keyboards are the raison d'être for QMK. Some keyboards are community maintained, while others are maintained by the people responsible for making a particular keyboard. The `readme.md` should tell you who maintains a particular keyboard. If you have questions relating to a particular keyboard you can [Open An Issue](https://github.com/qmk/qmk_firmware/issues) and tag the maintainer in your question.
|
||||
|
||||
We also ask that you follow these guidelines:
|
||||
|
||||
* Write a `readme.md` using [the template](https://docs.qmk.fm/documentation_templates.html#).
|
||||
* Keep the number of commits reasonable or we will squash your PR
|
||||
* Do not lump core features in with new keyboards. Submit the feature first and then submit a separate PR for the keyboard.
|
||||
|
||||
## Quantum/TMK Core
|
||||
|
||||
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)
|
||||
|
||||
Feature and Bug Fix PR's affect all keyboards. We are also in the process of restructuring QMK. For this reason it is especially important for significant changes to be discussed before implementation has happened. If you open a PR without talking to us first please be prepared to do some significant rework if your choices do not mesh well with our planned direction.
|
||||
|
||||
Here are some things to keep in mind when working on your feature or bug fix.
|
||||
|
||||
* **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.
|
||||
* **Consider revisions and different chip-bases** - there are several keyboards that have revisions 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** - 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.
|
||||
|
||||
We also ask that you follow these guidelines:
|
||||
|
||||
* Keep the number of commits reasonable or we will squash your PR
|
||||
* Do not lump keyboards or keymaps in with core changes. Submit your core changes first.
|
||||
* Write [Unit Tests](http://docs.qmk.fm/unit_testing.html) for your feature
|
||||
* Follow the style of the file you are editing. If the style is unclear or there are mixed styles you should conform to the [coding conventions](#coding-conventions) above.
|
||||
|
||||
## Refactoring
|
||||
|
||||
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.
|
||||
|
||||
# What does the Code of Conduct mean for me?
|
||||
|
||||
Our Code of Conduct means that you are responsible for treating everyone on the project with respect and courtesy regardless of their identity. If you are the victim of any inappropriate behavior or comments as described in our Code of Conduct, we are here for you and will do the best to ensure that the abuser is reprimanded appropriately, per our code.
|
42
docs/documentation_templates.md
Normal file
42
docs/documentation_templates.md
Normal file
@ -0,0 +1,42 @@
|
||||
# Documentation Templates
|
||||
|
||||
This page documents the templates you should use when submitting new Keymaps and Keyboards to QMK.
|
||||
|
||||
## Keymap `readme.md` Template
|
||||
|
||||
Most keymaps have an image depicting the layout. You can use [Keyboard Layout Editor](http://keyboard-layout-editor.com) to create an image. Upload it to [Imgur](http://imgur.com) or another hosting service, please do not include images in your Pull Request.
|
||||
|
||||
Below the image you should write a short description to help people understand your keymap.
|
||||
|
||||
```
|
||||

|
||||
|
||||
# Default Clueboard Layout
|
||||
|
||||
This is the default layout that comes flashed on every Clueboard. For the most
|
||||
part it's a straightforward and easy to follow layout. The only unusual key is
|
||||
the key in the upper left, which sends Escape normally, but Grave when any of
|
||||
the Ctrl, Alt, or GUI modifiers are held down.
|
||||
```
|
||||
|
||||
## Keyboard `readme.md` Template
|
||||
|
||||
```
|
||||
# Planck
|
||||
|
||||

|
||||
|
||||
A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/)
|
||||
|
||||
Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert)
|
||||
Hardware Supported: Planck PCB rev1, rev2, rev3, rev4, Teensy 2.0
|
||||
Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make planck/rev4: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.
|
||||
```
|
||||
|
||||
There needs to be two spaces at the end of the `Keyboard Maintainer` and `Hardware Supported` lines for it to render correctly with Markdown.
|
@ -1,6 +1,6 @@
|
||||
# Dynamic macros: record and replay macros in runtime
|
||||
|
||||
QMK supports temporarily macros created on the fly. We call these Dynamic Macros. They are defined by the user from the keyboard and are lost when the keyboard is unplugged or otherwise rebooted.
|
||||
QMK supports temporary macros created on the fly. We call these Dynamic Macros. They are defined by the user from the keyboard and are lost when the keyboard is unplugged or otherwise rebooted.
|
||||
|
||||
You can store one or two macros and they may have a combined total of 128 keypresses. You can increase this size at the cost of RAM.
|
||||
|
||||
@ -22,7 +22,7 @@ enum planck_keycodes {
|
||||
|
||||
It must be the last element because `dynamic_macros.h` will add some more keycodes after it.
|
||||
|
||||
Below it include the `dynamic_macro.h` header:
|
||||
Below it, include the `dynamic_macro.h` header:
|
||||
|
||||
```c
|
||||
#include "dynamic_macro.h"`
|
||||
@ -58,6 +58,6 @@ For users of the earlier versions of dynamic macros: It is still possible to fin
|
||||
}
|
||||
```
|
||||
|
||||
If the LED's start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 128; please read the comments for it in the header).
|
||||
If the LEDs start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 128; please read the comments for it in the header).
|
||||
|
||||
For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header.
|
||||
|
@ -13,7 +13,7 @@ In short when your controller is ATMega32u4,
|
||||
|
||||
or just
|
||||
|
||||
$ sudo make <keyboard>-<keymap>-dfu
|
||||
$ sudo make <keyboard>:<keymap>:dfu
|
||||
|
||||
But to run `make` with root privilege is not good idea. Use former method if possible.
|
||||
|
||||
@ -62,7 +62,7 @@ https://github.com/tmk/tmk_keyboard/wiki/mbed-cortex-porting#compile-error-cstdd
|
||||
https://developer.mbed.org/forum/mbed/topic/5205/
|
||||
|
||||
|
||||
## 'clock_prescale_set' and 'clock_div_1' not available
|
||||
## `clock_prescale_set` and `clock_div_1` not available
|
||||
Your toolchain is too old to support the MCU. For example WinAVR 20100110 doesn't support ATMega32u2.
|
||||
|
||||
```
|
||||
|
@ -92,7 +92,7 @@ First you have to compile frimware with this build option `NKRO_ENABLE` in **Mak
|
||||
|
||||
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.
|
||||
If your firmware 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
|
||||
|
||||
|
@ -14,7 +14,7 @@ Shortcuts for bootmagic options. You can use these even when bootmagic is off.
|
||||
|`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_SWAP_BACKSLASH_BACKSPACE`|Swap backslash and backspace|
|
||||
|`MAGIC_HOST_NKRO`|Force NKRO on|
|
||||
|`MAGIC_SWAP_ALT_GUI`/`AG_SWAP`|Swap Alt and Gui on both sides|
|
||||
|`MAGIC_UNSWAP_CONTROL_CAPSLOCK`|Disable the Control/Capslock swap|
|
||||
|
@ -43,15 +43,15 @@ The folder name must be added to the keyboard's `rules.mk`:
|
||||
|
||||
LAYOUTS = 60_ansi
|
||||
|
||||
`LAYOUTS` can be appended in the subproject's `rules.mk`:
|
||||
`LAYOUTS` can be set in any keyboard folder level's `rules.mk`:
|
||||
|
||||
LAYOUTS += 60_iso
|
||||
LAYOUTS = 60_iso
|
||||
|
||||
but the `LAYOUT_<layout>` variable must be defined in `<subproject>.h` as well.
|
||||
but the `LAYOUT_<layout>` variable must be defined in `<folder>.h` as well.
|
||||
|
||||
## Tips for making layouts keyboard-agnostic
|
||||
|
||||
Instead of using `#include "planck.h"`, you can use this line to include whatever `<keyboard>.h` (`<subproject>.h` should not be included here) file that is being compiled:
|
||||
Instead of using `#include "planck.h"`, you can use this line to include whatever `<keyboard>.h` (`<folder>.h` should not be included here) file that is being compiled:
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
@ -61,17 +61,16 @@ In your config.h, you can also use this variable to include the keyboard's `conf
|
||||
|
||||
If you want to keep some keyboard-specific code, you can use these variables to escape it with an `#ifdef` statement:
|
||||
|
||||
* `KEYBOARD_<keyboard>`
|
||||
* `SUBPROJECT_<subproject>`
|
||||
* `KEYBOARD_<folder1>_<folder2>`
|
||||
|
||||
For example:
|
||||
|
||||
```c
|
||||
#ifdef KEYBOARD_planck
|
||||
#ifdef SUBPROJECT_rev4
|
||||
#ifdef KEYBOARD_planck_rev4
|
||||
planck_rev4_function();
|
||||
#endif
|
||||
#endif
|
||||
```
|
||||
|
||||
Note that the names are lowercase and match the folder/file names for the keyboard/subproject exactly.
|
||||
Note that the names are lowercase and match the folder/file names for the keyboard/revision exactly.
|
47
docs/feature_pointing_device.md
Normal file
47
docs/feature_pointing_device.md
Normal file
@ -0,0 +1,47 @@
|
||||
## Pointing Device
|
||||
|
||||
Pointing Device is a generic name for a feature intended to be generic: moving the system pointer arround. There are certainly other options for it - like mousekeys - but this aims to be easily modifiable and lightweight. You can implement custom keys to control functionality, or you can gather information from other peripherals and insert it directly here - let QMK handle the processing for you.
|
||||
|
||||
To enable Pointing Device, uncomment the following line in your rules.mk:
|
||||
|
||||
```
|
||||
POINTING_DEVICE_ENABLE = yes
|
||||
```
|
||||
|
||||
To manipulate the mouse report, you can use the following functions:
|
||||
|
||||
* `pointing_device_get_report()` - Returns the current report_mouse_t that represents the information sent to the host computer
|
||||
* `pointing_device_set_report(report_mouse_t newMouseReport)` - Overrides and saves the report_mouse_t to be sent to the host computer
|
||||
|
||||
Keep in mind that a report_mouse_t (here "mouseReport") has the following properties:
|
||||
|
||||
* `mouseReport.x` - this is a signed int from -127 to 127 (not 128, this is defined in USB HID spec) representing movement (+ to the right, - to the left) on the x axis.
|
||||
* `mouseReport.y` - this is a signed int from -127 to 127 (not 128, this is defined in USB HID spec) representing movement (+ upward, - downward) on the y axis.
|
||||
* `mouseReport.v` - this is a signed int from -127 to 127 (not 128, this is defined in USB HID spec) representing vertical scrolling (+ upward, - downward).
|
||||
* `mouseReport.h` - this is a signed int from -127 to 127 (not 128, this is defined in USB HID spec) representing horizontal scrolling (+ right, - left).
|
||||
* `mouseReport.buttons` - this is a uint8_t in which the last 5 bits are used. These bits represent the mouse button state - bit 3 is mouse button 5, and bit 7 is mouse button 1.
|
||||
|
||||
When the mouse report is sent, the x, y, v, and h values are set to 0 (this is done in "pointing_device_send()", which can be overridden to avoid this behavior). This way, button states persist, but movement will only occur once. For further customization, both `pointing_device_init` and `pointing_device_task` can be overridden.
|
||||
|
||||
In the following example, a custom key is used to click the mouse and scroll 127 units vertically and horizontally, then undo all of that when released - because that's a totally useful function. Listen, this is an example:
|
||||
|
||||
```
|
||||
case MS_SPECIAL:
|
||||
report_mouse_t currentReport = pointing_device_get_report();
|
||||
if (record->event.pressed)
|
||||
{
|
||||
currentReport.v = 127;
|
||||
currentReport.h = 127;
|
||||
currentReport.buttons |= MOUSE_BTN1; //this is defined in report.h
|
||||
}
|
||||
else
|
||||
{
|
||||
currentReport.v = -127;
|
||||
currentReport.h = -127;
|
||||
currentReport.buttons &= ~MOUSE_BTN1;
|
||||
}
|
||||
pointing_device_set_report(currentReport);
|
||||
break;
|
||||
```
|
||||
|
||||
Recall that the mouse report is set to zero (except the buttons) whenever it is sent, so the scrolling would only occur once in each case.
|
@ -227,6 +227,26 @@ Fine control over the scrolling is supported with the following defines:
|
||||
#define PS2_MOUSE_SCROLL_DIVISOR_V 2
|
||||
```
|
||||
|
||||
#### Invert mouse and scroll axes
|
||||
|
||||
To invert the X and Y axes you can put:
|
||||
|
||||
```
|
||||
#define PS2_MOUSE_INVERT_X
|
||||
#define PS2_MOUSE_INVERT_Y
|
||||
```
|
||||
|
||||
into config.h.
|
||||
|
||||
To reverse the scroll axes you can put:
|
||||
|
||||
```
|
||||
#define PS2_MOUSE_INVERT_H
|
||||
#define PS2_MOUSE_INVERT_V
|
||||
```
|
||||
|
||||
into config.h.
|
||||
|
||||
#### Debug settings
|
||||
|
||||
To debug the mouse, add `debug_mouse = true` or enable via bootmagic.
|
||||
|
@ -49,8 +49,10 @@ If you have `#define RGBLIGHT_ANIMATIONS` in your `config.h` you will have a num
|
||||
| Option | Default Value | Description |
|
||||
|--------|---------------|-------------|
|
||||
| `RGBLIGHT_ANIMATIONS` | | `#define` this to enable animation modes. |
|
||||
| `RGBLIGHT_EFFECT_SNAKE_LENGTH` | 4 | The number of LEDs to light up for the "snake" mode. |
|
||||
| `RGBLIGHT_EFFECT_KNIGHT_LENGTH` | 3 | The number of LEDs to light up for the "knight" mode. |
|
||||
| `RGBLIGHT_EFFECT_BREATHE_CENTER` | 1.85 | Used to calculate the curve for the breathing animation. Valid values 1.0-2.7. |
|
||||
| `RGBLIGHT_EFFECT_BREATHE_MAX` | 255 | The maximum brightness for the breathing mode. Valid values 1-255. |
|
||||
| `RGBLIGHT_EFFECT_SNAKE_LENGTH` | 4 | The number of LEDs to light up for the "snake" animation. |
|
||||
| `RGBLIGHT_EFFECT_KNIGHT_LENGTH` | 3 | The number of LEDs to light up for the "knight" animation. |
|
||||
| `RGBLIGHT_EFFECT_KNIGHT_OFFSET` | 0 | Start the knight animation this many LEDs from the start of the strip. |
|
||||
| `RGBLIGHT_EFFECT_KNIGHT_LED_NUM` | RGBLED_NUM | The number of LEDs to have the "knight" animation travel. |
|
||||
| `RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL` | 1000 | How long to wait between light changes for the "christmas" animation. Specified in ms. |
|
||||
|
33
docs/feature_userspace.md
Normal file
33
docs/feature_userspace.md
Normal file
@ -0,0 +1,33 @@
|
||||
# Userspace: sharing code between keymaps
|
||||
|
||||
If you use more than one keyboard with a similar keymap, you might see the benefit in being able to share code between them. Create your own folder in `users/` named the same as your keymap (ideally your github username, `<name>`) with the following structure:
|
||||
|
||||
* `/users/<name>/` (added to the path automatically)
|
||||
* `readme.md`
|
||||
* `rules.mk` (included automatically)
|
||||
* `<name>.h` (optional)
|
||||
* `<name>.c` (optional)
|
||||
|
||||
`<name>.c` will need to be added to the SRC in `rules.mk` like this:
|
||||
|
||||
SRC += <name>.c
|
||||
|
||||
Additional files may be added in the same way - it's recommended you have one named `<name>`.c/.h though.
|
||||
|
||||
All this only happens when you build a keymap named `<name>`, like this:
|
||||
|
||||
make planck:<name>
|
||||
|
||||
For example,
|
||||
|
||||
make planck:jack
|
||||
|
||||
Will include the `/users/jack/` folder in the path, along with `/users/jack/rules.mk`.
|
||||
|
||||
## Readme
|
||||
|
||||
Please include authorship (your name, github username, email), and optionally [a license that's GPL compatible](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses).
|
||||
|
||||
## Example
|
||||
|
||||
For a brief example, checkout `/users/_example/` until we have more reasonable and useful examples.
|
@ -102,4 +102,4 @@ case MACRO_RAISED:
|
||||
update_tri_layer(LAYER_LOWER, LAYER_RAISED, LAYER_ADJUST);
|
||||
}
|
||||
break;
|
||||
```
|
||||
```
|
@ -121,10 +121,10 @@ If this is a bit complex for you, Docker might be the turn-key solution you need
|
||||
# modify the keymap and keyboard assigment to compile what you want
|
||||
# defaults are ergodox/default
|
||||
|
||||
docker run -e keymap=gwen -e subproject=ez -e keyboard=ergodox --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware
|
||||
docker run -e keymap=gwen -e keyboard=ergodox_ez --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware
|
||||
|
||||
# On windows docker seems to have issue with VOLUME tag in Dockerfile, and $('pwd') won't print a windows compliant path, use full path instead like this
|
||||
docker run -e keymap=default -e subproject=ez -e keyboard=ergobox --rm -v D:/Users/Sacapuces/Documents/Repositories/qmk:/qmk:rw edasque/qmk_firmware
|
||||
docker run -e keymap=default -e keyboard=ergobox_ez --rm -v D:/Users/Sacapuces/Documents/Repositories/qmk:/qmk:rw edasque/qmk_firmware
|
||||
|
||||
```
|
||||
|
||||
|
@ -1,22 +1,21 @@
|
||||
# More detailed make instruction
|
||||
|
||||
The full syntax of the `make` command is `<keyboard>-<subproject>-<keymap>-<target>`, where:
|
||||
The full syntax of the `make` command is `<keyboard_folder>:<keymap>:<target>`, where:
|
||||
|
||||
* `<keyboard>` is the name of the keyboard, for example `planck`
|
||||
* Use `allkb` to compile all keyboards
|
||||
* `<subproject>` is the name of the subproject (revision or sub-model of the keyboard). For example, for Ergodox it can be `ez` or `infinity`, and for Planck `rev3` or `rev4`.
|
||||
* If the keyboard doesn't have any subprojects, it can be left out
|
||||
* To compile the default subproject, you can leave it out, or specify `defaultsp`
|
||||
* Use `allsp` to compile all subprojects
|
||||
* `<keyboard_folder>` is the path of the keyboard, for example `planck`
|
||||
* Use `all` to compile all keyboards
|
||||
* Specify the path to compile a revision, for example `planck/rev4` or `planck/rev3`
|
||||
* If the keyboard doesn't have any folders, it can be left out
|
||||
* To compile the default folder, you can leave it out
|
||||
* `<keymap>` is the name of the keymap, for example `algernon`
|
||||
* Use `allkm` to compile all keymaps
|
||||
* Use `all` to compile all keymaps
|
||||
* `<target>` will be explained in more detail below.
|
||||
|
||||
The `<target>` means the following
|
||||
* If no target is given, then it's the same as `all` below
|
||||
* `all` compiles as many keyboard/revision/keymap combinations as specified. For example, `make planck-rev4-default-all` will generate a single .hex, while `make planck-rev-all` will generate a hex for every keymap available to the planck.
|
||||
* `all` compiles as many keyboard/revision/keymap combinations as specified. For example, `make planck/rev4:default:all` will generate a single .hex, while `make planck/rev4:all` will generate a hex for every keymap available to the planck.
|
||||
* `dfu`, `teensy` or `dfu-util`, compile and upload the firmware to the keyboard. If the compilation fails, then nothing will be uploaded. The programmer to use depends on the keyboard. For most keyboards it's `dfu`, but for ChibiOS keyboards you should use `dfu-util`, and `teensy` for standard Teensys. To find out which command you should use for your keyboard, check the keyboard specific readme.
|
||||
* **Note**: some operating systems need root access for these commands to work, so in that case you need to run for example `sudo make planck-rev4-default-dfu`.
|
||||
* **Note**: some operating systems need root access for these commands to work, so in that case you need to run for example `sudo make planck/rev4:default:dfu`.
|
||||
* `clean`, cleans the build output folders to make sure that everything is built from scratch. Run this before normal compilation if you have some unexplainable problems.
|
||||
|
||||
You can also add extra options at the end of the make command line, after the target
|
||||
@ -30,9 +29,9 @@ The make command itself also has some additional options, type `make --help` for
|
||||
|
||||
Here are some examples commands
|
||||
|
||||
* `make allkb-allsp-allkm` builds everything (all keyboards, all subprojects, all keymaps). Running just `make` from the `root` will also run this.
|
||||
* `make ergodox-infinity-algernon-clean` will clean the build output of the Ergodox Infinity keyboard.
|
||||
* `make planck-rev4-default-dfu COLOR=false` builds and uploads the keymap without color output.
|
||||
* `make all:all` builds everything (all keyboard folders, all keymaps). Running just `make` from the `root` will also run this.
|
||||
* `make ergodox_infinity:algernon:clean` will clean the build output of the Ergodox Infinity keyboard.
|
||||
* `make planck/rev4:default:dfu COLOR=false` builds and uploads the keymap without color output.
|
||||
|
||||
## `rules.mk` options
|
||||
|
||||
|
@ -273,7 +273,7 @@ Notice how the `k11` and `KC_NO` switched places to represent the wiring, and th
|
||||
|
||||
### keymaps/<variant>/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 handwired-<keyboard>-<variant>`, which will pull `keymaps/<variant>/keymap.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 handwired/<keyboard>:<variant>`, which will pull `keymaps/<variant>/keymap.c`.
|
||||
|
||||
The basis of a keymap is its layers - by default, layer 0 is active. You can activate other layers, the highest of which will be referenced first. Let's start with our base layer.
|
||||
|
||||
|
@ -79,7 +79,7 @@ Key with `KC_TRANS` (`KC_TRNS` and `_______` are the alias) doesn't has its own
|
||||
|
||||
## Anatomy Of A `keymap.c`
|
||||
|
||||
For this example we will walk through the [default Clueboard keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/keymaps/default/keymap.c). You'll find it helpful to open that file in another browser window so you can look at everything in context.
|
||||
For this example we will walk through the [default Clueboard 66% keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard_66/keymaps/default/keymap.c). You'll find it helpful to open that file in another browser window so you can look at everything in context.
|
||||
|
||||
There are 3 main sections of a `keymap.c` file you'll want to concern yourself with:
|
||||
|
||||
|
@ -14,7 +14,7 @@ The implementation hooks into two parts of the system, to achieve this: into `pr
|
||||
|
||||
But lets start with how to use it, first!
|
||||
|
||||
First, you will need `TAP_DANCE_ENABLE=yes` in your `Makefile`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()`, takes a number, which will later be used as an index into the `tap_dance_actions` array.
|
||||
First, you will need `TAP_DANCE_ENABLE=yes` in your `rules.mk`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()`, takes a number, which will later be used as an index into the `tap_dance_actions` array.
|
||||
|
||||
This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are three possible options:
|
||||
|
||||
@ -42,7 +42,7 @@ For the sake of flexibility, tap-dance actions can be either a pair of keycodes,
|
||||
|
||||
Here's a simple example for a single definition:
|
||||
|
||||
1. In your `makefile`, add `TAP_DANCE_ENABLE = yes`
|
||||
1. In your `rules.mk`, add `TAP_DANCE_ENABLE = yes`
|
||||
2. In your `config.h` (which you can copy from `qmk_firmware/keyboards/planck/config.h` to your keymap directory), add `#define TAPPING_TERM 200`
|
||||
3. In your `keymap.c` file, define the variables and definitions, then add to your keymap:
|
||||
|
||||
@ -63,20 +63,23 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
TD(TD_ESC_CAPS)
|
||||
```
|
||||
|
||||
## Complex Example
|
||||
## Complex Examples
|
||||
|
||||
Here's a more complex example involving custom actions:
|
||||
This section details several complex tap dance examples.
|
||||
All the enums used in the examples are declared like this:
|
||||
|
||||
```c
|
||||
// Enums defined for all examples:
|
||||
enum {
|
||||
CT_SE = 0,
|
||||
CT_CLN,
|
||||
CT_EGG,
|
||||
CT_FLSH,
|
||||
X_TAP_DANCE
|
||||
};
|
||||
|
||||
/* Have the above three on the keymap, TD(CT_SE), etc... */
|
||||
|
||||
```
|
||||
### Example 1: Send `:` on single tap, `;` on double tap
|
||||
```c
|
||||
void dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 1) {
|
||||
register_code (KC_RSFT);
|
||||
@ -95,6 +98,13 @@ void dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
//All tap dance functions would go here. Only showing this one.
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset)
|
||||
};
|
||||
```
|
||||
### Example 2: Send "Safety Dance!" after 100 taps
|
||||
```c
|
||||
void dance_egg (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 100) {
|
||||
SEND_STRING ("Safety dance!");
|
||||
@ -102,6 +112,14 @@ void dance_egg (qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg)
|
||||
};
|
||||
```
|
||||
|
||||
### Example 3: Turn LED lights on then off, one at a time
|
||||
|
||||
```c
|
||||
// on each tap, light up one led, from right to left
|
||||
// on the forth tap, turn them off from right to left
|
||||
void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) {
|
||||
@ -141,6 +159,7 @@ void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
ergodox_right_led_3_off();
|
||||
}
|
||||
|
||||
//All tap dances now put together. Example 3 is "CT_FLASH"
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT)
|
||||
,[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset)
|
||||
@ -148,3 +167,69 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
,[CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED (dance_flsh_each, dance_flsh_finished, dance_flsh_reset)
|
||||
};
|
||||
```
|
||||
|
||||
### Example 4: 'Quad Function Tap-Dance'
|
||||
|
||||
By @DanielGGordon
|
||||
|
||||
Allow one key to have 4 (or more) functions, depending on number of presses, and if the key is held or tapped.
|
||||
Below is a specific example:
|
||||
* Tap = Send `x`
|
||||
* Hold = Send `Control`
|
||||
* Double Tap = Send `Escape`
|
||||
* Double Tap and Hold = Send `Alt`
|
||||
|
||||
The following example can be easily expanded to more than 4 quite easily:
|
||||
```c
|
||||
//**************** Definitions needed for quad function to work *********************//
|
||||
//Enums used to clearly convey the state of the tap dance
|
||||
enum {
|
||||
SINGLE_TAP = 1,
|
||||
SINGLE_HOLD = 2,
|
||||
DOUBLE_TAP = 3,
|
||||
DOUBLE_HOLD = 4
|
||||
// Add more enums here if you want for triple, quadruple, etc.
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
bool is_press_action;
|
||||
int state;
|
||||
} tap;
|
||||
|
||||
int cur_dance (qk_tap_dance_state_t *state) {
|
||||
if ((state->count == 1) && (!state->pressed)) return SINGLE_TAP;
|
||||
else if ((state->count == 1) && (state->pressed)) return SINGLE_HOLD;
|
||||
else if ((state->count == 2) && (!state->pressed)) return DOUBLE_TAP;
|
||||
else if ((state->count == 2) && (state->pressed)) return DOUBLE_HOLD;
|
||||
else return 5; //magic number. At some point this method will expand to work for more presses
|
||||
}
|
||||
//**************** Definitions needed for quad function to work *********************//
|
||||
|
||||
//instanalize an instance of 'tap' for the 'x' tap dance.
|
||||
static tap xtap_state = {
|
||||
.is_press_action = true,
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void x_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
xtap_state.state = cur_dance(state);
|
||||
switch (xtap_state.state) {
|
||||
case SINGLE_TAP: register_code(KC_X); break;
|
||||
case SINGLE_HOLD: register_code(KC_LCTRL); break;
|
||||
case DOUBLE_TAP: register_code(KC_ESC); break;
|
||||
case DOUBLE_HOLD: register_code(KC_LALT);
|
||||
}
|
||||
}
|
||||
|
||||
void x_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (xtap_state.state) {
|
||||
case SINGLE_TAP: unregister_code(KC_X); break;
|
||||
case SINGLE_HOLD: unregister_code(KC_LCTRL); break;
|
||||
case DOUBLE_TAP: unregister_code(KC_ESC); break;
|
||||
case DOUBLE_HOLD: unregister_code(KC_LALT);
|
||||
}
|
||||
xtap_state.state = 0;
|
||||
}
|
||||
```
|
||||
And then simply add this to your list of tap dance functions:
|
||||
`[X_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished, x_reset)`
|
||||
|
@ -36,7 +36,7 @@ Note how there's several different tests, each mocking out a separate part. Also
|
||||
|
||||
## Running the tests
|
||||
|
||||
To run all the tests in the codebase, type `make test`. You can also run test matching a substring by typing `make test-matchingsubstring` Note that the tests are always compiled with the native compiler of your platform, so they are also run like any other program on your computer.
|
||||
To run all the tests in the codebase, type `make test`. You can also run test matching a substring by typing `make test:matchingsubstring` Note that the tests are always compiled with the native compiler of your platform, so they are also run like any other program on your computer.
|
||||
|
||||
## Debugging the tests
|
||||
|
||||
|
@ -12,6 +12,6 @@ Hardware Availability: [BishopKeyboards.com](http://bishopkeyboards.com/)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make 9key-default
|
||||
make 9key: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,12 +3,12 @@ Alps64
|
||||
|
||||
An Alps-only 60% board designed by Hasu.
|
||||
|
||||
Keyboard Maintainer: QMK Community
|
||||
Hardware Supported: Alps64 PCB
|
||||
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
|
||||
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.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user