Compare commits
63 Commits
0.6.342
...
planck-ez-
Author | SHA1 | Date | |
---|---|---|---|
|
fbb056c502 | ||
|
e83e316555 | ||
|
e01b2d518a | ||
|
99500243e1 | ||
|
cb1935aaff | ||
|
8a9c90ad78 | ||
|
fbc40032e7 | ||
|
e96d196dc9 | ||
|
c2f9e018ab | ||
|
af22609ba5 | ||
|
e290dc5ad8 | ||
|
e14732be9f | ||
|
eb9ea84927 | ||
|
63d53b0f28 | ||
|
0213867dea | ||
|
3a7c65b424 | ||
|
9f2fc1179a | ||
|
9d97e47df4 | ||
|
e73587cfd0 | ||
|
997bafc8ec | ||
|
4c14b5832a | ||
|
b9f060c98c | ||
|
da995d2aea | ||
|
bdc8d89e6b | ||
|
41beecfc18 | ||
|
29f68459a0 | ||
|
6a59198a42 | ||
|
36bed36cd6 | ||
|
db440f3e75 | ||
|
7e655a207e | ||
|
55d37d9fbc | ||
|
27b0f8923e | ||
|
3da8d46a07 | ||
|
4db31fb374 | ||
|
3956b7c685 | ||
|
de5c8d86b4 | ||
|
7e68faa336 | ||
|
588b2329cb | ||
|
6fa88d981c | ||
|
12a07dae33 | ||
|
3235c8527d | ||
|
22ba36a4d8 | ||
|
50bc2dbe77 | ||
|
61ce41ae13 | ||
|
e4b5c44262 | ||
|
074be4fe5e | ||
|
670ff2d19f | ||
|
e95283b545 | ||
|
8725197ad6 | ||
|
d67b99ff3c | ||
|
7c2a7ab817 | ||
|
5b9667a4bf | ||
|
0cde880747 | ||
|
b09dc19d32 | ||
|
bb208f3e3b | ||
|
483ad4e3e0 | ||
|
4c2453aa1b | ||
|
c745d9b82e | ||
|
7d4ae3e66e | ||
|
75d72c221d | ||
|
507805cd10 | ||
|
e77e46f4bf | ||
|
1f0a2d5550 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -54,6 +54,7 @@ util/Win_Check_Output.txt
|
||||
.vscode/tasks.json
|
||||
.vscode/last.sql
|
||||
.vscode/temp.sql
|
||||
.vscode/ipch/
|
||||
.stfolder
|
||||
.tags
|
||||
|
||||
|
@ -13,10 +13,14 @@ 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,6 +534,8 @@ 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,7 +324,6 @@ ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
|
||||
endif
|
||||
|
||||
# # project specific files
|
||||
SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
|
||||
SRC += $(KEYBOARD_SRC) \
|
||||
$(KEYMAP_C) \
|
||||
$(QUANTUM_SRC)
|
||||
@ -334,15 +333,16 @@ 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,6 +105,7 @@ 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
|
||||
@ -351,3 +352,9 @@ 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 Shift](feature_space_cadet_shift.md)
|
||||
* [Space Cadet Shift Enter](feature_space_cadet_shift_enter.md)
|
||||
* [Space Cadet](feature_space_cadet.md)
|
||||
* [Stenography](feature_stenography.md)
|
||||
* [Swap Hands](feature_swap_hands.md)
|
||||
* [Tap Dance](feature_tap_dance.md)
|
||||
|
@ -330,6 +330,8 @@ 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_code16(LALT(KC_TAB));
|
||||
unregister_code(KC_LALT);
|
||||
is_alt_tab_active = false;
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ The following options can be used to tweak the various animations:
|
||||
|`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_CENTER` |*Not defined*|If defined, 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_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 |
|
||||
@ -145,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 uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90};
|
||||
const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64};
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
59
docs/feature_space_cadet.md
Normal file
59
docs/feature_space_cadet.md
Normal file
@ -0,0 +1,59 @@
|
||||
# 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 |
|
@ -1,37 +0,0 @@
|
||||
# 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|
|
@ -1,31 +0,0 @@
|
||||
# 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 file, 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, 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 1024 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 16384 entries.
|
||||
|
||||
You may want to have an enum to make referencing easier. So, you could add something like this to your keymap file:
|
||||
|
||||
@ -26,13 +26,21 @@ const uint32_t PROGMEM unicode_map[] = {
|
||||
};
|
||||
```
|
||||
|
||||
Then you can use `X(BANG)` etc. in your keymap.
|
||||
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.
|
||||
|
||||
## `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 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.
|
||||
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.
|
||||
|
||||
For instance, you would define a table like this in your keymap file:
|
||||
For instance, you could define a table like this in your keymap file:
|
||||
|
||||
```c
|
||||
const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE(
|
||||
@ -42,7 +50,7 @@ const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE(
|
||||
);
|
||||
```
|
||||
|
||||
You call `qk_ucis_start()`, then type "rofl" and hit Enter. QMK should erase the "rofl" text and input the laughing emoji.
|
||||
To use it, call `qk_ucis_start()`, then type "rofl" and hit Enter. QMK should erase the "rofl" text and insert the laughing emoji.
|
||||
|
||||
### Customization
|
||||
|
||||
@ -60,28 +68,29 @@ Unicode input in QMK works by inputting a sequence of characters to the OS, sort
|
||||
|
||||
The following input modes are available:
|
||||
|
||||
* **`UC_OSX`**: Mac OS X built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with `UNICODEMAP`).
|
||||
* **`UC_OSX`**: macOS 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`), but this can be changed by defining [`UNICODE_OSX_KEY`](#input-key-configuration) with another keycode.
|
||||
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.
|
||||
|
||||
**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`).
|
||||
!> Using the _Unicode Hex Input_ input source may disable some Option based shortcuts, such as Option + Left Arrow and Option + Right Arrow.
|
||||
|
||||
* **`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. Afterwards, reboot.
|
||||
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.
|
||||
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.8.2, supports code points up to `0xFFFFF` (all currently assigned code points).
|
||||
* **`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).
|
||||
|
||||
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 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.
|
||||
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.
|
||||
|
||||
### Switching Input Modes
|
||||
|
||||
@ -89,17 +98,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` | |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.|
|
||||
|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 |
|
||||
|
||||
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) {
|
||||
@ -123,35 +132,45 @@ For instance, you can add these definitions to your `config.h` file:
|
||||
|
||||
### Additional Customization
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
#### 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 Mac.
|
||||
* `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_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
|
||||
|
||||
Additionally, you can customize the keys used to trigger the unicode input for macOS and WinCompose by adding defines to your `config.h`
|
||||
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.
|
||||
|
||||
```c
|
||||
#define UNICODE_OSX_KEY KC_LALT
|
||||
#define UNICODE_WINC_KEY KC_RALT
|
||||
#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WIN, UC_WINC
|
||||
```
|
||||
|
||||
#### Input Method Cycling
|
||||
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`).
|
||||
|
||||
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.
|
||||
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`:
|
||||
|
||||
```c
|
||||
#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WIN, UC_BSD, UC_WINC
|
||||
#define UNICODE_CYCLE_PERSIST false
|
||||
```
|
||||
|
||||
!> 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.
|
||||
|
@ -450,7 +450,15 @@ This is a reference only. Each group of keys links to the page documenting their
|
||||
|
||||
## [Unicode Support](feature_unicode.md)
|
||||
|
||||
|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`)|
|
||||
|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 |
|
||||
|
@ -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 With QMK Toolbox
|
||||
## Debugging
|
||||
|
||||
[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.
|
||||
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.
|
||||
|
||||
```c
|
||||
void keyboard_post_init_user(void) {
|
||||
@ -27,6 +27,14 @@ 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
|
||||
@ -41,3 +49,51 @@ 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
|
||||
```
|
||||
|
54
docs/zh-cn/getting_started_introduction.md
Normal file
54
docs/zh-cn/getting_started_introduction.md
Normal file
@ -0,0 +1,54 @@
|
||||
# 介绍
|
||||
|
||||
本页解释了使用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
|
||||
```
|
163
docs/zh-cn/newbs_best_practices.md
Normal file
163
docs/zh-cn/newbs_best_practices.md
Normal file
@ -0,0 +1,163 @@
|
||||
# 最佳实践
|
||||
|
||||
## 或者说, "我应如何学会不再担心并开始爱上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记录对冲突文件的更改,并继续应用来自我们的分支的提交,直到它到达末尾。
|
81
docs/zh-cn/newbs_building_firmware.md
Normal file
81
docs/zh-cn/newbs_building_firmware.md
Normal file
@ -0,0 +1,81 @@
|
||||
# 构建第一个固件
|
||||
|
||||
现在您已经建立了构建环境,就可以开始构建自定义固件了。对于本指南的这一部分,我们将在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) 来继续。
|
307
docs/zh-cn/newbs_flashing.md
Normal file
307
docs/zh-cn/newbs_flashing.md
Normal file
File diff suppressed because it is too large
Load Diff
102
docs/zh-cn/newbs_getting_started.md
Normal file
102
docs/zh-cn/newbs_getting_started.md
Normal file
@ -0,0 +1,102 @@
|
||||
# 介绍
|
||||
|
||||
你的电脑键盘里面包含一个处理器, 这个处理器和你电脑里面的不太一样。这个处理器负责运行一些特殊的软件,这些软件可以监测按钮按下并将按钮处于按下还是释放状态的数据发送出去。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)来继续。
|
15
docs/zh-cn/newbs_learn_more_resources.md
Normal file
15
docs/zh-cn/newbs_learn_more_resources.md
Normal file
@ -0,0 +1,15 @@
|
||||
# 学习资源
|
||||
|
||||
这些资源旨在让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)
|
43
docs/zh-cn/newbs_testing_debugging.md
Normal file
43
docs/zh-cn/newbs_testing_debugging.md
Normal file
@ -0,0 +1,43 @@
|
||||
# 测试和调试
|
||||
|
||||
使用自定义固件刷新键盘后,您就可以测试它了。如果您幸运,一切都会完美运行,但如果没有,这份文件将帮助您找出问题所在。
|
||||
|
||||
## 测试
|
||||
|
||||
测试键盘通常非常简单。按下每一个键并确保它发送的是您期望的键。甚至有一些程序可以帮助您确保没有任何键失效。
|
||||
|
||||
注意:这些程序不是由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 < RGBLED_NUM; i++) {
|
||||
for (int i = 0; i < sizeof(led)/sizeof(led[0]); i++) {
|
||||
led[i].r = r;
|
||||
led[i].g = g;
|
||||
led[i].b = b;
|
||||
|
@ -123,7 +123,7 @@
|
||||
{"label":";", "x":10.75, "y":2},
|
||||
{"label":"'", "x":11.75, "y":2},
|
||||
{"label":"ISO #", "x":12.75, "y":2},
|
||||
{"label":"Enter", "x":13.75, "y":2, "w":1.25, "h":2},
|
||||
{"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2},
|
||||
{"label":"Shift", "x":0, "y":3, "w":1.25},
|
||||
{"label":"ISO \\", "x":1.25, "y":3},
|
||||
{"label":"Z", "x":2.25, "y":3},
|
||||
|
@ -6,7 +6,7 @@ Baguette
|
||||
This is a custom keyboard with backlight inspired by France.
|
||||
|
||||
Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar)
|
||||
Hardware Supported: ATMEGA 32u4 MCU with backlight support.
|
||||
Hardware Supported: ATMEGA 32u4 MCU with backlight support.
|
||||
Hardware Availability: Closed group-buy please contact the runners (Tesletron and Enjoy)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
15
keyboards/bm16s/bm16s.h
Executable file
15
keyboards/bm16s/bm16s.h
Executable file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define LAYOUT_ortho_4x4( \
|
||||
K00, K01, K02, K03, \
|
||||
K10, K11, K12, K13, \
|
||||
K20, K21, K22, K23, \
|
||||
K30, K31, K32, K33 \
|
||||
) { \
|
||||
{ K00, K01, K02, K03 }, \
|
||||
{ K10, K11, K12, K13 }, \
|
||||
{ K20, K21, K22, K23 }, \
|
||||
{ K30, K31, K32, K33 } \
|
||||
}
|
46
keyboards/bm16s/config.h
Executable file
46
keyboards/bm16s/config.h
Executable file
@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER KPrepublic
|
||||
#define PRODUCT bm16s
|
||||
#define DESCRIPTION KPrepublic bm16s
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 4
|
||||
#define MATRIX_COLS 4
|
||||
|
||||
/* key matrix pins */
|
||||
#define MATRIX_ROW_PINS { D1, D0, D3, D2 }
|
||||
#define MATRIX_COL_PINS { F7, F6, D4, D6 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* number of backlight levels */
|
||||
|
||||
#ifdef BACKLIGHT_PIN
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
#endif
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
#define RGB_DI_PIN E2
|
||||
#ifdef RGB_DI_PIN
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 16
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#endif
|
30
keyboards/bm16s/info.json
Normal file
30
keyboards/bm16s/info.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"keyboard_name": "bm16s",
|
||||
"url": "",
|
||||
"maintainer": "qmk",
|
||||
"width": 4,
|
||||
"height": 4,
|
||||
"layouts": {
|
||||
"LAYOUT_ortho_4x4": {
|
||||
"key_count": 16,
|
||||
"layout": [
|
||||
{"x":0, "y":0},
|
||||
{"x":1, "y":0},
|
||||
{"x":2, "y":0},
|
||||
{"x":3, "y":0},
|
||||
{"x":0, "y":1},
|
||||
{"x":1, "y":1},
|
||||
{"x":2, "y":1},
|
||||
{"x":3, "y":1},
|
||||
{"x":0, "y":2},
|
||||
{"x":1, "y":2},
|
||||
{"x":2, "y":2},
|
||||
{"x":3, "y":2},
|
||||
{"x":0, "y":3},
|
||||
{"x":1, "y":3},
|
||||
{"x":2, "y":3},
|
||||
{"x":3, "y":3}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
16
keyboards/bm16s/keymaps/default/keymap.c
Executable file
16
keyboards/bm16s/keymaps/default/keymap.c
Executable file
@ -0,0 +1,16 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_ortho_4x4(
|
||||
KC_KP_7, KC_KP_8, KC_KP_9, MO(1), \
|
||||
KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS, \
|
||||
KC_KP_1, KC_KP_2, KC_KP_3, KC_PPLS, \
|
||||
KC_KP_0, KC_PDOT, KC_PCMM, KC_PENT \
|
||||
),
|
||||
[1] = LAYOUT_ortho_4x4(
|
||||
RESET, BL_STEP, _______, KC_VOLU, \
|
||||
BL_TOGG, BL_DEC, BL_INC, KC_VOLD, \
|
||||
RGB_TOG, RGB_MOD, RGB_HUI, KC_MUTE, \
|
||||
RGB_SAI, RGB_SAD, RGB_HUD, _______ \
|
||||
),
|
||||
};
|
20
keyboards/bm16s/keymaps/media/keymap.c
Executable file
20
keyboards/bm16s/keymaps/media/keymap.c
Executable file
@ -0,0 +1,20 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#define RGB_BRU RGB_VAI
|
||||
#define RGB_BRD RGB_VAD
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[0] = LAYOUT_ortho_4x4(
|
||||
KC_BRIU, _______, _______, KC_VOLU, \
|
||||
KC_BRID, _______, _______, KC_VOLD, \
|
||||
_______, _______, _______, KC_MUTE, \
|
||||
KC_MPRV, KC_MPLY, KC_MNXT, MO(1) \
|
||||
),
|
||||
[1] = LAYOUT_ortho_4x4(
|
||||
RESET, _______, _______, _______, \
|
||||
RGB_SPD, RGB_BRU, RGB_SPI, _______, \
|
||||
RGB_RMOD, RGB_BRD, RGB_MOD, _______, \
|
||||
RGB_TOG, _______, _______, _______ \
|
||||
),
|
||||
};
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user