Compare commits
1 Commits
0.6.369
...
planck_ez_
Author | SHA1 | Date | |
---|---|---|---|
c012d715bf |
1
.gitignore
vendored
1
.gitignore
vendored
@ -54,7 +54,6 @@ util/Win_Check_Output.txt
|
||||
.vscode/tasks.json
|
||||
.vscode/last.sql
|
||||
.vscode/temp.sql
|
||||
.vscode/ipch/
|
||||
.stfolder
|
||||
.tags
|
||||
|
||||
|
@ -13,14 +13,10 @@ env:
|
||||
- MAKEFLAGS="-j3 --output-sync"
|
||||
before_install:
|
||||
- wget http://ww1.microchip.com/downloads/en/DeviceDoc/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
|
||||
# Need DFU > .5 for dfu-suffix
|
||||
- sudo add-apt-repository --yes ppa:tormodvolden/ppa
|
||||
- sudo apt-get update -qq
|
||||
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"
|
||||
- npm install -g moxygen
|
||||
- sudo apt-get -y --force-yes install dfu-util
|
||||
before_script:
|
||||
- avr-gcc --version
|
||||
script:
|
||||
|
2
Makefile
2
Makefile
@ -534,8 +534,6 @@ endef
|
||||
%:
|
||||
# Check if we have the CMP tool installed
|
||||
cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
|
||||
# Ensure that python3 is installed. This check can be removed after python is used in more places.
|
||||
if ! python3 --version 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi
|
||||
# Check if the submodules are dirty, and display a warning if they are
|
||||
ifndef SKIP_GIT
|
||||
if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 1 --init lib/chibios; fi
|
||||
|
@ -324,6 +324,7 @@ ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
|
||||
endif
|
||||
|
||||
# # project specific files
|
||||
SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
|
||||
SRC += $(KEYBOARD_SRC) \
|
||||
$(KEYMAP_C) \
|
||||
$(QUANTUM_SRC)
|
||||
@ -333,16 +334,15 @@ SRC += $(KEYBOARD_SRC) \
|
||||
|
||||
# Search Path
|
||||
VPATH += $(KEYMAP_PATH)
|
||||
VPATH += $(USER_PATH)
|
||||
VPATH += $(KEYBOARD_PATHS)
|
||||
VPATH += $(COMMON_VPATH)
|
||||
VPATH += $(USER_PATH)
|
||||
|
||||
include common_features.mk
|
||||
include $(TMK_PATH)/protocol.mk
|
||||
include $(TMK_PATH)/common.mk
|
||||
include bootloader.mk
|
||||
|
||||
SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
|
||||
SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC))
|
||||
SRC += $(TMK_COMMON_SRC)
|
||||
OPT_DEFS += $(TMK_COMMON_DEFS)
|
||||
|
@ -105,7 +105,6 @@ endif
|
||||
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
||||
POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h
|
||||
OPT_DEFS += -DRGBLIGHT_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/color.c
|
||||
SRC += $(QUANTUM_DIR)/rgblight.c
|
||||
CIE1931_CURVE = yes
|
||||
LED_BREATHING_TABLE = yes
|
||||
@ -179,14 +178,6 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), WS2812)
|
||||
SRC += ws2812.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes)
|
||||
OPT_DEFS += -DRGB_MATRIX_CUSTOM_KB
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(RGB_MATRIX_CUSTOM_USER)), yes)
|
||||
OPT_DEFS += -DRGB_MATRIX_CUSTOM_USER
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
|
||||
OPT_DEFS += -DTAP_DANCE_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
|
||||
@ -352,9 +343,3 @@ ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
|
||||
QUANTUM_LIB_SRC += i2c_master.c
|
||||
SRC += oled_driver.c
|
||||
endif
|
||||
|
||||
SPACE_CADET_ENABLE ?= yes
|
||||
ifeq ($(strip $(SPACE_CADET_ENABLE)), yes)
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_space_cadet.c
|
||||
OPT_DEFS += -DSPACE_CADET_ENABLE
|
||||
endif
|
||||
|
@ -63,13 +63,13 @@
|
||||
* [LED Matrix](feature_led_matrix.md)
|
||||
* [Macros](feature_macros.md)
|
||||
* [Mouse Keys](feature_mouse_keys.md)
|
||||
* [OLED Driver](feature_oled_driver)
|
||||
* [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys)
|
||||
* [Pointing Device](feature_pointing_device.md)
|
||||
* [PS/2 Mouse](feature_ps2_mouse.md)
|
||||
* [RGB Lighting](feature_rgblight.md)
|
||||
* [RGB Matrix](feature_rgb_matrix.md)
|
||||
* [Space Cadet](feature_space_cadet.md)
|
||||
* [Space Cadet Shift](feature_space_cadet_shift.md)
|
||||
* [Space Cadet Shift Enter](feature_space_cadet_shift_enter.md)
|
||||
* [Stenography](feature_stenography.md)
|
||||
* [Swap Hands](feature_swap_hands.md)
|
||||
* [Tap Dance](feature_tap_dance.md)
|
||||
|
@ -330,8 +330,6 @@ Use these to enable or disable building certain features. The more you have enab
|
||||
* Forces the keyboard to wait for a USB connection to be established before it starts up
|
||||
* `NO_USB_STARTUP_CHECK`
|
||||
* Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master.
|
||||
* `LINK_TIME_OPTIMIZATION_ENABLE`
|
||||
= Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION`
|
||||
|
||||
## USB Endpoint Limitations
|
||||
|
||||
|
@ -230,7 +230,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
void matrix_scan_user(void) { # The very important timer.
|
||||
if (is_alt_tab_active) {
|
||||
if (timer_elapsed(alt_tab_timer) > 1000) {
|
||||
unregister_code(KC_LALT);
|
||||
unregister_code16(LALT(KC_TAB));
|
||||
is_alt_tab_active = false;
|
||||
}
|
||||
}
|
||||
|
@ -30,11 +30,9 @@ Configure the hardware via your `config.h`:
|
||||
#define DRIVER_COUNT 2
|
||||
#define DRIVER_1_LED_TOTAL 25
|
||||
#define DRIVER_2_LED_TOTAL 24
|
||||
#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
|
||||
#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL
|
||||
```
|
||||
|
||||
!> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`.
|
||||
|
||||
Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations.
|
||||
|
||||
Define these arrays listing all the LEDs in your `<keyboard>.c`:
|
||||
@ -126,25 +124,21 @@ Configure the hardware via your `config.h`:
|
||||
|
||||
---
|
||||
|
||||
From this point forward the configuration is the same for all the drivers. The `led_config_t` struct provides a key electrical matrix to led index lookup table, what the physical position of each LED is on the board, and what type of key or usage the LED if the LED represents. Here is a brief example:
|
||||
From this point forward the configuration is the same for all the drivers. The struct rgb_led array tells the system for each led, what key electrical matrix it represents, what the physical position is on the board, and if the led is for a modifier key or not. Here is a brief example:
|
||||
|
||||
```C
|
||||
const led_config_t g_led_config = { {
|
||||
// Key Matrix to LED Index
|
||||
{ 5, NO_LED, NO_LED, 0 },
|
||||
{ NO_LED, NO_LED, NO_LED, NO_LED },
|
||||
{ 4, NO_LED, NO_LED, 1 },
|
||||
{ 3, NO_LED, NO_LED, 2 }
|
||||
}, {
|
||||
// LED Index to Physical Position
|
||||
{ 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 }
|
||||
}, {
|
||||
// LED Index to Flag
|
||||
1, 4, 4, 4, 4, 1
|
||||
} };
|
||||
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||
/* {row | col << 4}
|
||||
* | {x=0..224, y=0..64}
|
||||
* | | modifier
|
||||
* | | | */
|
||||
{{0|(0<<4)}, {20.36*0, 21.33*0}, 1},
|
||||
{{0|(1<<4)}, {20.36*1, 21.33*0}, 1},
|
||||
....
|
||||
}
|
||||
```
|
||||
|
||||
The first part, `// Key Matrix to LED Index`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `// LED Index to Physical Position` represents the LED's physical position on the keyboard. The first value, `x`, is between 0-224 (inclusive), and the second value, `y`, is between 0-64 (inclusive). This range is due to effect that calculate the center or halves for their animations. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents x, y coordinate 0, 0 and the bottom right of your keyboard represents 224, 64. Using this as a basis, you can use the following formula to calculate the physical position:
|
||||
The first part, `{row | col << 4}`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `{x=0..224, y=0..64}` represents the LED's physical position on the keyboard. The `x` is between (inclusive) 0-224, and `y` is between (inclusive) 0-64 as the effects are based on this range. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents x, y coordinate 0, 0 and the bottom right of your keyboard represents 224, 64. Using this as a basis, you can use the following formula to calculate the physical position:
|
||||
|
||||
```C
|
||||
x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION
|
||||
@ -153,19 +147,7 @@ y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION
|
||||
|
||||
Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout.
|
||||
|
||||
`// LED Index to Flag` is a bitmask, whether or not a certain LEDs is of a certain type. It is recommended that LEDs are set to only 1 type.
|
||||
|
||||
## Flags
|
||||
|
||||
|Define |Description |
|
||||
|------------------------------------|-------------------------------------------|
|
||||
|`#define HAS_FLAGS(bits, flags)` |Returns true if `bits` has all `flags` set.|
|
||||
|`#define HAS_ANY_FLAGS(bits, flags)`|Returns true if `bits` has any `flags` set.|
|
||||
|`#define LED_FLAG_NONE 0x00` |If this LED has no flags. |
|
||||
|`#define LED_FLAG_ALL 0xFF` |If this LED has all flags. |
|
||||
|`#define LED_FLAG_MODIFIER 0x01` |If the Key for this LED is a modifier. |
|
||||
|`#define LED_FLAG_UNDERGLOW 0x02` |If the LED is for underglow. |
|
||||
|`#define LED_FLAG_KEYLIGHT 0x04` |If the LED is for key backlight. |
|
||||
`modifier` is a boolean, whether or not a certain key is considered a modifier (used in some effects).
|
||||
|
||||
## Keycodes
|
||||
|
||||
@ -195,7 +177,7 @@ enum rgb_matrix_effects {
|
||||
RGB_MATRIX_GRADIENT_UP_DOWN, // Static gradient top to bottom, speed controls how much gradient changes
|
||||
RGB_MATRIX_BREATHING, // Single hue brightness cycling animation
|
||||
RGB_MATRIX_CYCLE_ALL, // Full keyboard solid hue cycling through full gradient
|
||||
RGB_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right
|
||||
RGB_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right
|
||||
RGB_MATRIX_CYCLE_UP_DOWN, // Full gradient scrolling top to bottom
|
||||
RGB_MATRIX_RAINBOW_MOVING_CHEVRON, // Full gradent Chevron shapped scrolling left to right
|
||||
RGB_MATRIX_DUAL_BEACON, // Full gradient spinning around center of keyboard
|
||||
@ -203,10 +185,7 @@ enum rgb_matrix_effects {
|
||||
RGB_MATRIX_RAINBOW_PINWHEELS, // Full dual gradients spinning two halfs of keyboard
|
||||
RGB_MATRIX_RAINDROPS, // Randomly changes a single key's hue
|
||||
RGB_MATRIX_JELLYBEAN_RAINDROPS, // Randomly changes a single key's hue and saturation
|
||||
#if define(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
|
||||
RGB_MATRIX_TYPING_HEATMAP, // How hot is your WPM!
|
||||
RGB_MATRIX_DIGITAL_RAIN, // That famous computer simulation
|
||||
#endif
|
||||
#if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES)
|
||||
RGB_MATRIX_SOLID_REACTIVE_SIMPLE, // Pulses keys hit to hue & value then fades value out
|
||||
RGB_MATRIX_SOLID_REACTIVE, // Static single hue, pulses keys hit to shifted hue then fades to current hue
|
||||
@ -224,7 +203,7 @@ enum rgb_matrix_effects {
|
||||
RGB_MATRIX_EFFECT_MAX
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`:
|
||||
|
||||
|
||||
@ -242,7 +221,6 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con
|
||||
|`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` |
|
||||
|`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` |
|
||||
|`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` |
|
||||
|`#define DISABLE_RGB_MATRIX_TYPING_HEATMAP` |Disables `RGB_MATRIX_TYPING_HEATMAP` |
|
||||
|`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` |
|
||||
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` |
|
||||
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |
|
||||
@ -258,60 +236,17 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con
|
||||
|`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` |
|
||||
|
||||
|
||||
## Custom RGB Matrix Effects
|
||||
## Custom layer effects
|
||||
|
||||
By setting `RGB_MATRIX_CUSTOM_USER` (and/or `RGB_MATRIX_CUSTOM_KB`) in `rule.mk`, new effects can be defined directly from userspace, without having to edit any QMK core files.
|
||||
|
||||
To declare new effects, create a new `rgb_matrix_user/kb.inc` that looks something like this:
|
||||
|
||||
`rgb_matrix_user.inc` should go in the root of the keymap directory.
|
||||
`rgb_matrix_kb.inc` should go in the root of the keyboard directory.
|
||||
Custom layer effects can be done by defining this in your `<keyboard>.c`:
|
||||
|
||||
```C
|
||||
// !!! DO NOT ADD #pragma once !!! //
|
||||
|
||||
// Step 1.
|
||||
// Declare custom effects using the RGB_MATRIX_EFFECT macro
|
||||
// (note the lack of semicolon after the macro!)
|
||||
RGB_MATRIX_EFFECT(my_cool_effect)
|
||||
RGB_MATRIX_EFFECT(my_cool_effect2)
|
||||
|
||||
// Step 2.
|
||||
// Define effects inside the `RGB_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block
|
||||
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
|
||||
|
||||
// e.g: A simple effect, self-contained within a single method
|
||||
static bool my_cool_effect(effect_params_t* params) {
|
||||
RGB_MATRIX_USE_LIMITS(led_min, led_max);
|
||||
for (uint8_t i = led_min; i < led_max; i++) {
|
||||
rgb_matrix_set_color(i, 0xff, 0xff, 0x00);
|
||||
}
|
||||
return led_max < DRIVER_LED_TOTAL;
|
||||
void rgb_matrix_indicators_kb(void) {
|
||||
rgb_matrix_set_color(index, red, green, blue);
|
||||
}
|
||||
|
||||
// e.g: A more complex effect, relying on external methods and state, with
|
||||
// dedicated init and run methods
|
||||
static uint8_t some_global_state;
|
||||
static void my_cool_effect2_complex_init(effect_params_t* params) {
|
||||
some_global_state = 1;
|
||||
}
|
||||
static bool my_cool_effect2_complex_run(effect_params_t* params) {
|
||||
RGB_MATRIX_USE_LIMITS(led_min, led_max);
|
||||
for (uint8_t i = led_min; i < led_max; i++) {
|
||||
rgb_matrix_set_color(i, 0xff, some_global_state++, 0xff);
|
||||
}
|
||||
|
||||
return led_max < DRIVER_LED_TOTAL;
|
||||
}
|
||||
static bool my_cool_effect2(effect_params_t* params) {
|
||||
if (params->init) my_cool_effect2_complex_init(params);
|
||||
return my_cool_effect2_complex_run(params);
|
||||
}
|
||||
|
||||
#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
|
||||
```
|
||||
|
||||
For inspiration and examples, check out the built-in effects under `quantum/rgb_matrix_animation/`
|
||||
A similar function works in the keymap as `rgb_matrix_indicators_user`.
|
||||
|
||||
|
||||
## Colors
|
||||
|
@ -37,9 +37,9 @@ QMK uses [Hue, Saturation, and Value](https://en.wikipedia.org/wiki/HSL_and_HSV)
|
||||
|
||||
<img src="gitbook/images/color-wheel.svg" alt="HSV Color Wheel" width="250"/>
|
||||
|
||||
Changing the **Hue** cycles around the circle.<br>
|
||||
Changing the **Saturation** moves between the inner and outer sections of the wheel, affecting the intensity of the color.<br>
|
||||
Changing the **Value** sets the overall brightness.<br>
|
||||
Changing the **Hue** cycles around the circle.
|
||||
Changing the **Saturation** moves between the inner and outer sections of the wheel, affecting the intensity of the color.
|
||||
Changing the **Value** sets the overall brightness.
|
||||
|
||||
## Keycodes
|
||||
|
||||
@ -77,7 +77,8 @@ Your RGB lighting can be configured by placing these `#define`s in your `config.
|
||||
|`RGBLIGHT_SLEEP` |*Not defined*|If defined, the RGB lighting will be switched off when the host goes to sleep|
|
||||
|`RGBLIGHT_SPLIT` |*Not defined*|If defined, synchronization functionality for split keyboards is added|
|
||||
|
||||
## Effects and Animations
|
||||
## Animations
|
||||
|
||||
|
||||
Not only can this lighting be whatever color you want,
|
||||
if `RGBLIGHT_EFFECT_xxxx` or `RGBLIGHT_ANIMATIONS` is defined, you also have a number of animation modes at your disposal:
|
||||
@ -99,54 +100,29 @@ Check out [this video](https://youtube.com/watch?v=VKrpPAHlisY) for a demonstrat
|
||||
|
||||
Note: For versions older than 0.6.117, The mode numbers were written directly. In `quantum/rgblight.h` there is a contrast table between the old mode number and the current symbol.
|
||||
|
||||
### Effect and Animation Toggles
|
||||
|
||||
Use these defines to add or remove animations from the firmware. When you are running low on flash space, it can be helpful to disable animations you are not using.
|
||||
The following options can be used to tweak the various animations:
|
||||
|
||||
|Define |Default |Description |
|
||||
|------------------------------------|-------------|-------------------------------------------------------------------------------------|
|
||||
|`RGBLIGHT_ANIMATIONS` |*Not defined*|Enable all additional animation modes. |
|
||||
|`RGBLIGHT_EFFECT_ALTERNATING` |*Not defined*|Enable alternating animation mode. |
|
||||
|`RGBLIGHT_EFFECT_BREATHING` |*Not defined*|Enable breathing animation mode. |
|
||||
|`RGBLIGHT_EFFECT_CHRISTMAS` |*Not defined*|Enable christmas animation mode. |
|
||||
|`RGBLIGHT_EFFECT_KNIGHT` |*Not defined*|Enable knight animation mode. |
|
||||
|`RGBLIGHT_EFFECT_RAINBOW_MOOD` |*Not defined*|Enable rainbow mood animation mode. |
|
||||
|`RGBLIGHT_EFFECT_RAINBOW_SWIRL` |*Not defined*|Enable rainbow swirl animation mode. |
|
||||
|`RGBLIGHT_EFFECT_RGB_TEST` |*Not defined*|Enable RGB test animation mode. |
|
||||
|`RGBLIGHT_EFFECT_SNAKE` |*Not defined*|Enable snake animation mode. |
|
||||
|`RGBLIGHT_EFFECT_STATIC_GRADIENT` |*Not defined*|Enable static gradient mode. |
|
||||
|
||||
### Effect and Animation Settings
|
||||
|
||||
The following options are used to tweak the various animations:
|
||||
|
||||
|Define |Default |Description |
|
||||
|------------------------------------|-------------|-------------------------------------------------------------------------------------|
|
||||
|`RGBLIGHT_EFFECT_BREATHE_CENTER` |*Not defined*|If defined, used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7 |
|
||||
|`RGBLIGHT_EFFECT_BREATHING` |*Not defined*|If defined, enable breathing animation mode. |
|
||||
|`RGBLIGHT_EFFECT_RAINBOW_MOOD` |*Not defined*|If defined, enable rainbow mood animation mode. |
|
||||
|`RGBLIGHT_EFFECT_RAINBOW_SWIRL` |*Not defined*|If defined, enable rainbow swirl animation mode. |
|
||||
|`RGBLIGHT_EFFECT_SNAKE` |*Not defined*|If defined, enable snake animation mode. |
|
||||
|`RGBLIGHT_EFFECT_KNIGHT` |*Not defined*|If defined, enable knight animation mode. |
|
||||
|`RGBLIGHT_EFFECT_CHRISTMAS` |*Not defined*|If defined, enable christmas animation mode. |
|
||||
|`RGBLIGHT_EFFECT_STATIC_GRADIENT` |*Not defined*|If defined, enable static gradient mode. |
|
||||
|`RGBLIGHT_EFFECT_RGB_TEST` |*Not defined*|If defined, enable RGB test animation mode. |
|
||||
|`RGBLIGHT_EFFECT_ALTERNATING` |*Not defined*|If defined, enable alternating animation mode. |
|
||||
|`RGBLIGHT_ANIMATIONS` |*Not defined*|If defined, enables all additional animation modes |
|
||||
|`RGBLIGHT_EFFECT_BREATHE_CENTER` |`1.85` |Used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7 |
|
||||
|`RGBLIGHT_EFFECT_BREATHE_MAX` |`255` |The maximum brightness for the breathing mode. Valid values are 1 to 255 |
|
||||
|`RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL`|`1000` |How long to wait between light changes for the "Christmas" animation, in milliseconds|
|
||||
|`RGBLIGHT_EFFECT_CHRISTMAS_STEP` |`2` |The number of LEDs to group the red/green colors by for the "Christmas" animation |
|
||||
|`RGBLIGHT_EFFECT_KNIGHT_LED_NUM` |`RGBLED_NUM` |The number of LEDs to have the "Knight" animation travel |
|
||||
|`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` |The number of LEDs to start the "Knight" animation from the start of the strip by |
|
||||
|`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, in milliseconds|
|
||||
|`RGBLIGHT_EFFECT_CHRISTMAS_STEP` |`2` |The number of LEDs to group the red/green colors by for the "Christmas" animation |
|
||||
|`RGBLIGHT_RAINBOW_SWIRL_RANGE` |`360` |Range adjustment for the rainbow swirl effect to get different swirls |
|
||||
|`RGBLIGHT_EFFECT_SNAKE_LENGTH` |`4` |The number of LEDs to light up for the "Snake" animation |
|
||||
|
||||
### Example Usage to Reduce Memory Footprint
|
||||
1. Remove `RGBLIGHT_ANIMATIONS` from `config.h`.
|
||||
1. Selectively add the animations you want to enable. The following would enable two animations and save about 4KiB:
|
||||
|
||||
```diff
|
||||
#undef RGBLED_NUM
|
||||
-#define RGBLIGHT_ANIMATIONS
|
||||
+#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
+#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
#define RGBLED_NUM 12
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
```
|
||||
|
||||
### Animation Speed
|
||||
|
||||
You can also modify the speeds that the different modes animate at:
|
||||
|
||||
@ -169,7 +145,7 @@ const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20};
|
||||
const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31};
|
||||
|
||||
// These control which hues are selected for each of the "Static gradient" modes
|
||||
const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64};
|
||||
const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90};
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
@ -1,59 +0,0 @@
|
||||
# Space Cadet: The Future, Built In
|
||||
|
||||
Steve Losh described the [Space Cadet Shift](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) quite well. Essentially, when you tap Left Shift on its own, you get an opening parenthesis; tap Right Shift on its own and you get the closing one. When held, the Shift keys function as normal. Yes, it's as cool as it sounds, and now even cooler supporting Control and Alt as well!
|
||||
|
||||
## Usage
|
||||
|
||||
Firstly, in your keymap, do one of the following:
|
||||
- Replace the Left Shift key with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close).
|
||||
- Replace the Left Control key with `KC_LCPO` (Left Control, Parenthesis Open), and Right Control with `KC_RCPC` (Right Control, Parenthesis Close).
|
||||
- Replace the Left Alt key with `KC_LAPO` (Left Alt, Parenthesis Open), and Right Alt with `KC_RAPC` (Right Alt, Parenthesis Close).
|
||||
- Replace any Shift key in your keymap with `KC_SFTENT` (Right Shift, Enter).
|
||||
|
||||
## Keycodes
|
||||
|
||||
|Keycode |Description |
|
||||
|-----------|-------------------------------------------|
|
||||
|`KC_LSPO` |Left Shift when held, `(` when tapped |
|
||||
|`KC_RSPC` |Right Shift when held, `)` when tapped |
|
||||
|`KC_LCPO` |Left Control when held, `(` when tapped |
|
||||
|`KC_RCPC` |Right Control when held, `)` when tapped |
|
||||
|`KC_LAPO` |Left Alt when held, `(` when tapped |
|
||||
|`KC_RAPC` |Right Alt when held, `)` when tapped |
|
||||
|`KC_SFTENT`|Right Shift when held, `Enter` when tapped |
|
||||
|
||||
## Caveats
|
||||
|
||||
Space Cadet's functionality can conflict with the default Command functionality when both Shift keys are held at the same time. See the [Command feature](feature_command.md) for info on how to change it, or make sure that Command is disabled in your `rules.mk` with:
|
||||
|
||||
```make
|
||||
COMMAND_ENABLE = no
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`. In addition, you can redefine the modifier to send on tap, or even send no modifier at all. The new configuration defines bundle all options up into a single define of 3 key codes in this order: the `Modifier` when held or when used with other keys, the `Tap Modifer` sent when tapped (no modifier if `KC_TRNS`), finally the `Keycode` sent when tapped. Now keep in mind, mods from other keys will still apply to the `Keycode` if say `KC_RSFT` is held while tapping `KC_LSPO` key with `KC_TRNS` as the `Tap Modifer`.
|
||||
|
||||
|Define |Default |Description |
|
||||
|----------------|-------------------------------|---------------------------------------------------------------------------------|
|
||||
|`LSPO_KEYS` |`KC_LSFT, LSPO_MOD, LSPO_KEY` |Send `KC_LSFT` when held, the mod and key defined by `LSPO_MOD` and `LSPO_KEY`. |
|
||||
|`RSPC_KEYS` |`KC_RSFT, RSPC_MOD, RSPC_KEY` |Send `KC_RSFT` when held, the mod and key defined by `RSPC_MOD` and `RSPC_KEY`. |
|
||||
|`LCPO_KEYS` |`KC_LCTL, KC_LCTL, KC_9` |Send `KC_LCTL` when held, the mod `KC_LCTL` with the key `KC_9` when tapped. |
|
||||
|`RCPC_KEYS` |`KC_RCTL, KC_RCTL, KC_0` |Send `KC_RCTL` when held, the mod `KC_RCTL` with the key `KC_0` when tapped. |
|
||||
|`LAPO_KEYS` |`KC_LALT, KC_LALT, KC_9` |Send `KC_LALT` when held, the mod `KC_LALT` with the key `KC_9` when tapped. |
|
||||
|`RAPC_KEYS` |`KC_RALT, KC_RALT, KC_0` |Send `KC_RALT` when held, the mod `KC_RALT` with the key `KC_0` when tapped. |
|
||||
|`SFTENT_KEYS` |`KC_RSFT, KC_TRNS, SFTENT_KEY` |Send `KC_RSFT` when held, no mod with the key `SFTENT_KEY` when tapped. |
|
||||
|
||||
|
||||
## Obsolete Configuration
|
||||
|
||||
These defines are used in the above defines internally to support backwards compatibility, so you may continue to use them, however the above defines open up a larger range of flexibility than before. As an example, say you want to not send any modifier when you tap just `KC_LSPO`, with the old defines you had an all or nothing choice of using the `DISABLE_SPACE_CADET_MODIFIER` define. Now you can define that key as: `#define LSPO_KEYS KC_LSFT, KC_TRNS, KC_9`. This tells the system to set Left Shift if held or used with other keys, then on tap send no modifier (transparent) with the `KC_9`.
|
||||
|
||||
|Define |Default |Description |
|
||||
|------------------------------|-------------|------------------------------------------------------------------|
|
||||
|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped |
|
||||
|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped |
|
||||
|`LSPO_MOD` |`KC_LSFT` |The modifier to apply to `LSPO_KEY` |
|
||||
|`RSPC_MOD` |`KC_RSFT` |The modifier to apply to `RSPC_KEY` |
|
||||
|`SFTENT_KEY` |`KC_ENT` |The keycode to send when the Shift key is tapped |
|
||||
|`DISABLE_SPACE_CADET_MODIFIER`|*Not defined*|If defined, prevent the Space Cadet from applying a modifier |
|
37
docs/feature_space_cadet_shift.md
Normal file
37
docs/feature_space_cadet_shift.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Space Cadet Shift: The Future, Built In
|
||||
|
||||
Steve Losh described the [Space Cadet Shift](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) quite well. Essentially, when you tap Left Shift on its own, you get an opening parenthesis; tap Right Shift on its own and you get the closing one. When held, the Shift keys function as normal. Yes, it's as cool as it sounds.
|
||||
|
||||
## Usage
|
||||
|
||||
Replace the Left Shift key in your keymap with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close).
|
||||
|
||||
## Keycodes
|
||||
|
||||
|Keycode |Description |
|
||||
|---------|--------------------------------------|
|
||||
|`KC_LSPO`|Left Shift when held, `(` when tapped |
|
||||
|`KC_RSPC`|Right Shift when held, `)` when tapped|
|
||||
|
||||
## Caveats
|
||||
|
||||
Space Cadet's functionality can conflict with the default Command functionality when both Shift keys are held at the same time. Make sure that Command is disabled in your `rules.mk` with:
|
||||
|
||||
```make
|
||||
COMMAND_ENABLE = no
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`.
|
||||
You can also disable the rollover, allowing you to use the opposite Shift key to cancel the Space Cadet state in the event of an erroneous press, instead of emitting a pair of parentheses when the keys are released.
|
||||
Also, by default, the Space Cadet applies modifiers LSPO_MOD and RSPC_MOD to keys defined by LSPO_KEY and RSPC_KEY. You can override this behavior by redefining those variables in your `config.h`. You can also prevent the Space Cadet to apply a modifier by defining DISABLE_SPACE_CADET_MODIFIER in your `config.h`.
|
||||
|
||||
|Define |Default |Description |
|
||||
|------------------------------|-------------|--------------------------------------------------------------------------------|
|
||||
|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped |
|
||||
|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped |
|
||||
|`LSPO_MOD` |`KC_LSFT` |The keycode to send when Left Shift is tapped |
|
||||
|`RSPC_MOD` |`KC_RSFT` |The keycode to send when Right Shift is tapped |
|
||||
|`DISABLE_SPACE_CADET_ROLLOVER`|*Not defined*|If defined, use the opposite Shift key to cancel Space Cadet |
|
||||
|`DISABLE_SPACE_CADET_MODIFIER`|*Not defined*|If defined, prevent the Space Cadet to apply a modifier to LSPO_KEY and RSPC_KEY|
|
31
docs/feature_space_cadet_shift_enter.md
Normal file
31
docs/feature_space_cadet_shift_enter.md
Normal file
@ -0,0 +1,31 @@
|
||||
# Space Cadet Shift Enter
|
||||
|
||||
Based on the [Space Cadet Shift](feature_space_cadet_shift.md) feature. Tap the Shift key on its own, and it behaves like Enter. When held, the Shift functions as normal.
|
||||
|
||||
## Usage
|
||||
|
||||
Replace any Shift key in your keymap with `KC_SFTENT` (Shift, Enter), and you're done.
|
||||
|
||||
## Keycodes
|
||||
|
||||
|Keycode |Description |
|
||||
|-----------|----------------------------------------|
|
||||
|`KC_SFTENT`|Right Shift when held, Enter when tapped|
|
||||
|
||||
## Caveats
|
||||
|
||||
As with Space Cadet Shift, this feature may conflict with Command, so it should be disabled in your `rules.mk` with:
|
||||
|
||||
```make
|
||||
COMMAND_ENABLE = no
|
||||
```
|
||||
|
||||
This feature also uses the same timers as Space Cadet Shift, so using them in tandem may produce strange results.
|
||||
|
||||
## Configuration
|
||||
|
||||
By default Space Cadet assumes a US ANSI layout, but if you'd like to use a different key for Enter, you can redefine it in your `config.h`:
|
||||
|
||||
|Define |Default |Description |
|
||||
|------------|--------|------------------------------------------------|
|
||||
|`SFTENT_KEY`|`KC_ENT`|The keycode to send when the Shift key is tapped|
|
@ -4,11 +4,11 @@ There are three Unicode keymap definition methods available in QMK:
|
||||
|
||||
## `UNICODE_ENABLE`
|
||||
|
||||
Supports Unicode up to `0x7FFF`. This covers characters for most modern languages, as well as symbols, but it doesn't cover emoji. The keycode function is `UC(c)` in the keymap, where _c_ is the code point's number (preferably hexadecimal, up to 4 digits long). For example: `UC(0x45B)`, `UC(0x30C4)`.
|
||||
Supports Unicode up to `0x7FFF`. This covers characters for most modern languages, as well as symbols, but it doesn't cover emoji. The keycode function is `UC(c)` in the keymap file, where _c_ is the code point's number (preferably hexadecimal, up to 4 digits long). For example: `UC(0x45B)`, `UC(0x30C4)`.
|
||||
|
||||
## `UNICODEMAP_ENABLE`
|
||||
|
||||
Supports Unicode up to `0x10FFFF` (all possible code points). You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(i)`, where _i_ is an array index into the mapping table. The table may contain at most 16384 entries.
|
||||
Supports Unicode up to `0x10FFFF` (all possible code points). You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(i)`, where _i_ is an array index into the mapping table. The table may contain at most 1024 entries.
|
||||
|
||||
You may want to have an enum to make referencing easier. So, you could add something like this to your keymap file:
|
||||
|
||||
@ -26,21 +26,13 @@ const uint32_t PROGMEM unicode_map[] = {
|
||||
};
|
||||
```
|
||||
|
||||
Then you can use `X(BANG)`, `X(SNEK)` etc. in your keymap.
|
||||
|
||||
### Lower and Upper Case
|
||||
|
||||
Characters often come in lower and upper case pairs, for example: å, Å. To make inputting these characters easier, you can use `XP(i, j)` in your keymap, where _i_ and _j_ are the mapping table indices of the lower and upper case character, respectively. If you're holding down Shift or have Caps Lock turned on when you press the key, the second (upper case) character will be inserted; otherwise, the first (lower case) version will appear.
|
||||
|
||||
This is most useful when creating a keymap for an international layout with special characters. Instead of having to put the lower and upper case versions of a character on separate keys, you can have them both on the same key by using `XP`. This blends Unicode keys in with regular alphas.
|
||||
|
||||
Due to keycode size constraints, _i_ and _j_ can each only refer to one of the first 128 characters in your `unicode_map`. In other words, 0 ≤ _i_ ≤ 127 and 0 ≤ _j_ ≤ 127. This is enough for most use cases, but if you'd like to customize the index calculation, you can override the [`unicodemap_index()`](https://github.com/qmk/qmk_firmware/blob/71f640d47ee12c862c798e1f56392853c7b1c1a8/quantum/process_keycode/process_unicodemap.c#L40) function. This also allows you to, say, check Ctrl instead of Shift/Caps.
|
||||
Then you can use `X(BANG)` etc. in your keymap.
|
||||
|
||||
## `UCIS_ENABLE`
|
||||
|
||||
Supports Unicode up to `0x10FFFF` (all possible code points). As with `UNICODEMAP`, you need to maintain a mapping table in your keymap file. However, there are no built-in keycodes for this feature — you have to add a keycode or function that calls `qk_ucis_start()`. Once this function has been called, you can type the corresponding mnemonic for your character, then hit Space or Enter to complete it, or Esc to cancel. If the mnemonic matches an entry in your table, the typed text will automatically be erased and the corresponding Unicode character inserted.
|
||||
Supports Unicode up to `0x10FFFF` (all possible code points). As with `UNICODEMAP`, you need to maintain a mapping table in your keymap file. However, there are no built-in keycodes for this feature — you will have to add a keycode or function that calls `qk_ucis_start()`. Once this function's been called, you can type the corresponding mnemonic for your character, then hit Space or Enter to complete it, or Esc to cancel. If the mnemonic matches an entry in your table, the typed text will automatically be erased and the corresponding Unicode character inserted.
|
||||
|
||||
For instance, you could define a table like this in your keymap file:
|
||||
For instance, you would define a table like this in your keymap file:
|
||||
|
||||
```c
|
||||
const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE(
|
||||
@ -50,7 +42,7 @@ const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE(
|
||||
);
|
||||
```
|
||||
|
||||
To use it, call `qk_ucis_start()`, then type "rofl" and hit Enter. QMK should erase the "rofl" text and insert the laughing emoji.
|
||||
You call `qk_ucis_start()`, then type "rofl" and hit Enter. QMK should erase the "rofl" text and input the laughing emoji.
|
||||
|
||||
### Customization
|
||||
|
||||
@ -68,29 +60,28 @@ Unicode input in QMK works by inputting a sequence of characters to the OS, sort
|
||||
|
||||
The following input modes are available:
|
||||
|
||||
* **`UC_OSX`**: macOS built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with `UNICODEMAP`).
|
||||
* **`UC_OSX`**: Mac OS X built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with `UNICODEMAP`).
|
||||
|
||||
To enable, go to _System Preferences > Keyboard > Input Sources_, add _Unicode Hex Input_ to the list (it's under _Other_), then activate it from the input dropdown in the Menu Bar.
|
||||
By default, this mode uses the left Option key (`KC_LALT`) for Unicode input, but this can be changed by defining [`UNICODE_KEY_OSX`](#input-key-configuration) with another keycode.
|
||||
By default, this mode uses the left Option key (`KC_LALT`), but this can be changed by defining [`UNICODE_OSX_KEY`](#input-key-configuration) with another keycode.
|
||||
|
||||
!> Using the _Unicode Hex Input_ input source may disable some Option based shortcuts, such as Option + Left Arrow and Option + Right Arrow.
|
||||
**Note:** Using the _Unicode Hex Input_ input source may disable some Option based shortcuts, such as: Option + Left Arrow (`moveWordLeftAndModifySelection`) and Option + Right Arrow (`moveWordRightAndModifySelection`).
|
||||
|
||||
* **`UC_LNX`**: Linux built-in IBus Unicode input. Supports code points up to `0x10FFFF` (all possible code points).
|
||||
|
||||
Enabled by default and works almost anywhere on IBus-enabled distros. Without IBus, this mode works under GTK apps, but rarely anywhere else.
|
||||
By default, this mode uses Ctrl+Shift+U (`LCTL(LSFT(KC_U))`) to start Unicode input, but this can be changed by defining [`UNICODE_KEY_LNX`](#input-key-configuration) with another keycode. This might be required for IBus versions ≥1.5.15, where Ctrl+Shift+U behavior is consolidated into Ctrl+Shift+E.
|
||||
|
||||
* **`UC_WIN`**: _(not recommended)_ Windows built-in hex numpad Unicode input. Supports code points up to `0xFFFF`.
|
||||
|
||||
To enable, create a registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad` and set its value to `1`. This can be done from the Command Prompt by running `reg add "HKCU\Control Panel\Input Method" -v EnableHexNumpad -t REG_SZ -d 1` with administrator privileges. Reboot afterwards.
|
||||
To enable, create a registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad` and set its value to `1`. This can be done from the Command Prompt by running `reg add "HKCU\Control Panel\Input Method" -v EnableHexNumpad -t REG_SZ -d 1` with administrator privileges. Afterwards, reboot.
|
||||
This mode is not recommended because of reliability and compatibility issues; use the `UC_WINC` mode instead.
|
||||
|
||||
* **`UC_BSD`**: _(non implemented)_ Unicode input under BSD. Not implemented at this time. If you're a BSD user and want to help add support for it, please [open an issue on GitHub](https://github.com/qmk/qmk_firmware/issues).
|
||||
|
||||
* **`UC_WINC`**: Windows Unicode input using [WinCompose](https://github.com/samhocevar/wincompose). As of v0.9.0, supports code points up to `0x10FFFF` (all possible code points).
|
||||
* **`UC_WINC`**: Windows Unicode input using [WinCompose](https://github.com/samhocevar/wincompose). As of v0.8.2, supports code points up to `0xFFFFF` (all currently assigned code points).
|
||||
|
||||
To enable, install the [latest release](https://github.com/samhocevar/wincompose/releases/latest). Once installed, WinCompose will automatically run on startup. Works reliably under all version of Windows supported by the app.
|
||||
By default, this mode uses right Alt (`KC_RALT`) as the Compose key, but this can be changed in the WinCompose settings and by defining [`UNICODE_KEY_WINC`](#input-key-configuration) with another keycode.
|
||||
By default, this mode uses the right Alt key (`KC_RALT`), but this can be changed in the WinCompose settings and by defining [`UNICODE_WINC_KEY`](#input-key-configuration) with another keycode.
|
||||
|
||||
### Switching Input Modes
|
||||
|
||||
@ -98,17 +89,17 @@ There are two ways to set the input mode for Unicode: by keycode or by function.
|
||||
|
||||
You can switch the input mode at any time by using one of the following keycodes. The easiest way is to add the ones you use to your keymap.
|
||||
|
||||
|Keycode |Alias |Input Mode |Description |
|
||||
|----------------------|---------|------------|--------------------------------------------------------------|
|
||||
|`UNICODE_MODE_FORWARD`|`UC_MOD` |Next in list|[Cycle](#input-mode-cycling) through selected modes |
|
||||
|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Prev in list|[Cycle](#input-mode-cycling) through selected modes in reverse|
|
||||
|`UNICODE_MODE_OSX` |`UC_M_OS`|`UC_OSX` |Switch to macOS input |
|
||||
|`UNICODE_MODE_LNX` |`UC_M_LN`|`UC_LNX` |Switch to Linux input |
|
||||
|`UNICODE_MODE_WIN` |`UC_M_WI`|`UC_WIN` |Switch to Windows input |
|
||||
|`UNICODE_MODE_BSD` |`UC_M_BS`|`UC_BSD` |Switch to BSD input (not implemented) |
|
||||
|`UNICODE_MODE_WINC` |`UC_M_WC`|`UC_WINC` |Switch to Windows input using WinCompose |
|
||||
|Keycode |Alias |Input mode |Description |
|
||||
|-----------------------|---------|-------------|-----------------------------------------|
|
||||
|`UNICODE_MODE_FORWARD` |`UC_MOD` | |Cycles forwards through the available modes. [(Disabled by default)](#input-method-cycling)|
|
||||
|`UNICODE_MODE_REVERSE` |`UC_RMOD`| |Cycles forwards through the available modes. [(Disabled by default)](#input-method-cycling)|
|
||||
|`UNICODE_MODE_OSX` |`UC_M_OS`|`UC_OSX` |Switch to Mac OS X input. |
|
||||
|`UNICODE_MODE_LNX` |`UC_M_LN`|`UC_LNX` |Switch to Linux input. |
|
||||
|`UNICODE_MODE_WIN` |`UC_M_WI`|`UC_WIN` |Switch to Windows input. |
|
||||
|`UNICODE_MODE_BSD` |`UC_M_BS`|`UC_BSD` |Switch to BSD input (not implemented). |
|
||||
|`UNICODE_MODE_WINC` |`UC_M_WC`|`UC_WINC` |Switch to Windows input using WinCompose.|
|
||||
|
||||
You can also switch the input mode by calling `set_unicode_input_mode(x)` in your code, where _x_ is one of the above input mode constants (e.g. `UC_LNX`). Since the function only needs to be called once, it's recommended that you do it in `eeconfig_init_user()` (or a similar function). For example:
|
||||
You can also switch the input mode by calling `set_unicode_input_mode(x)` in your code, where _x_ is one of the above input mode constants (e.g. `UC_LNX`). Since the function only needs to be called once, it's recommended that you do it in `eeconfig_init_user` (or a similar function). For example:
|
||||
|
||||
```c
|
||||
void eeconfig_init_user(void) {
|
||||
@ -132,45 +123,35 @@ For instance, you can add these definitions to your `config.h` file:
|
||||
|
||||
### Additional Customization
|
||||
|
||||
Because Unicode is a large and versatile feature, there are a number of options you can customize to make it work better on your system.
|
||||
Because Unicode is such a large and variable feature, there are a number of options that you can customize to work better on your system.
|
||||
|
||||
#### Start and Finish Input Functions
|
||||
#### Start and Finish input functions
|
||||
|
||||
The functions for starting and finishing Unicode input on your platform can be overridden locally. Possible uses include customizing input mode behavior if you don't use the default keys, or adding extra visual/audio feedback to Unicode input.
|
||||
|
||||
* `void unicode_input_start(void)` – This sends the initial sequence that tells your platform to enter Unicode input mode. For example, it presses Ctrl+Shift+U on Linux and holds the Option key on macOS.
|
||||
* `void unicode_input_start(void)` – This sends the initial sequence that tells your platform to enter Unicode input mode. For example, it presses Ctrl+Shift+U on Linux and holds the Option key on Mac.
|
||||
* `void unicode_input_finish(void)` – This is called to exit Unicode input mode, for example by pressing Space or releasing the Option key.
|
||||
|
||||
You can find the default implementations of these functions in [`process_unicode_common.c`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicode_common.c).
|
||||
|
||||
|
||||
#### Input Key Configuration
|
||||
|
||||
You can customize the keys used to trigger Unicode input for macOS, Linux and WinCompose by adding corresponding defines to your `config.h`. The default values match the platforms' default settings, so you shouldn't need to change this unless Unicode input isn't working, or you want to use a different key (e.g. in order to free up left or right Alt).
|
||||
|
||||
|Define |Type |Default |Example |
|
||||
|------------------|----------|------------------|-------------------------------------------|
|
||||
|`UNICODE_KEY_OSX` |`uint8_t` |`KC_LALT` |`#define UNICODE_KEY_OSX KC_RALT` |
|
||||
|`UNICODE_KEY_LNX` |`uint16_t`|`LCTL(LSFT(KC_U))`|`#define UNICODE_KEY_LNX LCTL(LSFT(KC_E))`|
|
||||
|`UNICODE_KEY_WINC`|`uint8_t` |`KC_RALT` |`#define UNICODE_KEY_WINC KC_RGUI` |
|
||||
|
||||
#### Input Mode Cycling
|
||||
|
||||
You can choose which input modes are available for cycling through. By default, this is disabled. If you want to enable it, limiting it to just the modes you use makes sense. Note that the values in the list are comma-delimited.
|
||||
Additionally, you can customize the keys used to trigger the unicode input for macOS and WinCompose by adding defines to your `config.h`
|
||||
|
||||
```c
|
||||
#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WIN, UC_WINC
|
||||
#define UNICODE_OSX_KEY KC_LALT
|
||||
#define UNICODE_WINC_KEY KC_RALT
|
||||
```
|
||||
|
||||
You can cycle through the selected modes by using the `UC_MOD`/`UC_RMOD` keycodes, or by calling `cycle_unicode_input_mode(offset)` in your code (`offset` is how many modes to move forward by, so +1 corresponds to `UC_MOD`).
|
||||
#### Input Method Cycling
|
||||
|
||||
By default, when the keyboard boots, it will initialize the input mode to the last one you used. You can disable this and make it start with the first mode in the list every time by adding the following to your `config.h`:
|
||||
Also, you can choose which input methods are availble for cycling through. By default, this is disabled. But if you want to enabled it, then limiting it to just those modes makes sense. Note that `UNICODE_SELECTED_MODES` define is comma delimited.
|
||||
|
||||
```c
|
||||
#define UNICODE_CYCLE_PERSIST false
|
||||
#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WIN, UC_BSD, UC_WINC
|
||||
```
|
||||
|
||||
!> Using `UNICODE_SELECTED_MODES` means you don't have to initially set the input mode in `matrix_init_user()` (or a similar function); the Unicode system will do that for you on startup. This has the added benefit of avoiding unnecessary writes to EEPROM.
|
||||
|
||||
## `send_unicode_hex_string`
|
||||
|
||||
To type multiple characters for things like (ノಠ痊ಠ)ノ彡┻━┻, you can use `send_unicode_hex_string()` much like `SEND_STRING()` except you would use hex values separate by spaces.
|
||||
|
@ -25,7 +25,7 @@ QMK has a staggering number of features for building your keyboard. It can take
|
||||
* [PS2 Mouse](feature_ps2_mouse.md) - Driver for connecting a PS/2 mouse directly to your keyboard.
|
||||
* [RGB Light](feature_rgblight.md) - RGB lighting for your keyboard.
|
||||
* [RGB Matrix](feature_rgb_matrix.md) - RGB Matrix lights for per key lighting.
|
||||
* [Space Cadet](feature_space_cadet.md) - Use your left/right shift keys to type parenthesis and brackets.
|
||||
* [Space Cadet](feature_space_cadet_shift.md) - Use your left/right shift keys to type parenthesis and brackets.
|
||||
* [Stenography](feature_stenography.md) - Put your keyboard into Plover mode for stenography use.
|
||||
* [Swap Hands](feature_swap_hands.md) - Mirror your keyboard for one handed usage.
|
||||
* [Tap Dance](feature_tap_dance.md) - Make a single key do as many things as you want.
|
||||
|
@ -198,17 +198,15 @@ From here, you should have a working keyboard once you program a firmware. Befor
|
||||
|
||||
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/) (paid) or [Visual Studio Code](https://code.visualstudio.com) (free).
|
||||
|
||||
The first thing we're going to do is create a new keyboard. In your terminal, run this command, which will ask you some questions and generate a basic keyboard project:
|
||||
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_keyboard.sh
|
||||
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:
|
||||
|
||||
```
|
||||
cd keyboards/<project_name>
|
||||
```
|
||||
cd keyboards/<project_name>
|
||||
|
||||
### `config.h`
|
||||
|
||||
@ -328,7 +326,7 @@ Carefully flip your keyboard over, open up a new text document, and try typing -
|
||||
2. Check the solder joints on the diode - if the diode is loose, part of your row may register, while the other may not.
|
||||
3. Check the solder joints on the columns - if your column wiring is loose, part or all of the column may not work.
|
||||
4. Check the solder joints on both sides of the wires going to/from the Teensy - the wires need to be fully soldered and connect to both sides.
|
||||
5. Check the `<project_name>.h` file for errors and incorrectly placed `KC_NO`s - if you're unsure where they should be, instead duplicate a k*xy* variable.
|
||||
5. Check the <project_name>.h file for errors and incorrectly placed `KC_NO`s - if you're unsure where they should be, instead duplicate a k*xy* variable.
|
||||
6. Check to make sure you actually compiled the firmware and flashed the Teensy correctly. Unless you got error messages in the terminal, or a pop-up during flashing, you probably did everything correctly.
|
||||
|
||||
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.
|
||||
@ -337,4 +335,4 @@ If you've done all of these things, keep in mind that sometimes you might have h
|
||||
|
||||
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 - explore [docs.qmk.fm](http://docs.qmk.fm) for a full feature list, and dive into the different keyboards (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)
|
||||
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)
|
||||
|
@ -6,26 +6,14 @@ If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_
|
||||
|
||||
## Adding Your AVR Keyboard to QMK
|
||||
|
||||
QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started, run the `util/new_keyboard.sh` script:
|
||||
QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started run the `util/new_project.sh` script:
|
||||
|
||||
```
|
||||
$ ./util/new_keyboard.sh
|
||||
Generating a new QMK keyboard directory
|
||||
|
||||
Keyboard Name: mycoolkb
|
||||
Keyboard Type [avr]:
|
||||
Your Name [John Smith]:
|
||||
|
||||
Copying base template files... done
|
||||
Copying avr template files... done
|
||||
Renaming keyboard files... done
|
||||
Replacing %KEYBOARD% with mycoolkb... done
|
||||
Replacing %YOUR_NAME% with John Smith... done
|
||||
|
||||
Created a new keyboard called mycoolkb.
|
||||
|
||||
To start working on things, cd into keyboards/mycoolkb,
|
||||
or open the directory in your favourite text editor.
|
||||
```bash
|
||||
$ util/new_project.sh my_awesome_keyboard
|
||||
######################################################
|
||||
# /keyboards/my_awesome_keyboard project created. To start
|
||||
# working on things, cd into keyboards/my_awesome_keyboard
|
||||
######################################################
|
||||
```
|
||||
|
||||
This will create all the files needed to support your new keyboard, and populate the settings with default values. Now you just need to customize it for your keyboard.
|
||||
|
@ -450,15 +450,7 @@ This is a reference only. Each group of keys links to the page documenting their
|
||||
|
||||
## [Unicode Support](feature_unicode.md)
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|----------------------|---------|----------------------------------------------------------------|
|
||||
|`UC(c)` | |Send Unicode code point `c` |
|
||||
|`X(i)` | |Send Unicode code point at index `i` in `unicode_map` |
|
||||
|`XP(i, j)` | |Send Unicode code point at index `i`, or `j` if Shift/Caps is on|
|
||||
|`UNICODE_MODE_FORWARD`|`UC_MOD` |Cycle through selected input modes |
|
||||
|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Cycle through selected input modes in reverse |
|
||||
|`UNICODE_MODE_OSX` |`UC_M_OS`|Switch to macOS input |
|
||||
|`UNICODE_MODE_LNX` |`UC_M_LN`|Switch to Linux input |
|
||||
|`UNICODE_MODE_WIN` |`UC_M_WI`|Switch to Windows input |
|
||||
|`UNICODE_MODE_BSD` |`UC_M_BS`|Switch to BSD input (not implemented) |
|
||||
|`UNICODE_MODE_WINC` |`UC_M_WC`|Switch to Windows input using WinCompose |
|
||||
|Key |Description |
|
||||
|-------|---------------------------------------------------------------------------|
|
||||
|`UC(c)`|Send Unicode code point `c` (`UNICODE_ENABLE`) |
|
||||
|`X(i)` |Send Unicode code point at index `i` in `unicode_map` (`UNICODEMAP_ENABLE`)|
|
||||
|
@ -13,9 +13,9 @@ Note: These programs are not provided by or endorsed by QMK.
|
||||
* [Keyboard Tester](http://www.keyboardtester.com) (Web Based)
|
||||
* [Keyboard Checker](http://keyboardchecker.com) (Web Based)
|
||||
|
||||
## Debugging
|
||||
## Debugging With QMK Toolbox
|
||||
|
||||
Your keyboard will output debug information if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, use the [Command](feature_command.md) feature to enable debug mode, or add the following code to your keymap.
|
||||
[QMK Toolbox](https://github.com/qmk/qmk_toolbox) will show messages from your keyboard if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, use the [Command](feature_command.md) feature to enable debug mode, or add the following code to your keymap.
|
||||
|
||||
```c
|
||||
void keyboard_post_init_user(void) {
|
||||
@ -27,14 +27,6 @@ void keyboard_post_init_user(void) {
|
||||
}
|
||||
```
|
||||
|
||||
### Debugging With QMK Toolbox
|
||||
|
||||
For compatible platforms, [QMK Toolbox](https://github.com/qmk/qmk_toolbox) can be used to display debug messages from your keyboard.
|
||||
|
||||
### Debugging With hid_listen
|
||||
|
||||
Prefer a terminal based solution? [hid_listen](https://www.pjrc.com/teensy/hid_listen.html), provided by PJRC, can also be used to display debug messages. Prebuilt binaries for Windows,Linux,and MacOS are available.
|
||||
|
||||
<!-- FIXME: Describe the debugging messages here. -->
|
||||
|
||||
## Sending Your Own Debug Messages
|
||||
@ -49,51 +41,3 @@ After that you can use a few different print functions:
|
||||
* `uprintf("%s string", var)`: Print a formatted string
|
||||
* `dprint("string")` Print a simple string, but only when debug mode is enabled
|
||||
* `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled
|
||||
|
||||
## Debug Examples
|
||||
|
||||
Below is a collection of real world debugging examples. For additional information, refer to [Debugging/Troubleshooting QMK](faq_debug.md).
|
||||
|
||||
### Which matrix position is this keypress?
|
||||
|
||||
When porting, or when attempting to diagnose pcb issues, it can be useful to know if a keypress is scanned correctly. To enable logging for this scenario, add the following code to your keymaps `keymap.c`
|
||||
|
||||
```c
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
// If console is enabled, it will print the matrix position and status of each key pressed
|
||||
#ifdef CONSOLE_ENABLE
|
||||
uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
Example output
|
||||
```text
|
||||
Waiting for device:.......
|
||||
Listening:
|
||||
KL: kc: 169, col: 0, row: 0, pressed: 1
|
||||
KL: kc: 169, col: 0, row: 0, pressed: 0
|
||||
KL: kc: 174, col: 1, row: 0, pressed: 1
|
||||
KL: kc: 174, col: 1, row: 0, pressed: 0
|
||||
KL: kc: 172, col: 2, row: 0, pressed: 1
|
||||
KL: kc: 172, col: 2, row: 0, pressed: 0
|
||||
```
|
||||
|
||||
### How long did it take to scan for a keypress?
|
||||
|
||||
When testing performance issues, it can be useful to know the frequency at which the switch matrix is being scanned. To enable logging for this scenario, add the following code to your keymaps `config.h`
|
||||
|
||||
```c
|
||||
#define DEBUG_MATRIX_SCAN_RATE
|
||||
```
|
||||
|
||||
Example output
|
||||
```text
|
||||
> matrix scan frequency: 315
|
||||
> matrix scan frequency: 313
|
||||
> matrix scan frequency: 316
|
||||
> matrix scan frequency: 316
|
||||
> matrix scan frequency: 316
|
||||
> matrix scan frequency: 316
|
||||
```
|
||||
|
@ -1,25 +1,15 @@
|
||||
Setting up your ARM based PCB is a little more involved than an Atmel MCU, but is easy enough. Start by running `util/new_keyboard.sh`:
|
||||
Setting up your ARM based PCB is a little more involved than an Atmel MCU, but is easy enough. Start by using `util/new_project.sh <keyboard>` to create a new project:
|
||||
|
||||
```
|
||||
$ ./util/new_keyboard.sh
|
||||
Generating a new QMK keyboard directory
|
||||
|
||||
Keyboard Name: mycoolkb
|
||||
Keyboard Type [avr]:
|
||||
Your Name [John Smith]:
|
||||
|
||||
Copying base template files... done
|
||||
Copying avr template files... done
|
||||
Renaming keyboard files... done
|
||||
Replacing %KEYBOARD% with mycoolkb... done
|
||||
Replacing %YOUR_NAME% with John Smith... done
|
||||
|
||||
Created a new keyboard called mycoolkb.
|
||||
|
||||
To start working on things, cd into keyboards/mycoolkb,
|
||||
or open the directory in your favourite text editor.
|
||||
$ util/new_project.sh simontester
|
||||
######################################################
|
||||
# /keyboards/simontester project created. To start
|
||||
# working on things, cd into keyboards/simontester
|
||||
######################################################
|
||||
```
|
||||
|
||||
|
||||
|
||||
# END OF NEW ARM DOC, OLD ATMEL DOC FOLLOWS
|
||||
|
||||
## `/keyboards/<keyboard>/config.h`
|
||||
|
@ -1,32 +0,0 @@
|
||||
# QMK机械键盘固件
|
||||
|
||||
[](https://github.com/qmk/qmk_firmware/tags)
|
||||
[](https://travis-ci.org/qmk/qmk_firmware)
|
||||
[](https://discord.gg/Uq7gcHh)
|
||||
[](https://docs.qmk.fm)
|
||||
[](https://github.com/qmk/qmk_firmware/pulse/monthly)
|
||||
[](https://github.com/qmk/qmk_firmware/)
|
||||
|
||||
## 什么是 QMK 固件?
|
||||
|
||||
QMK (*Quantum Mechanical Keyboard*) 是一个社区维护的开源软件,包括 QMK 固件, QMK 工具箱, qmk.fm网站, 和这些文档。QMK 固件是一个基于[tmk\_keyboard](http://github.com/tmk/tmk_keyboard)的键盘固件,它在爱特梅尔AVR微控制器实现一些有用的功能,确切地说, 是在 [OLKB product line](http://olkb.com), 在 [ErgoDox EZ](http://www.ergodox-ez.com) 键盘, 和 [Clueboard product line](http://clueboard.co/). 上。它被移植到使用ChibiOS的ARM芯片上. 它可以在飞线键盘或定制PCB键盘中发挥功能.
|
||||
|
||||
## 如何得到它
|
||||
|
||||
如果你打算贡献布局, 键盘, 或者其他QMK特性, 一下是最简单的方法:[从Github获得repo分支](https://github.com/qmk/qmk_firmware#fork-destination-box), 并克隆你的repo到本地进行编辑,推送,然后从你的分支打开 [Pull Request](https://github.com/qmk/qmk_firmware/pulls).
|
||||
|
||||
此外, 你也可以直接下载 ([zip](https://github.com/qmk/qmk_firmware/zipball/master), [tar](https://github.com/qmk/qmk_firmware/tarball/master)), 或者从git克隆 (`git@github.com:qmk/qmk_firmware.git`), 或 https (`https://github.com/qmk/qmk_firmware.git`).
|
||||
|
||||
## 如何编译
|
||||
|
||||
在你能编译之前, 你需要[部署环境](getting_started_build_tools.md) 用于 AVR or/and ARM 开发。完成后, 你可以使用 `make` 命令来编译一个键盘和布局使用以下命令:
|
||||
|
||||
make planck/rev4:default
|
||||
|
||||
这将建立 `planck`的`rev4` 修订版本并使用 `default`布局。并非所有键盘都有修订版本 (也叫做子项目或文件夹),在此情况下,修订版本可以省略,如下:
|
||||
|
||||
make preonic:default
|
||||
|
||||
## 如何定制
|
||||
|
||||
QMK 有许多 [特性](features.md)来探索,也有很多 [参考文档](http://docs.qmk.fm) 供您发掘。你可以通过修改 [布局](keymap.md)和[键码](keycodes.md)来利用许多特性。
|
@ -1,106 +0,0 @@
|
||||
* [完全菜鸟指南](newbs.md)
|
||||
* [入门](newbs_getting_started.md)
|
||||
* [构建你的第一个固件](newbs_building_firmware.md)
|
||||
* [刷新固件](newbs_flashing.md)
|
||||
* [测试和调试](newbs_testing_debugging.md)
|
||||
* [Git最佳实践](newbs_best_practices.md)
|
||||
* [学习资源](newbs_learn_more_resources.md)
|
||||
|
||||
* [QMK基础](README.md)
|
||||
* [QMK 简介](getting_started_introduction.md)
|
||||
* [贡献 QMK](contributing.md)
|
||||
* [如何使用Github](getting_started_github.md)
|
||||
* [获得帮助](getting_started_getting_help.md)
|
||||
|
||||
* [问题解答](faq.md)
|
||||
* [一般问题](faq_general.md)
|
||||
* [构建/编译QMK](faq_build.md)
|
||||
* [调试/故障排除 QMK](faq_debug.md)
|
||||
* [键盘布局](faq_keymap.md)
|
||||
|
||||
* 详细指南
|
||||
* [安装构建工具](getting_started_build_tools.md)
|
||||
* [流浪者指南](getting_started_vagrant.md)
|
||||
* [构建/编译指令](getting_started_make_guide.md)
|
||||
* [刷新固件](flashing.md)
|
||||
* [定制功能](custom_quantum_functions.md)
|
||||
* [布局概述](keymap.md)
|
||||
|
||||
* [硬件](hardware.md)
|
||||
* [AVR 处理器](hardware_avr.md)
|
||||
* [驱动](hardware_drivers.md)
|
||||
|
||||
* 参考
|
||||
* [键盘指南](hardware_keyboard_guidelines.md)
|
||||
* [配置选项](config_options.md)
|
||||
* [键码](keycodes.md)
|
||||
* [记录最佳实践](documentation_best_practices.md)
|
||||
* [文档指南](documentation_templates.md)
|
||||
* [词汇表](reference_glossary.md)
|
||||
* [单元测试](unit_testing.md)
|
||||
* [有用的功能](ref_functions.md)
|
||||
* [配置器支持](reference_configurator_support.md)
|
||||
* [info.json 格式](reference_info_json.md)
|
||||
|
||||
* [特性](features.md)
|
||||
* [基本键码](keycodes_basic.md)
|
||||
* [US ANSI 控制键](keycodes_us_ansi_shifted.md)
|
||||
* [量子键码](quantum_keycodes.md)
|
||||
* [高级键码](feature_advanced_keycodes.md)
|
||||
* [音频](feature_audio.md)
|
||||
* [自动控制](feature_auto_shift.md)
|
||||
* [背光](feature_backlight.md)
|
||||
* [蓝牙](feature_bluetooth.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* [组合](feature_combo)
|
||||
* [命令](feature_command.md)
|
||||
* [动态宏指令](feature_dynamic_macros.md)
|
||||
* [编码器](feature_encoders.md)
|
||||
* [Grave Escape](feature_grave_esc.md)
|
||||
* [键锁](feature_key_lock.md)
|
||||
* [层](feature_layouts.md)
|
||||
* [引导键](feature_leader_key.md)
|
||||
* [LED 阵列](feature_led_matrix.md)
|
||||
* [宏指令](feature_macros.md)
|
||||
* [鼠标键](feature_mouse_keys.md)
|
||||
* [一键功能](feature_advanced_keycodes.md#one-shot-keys)
|
||||
* [指针设备](feature_pointing_device.md)
|
||||
* [PS/2 鼠标](feature_ps2_mouse.md)
|
||||
* [RGB 光](feature_rgblight.md)
|
||||
* [RGB 矩阵](feature_rgb_matrix.md)
|
||||
* [空格候补换挡](feature_space_cadet_shift.md)
|
||||
* [空格候补换挡回车](feature_space_cadet_shift_enter.md)
|
||||
* [速录机](feature_stenography.md)
|
||||
* [换手](feature_swap_hands.md)
|
||||
* [踢踏舞](feature_tap_dance.md)
|
||||
* [终端](feature_terminal.md)
|
||||
* [热敏打印机](feature_thermal_printer.md)
|
||||
* [Unicode](feature_unicode.md)
|
||||
* [用户空间](feature_userspace.md)
|
||||
* [速度键](feature_velocikey.md)
|
||||
|
||||
* 针对制造者和定制者
|
||||
* [飞线指南](hand_wire.md)
|
||||
* [ISP 刷新指南](isp_flashing_guide.md)
|
||||
* [ARM 调试指南](arm_debugging.md)
|
||||
* [I2C 驱动](i2c_driver.md)
|
||||
* [GPIO 控制器](internals_gpio_control.md)
|
||||
* [Proton C 转换](proton_c_conversion.md)
|
||||
|
||||
* 深入了解
|
||||
* [键盘如何工作](how_keyboards_work.md)
|
||||
* [理解 QMK](understanding_qmk.md)
|
||||
|
||||
* 其他话题
|
||||
* [使用Eclipse开发QMK](other_eclipse.md)
|
||||
* [使用VSCode开发QMK](other_vscode.md)
|
||||
* [支持](support.md)
|
||||
|
||||
* QMK 内构 (正在编写)
|
||||
* [定义](internals_defines.md)
|
||||
* [输入回调寄存器](internals_input_callback_reg.md)
|
||||
* [Midi 设备](internals_midi_device.md)
|
||||
* [Midi 设备设置过程](internals_midi_device_setup_process.md)
|
||||
* [Midi 工具库](internals_midi_util.md)
|
||||
* [发送函数](internals_send_functions.md)
|
||||
* [Sysex 工具](internals_sysex_tools.md)
|
@ -1,54 +0,0 @@
|
||||
# 介绍
|
||||
|
||||
本页解释了使用QMK项目所需的基本信息。它假定您能熟练使用Unix shell,但您不熟悉C语言也不熟悉使用make编译。
|
||||
|
||||
## 基本QMK结构
|
||||
|
||||
QMK是[Jun Wako](https://github.com/tmk)的[tmk_keyboard](https://github.com/tmk/tmk_keyboard)工程的一个分叉。经过更改的TMK原始代码放在`tmk` 文件夹中。 QMK增加的新东西可以在 `quantum` 文件夹中找到。 键盘项目可以在 `handwired`(手动飞线) 和 `keyboard`(PCB键盘)这两个文件夹找到。
|
||||
|
||||
### 用户空间结构
|
||||
|
||||
在`users`文件夹里面的目录是每个用户的目录。这个文件夹里面放的是用户们在不同键盘都能用到的代码。详见[用户空间特性](feature_userspace.md)
|
||||
|
||||
### 键盘项目结构
|
||||
|
||||
在`keyboards`文件夹和他的子文件夹`handwired`中就是各个键盘的项目了,比如`qmk_firmware/keyboards/clueboard`。内部结构与如下:
|
||||
|
||||
* `keymaps/`: 可以构建的不同布局
|
||||
* `rules.mk`: 用来设置 "make" 命令默认选项的文件。别直接编辑这个文件,你应该使用具体某个布局的 `rules.mk`.
|
||||
* `config.h`: 用于设置默认编译选项的文件。别直接编辑这个文件, 你应该使用具体某个布局的 `config.h`.
|
||||
|
||||
### 布局结构
|
||||
|
||||
在各个布局的文件夹,你能找到以下文件。只有 `keymap.c` 是必要的, 如果其他文件找不到就会直接选择默认选项。
|
||||
|
||||
* `config.h`: 配置布局的选项
|
||||
* `keymap.c`: 布局的全部代码, 必要文件
|
||||
* `rules.mk`: 使能的QMK特性
|
||||
* `readme.md`:介绍你的布局,告诉别人怎么使用,附上功能说明。请将图片上传到imgur等图床(译者注:imgur可能已被墙,为了方便国人访问,建议使用国内可以直接访问的图床)。
|
||||
|
||||
# `config.h` 文件
|
||||
|
||||
有三个重要的`config.h` 位置:
|
||||
|
||||
* 键盘 (`/keyboards/<keyboard>/config.h`)
|
||||
* 用户空间 (`/users/<user>/config.h`)
|
||||
* 布局 (`/keyboards/<keyboard>/keymaps/<keymap>/config.h`)
|
||||
|
||||
构建系统按照上述顺序自动获取配置文件。如果要覆盖由上一个 `config.h` 所做的设置,您需要首先为要更改的设置包含一些样板代码。
|
||||
|
||||
```
|
||||
#pragma once
|
||||
```
|
||||
|
||||
要覆盖上一个 `config.h` 所做的设置,你要先 `#undef` 然后再 `#define` 这个设置.
|
||||
|
||||
样板代码和设置看起来像这样:
|
||||
|
||||
```
|
||||
#pragma once
|
||||
|
||||
// 像下面那样覆盖设置(MY_SETTING指的是你要覆盖的设置项)!
|
||||
#undef MY_SETTING
|
||||
#define MY_SETTING 4
|
||||
```
|
@ -1,163 +0,0 @@
|
||||
# 最佳实践
|
||||
|
||||
## 或者说, "我应如何学会不再担心并开始爱上Git。"
|
||||
|
||||
本文档旨在指导新手以最佳方式获得为QMK做出贡献的丝滑体验。我们将介绍为QMK做出贡献的过程,详细介绍使这项任务更容易的一些方法,然后我们将制造一些问题,来教你如何解决它们。
|
||||
|
||||
本文假设了一些内容:
|
||||
|
||||
1. 一有个GitHub账户, 并[创建qmk_firmware仓库分叉](getting_started_github.md)到你的帐户.
|
||||
2. 你已经[建立你的构建环境](newbs_getting_started.md?id=environment-setup).
|
||||
|
||||
|
||||
## 你分叉的主分支: 一直在上传,但不要提交
|
||||
|
||||
十分推荐您在QMK开发过程中无论开发是否完成都要保持你的 `master` 分支更新,但是 ***一定不要*** 提交。相反,你应该在一个开发分叉中做出你所有修改并在开发时提交pull request。
|
||||
|
||||
减少合并冲突的可能性 — 两个或多个用户同时编辑文件的同一部分的实例 — 保持 `master` 分支最新,并创建一个新的分支来开始新的开发。
|
||||
|
||||
### 更新你的主分支
|
||||
|
||||
保持你的 `master` 更新, 推荐你添加QMK Firmware仓库作为Git的远程仓库,想这么做的话, 你可以打开你的Git命令行接口然后输入:
|
||||
|
||||
```
|
||||
git remote add upstream https://github.com/qmk/qmk_firmware.git
|
||||
```
|
||||
|
||||
运行 `git remote -v`, 来确定这个仓库已经添加,以下是回显:
|
||||
|
||||
```
|
||||
$ git remote -v
|
||||
origin https://github.com/<your_username>/qmk_firmware.git (fetch)
|
||||
origin https://github.com/<your_username>/qmk_firmware.git (push)
|
||||
upstream https://github.com/qmk/qmk_firmware.git (fetch)
|
||||
upstream https://github.com/qmk/qmk_firmware.git (push)
|
||||
```
|
||||
|
||||
现在添加已完成,你可以用`git fetch upstream`来检查仓库的更新. 这会检索branches 和 tags — 统称为"refs" — 从QMK仓库, 也就是 `upstream`。我们可以比较我们的分叉和QMK的 `origin` 数据的不同。
|
||||
|
||||
要更新你的分叉的主分支,请运行以下命令,在每行之后按Enter键:
|
||||
|
||||
```
|
||||
git checkout master
|
||||
git fetch upstream
|
||||
git pull upstream master
|
||||
git push origin master
|
||||
```
|
||||
|
||||
这回切换到你的`master` 分支, 检索你QMK仓库的refs, 下载当前QMK `master` 分支到你的电脑, 并上传到你的分叉.
|
||||
|
||||
### 做改动
|
||||
|
||||
你可以输入以下命令来创建一个新的分支来做改动:
|
||||
|
||||
```
|
||||
git checkout -b dev_branch
|
||||
git push --set-upstream origin dev_branch
|
||||
```
|
||||
|
||||
这回建立一个叫做 `dev_branch`的新分支, 检查一下, 然后想你的分叉保存分支. 使用 `--set-upstream` 参数来告诉git使用你的分叉并且当每次你对你的分支用`git push` 或 `git pull`时要使用`dev_branch`。 它仅需要在第一次push的时候使用;然后你就可以很安全的用 `git push` 或 `git pull`, 并不需要其他参数了。
|
||||
|
||||
!> 使用 `git push`, 你可以用 `-u` 来代替 `--set-upstream` — `-u`是`--set-upstream`的简写。
|
||||
|
||||
您可以将您的分支命名为您想要的任何名称,但建议将其命名为与您要进行的更改相关的内容。
|
||||
|
||||
默认情况下 `git checkout -b` 在已经检出的分支上建立新的分支。您可以将新的分支建立在未检出的现有分支的基础上,方法是将现有分支的名称添加到命令:
|
||||
|
||||
```
|
||||
git checkout -b dev_branch master
|
||||
```
|
||||
|
||||
现在您已经有了一个开发分支,那么就打开您的文本编辑器并进行您需要做的任何更改。建议对您的分支进行许多小的提交;这样,任何引起问题的更改都可以在需要时更容易地跟踪和撤消。要进行更改,编辑并保存任何需要更新的文件,请将它们添加到Git的 *staging area* ,然后将它们提交到您的分支:
|
||||
|
||||
```
|
||||
git add path/to/updated_file
|
||||
git commit -m "My commit message."
|
||||
```
|
||||
|
||||
` git add`添加已更改到Git的*临时区域*也就是Git的“加载区域”的文件。其中包含使用 `git commit` 命令 *提交* 的并已经保存到仓库的更改。建议您使用描述性的提交消息,这样您就可以一目了然地知道更改了什么。
|
||||
|
||||
!> 如果你修改了很多文件,但所有的文件都是同一个更改的一部分,你可以用 `git add .` 来添加当前目录中所有已更改的文件而不是单独添加每个文件.
|
||||
|
||||
### 发布更改
|
||||
|
||||
最后一步是将更改推送到您的分叉。 输入 `git push`来推送. 现在Git将`dev_branch`的当前状态发布到您的分叉。
|
||||
|
||||
|
||||
## 解决合并冲突
|
||||
|
||||
有时,当您在某个分支中的工作需要很长时间才能完成时,其他人所做的更改与您在打开pull request时对该分支所做的更改相冲突。这称为*rebase* 即合并冲突,当多个人编辑同一文件的同一部分时会发生这种情况。
|
||||
|
||||
### 重新调整您的更改
|
||||
|
||||
*rebase*是Git的一种方法,它获取在某一点上应用的更改,撤销它们,然后将相同的更改应用到另一点。在合并冲突的情况下,您可以重新设置您的分支以获取在创建分支时和当前时间之间的那段时间所做的更改。
|
||||
|
||||
运行以下命令来开始:
|
||||
|
||||
```
|
||||
git fetch upstream
|
||||
git rev-list --left-right --count HEAD...upstream/master
|
||||
```
|
||||
|
||||
这里的`git rev-list` 命令返回当前分支和qmk的主分支之间不同的提交数。我们首先运行`git fetch`,以确保我们有代表upstream仓库的refs。 `git rev-list` 命令的回显有两个数字:
|
||||
|
||||
```
|
||||
$ git rev-list --left-right --count HEAD...upstream/master
|
||||
7 35
|
||||
```
|
||||
|
||||
第一个数字表示自创建以来当前分支的提交数, 第二个数字是自创建当前分支以来对 `upstream/master` 进行的提交数, 因此, 当前分支中未记录变动。
|
||||
|
||||
既然知道当前分支和upstream仓库的当前状态,我们可以开始一个rebase操作:
|
||||
|
||||
```
|
||||
git rebase upstream/master
|
||||
```
|
||||
|
||||
这就是让Git撤销当前分支上的提交,然后根据QMK的主分支重新应用它们。
|
||||
|
||||
```
|
||||
$ git rebase upstream/master
|
||||
First, rewinding head to replay your work on top of it...
|
||||
Applying: Commit #1
|
||||
Using index info to reconstruct a base tree...
|
||||
M conflicting_file_1.txt
|
||||
Falling back to patching base and 3-way merge...
|
||||
Auto-merging conflicting_file_1.txt
|
||||
CONFLICT (content): Merge conflict in conflicting_file_1.txt
|
||||
error: Failed to merge in the changes.
|
||||
hint: Use 'git am --show-current-patch' to see the failed patch
|
||||
Patch failed at 0001 Commit #1
|
||||
|
||||
Resolve all conflicts manually, mark them as resolved with
|
||||
"git add/rm <conflicted_files>", then run "git rebase --continue".
|
||||
You can instead skip this commit: run "git rebase --skip".
|
||||
To abort and get back to the state before "git rebase", run "git rebase --abort".
|
||||
```
|
||||
|
||||
这告诉我们有一个合并冲突,并给出带有冲突的文件的名称。在文本编辑器中打开冲突的文件,在该文件的某个位置,您会发现如下内容:
|
||||
|
||||
```
|
||||
<<<<<<< HEAD
|
||||
<p>For help with any issues, email us at support@webhost.us.</p>
|
||||
=======
|
||||
<p>Need help? Email support@webhost.us.</p>
|
||||
>>>>>>> Commit #1
|
||||
```
|
||||
|
||||
`<<<<<<< HEAD`行标记合并冲突的开始, `>>>>>>> Commit #1` 行标记结束, 冲突选项被 `=======`分隔。`HEAD`那端的部分来自文件的qmk master版本,标记有commit消息的部分来自当前的分支持和提交。
|
||||
|
||||
因为Git跟踪 *对文件的更改* 而不是直接跟踪文件的内容,所以如果Git在提交之前找不到文件中的文本,它将不知道如何编辑该文件。重新编辑文件将解决冲突。进行更改,然后保存文件。
|
||||
|
||||
```
|
||||
<p>Need help? Email support@webhost.us.</p>
|
||||
```
|
||||
|
||||
现在运行:
|
||||
|
||||
```
|
||||
git add conflicting_file_1.txt
|
||||
git rebase --continue
|
||||
```
|
||||
|
||||
Git记录对冲突文件的更改,并继续应用来自我们的分支的提交,直到它到达末尾。
|
@ -1,81 +0,0 @@
|
||||
# 构建第一个固件
|
||||
|
||||
现在您已经建立了构建环境,就可以开始构建自定义固件了。对于本指南的这一部分,我们将在3个程序之间切换——文件管理器、文本编辑器和终端窗口。请保持所有3个程序打开,直到您完成并对键盘固件满意。
|
||||
|
||||
如果您在按照指南第一部分的操作之后关闭并重新打开了终端窗口,请不要忘记输入“cd qmk_firmware”,来使您的终端位于正确的目录。
|
||||
|
||||
## 导航到您的keymaps文件夹
|
||||
|
||||
首先导航到键盘的 `keymaps` 文件夹.
|
||||
|
||||
?> 如果您使用的是MacOS或Windows,可以使用以下命令轻松地打开keymaps文件夹。
|
||||
|
||||
?> macOS:
|
||||
|
||||
open keyboards/<keyboard_folder>/keymaps
|
||||
|
||||
?> Windows:
|
||||
|
||||
start .\\keyboards\\<keyboard_folder>\\keymaps
|
||||
|
||||
## 创建`default` 布局副本
|
||||
|
||||
打开`keymaps`文件夹后,您将需要创建`default`文件夹的副本。我们强烈建议您将文件夹命名为与Github用户名相同的名称,但您也可以使用任何您想使用的名称,只要它只包含小写字母、数字和下划线字符。
|
||||
|
||||
要自动执行此过程,您还可以选择运行`new_keymap.sh`脚本。
|
||||
|
||||
导航到`qmk_firmware/util` 目录然后输入以下命令:
|
||||
|
||||
```
|
||||
./new_keymap.sh <keyboard path> <username>
|
||||
```
|
||||
|
||||
例如,一个名字叫ymzcdg的用户要创建1up60hse的布局,他需要输入
|
||||
|
||||
```
|
||||
./new_keymap.sh 1upkeyboards/1up60hse ymzcdg
|
||||
```
|
||||
|
||||
## 在你最钟爱的文本编辑器中打开`keymap.c`
|
||||
|
||||
打开你的`keymap.c`. 在这个文件中,您可以找到控制键盘行为的结构。 在你的`keymap.c` 的顶部有一些让布局更易读的define和enum。在靠下的位置你会找到一行和下面这句很像的:
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
从这一行开始便是层列表。这行下面你会看到包括 `LAYOUT` 或 `KEYMAP`这两个词的几行, 从这些行开始就是层。在这一行下面是组成该特定层的键的列表。
|
||||
|
||||
!> 编辑您的keymap文件时,注意不要添加或删除任何逗号。如果这样做,您将阻止您的固件编译,并且您可能不容易找出多余的或缺少的逗号在哪里。
|
||||
|
||||
## 根据您的喜好自定义布局
|
||||
|
||||
如何完成这一步骤完全取决于您。改变一直困扰着你的问题,或者完全重做所有的事情。如果您不需要全部图层,可以删除图层,或者将图层总数增加到32个。查看以下文档,了解可以在此处定义的内容:
|
||||
|
||||
* [键码](keycodes.md)
|
||||
* [特性](features.md)
|
||||
* [问题与解答](faq.md)
|
||||
|
||||
?> 当你明白布局是怎么工作时,您也要让每次改变尽可能小。一次改变很大在调试时找出问题会十分困难。
|
||||
|
||||
## 构建你的固件
|
||||
|
||||
完成对布局的更改后,您就要构建固件了。为此,请返回终端窗口并运行build命令:
|
||||
|
||||
make <my_keyboard>:<my_keymap>
|
||||
|
||||
例如,如果您的keymap名为“xyverz”,并且您正在为rev5 planck构建一个keymap,那么您将使用此命令:
|
||||
|
||||
make planck/rev5:xyverz
|
||||
|
||||
在编译过程中,你将看到屏幕上有很多输出,通知您正在编译哪些文件他应该以与下文类似的输出结束:
|
||||
|
||||
```
|
||||
Linking: .build/planck_rev5_xyverz.elf [OK]
|
||||
Creating load file for flashing: .build/planck_rev5_xyverz.hex [OK]
|
||||
Copying planck_rev5_xyverz.hex to qmk_firmware folder [OK]
|
||||
Checking file size of planck_rev5_xyverz.hex [OK]
|
||||
* File size is fine - 18392/28672
|
||||
```
|
||||
|
||||
## 刷新你的固件
|
||||
|
||||
请移步 [Flashing Firmware](newbs_flashing.md) 来继续。
|
File diff suppressed because it is too large
Load Diff
@ -1,102 +0,0 @@
|
||||
# 介绍
|
||||
|
||||
你的电脑键盘里面包含一个处理器, 这个处理器和你电脑里面的不太一样。这个处理器负责运行一些特殊的软件,这些软件可以监测按钮按下并将按钮处于按下还是释放状态的数据发送出去。QMK就是这样一种软件,即监测按钮被按下并发送这样的信息到作为主机的计算机上。当你创建了你的布局, 你也就创建了你的键盘运行的的可执行程序。
|
||||
|
||||
QMK试图通过使简单的事情变得更简单,使使不可能成为可能来把大量的权力交给你。你不需要懂如何通过程序创建强大的布局——你只需要遵循简单的语法规则。
|
||||
|
||||
# 新手上路
|
||||
|
||||
在你能创建布局前,你要安装一些软件来建立你的开发环境。无论你想编译多少固件,这个操作都只需要进行一次。
|
||||
|
||||
如果您更喜欢图形化界面, 请考虑使用在线工具[QMK配置器](https://config.qmk.fm)。 请参考 [使用在线GUI构建您的第一个固件](newbs_building_firmware_configurator.md)。
|
||||
|
||||
|
||||
## 下载软件
|
||||
|
||||
### 文本编辑器
|
||||
|
||||
你需要一个可以编辑 **纯文本** 文件的程序。在Windows上你可以用Notepad, 在Linux上使用gedit,这两个都是简单又实用的文本编辑工具。 在macOS上, 请小心使用 “文本编辑” 这个默认软件: 如果你不明确的选择_格式_菜单中的 _制作纯文本_ 的话文本将不会被保存为纯文本。
|
||||
|
||||
你也可以下载并安装一个专用编辑器 [Sublime Text](https://www.sublimetext.com/) 或 [VS Code](https://code.visualstudio.com/)。 这大概是跨平台的最好方法了, 这些编辑器是专门为了编辑代码设计的。
|
||||
|
||||
?>搞不清用哪种编辑器? Laurence Bradford 写了篇关于编辑器选择的文章 [a great introduction](https://learntocodewith.me/programming/basics/text-editors/)。
|
||||
|
||||
### QMK 工具箱
|
||||
|
||||
QMK 工具箱 是一种可选的Windows和macOS下的图形化工具,它可以对你的定制键盘进行编程和调试。你可能会发现它就是你能简单的刷新你的键盘固件并查看调试信息的稀世珍宝。
|
||||
|
||||
[在这里下载最新发布版本](https://github.com/qmk/qmk_toolbox/releases/latest)
|
||||
|
||||
* Windows用户: `qmk_toolbox.exe` (绿色版) 或 `qmk_toolbox_install.exe` (安装版)
|
||||
* macOS用户: `QMK.Toolbox.app.zip` (绿色版) or `QMK.Toolbox.pkg` (安装版)
|
||||
|
||||
## 建立你的环境
|
||||
|
||||
我们为了使QMK环境变得更容易建立已竭尽所能。你只需要准备Linux 或 Unix 环境, 然后让QMK安装剩余部分。
|
||||
|
||||
?> 如果你从未使用过Linux/Unix的命令行,有一些你需要学习的基础概念和命令,以下资料将教会您使用QMK环境的必要能力:<br>
|
||||
[必会Linux命令](https://www.guru99.com/must-know-linux-commands.html)<br>
|
||||
[一些基本的Unix命令](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html)
|
||||
|
||||
### Windows
|
||||
|
||||
你需要安装MSYS2和Git.
|
||||
|
||||
* 按照以下安装说明进行操作[MSYS2 主页](http://www.msys2.org)。
|
||||
* 关闭所有打开的MSYS2终端并打开新的MSYS2 MinGW 64-bit终端。
|
||||
* 使用以下命令安装Git: `pacman -S git`。
|
||||
|
||||
### macOS
|
||||
|
||||
你需要安装Homebrew。按照以下说明进行操作 [Homebrew 主页](https://brew.sh)。
|
||||
|
||||
在Homebrew安装完成后, 继续 _同步QMK工程_. 这一步你将会通过运行一个脚本安装其他包。
|
||||
|
||||
### Linux
|
||||
|
||||
你将需要安装Git.你很有可能已经安装,但若你尚未安装,可以使用以下命令进行安装:
|
||||
|
||||
* Debian / Ubuntu / Devuan: `apt-get install git`
|
||||
* Fedora / Red Hat / CentOS: `yum install git`
|
||||
* Arch: `pacman -S git`
|
||||
|
||||
?> 无论你使用哪种平台,Docker都可以是你的选择[点这里进一步了解](getting_started_build_tools.md#docker)
|
||||
|
||||
## 同步QMK工程
|
||||
|
||||
当你建立Linux/Unix环境后,你就已经可以下载QMK了.下载时我们可以用Git来 "clone" QMK仓库. 打开一个终端或MSYS2 MinGW 窗口,在阅读剩余的指南时请保持窗口打开。在窗口里面运行以下两句命令:
|
||||
|
||||
```shell
|
||||
git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git
|
||||
cd qmk_firmware
|
||||
```
|
||||
|
||||
?> 如果您已经知道[如何使用GitHub](getting_started_github.md), 我们推荐您创建您自己的分支并克隆。 如果您不知道这是什么, 您完全可以忽略这句无关紧要的话。
|
||||
|
||||
QMK附带一个脚本,可帮助您设置剩余的所需内容.您可以通过输入此命令来运行它:
|
||||
|
||||
util/qmk_install.sh
|
||||
|
||||
## 测试你的开发环境
|
||||
|
||||
现在你的QMK环境已经建立完毕, 你可以为你的键盘创建固件了。开始试着创建键盘的默认固件吧。 你需要使用以下格式的命令创建固件:
|
||||
|
||||
make <keyboard>:default
|
||||
|
||||
比如, 制作一个Clueboard 66%的固件,需要用:
|
||||
|
||||
make clueboard/66/rev3:default
|
||||
|
||||
当完成后你要看到一些回显,尾部如下:
|
||||
|
||||
```
|
||||
Linking: .build/clueboard_66_rev3_default.elf [OK]
|
||||
Creating load file for flashing: .build/clueboard_66_rev3_default.hex [OK]
|
||||
Copying clueboard_66_rev3_default.hex to qmk_firmware folder [OK]
|
||||
Checking file size of clueboard_66_rev3_default.hex [OK]
|
||||
* The firmware size is fine - 26356/28672 (2316 bytes free)
|
||||
```
|
||||
|
||||
# 创建你的布局
|
||||
|
||||
现在你可以创建属于你自己的布局了! 请移步 [构建你的第一个固件](newbs_building_firmware.md)来继续。
|
@ -1,15 +0,0 @@
|
||||
# 学习资源
|
||||
|
||||
这些资源旨在让QMK社区的新成员更了解新成员文档中提供的信息。
|
||||
|
||||
Git 资源:
|
||||
|
||||
* [很好的通用教程](https://www.codecademy.com/learn/learn-git)
|
||||
* [从例子中学习Git游戏](https://learngitbranching.js.org/)
|
||||
* [了解有关GitHub的更多信息的Git资源](getting_started_github.md)
|
||||
* [专门针对QMK的Git资源](contributing.md)
|
||||
|
||||
|
||||
命令行资源:
|
||||
|
||||
* [超棒的命令行通用教程](https://www.codecademy.com/learn/learn-the-command-line)
|
@ -1,43 +0,0 @@
|
||||
# 测试和调试
|
||||
|
||||
使用自定义固件刷新键盘后,您就可以测试它了。如果您幸运,一切都会完美运行,但如果没有,这份文件将帮助您找出问题所在。
|
||||
|
||||
## 测试
|
||||
|
||||
测试键盘通常非常简单。按下每一个键并确保它发送的是您期望的键。甚至有一些程序可以帮助您确保没有任何键失效。
|
||||
|
||||
注意:这些程序不是由QMK提供或认可的。
|
||||
|
||||
* [Switch Hitter](https://elitekeyboards.com/switchhitter.php) (仅Windows)
|
||||
* [Keyboard Viewer](https://www.imore.com/how-use-keyboard-viewer-your-mac) (仅Mac)
|
||||
* [Keyboard Tester](http://www.keyboardtester.com) (网页版)
|
||||
* [Keyboard Checker](http://keyboardchecker.com) (网页版)
|
||||
|
||||
## 使用QMK工具箱进行调试
|
||||
|
||||
[QMK工具箱](https://github.com/qmk/qmk_toolbox) 将会在你的`rules.mk`中有`CONSOLE_ENABLE = yes`的时候显示你键盘发来的消息。 默认情况下,输出极为有限,不过您可以打开调试模式来增加输出信息量。使用你键盘布局中的`DEBUG`键码,使用 [命令](feature_command.md) 特性来使能调试模式, 或者向你的布局中添加以下代码。
|
||||
|
||||
```c
|
||||
void keyboard_post_init_user(void) {
|
||||
// Customise these values to desired behaviour
|
||||
debug_enable=true;
|
||||
debug_matrix=true;
|
||||
//debug_keyboard=true;
|
||||
//debug_mouse=true;
|
||||
}
|
||||
```
|
||||
|
||||
<!-- 需要修改之处:这里要添加调试回显。 -->
|
||||
|
||||
## 发送您自己的调试消息
|
||||
|
||||
有时用[custom code](custom_quantum_functions.md)发送自定义调试信息很有用. 这么做很简单. 首先在你文件头部包含`print.h`:
|
||||
|
||||
#include <print.h>
|
||||
|
||||
之后,您可以使用一些不同的打印功能:
|
||||
|
||||
* `print("string")`: 打印简单字符串.
|
||||
* `uprintf("%s string", var)`: 打印格式化字符串
|
||||
* `dprint("string")`: 仅在调试模式使能时打印简单字符串
|
||||
* `dprintf("%s string", var)`: 仅在调试模式使能时打印格式化字符串
|
@ -158,7 +158,7 @@ void inline ws2812_setled(int i, uint8_t r, uint8_t g, uint8_t b)
|
||||
|
||||
void ws2812_setled_all (uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
for (int i = 0; i < sizeof(led)/sizeof(led[0]); i++) {
|
||||
for (int i = 0; i < RGBLED_NUM; i++) {
|
||||
led[i].r = r;
|
||||
led[i].g = g;
|
||||
led[i].b = b;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user