commit
e7f4d56592
@ -1,5 +1,11 @@ |
||||
--- |
||||
name: Blank issue |
||||
about: If you're 100% sure that you don't need one of the other issue templates, use this one instead. |
||||
about: If you're 100% sure that you don't need one of the other issue templates, use |
||||
this one instead. |
||||
title: '' |
||||
labels: help wanted, question |
||||
assignees: '' |
||||
|
||||
--- |
||||
|
||||
|
||||
|
@ -0,0 +1,8 @@ |
||||
blank_issues_enabled: false |
||||
contact_links: |
||||
- name: QMK Discord |
||||
url: https://discord.gg/Uq7gcHh |
||||
about: Ask questions, discuss issues and features. Chill. |
||||
- name: OLKB Subreddit |
||||
url: https://www.reddit.com/r/olkb |
||||
about: All things OLKB and QMK. |
@ -0,0 +1,52 @@ |
||||
# Configuration for probot-stale - https://github.com/probot/stale |
||||
|
||||
# General configuration |
||||
|
||||
# Pull request specific configuration |
||||
pulls: |
||||
staleLabel: awaiting changes |
||||
# Number of days of inactivity before an Issue or Pull Request becomes stale |
||||
daysUntilStale: 45 |
||||
# Number of days of inactivity before a stale Issue or Pull Request is closed. |
||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. |
||||
daysUntilClose: 30 |
||||
# Comment to post when marking as stale. Set to `false` to disable |
||||
markComment: > |
||||
Thank you for your contribution! |
||||
|
||||
This pull request has been automatically marked as stale because it has not had |
||||
activity in the last 45 days. It will be closed in 30 days if no further activity occurs. |
||||
Please feel free to give a status update now, or re-open when it's ready. |
||||
# Comment to post when closing a stale Issue or Pull Request. |
||||
closeComment: > |
||||
Thank you for your contribution! |
||||
|
||||
This pull request has been automatically closed because it has not had activity in the last 30 days. |
||||
Please feel free to give a status update now, ping for review, or re-open when it's ready. |
||||
# Limit the number of actions per hour, from 1-30. Default is 30 |
||||
limitPerRun: 30 |
||||
exemptLabels: |
||||
- awaiting review |
||||
- breaking_change |
||||
- in progress |
||||
- on hold |
||||
|
||||
# Issue specific configuration |
||||
issues: |
||||
staleLabel: solved |
||||
limitPerRun: 10 |
||||
daysUntilStale: 90 |
||||
daysUntilClose: 30 |
||||
markComment: > |
||||
This issue has been automatically marked as resolved because it has not had activity in the |
||||
last 90 days. It will be closed in the next 30 days unless it is tagged properly or other activity |
||||
occurs. |
||||
closeComment: > |
||||
This issue has been automatically closed because it has not had activity in the last 30 days. |
||||
If this issue is still valid, re-open the issue and let us know. |
||||
exemptLabels: |
||||
- bug |
||||
- in progress |
||||
- on hold |
||||
- discussion |
||||
- to do |
@ -1,6 +1,11 @@ |
||||
// Suggested extensions |
||||
{ |
||||
"recommendations": [ |
||||
"EditorConfig.EditorConfig" |
||||
"EditorConfig.EditorConfig", |
||||
"xaver.clang-format", |
||||
"ms-vscode.cpptools", |
||||
"bierner.github-markdown-preview", |
||||
"donjayamanne.git-extension-pack", |
||||
"CoenraadS.bracket-pair-colorizer-2" |
||||
] |
||||
} |
||||
|
@ -0,0 +1,83 @@ |
||||
#!/usr/bin/env python3 |
||||
"""CLI wrapper for running QMK commands. |
||||
""" |
||||
import os |
||||
import subprocess |
||||
import sys |
||||
from importlib.util import find_spec |
||||
from time import strftime |
||||
|
||||
# Add the QMK python libs to our path |
||||
script_dir = os.path.dirname(os.path.realpath(__file__)) |
||||
qmk_dir = os.path.abspath(os.path.join(script_dir, '..')) |
||||
python_lib_dir = os.path.abspath(os.path.join(qmk_dir, 'lib', 'python')) |
||||
sys.path.append(python_lib_dir) |
||||
|
||||
# Make sure our modules have been setup |
||||
with open(os.path.join(qmk_dir, 'requirements.txt'), 'r') as fd: |
||||
for line in fd.readlines(): |
||||
line = line.strip().replace('<', '=').replace('>', '=') |
||||
|
||||
if line[0] == '#': |
||||
continue |
||||
|
||||
if '#' in line: |
||||
line = line.split('#')[0] |
||||
|
||||
module = line.split('=')[0] if '=' in line else line |
||||
if not find_spec(module): |
||||
print('Could not find module %s!' % module) |
||||
print('Please run `pip3 install -r requirements.txt` to install the python dependencies.') |
||||
exit(255) |
||||
|
||||
# Figure out our version |
||||
# TODO(skullydazed/anyone): Find a method that doesn't involve git. This is slow in docker and on windows. |
||||
command = ['git', 'describe', '--abbrev=6', '--dirty', '--always', '--tags'] |
||||
result = subprocess.run(command, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
||||
|
||||
if result.returncode == 0: |
||||
os.environ['QMK_VERSION'] = result.stdout.strip() |
||||
else: |
||||
os.environ['QMK_VERSION'] = 'nogit-' + strftime('%Y-%m-%d-%H:%M:%S') + '-dirty' |
||||
|
||||
# Setup the CLI |
||||
import milc # noqa |
||||
|
||||
milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}' |
||||
|
||||
|
||||
@milc.cli.entrypoint('QMK Helper Script') |
||||
def qmk_main(cli): |
||||
"""The function that gets run when no subcommand is provided. |
||||
""" |
||||
cli.print_help() |
||||
|
||||
|
||||
def main(): |
||||
"""Setup our environment and then call the CLI entrypoint. |
||||
""" |
||||
# Change to the root of our checkout |
||||
os.environ['ORIG_CWD'] = os.getcwd() |
||||
os.chdir(qmk_dir) |
||||
|
||||
# Import the subcommands |
||||
import qmk.cli # noqa |
||||
|
||||
# Execute |
||||
return_code = milc.cli() |
||||
|
||||
if return_code is False: |
||||
exit(1) |
||||
|
||||
elif return_code is not True and isinstance(return_code, int): |
||||
if return_code < 0 or return_code > 255: |
||||
milc.cli.log.error('Invalid return_code: %d', return_code) |
||||
exit(255) |
||||
|
||||
exit(return_code) |
||||
|
||||
exit(0) |
||||
|
||||
|
||||
if __name__ == '__main__': |
||||
main() |
@ -0,0 +1,26 @@ |
||||
# Look for a json keymap file
|
||||
ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.json)","") |
||||
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
||||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_5)/keymap.json
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.json)","") |
||||
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
||||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_4)/keymap.json
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.json)","") |
||||
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
||||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_3)/keymap.json
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.json)","") |
||||
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
||||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_2)/keymap.json
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","") |
||||
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
||||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_1)/keymap.json
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
|
||||
endif |
||||
|
||||
# Generate the keymap.c
|
||||
$(KEYBOARD_OUTPUT)/src/keymap.c: |
||||
bin/qmk json-keymap --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
|
@ -0,0 +1,53 @@ |
||||
# QMK Breaking Change - 2019 Aug 30 |
||||
|
||||
Four times a year QMK runs a process for merging Breaking Changes. A Breaking Change is any change which modifies how QMK behaves in a way that is incompatible or potentially dangerous. We limit these changes to 4 times per year so that users can have confidence that updating their QMK tree will not break their keymaps. |
||||
|
||||
This document marks the inaugural Breaking Change merge. A list of changes follows. |
||||
|
||||
## Core code formatting with clang-format |
||||
|
||||
* All core files (`drivers/`, `quantum/`, `tests/`, and `tmk_core/`) have been formatted with clang-format |
||||
* A travis process to reformat PR's on merge has been instituted |
||||
* You can use the new CLI command `qmk cformat` to format before submitting your PR if you wish. |
||||
|
||||
## LUFA USB descriptor cleanup |
||||
|
||||
* Some code cleanups related to the USB HID descriptors on AVR keyboards, to make them easier to read and understand |
||||
* More information: see https://github.com/qmk/qmk_firmware/pull/4871 |
||||
* No behaviour changes anticipated and no keymaps modified |
||||
|
||||
## Migrating `ACTION_LAYER_MOMENTARY()` entries in `fn_actions` to `MO()` keycodes |
||||
|
||||
* `fn_actions` is deprecated, and its functionality has been superseded by direct keycodes and `process_record_user()` |
||||
* The end result of removing this obsolete feature should result in a decent reduction in firmware size and code complexity |
||||
* All keymaps affected are recommended to switch away from `fn_actions` in favour of the [custom keycode](https://docs.qmk.fm/#/custom_quantum_functions) and [macro](https://docs.qmk.fm/#/feature_macros) features |
||||
|
||||
## Update Atreus to current code conventions |
||||
|
||||
* Duplicate include guards have bypassed the expected header processing behavior |
||||
* All keymaps affected are recommended to remove duplication of `<keyboard>/config.h` to `<keyboard>/keymaps/<user>/config.h` and only provide overrides at the keymap level |
||||
|
||||
## Backport changes to keymap language files from ZSA fork |
||||
|
||||
* Fixes an issue in the `keymap_br_abnt2.h` file that includes the wrong source (`keymap_common.h` instead of `keymap.h`) |
||||
* Updates the `keymap_swedish.h` file to be specific to swedish, and not just "nordic" in general. |
||||
* Any keymaps using this will need to remove `NO_*` and replace it with `SE_*`. |
||||
|
||||
## Update repo to use LUFA as a git submodule |
||||
|
||||
* `/lib/LUFA` removed from the repo |
||||
* LUFA set as a submodule, pointing to qmk/lufa |
||||
* This should allow more flexibility with LUFA, and allow us to keep the sub-module up to date, a lot more easily. It was ~2 years out of date with no easy path to fix that. This prevents that from being an issue in the future |
||||
|
||||
## Migrating `ACTION_BACKLIGHT_*()` entries in `fn_actions` to `BL_` keycodes |
||||
|
||||
* `fn_actions` is deprecated, and its functionality has been superseded by direct keycodes and `process_record_user()` |
||||
* All keymaps using these actions have had the relevant `KC_FN*` keys replaced with the equivalent `BL_*` keys |
||||
* If you currently use `KC_FN*` you will need to replace `fn_actions` with the [custom keycode](https://docs.qmk.fm/#/custom_quantum_functions) and [macro](https://docs.qmk.fm/#/feature_macros) features |
||||
|
||||
## Remove `KC_DELT` alias in favor of `KC_DEL` |
||||
|
||||
* `KC_DELT` was a redundant, undocumented alias for `KC_DELETE` |
||||
* It has been removed and all its uses replaced with the more common `KC_DEL` alias |
||||
* Around 90 keymaps (mostly for ErgoDox boards) have been modified as a result |
||||
|
@ -1,4 +0,0 @@ |
||||
# Languages |
||||
|
||||
* [English](/) |
||||
* [Chinese](zh/) |
@ -0,0 +1,8 @@ |
||||
- Translations |
||||
- [:uk: English](/) |
||||
- [:cn: 中文](/zh-cn/) |
||||
- [:es: Español](/es/) |
||||
- [:fr: Français](/fr-fr/) |
||||
- [:he: עברית](/he-il/) |
||||
- [:ru: Русский](/ru-ru/) |
||||
- [:jp: 日本語](/ja/) |
@ -0,0 +1,107 @@ |
||||
# Breaking Changes |
||||
|
||||
This document describes QMK's Breaking Change process. A Breaking Change is any change which modifies how QMK behaves in a way that in incompatible or potentially dangerous. We limit these changes so that users can have confidence that updating their QMK tree will not break their keymaps. |
||||
|
||||
The breaking change period is when we will merge PR's that change QMK in dangerous or unexpected ways. There is a built-in period of testing so we are confident that any problems caused are rare or unable to be predicted. |
||||
|
||||
## What has been included in past Breaking Changes? |
||||
|
||||
* [2019 Aug 30](ChangeLog/20190830.md) |
||||
|
||||
## When is the next Breaking Change? |
||||
|
||||
The next Breaking Change is scheduled for Nov 29. |
||||
|
||||
### Important Dates |
||||
|
||||
* [x] 2019 Sep 21 - `future` is created. It will be rebased weekly. |
||||
* [ ] 2019 Nov 01 - `future` closed to new PR's. |
||||
* [ ] 2019 Nov 01 - Call for testers. |
||||
* [ ] 2019 Nov 27 - `master` is locked, no PR's merged. |
||||
* [ ] 2019 Nov 29 - Merge `future` to `master`. |
||||
* [ ] 2019 Nov 30 - `master` is unlocked. PR's can be merged again. |
||||
|
||||
## What changes will be included? |
||||
|
||||
To see a list of breaking change candidates you can look at the [`breaking_change` label](https://github.com/qmk/qmk_firmware/pulls?q=is%3Aopen+label%3Abreaking_change+is%3Apr). New changes might be added between now and when `future` is closed, and a PR with that label applied is not guaranteed to be merged. |
||||
|
||||
If you want your breaking change to be included in this round you need to create a PR with the `breaking_change` label and have it accepted before `future` closes. After `future` closes no new breaking changes will be accepted. |
||||
|
||||
Criteria for acceptance: |
||||
|
||||
* PR is complete and ready to merge |
||||
* PR has a ChangeLog |
||||
|
||||
# Checklists |
||||
|
||||
This section documents various processes we use when running the Breaking Changes process. |
||||
|
||||
## Rebase `future` from `master` |
||||
|
||||
This is run every Friday while `future` is open. |
||||
|
||||
Process: |
||||
|
||||
``` |
||||
cd qmk_firmware |
||||
git checkout master |
||||
git pull --ff-only |
||||
git checkout future |
||||
git rebase master |
||||
git push --force |
||||
``` |
||||
|
||||
## Creating the `future` branch |
||||
|
||||
This happens immediately after the previous `future` branch is merged. |
||||
|
||||
* `qmk_firmware` git commands |
||||
* [ ] `git checkout master` |
||||
* [ ] `git pull --ff-only` |
||||
* [ ] `git checkout -b future` |
||||
* [ ] Edit `readme.md` |
||||
* [ ] Add a big notice at the top that this is a testing branch. |
||||
* [ ] Include a link to this document |
||||
* [ ] `git commit -m 'Branch point for <DATE> Breaking Change'` |
||||
* [ ] `git tag breakpoint_<YYYY>_<MM>_<DD>` |
||||
* [ ] `git tag <next_version>` # Prevent the breakpoint tag from confusing version incrementing |
||||
* [ ] `git push origin future` |
||||
* [ ] `git push --tags` |
||||
|
||||
## 4 Weeks Before Merge |
||||
|
||||
* `future` is now closed to new PR's, only fixes for current PR's may be merged |
||||
* Post call for testers |
||||
* [ ] Discord |
||||
* [ ] GitHub PR |
||||
* [ ] https://reddit.com/r/olkb |
||||
|
||||
## 1 Week Before Merge |
||||
|
||||
* Announce that master will be closed from <2 Days Before> to <Day of Merge> |
||||
* [ ] Discord |
||||
* [ ] GitHub PR |
||||
* [ ] https://reddit.com/r/olkb |
||||
|
||||
## 2 Days Before Merge |
||||
|
||||
* Announce that master is closed for 2 days |
||||
* [ ] Discord |
||||
* [ ] GitHub PR |
||||
* [ ] https://reddit.com/r/olkb |
||||
|
||||
## Day Of Merge |
||||
|
||||
* `qmk_firmware` git commands |
||||
* [ ] `git checkout future` |
||||
* [ ] `git pull --ff-only` |
||||
* [ ] `git rebase origin/master` |
||||
* [ ] Edit `readme.md` |
||||
* [ ] Remove the notes about `future` |
||||
* [ ] Roll up the ChangeLog into one file. |
||||
* [ ] `git commit -m 'Merge point for <DATE> Breaking Change'` |
||||
* [ ] `git push origin future` |
||||
* Github Actions |
||||
* [ ] Create a PR for `future` |
||||
* [ ] Make sure travis comes back clean |
||||
* [ ] Merge `future` PR |
@ -0,0 +1,222 @@ |
||||
# QMK CLI |
||||
|
||||
This page describes how to setup and use the QMK CLI. |
||||
|
||||
# Overview |
||||
|
||||
The QMK CLI makes building and working with QMK keyboards easier. We have provided a number of commands to simplify and streamline tasks such as obtaining and compiling the QMK firmware, creating keymaps, and more. |
||||
|
||||
* [Global CLI](#global-cli) |
||||
* [Local CLI](#local-cli) |
||||
* [CLI Commands](#cli-commands) |
||||
|
||||
# Requirements |
||||
|
||||
The CLI requires Python 3.5 or greater. We try to keep the number of requirements small but you will also need to install the packages listed in [`requirements.txt`](https://github.com/qmk/qmk_firmware/blob/master/requirements.txt). |
||||
|
||||
# Global CLI |
||||
|
||||
QMK provides an installable CLI that can be used to setup your QMK build environment, work with QMK, and which makes working with multiple copies of `qmk_firmware` easier. We recommend installing and updating this periodically. |
||||
|
||||
## Install Using Homebrew (macOS, some Linux) |
||||
|
||||
If you have installed [Homebrew](https://brew.sh) you can tap and install QMK: |
||||
|
||||
``` |
||||
brew tap qmk/qmk |
||||
brew install qmk |
||||
export QMK_HOME='~/qmk_firmware' # Optional, set the location for `qmk_firmware` |
||||
qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build environment |
||||
``` |
||||
|
||||
## Install Using easy_install or pip |
||||
|
||||
If your system is not listed above you can install QMK manually. First ensure that you have python 3.5 (or later) installed and have installed pip. Then install QMK with this command: |
||||
|
||||
``` |
||||
pip3 install qmk |
||||
export QMK_HOME='~/qmk_firmware' # Optional, set the location for `qmk_firmware` |
||||
qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build environment |
||||
``` |
||||
|
||||
## Packaging For Other Operating Systems |
||||
|
||||
We are looking for people to create and maintain a `qmk` package for more operating systems. If you would like to create a package for your OS please follow these guidelines: |
||||
|
||||
* Follow best practices for your OS when they conflict with these guidelines |
||||
* Document why in a comment when you do deviate |
||||
* Install using a virtualenv |
||||
* Instruct the user to set the environment variable `QMK_HOME` to have the firmware source checked out somewhere other than `~/qmk_firmware`. |
||||
|
||||
# Local CLI |
||||
|
||||
If you do not want to use the global CLI there is a local CLI bundled with `qmk_firmware`. You can find it in `qmk_firmware/bin/qmk`. You can run the `qmk` command from any directory and it will always operate on that copy of `qmk_firmware`. |
||||
|
||||
**Example**: |
||||
|
||||
``` |
||||
$ ~/qmk_firmware/bin/qmk hello |
||||
Ψ Hello, World! |
||||
``` |
||||
|
||||
## Local CLI Limitations |
||||
|
||||
There are some limitations to the local CLI compared to the global CLI: |
||||
|
||||
* The local CLI does not support `qmk setup` or `qmk clone` |
||||
* The local CLI always operates on the same `qmk_firmware` tree, even if you have multiple repositories cloned. |
||||
* The local CLI does not run in a virtualenv, so it's possible that dependencies will conflict |
||||
|
||||
# CLI Commands |
||||
|
||||
## `qmk cformat` |
||||
|
||||
This command formats C code using clang-format. Run it with no arguments to format all core code, or pass filenames on the command line to run it on specific files. |
||||
|
||||
**Usage**: |
||||
|
||||
``` |
||||
qmk cformat [file1] [file2] [...] [fileN] |
||||
``` |
||||
|
||||
## `qmk compile` |
||||
|
||||
This command allows you to compile firmware from any directory. You can compile JSON exports from <https://config.qmk.fm> or compile keymaps in the repo. |
||||
|
||||
**Usage for Configurator Exports**: |
||||
|
||||
``` |
||||
qmk compile <configuratorExport.json> |
||||
``` |
||||
|
||||
**Usage for Keymaps**: |
||||
|
||||
``` |
||||
qmk compile -kb <keyboard_name> -km <keymap_name> |
||||
``` |
||||
|
||||
## `qmk flash` |
||||
|
||||
This command is similar to `qmk compile`, but can also target a bootloader. The bootloader is optional, and is set to `:flash` by default. |
||||
To specify a different bootloader, use `-bl <bootloader>`. Visit <https://docs.qmk.fm/#/flashing> |
||||
for more details of the available bootloaders. |
||||
|
||||
**Usage for Configurator Exports**: |
||||
|
||||
``` |
||||
qmk flash <configuratorExport.json> -bl <bootloader> |
||||
``` |
||||
|
||||
**Usage for Keymaps**: |
||||
|
||||
``` |
||||
qmk flash -kb <keyboard_name> -km <keymap_name> -bl <bootloader> |
||||
``` |
||||
|
||||
**Listing the Bootloaders** |
||||
|
||||
``` |
||||
qmk flash -b |
||||
``` |
||||
|
||||
## `qmk config` |
||||
|
||||
This command lets you configure the behavior of QMK. For the full `qmk config` documentation see [CLI Configuration](cli_configuration.md). |
||||
|
||||
**Usage**: |
||||
|
||||
``` |
||||
qmk config [-ro] [config_token1] [config_token2] [...] [config_tokenN] |
||||
``` |
||||
|
||||
## `qmk docs` |
||||
|
||||
This command starts a local HTTP server which you can use for browsing or improving the docs. Default port is 8936. |
||||
|
||||
**Usage**: |
||||
|
||||
``` |
||||
qmk docs [-p PORT] |
||||
``` |
||||
|
||||
## `qmk doctor` |
||||
|
||||
This command examines your environment and alerts you to potential build or flash problems. |
||||
|
||||
**Usage**: |
||||
|
||||
``` |
||||
qmk doctor |
||||
``` |
||||
|
||||
## `qmk json-keymap` |
||||
|
||||
Creates a keymap.c from a QMK Configurator export. |
||||
|
||||
**Usage**: |
||||
|
||||
``` |
||||
qmk json-keymap [-o OUTPUT] filename |
||||
``` |
||||
|
||||
## `qmk kle2json` |
||||
|
||||
This command allows you to convert from raw KLE data to QMK Configurator JSON. It accepts either an absolute file path, or a file name in the current directory. By default it will not overwrite `info.json` if it is already present. Use the `-f` or `--force` flag to overwrite. |
||||
|
||||
**Usage**: |
||||
|
||||
``` |
||||
qmk kle2json [-f] <filename> |
||||
``` |
||||
|
||||
**Examples**: |
||||
|
||||
``` |
||||
$ qmk kle2json kle.txt |
||||
☒ File info.json already exists, use -f or --force to overwrite. |
||||
``` |
||||
|
||||
``` |
||||
$ qmk kle2json -f kle.txt -f |
||||
Ψ Wrote out to info.json |
||||
``` |
||||
|
||||
## `qmk list-keyboards` |
||||
|
||||
This command lists all the keyboards currently defined in `qmk_firmware` |
||||
|
||||
**Usage**: |
||||
|
||||
``` |
||||
qmk list-keyboards |
||||
``` |
||||
|
||||
## `qmk new-keymap` |
||||
|
||||
This command creates a new keymap based on a keyboard's existing default keymap. |
||||
|
||||
**Usage**: |
||||
|
||||
``` |
||||
qmk new-keymap [-kb KEYBOARD] [-km KEYMAP] |
||||
``` |
||||
|
||||
## `qmk pyformat` |
||||
|
||||
This command formats python code in `qmk_firmware`. |
||||
|
||||
**Usage**: |
||||
|
||||
``` |
||||
qmk pyformat |
||||
``` |
||||
|
||||
## `qmk pytest` |
||||
|
||||
This command runs the python test suite. If you make changes to python code you should ensure this runs successfully. |
||||
|
||||
**Usage**: |
||||
|
||||
``` |
||||
qmk pytest |
||||
``` |
@ -0,0 +1,121 @@ |
||||
# QMK CLI Configuration |
||||
|
||||
This document explains how `qmk config` works. |
||||
|
||||
# Introduction |
||||
|
||||
Configuration for QMK CLI is a key/value system. Each key consists of a subcommand and an argument name separated by a period. This allows for a straightforward and direct translation between config keys and the arguments they set. |
||||
|
||||
## Simple Example |
||||
|
||||
As an example let's look at the command `qmk compile --keyboard clueboard/66/rev4 --keymap default`. |
||||
|
||||
There are two command line arguments that could be read from configuration instead: |
||||
|
||||
* `compile.keyboard` |
||||
* `compile.keymap` |
||||
|
||||
Let's set these now: |
||||
|
||||
``` |
||||
$ qmk config compile.keyboard=clueboard/66/rev4 compile.keymap=default |
||||
compile.keyboard: None -> clueboard/66/rev4 |
||||
compile.keymap: None -> default |
||||
Ψ Wrote configuration to '/Users/example/Library/Application Support/qmk/qmk.ini' |
||||
``` |
||||
|
||||
Now I can run `qmk compile` without specifying my keyboard and keymap each time. |
||||
|
||||
## Setting User Defaults |
||||
|
||||
Sometimes you want to share a setting between multiple commands. For example, multiple commands take the argument `--keyboard`. Rather than setting this value for every command you can set a user value which will be used by any command that takes that argument. |
||||
|
||||
Example: |
||||
|
||||
``` |
||||
$ qmk config user.keyboard=clueboard/66/rev4 user.keymap=default |
||||
user.keyboard: None -> clueboard/66/rev4 |
||||
user.keymap: None -> default |
||||
Ψ Wrote configuration to '/Users/example/Library/Application Support/qmk/qmk.ini' |
||||
``` |
||||
|
||||
# CLI Documentation (`qmk config`) |
||||
|
||||
The `qmk config` command is used to interact with the underlying configuration. When run with no argument it shows the current configuration. When arguments are supplied they are assumed to be configuration tokens, which are strings containing no spaces with the following form: |
||||
|
||||
<subcommand|general|default>[.<key>][=<value>] |
||||
|
||||
## Setting Configuration Values |
||||
|
||||
You can set configuration values by putting an equal sign (=) into your config key. The key must always be the full `<section>.<key>` form. |
||||
|
||||
Example: |
||||
|
||||
``` |
||||
$ qmk config default.keymap=default |
||||
default.keymap: None -> default |
||||
Ψ Wrote configuration to '/Users/example/Library/Application Support/qmk/qmk.ini' |
||||
``` |
||||
|
||||
## Reading Configuration Values |
||||
|
||||
You can read configuration values for the entire configuration, a single key, or for an entire section. You can also specify multiple keys to display more than one value. |
||||
|
||||
### Entire Configuration Example |
||||
|
||||
qmk config |
||||
|
||||
### Whole Section Example |
||||
|
||||
qmk config compile |
||||
|
||||
### Single Key Example |
||||
|
||||
qmk config compile.keyboard |
||||
|
||||
### Multiple Keys Example |
||||
|
||||
qmk config user compile.keyboard compile.keymap |
||||
|
||||
## Deleting Configuration Values |
||||
|
||||
You can delete a configuration value by setting it to the special string `None`. |
||||
|
||||
Example: |
||||
|
||||
``` |
||||
$ qmk config default.keymap=None |
||||
default.keymap: default -> None |
||||
Ψ Wrote configuration to '/Users/example/Library/Application Support/qmk/qmk.ini' |
||||
``` |
||||
|
||||
## Multiple Operations |
||||
|
||||
You can combine multiple read and write operations into a single command. They will be executed and displayed in order: |
||||
|
||||
``` |
||||
$ qmk config compile default.keymap=default compile.keymap=None |
||||
compile.keymap=skully |
||||
compile.keyboard=clueboard/66_hotswap/gen1 |
||||
default.keymap: None -> default |
||||
compile.keymap: skully -> None |
||||
Ψ Wrote configuration to '/Users/example/Library/Application Support/qmk/qmk.ini' |
||||
``` |
||||
|
||||
# User Configuration Options |
||||
|
||||
| Key | Default Value | Description | |
||||
|-----|---------------|-------------| |
||||
| user.keyboard | None | The keyboard path (Example: `clueboard/66/rev4`) | |
||||
| user.keymap | None | The keymap name (Example: `default`) | |
||||
| user.name | None | The user's github username. | |
||||
|
||||
# All Configuration Options |
||||
|
||||
| Key | Default Value | Description | |
||||
|-----|---------------|-------------| |
||||
| compile.keyboard | None | The keyboard path (Example: `clueboard/66/rev4`) | |
||||
| compile.keymap | None | The keymap name (Example: `default`) | |
||||
| hello.name | None | The name to greet when run. | |
||||
| new_keyboard.keyboard | None | The keyboard path (Example: `clueboard/66/rev4`) | |
||||
| new_keyboard.keymap | None | The keymap name (Example: `default`) | |
@ -0,0 +1,207 @@ |
||||
# QMK CLI Development |
||||
|
||||
This document has useful information for developers wishing to write new `qmk` subcommands. |
||||
|
||||
# Overview |
||||
|
||||
The QMK CLI operates using the subcommand pattern made famous by git. The main `qmk` script is simply there to setup the environment and pick the correct entrypoint to run. Each subcommand is a self-contained module with an entrypoint (decorated by `@cli.subcommand()`) that performs some action and returns a shell returncode, or None. |
||||
|
||||
# Subcommands |
||||
|
||||
[MILC](https://github.com/clueboard/milc) is the CLI framework `qmk` uses to handle argument parsing, configuration, logging, and many other features. It lets you focus on writing your tool without wasting your time writing glue code. |
||||
|
||||
Subcommands in the local CLI are always found in `qmk_firmware/lib/python/qmk/cli`. |
||||
|
||||
Let's start by looking at an example subcommand. This is `lib/python/qmk/cli/hello.py`: |
||||
|
||||
```python |
||||
"""QMK Python Hello World |
||||
|
||||
This is an example QMK CLI script. |
||||
""" |
||||
from milc import cli |
||||
|
||||
|
||||
@cli.argument('-n', '--name', default='World', help='Name to greet.') |
||||
@cli.subcommand('QMK Hello World.') |
||||
def hello(cli): |
||||
"""Log a friendly greeting. |
||||
""" |
||||
cli.log.info('Hello, %s!', cli.config.hello.name) |
||||
``` |
||||
|
||||
First we import the `cli` object from `milc`. This is how we interact with the user and control the script's behavior. We use `@cli.argument()` to define a command line flag, `--name`. This also creates a configuration variable named `hello.name` (and the corresponding `user.name`) which the user can set so they don't have to specify the argument. The `cli.subcommand()` decorator designates this function as a subcommand. The name of the subcommand will be taken from the name of the function. |
||||
|
||||
Once inside our function we find a typical "Hello, World!" program. We use `cli.log` to access the underlying [Logger Object](https://docs.python.org/3.5/library/logging.html#logger-objects), whose behavior is user controllable. We also access the value for name supplied by the user as `cli.config.hello.name`. The value for `cli.config.hello.name` will be determined by looking at the `--name` argument supplied by the user, if not provided it will use the value in the `qmk.ini` config file, and if neither of those is provided it will fall back to the default supplied in the `cli.argument()` decorator. |
||||
|
||||
# User Interaction |
||||
|
||||
MILC and the QMK CLI have several nice tools for interacting with the user. Using these standard tools will allow you to colorize your text for easier interactions, and allow the user to control when and how that information is displayed and stored. |
||||
|
||||
## Printing Text |
||||
|
||||
There are two main methods for outputting text in a subcommand- `cli.log` and `cli.echo()`. They operate in similar ways but you should prefer to use `cli.log.info()` for most general purpose printing. |
||||
|
||||
You can use special tokens to colorize your text, to make it easier to understand the output of your program. See [Colorizing Text](#colorizing-text) below. |
||||
|
||||
Both of these methods support built-in string formatting using python's [printf style string format operations](https://docs.python.org/3.5/library/stdtypes.html#old-string-formatting). You can use tokens such as `%s` and `%d` within your text strings then pass the values as arguments. See our Hello, World program above for an example. |
||||
|
||||
You should never use the format operator (`%`) directly, always pass values as arguments. |
||||
|
||||
### Logging (`cli.log`) |
||||
|
||||
The `cli.log` object gives you access to a [Logger Object](https://docs.python.org/3.5/library/logging.html#logger-objects). We have configured our log output to show the user a nice emoji for each log level (or the log level name if their terminal does not support unicode.) This way the user can tell at a glance which messages are most important when something goes wrong. |
||||
|
||||
The default log level is `INFO`. If the user runs `qmk -v <subcommand>` the default log level will be set to `DEBUG`. |
||||
|
||||
| Function | Emoji | |
||||
|----------|-------| |
||||
| cli.log.critical | `{bg_red}{fg_white}¬_¬{style_reset_all}` | |
||||
| cli.log.error | `{fg_red}☒{style_reset_all}` | |
||||
| cli.log.warning | `{fg_yellow}⚠{style_reset_all}` | |
||||
| cli.log.info | `{fg_blue}Ψ{style_reset_all}` | |
||||
| cli.log.debug | `{fg_cyan}☐{style_reset_all}` | |
||||
| cli.log.notset | `{style_reset_all}¯\\_(o_o)_/¯` | |
||||
|
||||
### Printing (`cli.echo`) |
||||
|
||||
Sometimes you simply need to print text outside of the log system. This is appropriate if you are outputting fixed data or writing out something that should never be logged. Most of the time you should prefer `cli.log.info()` over `cli.echo`. |
||||
|
||||
### Colorizing Text |
||||
|
||||
You can colorize the output of your text by including color tokens within text. Use color to highlight, not to convey information. Remember that the user can disable color, and your subcommand should still be usable if they do. |
||||
|
||||
You should generally avoid setting the background color, unless it's integral to what you are doing. Remember that users have a lot of preferences when it comes to their terminal color, so you should pick colors that work well against both black and white backgrounds. |
||||
|
||||
Colors prefixed with 'fg' will affect the foreground (text) color. Colors prefixed with 'bg' will affect the background color. |
||||
|
||||
| Color | Background | Extended Background | Foreground | Extended Foreground| |
||||
|-------|------------|---------------------|------------|--------------------| |
||||
| Black | {bg_black} | {bg_lightblack_ex} | {fg_black} | {fg_lightblack_ex} | |
||||
| Blue | {bg_blue} | {bg_lightblue_ex} | {fg_blue} | {fg_lightblue_ex} | |
||||
| Cyan | {bg_cyan} | {bg_lightcyan_ex} | {fg_cyan} | {fg_lightcyan_ex} | |
||||
| Green | {bg_green} | {bg_lightgreen_ex} | {fg_green} | {fg_lightgreen_ex} | |
||||
| Magenta | {bg_magenta} | {bg_lightmagenta_ex} | {fg_magenta} | {fg_lightmagenta_ex} | |
||||
| Red | {bg_red} | {bg_lightred_ex} | {fg_red} | {fg_lightred_ex} | |
||||
| White | {bg_white} | {bg_lightwhite_ex} | {fg_white} | {fg_lightwhite_ex} | |
||||
| Yellow | {bg_yellow} | {bg_lightyellow_ex} | {fg_yellow} | {fg_lightyellow_ex} | |
||||
|
||||
There are also control sequences that can be used to change the behavior of |
||||
ANSI output: |
||||
|
||||
| Control Sequences | Description | |
||||
|-------------------|-------------| |
||||
| {style_bright} | Make the text brighter | |
||||
| {style_dim} | Make the text dimmer | |
||||
| {style_normal} | Make the text normal (neither `{style_bright}` nor `{style_dim}`) | |
||||
| {style_reset_all} | Reset all text attributes to default. (This is automatically added to the end of every string.) | |
||||
| {bg_reset} | Reset the background color to the user's default | |
||||
| {fg_reset} | Reset the foreground color to the user's default | |
||||
|
||||
# Arguments and Configuration |
||||
|
||||
QMK handles the details of argument parsing and configuration for you. When you add a new argument it is automatically incorporated into the config tree based on your subcommand's name and the long name of the argument. You can access this configuration in `cli.config`, using either attribute-style access (`cli.config.<subcommand>.<argument>`) or dictionary-style access (`cli.config['<subcommand>']['<argument>']`). |
||||
|
||||
Under the hood QMK uses [ConfigParser](https://docs.python.org/3/library/configparser.html) to store configurations. This gives us an easy and straightforward way to represent the configuration in a human-editable way. We have wrapped access to this configuration to provide some nicities that ConfigParser does not normally have. |
||||
|
||||
## Reading Configuration Values |
||||
|
||||
You can interact with `cli.config` in all the ways you'd normally expect. For example the `qmk compile` command gets the keyboard name from `cli.config.compile.keyboard`. It does not need to know whether that value came from the command line, an environment variable, or the configuration file. |
||||
|
||||
Iteration is also supported: |
||||
|
||||
``` |
||||
for section in cli.config: |
||||
for key in cli.config[section]: |
||||
cli.log.info('%s.%s: %s', section, key, cli.config[section][key]) |
||||
``` |
||||
|
||||
## Setting Configuration Values |
||||
|
||||
You can set configuration values in the usual ways. |
||||
|
||||
Dictionary style: |
||||
|
||||
``` |
||||
cli.config['<section>']['<key>'] = <value> |
||||
``` |
||||
|
||||
Attribute style: |
||||
|
||||
``` |
||||
cli.config.<section>.<key> = <value> |
||||
``` |
||||
|
||||
## Deleting Configuration Values |
||||
|
||||
You can delete configuration values in the usual ways. |
||||
|
||||
Dictionary style: |
||||
|
||||
``` |
||||
del(cli.config['<section>']['<key>']) |
||||
``` |
||||
|
||||
Attribute style: |
||||
|
||||
``` |
||||
del(cli.config.<section>.<key>) |
||||
``` |
||||
|
||||
## Writing The Configuration File |
||||
|
||||
The configuration is not written out when it is changed. Most commands do not need to do this. We prefer to have the user change their configuration deliberitely using `qmk config`. |
||||
|
||||
You can use `cli.save_config()` to write out the configuration. |
||||
|
||||
## Excluding Arguments From Configuration |
||||
|
||||
Some arguments should not be propagated to the configuration file. These can be excluded by adding `arg_only=True` when creating the argument. |
||||
|
||||
Example: |
||||
|
||||
``` |
||||
@cli.argument('-o', '--output', arg_only=True, help='File to write to') |
||||
@cli.argument('filename', arg_only=True, help='Configurator JSON file') |
||||
@cli.subcommand('Create a keymap.c from a QMK Configurator export.') |
||||
def json_keymap(cli): |
||||
pass |
||||
``` |
||||
|
||||
You will only be able to access these arguments using `cli.args`. For example: |
||||
|
||||
``` |
||||
cli.log.info('Reading from %s and writing to %s', cli.args.filename, cli.args.output) |
||||
``` |
||||
|
||||
# Testing, and Linting, and Formatting (oh my!) |
||||
|
||||
We use nose2, flake8, and yapf to test, lint, and format code. You can use the `pytest` and `pyformat` subcommands to run these tests: |
||||
|
||||
### Testing and Linting |
||||
|
||||
qmk pytest |
||||
|
||||
### Formatting |
||||
|
||||
qmk pyformat |
||||
|
||||
## Formatting Details |
||||
|
||||
We use [yapf](https://github.com/google/yapf) to automatically format code. Our configuration is in the `[yapf]` section of `setup.cfg`. |
||||
|
||||
?> Tip- Many editors can use yapf as a plugin to automatically format code as you type. |
||||
|
||||
## Testing Details |
||||
|
||||
Our tests can be found in `lib/python/qmk/tests/`. You will find both unit and integration tests in this directory. We hope you will write both unit and integration tests for your code, but if you do not please favor integration tests. |
||||
|
||||
If your PR does not include a comprehensive set of tests please add comments like this to your code so that other people know where they can help: |
||||
|
||||
# TODO(unassigned/<yourGithubUsername>): Write <unit|integration> tests |
||||
|
||||
We use [nose2](https://nose2.readthedocs.io/en/latest/getting_started.html) to run our tests. You can refer to the nose2 documentation for more details on what you can do in your test functions. |
||||
|
||||
## Linting Details |
||||
|
||||
We use flake8 to lint our code. Your code should pass flake8 before you open a PR. This will be checked when you run `qmk pytest` and by CI when you submit a PR. |
@ -0,0 +1,58 @@ |
||||
# Coding Conventions (C) |
||||
|
||||
Most of our style is pretty easy to pick up on, but right now it's not entirely consistent. You should match the style of the code surrounding your change, but if that code is inconsistent or unclear use the following guidelines: |
||||
|
||||
* We indent using four (4) spaces (soft tabs) |
||||
* We use a modified One True Brace Style |
||||
* Opening Brace: At the end of the same line as the statement that opens the block |
||||
* Closing Brace: Lined up with the first character of the statement that opens the block |
||||
* Else If: Place the closing brace at the beginning of the line and the next opening brace at the end of the same line. |
||||
* Optional Braces: Always include optional braces. |
||||
* Good: if (condition) { return false; } |
||||
* Bad: if (condition) return false; |
||||
* We encourage use of C style comments: `/* */` |
||||
* Think of them as a story describing the feature |
||||
* Use them liberally to explain why particular decisions were made. |
||||
* Do not write obvious comments |
||||
* If you not sure if a comment is obvious, go ahead and include it. |
||||
* In general we don't wrap lines, they can be as long as needed. If you do choose to wrap lines please do not wrap any wider than 76 columns. |
||||
* We use `#pragma once` at the start of header files rather than old-style include guards (`#ifndef THIS_FILE_H`, `#define THIS_FILE_H`, ..., `#endif`) |
||||
* We accept both forms of preprocessor if's: `#ifdef DEFINED` and `#if defined(DEFINED)` |
||||
* If you are not sure which to prefer use the `#if defined(DEFINED)` form. |
||||
* Do not change existing code from one style to the other, except when moving to a multiple condition `#if`. |
||||
* Do not put whitespace between `#` and `if`. |
||||
* When deciding how (or if) to indent directives keep these points in mind: |
||||
* Readability is more important than consistency. |
||||
* Follow the file's existing style. If the file is mixed follow the style that makes sense for the section you are modifying. |
||||
* When choosing to indent you can follow the indention level of the surrounding C code, or preprocessor directives can have their own indent level. Choose the style that best communicates the intent of your code. |
||||
|
||||
Here is an example for easy reference: |
||||
|
||||
```c |
||||
/* Enums for foo */ |
||||
enum foo_state { |
||||
FOO_BAR, |
||||
FOO_BAZ, |
||||
}; |
||||
|
||||
/* Returns a value */ |
||||
int foo(void) { |
||||
if (some_condition) { |
||||
return FOO_BAR; |
||||
} else { |
||||
return -1; |
||||
} |
||||
} |
||||
``` |
||||
|
||||
# Auto-formatting with clang-format |
||||
|
||||
[Clang-format](https://clang.llvm.org/docs/ClangFormat.html) is part of LLVM and can automatically format your code for you, because ain't nobody got time to do it manually. We supply a configuration file for it that applies most of the coding conventions listed above. It will only change whitespace and newlines, so you will still have to remember to include optional braces yourself. |
||||
|
||||
Use the [full LLVM installer](http://llvm.org/builds/) to get clang-format on Windows, or use `sudo apt install clang-format` on Ubuntu. |
||||
|
||||
If you run it from the command-line, pass `-style=file` as an option and it will automatically find the .clang-format configuration file in the QMK root directory. |
||||
|
||||
If you use VSCode, the standard C/C++ plugin supports clang-format, alternatively there is a [separate extension](https://marketplace.visualstudio.com/items?itemName=LLVMExtensions.ClangFormat) for it. |
||||
|
||||
Some things (like LAYOUT macros) are destroyed by clang-format, so either don't run it on those files, or wrap the sensitive code in `// clang-format off` and `// clang-format on`. |
@ -0,0 +1,314 @@ |
||||
# Coding Conventions (Python) |
||||
|
||||
Most of our style follows PEP8 with some local modifications to make things less nit-picky. |
||||
|
||||
* We target Python 3.5 for compatability with all supported platforms. |
||||
* We indent using four (4) spaces (soft tabs) |
||||
* We encourage liberal use of comments |
||||
* Think of them as a story describing the feature |
||||
* Use them liberally to explain why particular decisions were made. |
||||
* Do not write obvious comments |
||||
* If you not sure if a comment is obvious, go ahead and include it. |
||||
* We require useful docstrings for all functions. |
||||
* In general we don't wrap lines, they can be as long as needed. If you do choose to wrap lines please do not wrap any wider than 76 columns. |
||||
* Some of our practices conflict with the wider python community to make our codebase more approachable to non-pythonistas. |
||||
|
||||
# YAPF |
||||
|
||||
You can use [yapf](https://github.com/google/yapf) to style your code. We provide a config in [setup.cfg](setup.cfg). |
||||
|
||||
# Imports |
||||
|
||||
We don't have a hard and fast rule for when to use `import ...` vs `from ... import ...`. Understandability and maintainability is our ultimate goal. |
||||
|
||||
Generally we prefer to import specific function and class names from a module to keep code shorter and easier to understand. Sometimes this results in a name that is ambiguous, and in such cases we prefer to import the module instead. You should avoid using the "as" keyword when importing, unless you are importing a compatability module. |
||||
|
||||
Imports should be one line per module. We group import statements together using the standard python rules- system, 3rd party, local. |
||||
|
||||
Do not use `from foo import *`. Supply a list of objects you want to import instead, or import the whole module. |
||||
|
||||
## Import Examples |
||||
|
||||
Good: |
||||
|
||||
``` |
||||
from qmk import effects |
||||
|
||||
effects.echo() |
||||
``` |
||||
|
||||
Bad: |
||||
|
||||
``` |
||||
from qmk.effects import echo |
||||
|
||||
echo() # It's unclear where echo comes from |
||||
``` |
||||
|
||||
Good: |
||||
|
||||
``` |
||||
from qmk.keymap import compile_firmware |
||||
|
||||
compile_firmware() |
||||
``` |
||||
|
||||
OK, but the above is better: |
||||
|
||||
``` |
||||
import qmk.keymap |
||||
|
||||
qmk.keymap.compile_firmware() |
||||
``` |
||||
|
||||
# Statements |
||||
|
||||
One statement per line. |
||||
|
||||
Even when allowed (EG `if foo: bar`) we do not combine 2 statements onto a single line. |
||||
|
||||
# Naming |
||||
|
||||
`module_name`, `package_name`, `ClassName`, `method_name`, `ExceptionName`, `function_name`, `GLOBAL_CONSTANT_NAME`, `global_var_name`, `instance_var_name`, `function_parameter_name`, `local_var_name`. |
||||
|
||||
Function names, variable names, and filenames should be descriptive; eschew abbreviation. In particular, do not use abbreviations that are ambiguous or unfamiliar to readers outside your project, and do not abbreviate by deleting letters within a word. |
||||
|
||||
Always use a .py filename extension. Never use dashes. |
||||
|
||||
## Names to Avoid |
||||
|
||||
* single character names except for counters or iterators. You may use `e` as an exception identifier in try/except statements. |
||||
* dashes (`-`) in any package/module name |
||||
* `__double_leading_and_trailing_underscore__` names (reserved by Python) |
||||
|
||||
# Docstrings |
||||
|
||||
To maintain consistency with our docstrings we've set out the following guidelines. |
||||
|
||||
* Use markdown formatting |
||||
* Always use triple-dquote docstrings with at least one linebreak: `"""\n"""` |
||||
* First line is a short (< 70 char) description of what the function does |
||||
* If you need more in your docstring leave a blank line between the description and the rest. |
||||
* Start indented lines at the same indent level as the opening triple-dquote |
||||
* Document all function arguments using the format described below |
||||
* If present, Args:, Returns:, and Raises: should be the last three things in the docstring, separated by a blank line each. |
||||
|
||||
## Simple docstring example |
||||
|
||||
``` |
||||
def my_awesome_function(): |
||||
"""Return the number of seconds since 1970 Jan 1 00:00 UTC. |
||||
""" |
||||
return int(time.time()) |
||||
``` |
||||
|
||||
## Complex docstring example |
||||
|
||||
``` |
||||
def my_awesome_function(): |
||||
"""Return the number of seconds since 1970 Jan 1 00:00 UTC. |
||||
|
||||
This function always returns an integer number of seconds. |
||||
""" |
||||
return int(time.time()) |
||||
``` |
||||
|
||||
## Function arguments docstring example |
||||
|
||||
``` |
||||
def my_awesome_function(start=None, offset=0): |
||||
"""Return the number of seconds since 1970 Jan 1 00:00 UTC. |
||||
|
||||
This function always returns an integer number of seconds. |
||||
|
||||
|
||||
Args: |
||||
start |
||||
The time to start at instead of 1970 Jan 1 00:00 UTC |
||||
|
||||
offset |
||||
Return an answer that has this number of seconds subtracted first |
||||
|
||||
Returns: |
||||
An integer describing a number of seconds. |
||||
|
||||
Raises: |
||||
ValueError |
||||
When `start` or `offset` are not positive numbers |
||||
""" |
||||
if start < 0 or offset < 0: |
||||
raise ValueError('start and offset must be positive numbers.') |
||||
|
||||
if not start: |
||||
start = time.time() |
||||
|
||||
return int(start - offset) |
||||
``` |
||||
|
||||
# Exceptions |
||||
|
||||
Exceptions are used to handle exceptional situations. They should not be used for flow control. This is a break from the python norm of "ask for forgiveness." If you are catching an exception it should be to handle a situation that is unusual. |
||||
|
||||
If you use a catch-all exception for any reason you must log the exception and stacktrace using cli.log. |
||||
|
||||
Make your try/except blocks as short as possible. If you need a lot of try statements you may need to restructure your code. |
||||
|
||||
# Tuples |
||||
|
||||
When defining one-item tuples always include a trailing comma so that it is obvious you are using a tuple. Do not rely on implicit one-item tuple unpacking. Better still use a list which is unambiguous. |
||||
|
||||
This is particularly important when using the printf-style format strings that are commonly used. |
||||
|
||||
# Lists and Dictionaries |
||||
|
||||
We have configured YAPF to differentiate between sequence styles with a trailing comma. When a trailing comma is omitted YAPF will format the sequence as a single line. When a trailing comma is included YAPF will format the sequence with one item per line. |
||||
|
||||
You should generally prefer to keep short definition on a single line. Break out to multiple lines sooner rather than later to aid readability and maintainability. |
||||
|
||||
# Parentheses |
||||
|
||||
Avoid excessive parentheses, but do use parentheses to make code easier to understand. Do not use them in return statements unless you are explicitly returning a tuple, or it is part of a math expression. |
||||
|
||||
# Format Strings |
||||
|
||||
We generally prefer printf-style format strings. Example: |
||||
|
||||
``` |
||||
name = 'World' |
||||
print('Hello, %s!' % (name,)) |
||||
``` |
||||
|
||||
This style is used by the logging module, which we make use of extensively, and we have adopted it in other places for consistency. It is also more familiar to C programmers, who are a big part of our casual audience. |
||||
|
||||
Our included CLI module has support for using these without using the percent (%) operator. Look at `cli.echo()` and the various `cli.log` functions (EG, `cli.log.info()`) for more details. |
||||
|
||||
# Comprehensions & Generator Expressions |
||||
|
||||
We encourage the liberal use of comprehensions and generators, but do not let them get too complex. If you need complexity fall back to a for loop that is easier to understand. |
||||
|
||||
# Lambdas |
||||
|
||||
OK to use but probably should be avoided. With comprehensions and generators the need for lambdas is not as strong as it once was. |
||||
|
||||
# Conditional Expressions |
||||
|
||||
OK in variable assignment, but otherwise should be avoided. |
||||
|
||||
Conditional expressions are if statements that are in line with code. For example: |
||||
|
||||
``` |
||||
x = 1 if cond else 2 |
||||
``` |
||||
|
||||
It's generally not a good idea to use these as function arguments, sequence items, etc. It's too easy to overlook. |
||||
|
||||
# Default Argument Values |
||||
|
||||
Encouraged, but values must be immutable objects. |
||||
|
||||
When specifying default values in argument lists always be careful to specify objects that can't be modified in place. If you use a mutable object the changes you make will persist between calls, which is usually not what you want. Even if that is what you intend to do it is confusing for others and will hinder understanding. |
||||
|
||||
Bad: |
||||
|
||||
``` |
||||
def my_func(foo={}): |
||||
pass |
||||
``` |
||||
|
||||
Good: |
||||
|
||||
``` |
||||
def my_func(foo=None): |
||||
if not foo: |
||||
foo = {} |
||||
``` |
||||
|
||||
# Properties |
||||
|
||||
Always use properties instead of getter and setter functions. |
||||
|
||||
``` |
||||
class Foo(object): |
||||
def __init__(self): |
||||
self._bar = None |
||||
|
||||
@property |
||||
def bar(self): |
||||
return self._bar |
||||
|
||||
@bar.setter |
||||
def bar(self, bar): |
||||
self._bar = bar |
||||
``` |
||||
|
||||
# True/False Evaluations |
||||
|
||||
You should generally prefer the implicit True/False evaluation in if statements, rather than checking equivalency. |
||||
|
||||
Bad: |
||||
|
||||
``` |
||||
if foo == True: |
||||
pass |
||||
|
||||
if bar == False: |
||||
pass |
||||
``` |
||||
|
||||
Good: |
||||
|
||||
``` |
||||
if foo: |
||||
pass |
||||
|
||||
if not bar: |
||||
pass |
||||
``` |
||||
|
||||
# Decorators |
||||
|
||||
Use when appropriate. Try to avoid too much magic unless it helps with understanding. |
||||
|
||||
# Threading and Multiprocessing |
||||
|
||||
Should be avoided. If you need this you will have to make a strong case before we merge your code. |
||||
|
||||
# Power Features |
||||
|
||||
Python is an extremely flexible language and gives you many fancy features such as custom metaclasses, access to bytecode, on-the-fly compilation, dynamic inheritance, object reparenting, import hacks, reflection, modification of system internals, etc. |
||||
|
||||
Don't use these. |
||||
|
||||
Performance is not a critical concern for us, and code understandability is. We want our codebase to be approachable by someone who only has a day or two to play with it. These features generally come with a cost to easy understanding, and we would prefer to have code that can be readily understood over faster or more compact code. |
||||
|
||||
Note that some standard library modules use these techniques and it is ok to make use of those modules. But please keep readability and understandability in mind when using them. |
||||
|
||||
# Type Annotated Code |
||||
|
||||
For now we are not using any type annotation system, and would prefer that code remain unannotated. We may revisit this in the future. |
||||
|
||||
# Function length |
||||
|
||||
Prefer small and focused functions. |
||||
|
||||
We recognize that long functions are sometimes appropriate, so no hard limit is placed on function length. If a function exceeds about 40 lines, think about whether it can be broken up without harming the structure of the program. |
||||
|
||||
Even if your long function works perfectly now, someone modifying it in a few months may add new behavior. This could result in bugs that are hard to find. Keeping your functions short and simple makes it easier for other people to read and modify your code. |
||||
|
||||
You could find long and complicated functions when working with some code. Do not be intimidated by modifying existing code: if working with such a function proves to be difficult, you find that errors are hard to debug, or you want to use a piece of it in several different contexts, consider breaking up the function into smaller and more manageable pieces. |
||||
|
||||
# FIXMEs |
||||
|
||||
It is OK to leave FIXMEs in code. Why? Encouraging people to at least document parts of code that need to be thought out more (or that are confusing) is better than leaving this code undocumented. |
||||
|
||||
All FIXMEs should be formatted like: |
||||
|
||||
``` |
||||
FIXME(username): Revisit this code when the frob feature is done. |
||||
``` |
||||
|
||||
...where username is your GitHub username. |
||||
|
||||
# Unit Tests |
||||
|
||||
These are good. We should have some one day. |
@ -1,25 +1,36 @@ |
||||
# Atmel AVR |
||||
# Compatible Microcontrollers |
||||
|
||||
QMK should run on any Atmel AVR processor with enough Flash. It has been tested on the following: |
||||
QMK runs on any USB-capable AVR or ARM microcontroller with enough flash space - generally 32kB or more, though it will *just* squeeze into 16kB with most features disabled. |
||||
|
||||
* ATmega32U4 ([PJRC Teensy 2.0](http://www.pjrc.com/teensy/)) |
||||
* AT90USB1286 ([PJRC Teensy++ 2.0](http://www.pjrc.com/teensy/)) |
||||
* AT90USB1287 ([Atmel USBKEY](http://www.atmel.com/tools/AT90USBKEY.aspx)) |
||||
* ATmega168P with using [V-USB](http://www.obdev.at/products/vusb/index.html) |
||||
* ATmega328P with using [V-USB](http://www.obdev.at/products/vusb/index.html) |
||||
* ATmega32U2 |
||||
* AT90USB1286, 646, 647 should work |
||||
* AT90USB162 testing... |
||||
## Atmel AVR |
||||
|
||||
NOTE: To enable full features of firmware you'll need 32KB flash size. |
||||
The following use [LUFA](https://www.fourwalledcubicle.com/LUFA.php) as the USB stack: |
||||
|
||||
Please add any tested microcontrollers to this list. |
||||
* [ATmega16U2](https://www.microchip.com/wwwproducts/en/ATmega16U2) / [ATmega32U2](https://www.microchip.com/wwwproducts/en/ATmega32U2) |
||||
* [ATmega16U4](https://www.microchip.com/wwwproducts/en/ATmega16U4) / [ATmega32U4](https://www.microchip.com/wwwproducts/en/ATmega32U4) |
||||
* [AT90USB64](https://www.microchip.com/wwwproducts/en/AT90USB646) / [AT90USB128](https://www.microchip.com/wwwproducts/en/AT90USB1286) |
||||
|
||||
# ARM |
||||
Certain MCUs which do not have native USB will use [V-USB](https://www.obdev.at/products/vusb/index.html) instead: |
||||
|
||||
You can also use any ARM processor that [ChibiOS](http://www.chibios.org) supports. The following processors have been tested: |
||||
* [ATmega32A](https://www.microchip.com/wwwproducts/en/ATmega32A) |
||||
* [ATmega328P](https://www.microchip.com/wwwproducts/en/ATmega328P) |
||||
|
||||
* [Kinetis MKL26Z64](http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m-mcus/l-series-ultra-low-power-m0-plus/kinetis-kl2x-48-mhz-usb-ultra-low-power-microcontrollers-mcus-based-on-arm-cortex-m0-plus-core:KL2x) |
||||
* [Kinetis MK20DX128](http://www.nxp.com/assets/documents/data/en/data-sheets/K20P64M50SF0.pdf) |
||||
* [Kinetis MK20DX128](http://www.nxp.com/assets/documents/data/en/data-sheets/K20P64M50SF0.pdf) |
||||
* [Kinetis MK20DX256](http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m-mcus/k-series-performance-m4/k2x-usb/kinetis-k20-72-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-mcus-based-on-arm-cortex-m4-core:K20_72) |
||||
## ARM |
||||
|
||||
You can also use any ARM chip with USB that [ChibiOS](http://www.chibios.org) supports. Most have plenty of flash. Known to work are: |
||||
|
||||
### STMicroelectronics (STM32) |
||||
|
||||
* [STM32F0x2](https://www.st.com/en/microcontrollers-microprocessors/stm32f0x2.html) |
||||
* [STM32F103](https://www.st.com/en/microcontrollers-microprocessors/stm32f103.html) |
||||
* [STM32F303](https://www.st.com/en/microcontrollers-microprocessors/stm32f303.html) |
||||
|
||||
### NXP (Kinetis) |
||||
|
||||
* [MKL26Z64](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/kl-series-cortex-m0-plus/kinetis-kl2x-72-96-mhz-usb-ultra-low-power-microcontrollers-mcus-based-on-arm-cortex-m0-plus-core:KL2x) |
||||
* [MK20DX128](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k2x-usb/kinetis-k20-50-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-based-on-arm-cortex-m4-core:K20_50) |
||||
* [MK20DX256](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k2x-usb/kinetis-k20-72-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-mcus-based-on-arm-cortex-m4-core:K20_72) |
||||
|
||||
## Atmel ATSAM |
||||
|
||||
There is limited support for one of Atmel's ATSAM microcontrollers, that being the [ATSAMD51J18A](https://www.microchip.com/wwwproducts/en/ATSAMD51J18A) used by the [Massdrop keyboards](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop). |
||||
|
@ -0,0 +1,33 @@ |
||||
# Quantum Mechanical Keyboard Firmware |
||||
|
||||
[](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/) |
||||
|
||||
## Was ist QMK Firmware? |
||||
|
||||
QMK (*Quantum Mechanical Keyboard*) ist eine Open-Source-Community, welche die QMK-Firmware, die QMK-Toolbox, [qmk.fm](https://qmk.fm) und diese Dokumententation betreut. QMK-Firmware ist eine Weiterentwicklung der [tmk\_keyboard](http://github.com/tmk/tmk_keyboard)-Tastatur-Firmware mit vielen nützlichen Zusatzfunktionen für Atmel AVR-Prozessoren. Ursprünglich wurde sie für Produkte von [OLKB](http://olkb.com), das [ErgoDox EZ](http://www.ergodox-ez.com) und das [Clueboard](http://clueboard.co/) entwickelt. Im Laufe der Zeit wurde sie mit Hilfe von [ChibiOS](http://chibios.org) auch für die ARM-Architektur angepasst. Außerdem ist es inzwischen möglich, auch handverdrahtete Tastaturen und selbst geätzte PCBs mit QMK zu verwenden. |
||||
|
||||
## Bezugsquelle für QMK |
||||
|
||||
Wenn Du vorhast, deine Tastatur, Tastaturbelegung oder Features zu QMK beizusteuern, geht das am einfachsten, indem Du das [Repository auf Github](https://github.com/qmk/qmk_firmware#fork-destination-box) forkst, die Änderungen in deinem lokalen Repo vornimmst und anschließend einen [Pull Request](https://github.com/qmk/qmk_firmware/pulls) einreichst. |
||||
|
||||
Ansonsten kannst Du es als [zip](https://github.com/qmk/qmk_firmware/zipball/master) oder [tar](https://github.com/qmk/qmk_firmware/tarball/master) herunterladen, oder es direkt via git klonen (`git clone git@github.com:qmk/qmk_firmware.git` bzw. `git clone https://github.com/qmk/qmk_firmware.git`). |
||||
|
||||
|
||||
## Anleitung fürs Kompilieren |
||||
|
||||
Bevor Du in der Lage bist, die Firmware zu kompilieren, musst Du eine [Entwicklungsumgebung](de/getting_started_build_tools.md) für AVR und/oder ARM aufsetzen. Danach kannst Du mit dem `make` Befehl eine Keymap für deine Tastatur erzeugen. Die Notation dafür ist: |
||||
|
||||
make planck/rev4:default |
||||
|
||||
Dies generiert die Revision `rev4` für eine Tastatur vom Type `planck` mit der `default` Tastaturbelegung. Nicht alle Tastaturen haben Revisionen (auch bekannt als Subprojekt oder Unterordner) weswegen dies auch ausgelassen werden kann: |
||||
|
||||
make preonic:default |
||||
|
||||
## Möglichkeiten der Anpassung |
||||
|
||||
QMK hat viele [Features](de/features.md), die es zu entdecken gibt. In der [Dokumentation](https://docs.qmk.fmk) kannst Du Dir einen Überblick verschaffen. Die meisten Features basieren darauf, die [Tastaturbelegung](de/keymap.md) anzupassen und das Verhalten der [Keycodes](de/keycodes.md) zu verändern. |
@ -0,0 +1,121 @@ |
||||
* [Anleitung für Anfänger](de/newbs.md) |
||||
* [Erste Schritte](de/newbs_getting_started.md) |
||||
* [Die erste Firmware](de/newbs_building_firmware.md) |
||||
* [Firmware flashen](de/newbs_flashing.md) |
||||
* [Testen und Debuggen](de/newbs_testing_debugging.md) |
||||
* [Git Tips und Tricks](de/newbs_best_practices.md) |
||||
* [Hilfreiche Ressourcen](de/newbs_learn_more_resources.md) |
||||
|
||||
* [QMK Basics](de/README.md) |
||||
* [QMK Einführung](de/getting_started_introduction.md) |
||||
* [QMK CLI](de/cli.md) |
||||
* [QMK CLI Konfiguration](de/cli_configuration.md) |
||||
* [Zu QMK beitragen](de/contributing.md) |
||||
* [Anleitung für Github](de/getting_started_github.md) |
||||
* [Nach Hilfe fragen](de/getting_started_getting_help.md) |
||||
|
||||
* [Breaking Changes](de/breaking_changes.md) |
||||
* [2019 Aug 30](de/ChangeLog/20190830.md) |
||||
|
||||
* [FAQ](de/faq.md) |
||||
* [Häufige Fragen](de/faq_general.md) |
||||
* [Build/Kompilieren](de/faq_build.md) |
||||
* [Debugging/Troubleshooting](de/faq_debug.md) |
||||
* [Keymap](de/faq_keymap.md) |
||||
* [Treiber Installation mit Zadig](de/driver_installation_zadig.md) |
||||
|
||||
* Detailierte Guides |
||||
* [Build Tools installieren](de/getting_started_build_tools.md) |
||||
* [Vagrant Guide](de/getting_started_vagrant.md) |
||||
* [Build/Compile Anleitung](de/getting_started_make_guide.md) |
||||
* [Firmware flashen](de/flashing.md) |
||||
* [Funktionalität anpassen](de/custom_quantum_functions.md) |
||||
* [Keymap Überblick](de/keymap.md) |
||||
|
||||
* [Hardware](de/hardware.md) |
||||
* [AVR Prozessoren](de/hardware_avr.md) |
||||
* [Treiber](de/hardware_drivers.md) |
||||
|
||||
* Referenz |
||||
* [Tastatur Richtlinien](de/hardware_keyboard_guidelines.md) |
||||
* [Konfigurations Optionen](de/config_options.md) |
||||
* [Keycodes](de/keycodes.md) |
||||
* [Coding Konventionen - C](de/coding_conventions_c.md) |
||||
* [Coding Konventionen - Python](de/coding_conventions_python.md) |
||||
* [Dokumentations Best Practices](de/documentation_best_practices.md) |
||||
* [Dokumentations Templates](de/documentation_templates.md) |
||||
* [Glossar](de/reference_glossary.md) |
||||
* [Unit Testing](de/unit_testing.md) |
||||
* [Nützliche Funktionen](de/ref_functions.md) |
||||
* [Configurator Support](de/reference_configurator_support.md) |
||||
* [info.json Format](de/reference_info_json.md) |
||||
* [Python CLI Development](de/cli_development.md) |
||||
|
||||
* [Features](de/features.md) |
||||
* [Basic Keycodes](de/keycodes_basic.md) |
||||
* [US ANSI Shifted Keys](de/keycodes_us_ansi_shifted.md) |
||||
* [Quantum Keycodes](de/quantum_keycodes.md) |
||||
* [Advanced Keycodes](de/feature_advanced_keycodes.md) |
||||
* [Audio](de/feature_audio.md) |
||||
* [Auto Shift](de/feature_auto_shift.md) |
||||
* [Backlight](de/feature_backlight.md) |
||||
* [Bluetooth](de/feature_bluetooth.md) |
||||
* [Bootmagic](de/feature_bootmagic.md) |
||||
* [Combos](de/feature_combo.md) |
||||
* [Command](de/feature_command.md) |
||||
* [Debounce API](de/feature_debounce_type.md) |
||||
* [DIP Switch](de/feature_dip_switch.md) |
||||
* [Dynamic Macros](de/feature_dynamic_macros.md) |
||||
* [Encoders](de/feature_encoders.md) |
||||
* [Grave Escape](de/feature_grave_esc.md) |
||||
* [Haptic Feedback](de/feature_haptic_feedback.md) |
||||
* [HD44780 LCD Controller](de/feature_hd44780.md) |
||||
* [Key Lock](de/feature_key_lock.md) |
||||
* [Layouts](de/feature_layouts.md) |
||||
* [Leader Key](de/feature_leader_key.md) |
||||
* [LED Matrix](de/feature_led_matrix.md) |
||||
* [Macros](de/feature_macros.md) |
||||
* [Mouse Keys](de/feature_mouse_keys.md) |
||||
* [OLED Driver](de/feature_oled_driver.md) |
||||
* [One Shot Keys](de/feature_advanced_keycodes.md#one-shot-keys) |
||||
* [Pointing Device](de/feature_pointing_device.md) |
||||
* [PS/2 Mouse](de/feature_ps2_mouse.md) |
||||
* [RGB Lighting](de/feature_rgblight.md) |
||||
* [RGB Matrix](de/feature_rgb_matrix.md) |
||||
* [Space Cadet](de/feature_space_cadet.md) |
||||
* [Split Keyboard](de/feature_split_keyboard.md) |
||||
* [Stenography](de/feature_stenography.md) |
||||
* [Swap Hands](de/feature_swap_hands.md) |
||||
* [Tap Dance](de/feature_tap_dance.md) |
||||
* [Terminal](de/feature_terminal.md) |
||||
* [Thermal Printer](de/feature_thermal_printer.md) |
||||
* [Unicode](de/feature_unicode.md) |
||||
* [Userspace](de/feature_userspace.md) |
||||
* [Velocikey](de/feature_velocikey.md) |
||||
|
||||
* Für Maker und Modder |
||||
* [Hand Wiring Guide](de/hand_wire.md) |
||||
* [ISP Flashing Guide](de/isp_flashing_guide.md) |
||||
* [ARM Debugging Guide](de/arm_debugging.md) |
||||
* [I2C Driver](de/i2c_driver.md) |
||||
* [GPIO Controls](de/internals_gpio_control.md) |
||||
* [Proton C Conversion](de/proton_c_conversion.md) |
||||
|
||||
* Für ein tieferes Verständnis |
||||
* [Wie Tastaturen funktionieren](de/how_keyboards_work.md) |
||||
* [QMK verstehen](de/understanding_qmk.md) |
||||
|
||||
* Andere Themen |
||||
* [Eclipse mit QMK](de/other_eclipse.md) |
||||
* [VSCode mit QMK](de/other_vscode.md) |
||||
* [Support](de/support.md) |
||||
* [Übersetzungen](de/translating.md) |
||||
|
||||
* QMK Internals (de/In Progress) |
||||
* [Defines](de/internals_defines.md) |
||||
* [Input Callback Reg](de/internals_input_callback_reg.md) |
||||
* [Midi Device](de/internals_midi_device.md) |
||||
* [Midi Device Setup Process](de/internals_midi_device_setup_process.md) |
||||
* [Midi Util](de/internals_midi_util.md) |
||||
* [Send Functions](de/internals_send_functions.md) |
||||
* [Sysex Tools](de/internals_sysex_tools.md) |
@ -0,0 +1,169 @@ |
||||
# QMK CLI (Kommandozeile) |
||||
|
||||
Diese Seite beschreibt die Einrichtung und den Umgang mit dem QMK CLI (Kommandozeile). |
||||
|
||||
# Übersicht |
||||
|
||||
Die QMK CLI vereinfacht das Zusammenbauen und Arbeiten mit QMK Tastaturen. Hier findest Du wichtige Befehle, um beispielsweise das Herunterladen und Kompilieren der QMK Firmware oder das Erstellen von Tastaturbelegungen (und vieles mehr) zu erleichtern. |
||||
|
||||
* [Globale CLI](#globale-cli) |
||||
* [Lokale CLI](#lokale-cli) |
||||
* [CLI-Befehle](#cli-befehle) |
||||
|
||||
# System-Anforderungen |
||||
|
||||
Die CLI benötigt Python 3.5 oder höher. Außerdem ist es nötig, die Packages laut [`requirements.txt`](https://github.com/qmk/qmk_firmware/blob/master/requirements.txt) zu installieren. |
||||
|
||||
# Globale CLI |
||||
|
||||
QMK bietet ein installierbares CLI, das Du zum Einrichten Deiner QMK Build-Umgebung verwenden kannst. Dieses ermöglicht Dir das Arbeiten mit QMK, und erleichtert das Arbeiten mit mehreren Kopien der `qmk_firmware`. Wir empfehlen, dieses CLI zu installieren und regelmäßig upzudaten. |
||||
|
||||
## Installation mit Homebrew (macOS, manche Linux) |
||||
|
||||
Solltest Du [Homebrew](https://brew.sh) installiert haben, kannst Du QMK per tap installieren: |
||||
|
||||
``` |
||||
brew tap qmk/qmk |
||||
brew install qmk |
||||
export QMK_HOME='~/qmk_firmware' # Optional: setzt den Installationsort für `qmk_firmware` |
||||
qmk setup # Dies klont `qmk/qmk_firmware` und richtet optional auch Deine Build-Umgebung ein |
||||
``` |
||||
|
||||
## Installation mit easy_install oder pip |
||||
|
||||
Falls Du kein Homebrew hast, kannst Du QMK auch manuell installieren. Zuerst musst Du sicherstellen, dass Python 3.5 (oder höher) und pip installiert ist. Dann installiere QMK mit diesem Befehl: |
||||
|
||||
``` |
||||
pip3 install qmk |
||||
export QMK_HOME='~/qmk_firmware' # Optional: setzt den Installationsort für `qmk_firmware` |
||||
qmk setup # Dies klont `qmk/qmk_firmware` und richtet optional auch Deine Build-Umgebung ein |
||||
``` |
||||
## Installation mit git Repo |
||||
|
||||
`git clone https://github.com/qmk/qmk_cli.git && cd qmk_cli && python3 setup.py install` |
||||
|
||||
## Packaging für andere Betriebssysteme |
||||
|
||||
Wir suchen nach Freiwilligen, die ein `qmk`-Package für weitere Betriebssysteme erstellen und pflegen. Falls Du ein Package für Dein OS erstellen möchtest, bitte befolge diese Richtlinien: |
||||
|
||||
* Verwende "Best Practices" für Dein OS, sollten sie mit diesen Richtlinien in Konflikt stehen. |
||||
* Dokumentiere den Grund in einem Kommentar, wenn Du abweichen musstest. |
||||
* Installiere mit einem [virtualenv](https://virtualenv.pypa.io/en/latest/). |
||||
* Weise den User an, die Umgebungs-Variable `QMK_HOME` zu setzen, um die Firmware-Quelle anders einzustellen als `~/qmk_firmware`. |
||||
|
||||
# Lokale CLI |
||||
|
||||
Wenn Du die globale CLI nicht verwenden möchtest, beinhaltet `qmk_firmware` auch eine lokale CLI. Du kannst sie hier finden: `qmk_firmware/bin/qmk`. Du kannst den `qmk`-Befehl aus irgendeinem Datei-Verzeichnis ausführen und es wird immer auf dieser Kopie von `qmk_firmware` arbeiten. |
||||
|
||||
**Beispiel**: |
||||
|
||||
``` |
||||
$ ~/qmk_firmware/bin/qmk hello |
||||
Ψ Hello, World! |
||||
``` |
||||
|
||||
## Einschränkungen der lokalen CLI |
||||
|
||||
Hier ein Vergleich mit der globalen CLI: |
||||
|
||||
* Die lokale CLI unterstützt kein `qmk setup` oder `qmk clone`. |
||||
* Die lokale CLI arbeitet immer innerhalb der selben `qmk_firmware`-Verzeichnisstruktur, auch wenn Du mehrere Repositories geklont hast. |
||||
* Die lokale CLI läuft nicht in einer virtualenv. Daher ist es möglich, dass Abhängigkeiten (dependencies) miteinander in Konflikt kommen/stehen. |
||||
|
||||
# CLI-Befehle |
||||
|
||||
## `qmk compile` |
||||
|
||||
Dieser Befehl erlaubt es dir, die Firmware - aus egal welchem Datei-Verzeichnis - zu compilen. Du kannst JSON-Exporte von <https://config.qmk.fm> oder Keymaps in der Repo kompilen. |
||||
|
||||
**Anwendung für Konfigurations-Exports**: |
||||
|
||||
``` |
||||
qmk compile <configuratorExport.json> |
||||
``` |
||||
|
||||
**Anwendung für Keymaps**: |
||||
|
||||
``` |
||||
qmk compile -kb <keyboard_name> -km <keymap_name> |
||||
``` |
||||
|
||||
## `qmk cformat` |
||||
|
||||
Dieser Befehl formatiert C-Code im clang-Format. Benutze ihn ohne Argumente, um den core-Code zu formatieren, oder benutze Namen von Dateien in der CLI, um den Befehl auf bestimmte Dateien anzuwenden. |
||||
|
||||
**Anwendung**: |
||||
|
||||
``` |
||||
qmk cformat [file1] [file2] [...] [fileN] |
||||
``` |
||||
|
||||
## `qmk config` |
||||
|
||||
Dieser Befehl konfiguriert das Verhalten von QMK. Für die volle `qmk config`-Dokumentation gehe zu [CLI-Konfiguration](cli_configuration.md). |
||||
|
||||
**Anwendung**: |
||||
|
||||
``` |
||||
qmk config [-ro] [config_token1] [config_token2] [...] [config_tokenN] |
||||
``` |
||||
|
||||
## `qmk docs` |
||||
|
||||
Dieser Befehl startet einen lokalen HTTP-Server, den Du zum Browsen oder Verbessern der Dokumentation verwenden kannst. Der Default-Port ist 8936. |
||||
|
||||
**Anwendung**: |
||||
|
||||
``` |
||||
qmk docs [-p PORT] |
||||
``` |
||||
|
||||
## `qmk doctor` |
||||
|
||||
Dieser Befehl untersucht Deine Umgebung und warnt Dich vor potentiellen Build- oder Flash-Problemen. |
||||
|
||||
**Anwendung**: |
||||
|
||||
``` |
||||
qmk doctor |
||||
``` |
||||
|
||||
## `qmk list-keyboards` |
||||
|
||||
Dieser Befehl listet alle zurzeit in `qmk_firmware` definierten Tastaturen/Keyboards auf. |
||||
|
||||
**Anwendung**: |
||||
|
||||
``` |
||||
qmk list-keyboards |
||||
``` |
||||
|
||||
## `qmk new-keymap` |
||||
|
||||
Dieser Befehl erstellt eine neue Keymap basierend auf einer existierenden Standard-Keymap eines bestimmten Keyboards. |
||||
|
||||
**Anwendung**: |
||||
|
||||
``` |
||||
qmk new-keymap [-kb KEYBOARD] [-km KEYMAP] |
||||
``` |
||||
|
||||
## `qmk pyformat` |
||||
|
||||
Dieser Befehl formatiert Python-Code in `qmk_firmware`. |
||||
|
||||
**Anwendung**: |
||||
|
||||
``` |
||||
qmk pyformat |
||||
``` |
||||
|
||||
## `qmk pytest` |
||||
|
||||
Dieser Befehl führt die Python Test Suite aus. Wenn Du Python-Code veränderst, solltest Du sicherstellen, dass der Test erfolgreich ausgeführt wurde. |
||||
|
||||
**Anwendung**: |
||||
|
||||
``` |
||||
qmk pytest |
||||
``` |
@ -0,0 +1,47 @@ |
||||
# Bootloader Treiber Installation mit Zadig |
||||
|
||||
QMK erscheint für den Host als normales HID Eingabegerät und benötigt deshalb keine zusätzlichen Treiber. Der Bootloader, den Du für das Flashen der Firmware benötigst, jedoch meistens schon. |
||||
|
||||
Hierzu gibt es zwei Ausnahmen: den Caterina Bootloader, meistens auf Pro Micros, sowie den HalfKay Bootloader auf PJRC Teensys. Diese erscheinen als serieller Port und als generisches HID Gerät und benötigen keine Treiber. |
||||
|
||||
Wir empfehlen deshalb [Zadig](https://zadig.akeo.ie/). Wenn Du die Entwicklungsumgebung mit MSYS2 oder WSL installiert hast, wird dich dass `qmk_install.sh` Skript gefragt haben, ob es die Treiber für dich installieren sollte. |
||||
|
||||
## Installation |
||||
|
||||
Versetze deine Tastatur in den Bootloader-Modus, entweder durch Betätigung des physischen `RESET` Schalters - meist auf der Unterseite der Platine - oder durch das Auslösen des Key-Codes `RESET` bzw. `KC_RESET` (sollte in der zur Tastatur gehörigen `keycode.c` zu entnehmen sein). Sollte deine Tastatur weder noch besitzen, versuche es damit die `Escape`-Taste oder `Leertaste + B` zu halten während Du die Tastatur mit dem PC verbindest (Siehe auch [Bootmagic](de/feature_bootmagic.md) für weitere Details). Ein paar Tastaturen benutzen das [Command](de/feature_command.md)-Feature an Stelle von Bootmagic; in diesem Fall kannst du mit den Tastenkombinationen `linkes Shift + rechtes Shift + B` oder `linkes Shift + rechtes Shift + Escape` zu jeder Zeit in den Bootloader wechseln solange die Tastatur verbunden ist. |
||||
|
||||
Eingie Tastaturen haben u.U. spezielle Anweisungen um in den Bootloader-Modus zu gelangen. Zum Beispiel kann die [Bootmagic-Lite](de/feature_bootmagic.md#bootmagic-lite)-Taste (default: Escape) auf eine andere Taste gemappt sein; oder die magische Kombination (default: linkes Shift+rechtes Shift) verwendet anstatt Shift die STRG-Tasten. Die zur Tastatur gehörige README sollte dir Aufschluss darüber geben wie der Bootloader-Modus ausgelöst werden kann wenn Du unsicher bist. |
||||
|
||||
Um ein Gerät mit USBaspLoader in den Bootloader-Modus zu versetzen, halte `BOOT` gedrückt während Du den `RESET`-Knopf drückst. |
||||
Alternativ, halte `BOOT` gedrückt während Du das USB-Kabel einsteckst. |
||||
|
||||
Zadig sollte das Bootloader-Gerät automatisch erkennen. Manchmal musst Du zusätzlich noch **Options → List All Devices** auswählen. |
||||
|
||||
- Tastaturen mit Atmel AVR MCUs sollten als `ATm32U4DFU` (oder ähnlich) angezeigt werden, mit der Vendor ID `03EB`. |
||||
- USBasp werden als `USBasp` angezeigt, mit VID/PID `16C0:05DC`. |
||||
- Tastaturen AVR controller und dem QMK-DFU Bootloader haben den namen `<Tastatur Name> Bootloader` und die VID `03EB`. |
||||
- Die meisten ARM Tastaturen werden als `STM32 BOOTLOADER` angezeigt, mit VID/PID `0483:DF11`. |
||||
|
||||
!> Sollte Zadig ein oder mehrere Geräte mit `HidUsb`-Treiber anzeigen, dann ist deine Tastatur wahrscheinlich nicht im Bootloader-Modus. Der Pfeil wird orange eingefärbt sein und Du wirst nach einer Bestätigung gefragt um Veränderungen am System vorzunehmen. In diesem Fall **fahre nicht fort**! |
||||
|
||||
Wenn der Pfeil grün angezeigt wird, wähle den Treiber aus und klicke auf **Treiber installieren**. Der `libusb-win32`-Treiber sollte gewöhnlich für AVR verwendet werden und `WinUSB` für ARM. Sollte es danach noch nicht möglich sein die Tastatur zu flashen, versuche es mit einem anderen Treiber. Für USBaspLoader Geräte, die über die Befehlszeile mit MSYS2 geflasht werden, wird der `libusbk`-Treiber empfohlen. Ansonsten sollte `libusb-win32` funktionieren wenn die QMK Toolbox verwendet wird. |
||||
|
||||
 |
||||
|
||||
Entferne nun deine Tastatur und verbinde sie erneut um sicherzugehen dass der neue Treiber erfolgreich installiert wurde. Wenn Du QMK Toolbox benutzt, starte die Anwendung zur Sicherheit einmal neu, da Veränderungen am Treiber manchmal nicht richtig erkannt werden. Wenn dies immer noch nicht erfolgreich war hilft es an dieser Stelle manchmal ein Neustart des Computers. |
||||
|
||||
## Wiederherstellung einer Installation für ein falsches Gerät |
||||
|
||||
Wenn Du feststellst dass Du anschließend auf deiner Tastatur nicht mehr tippen kannst, ist etwas bei der Installation schief gelaufen. Ein häufiger Fehler ist es dass die Tastatur nicht im Bootloader-Modus war und stattdessen der Treiber für das HID-Gerät ersetzt wurde. Dies kannst Du einfach mit Zadig überprüfen, eine funktionierende Tastatur verwendet als Treiber `HidUsb` auf allen Interfaces . |
||||
|
||||
 |
||||
|
||||
Öffne den Geräte-Manager und suche nach einem Gerät das wie deine Tastatur aussieht. |
||||
|
||||
 |
||||
|
||||
Rechtsklick und **Gerät deinstallieren** anklicken. Bitte gehe sicher dass in diesem Schritt auch **Treibersoftware für dieses Gerät löschen** markiert ist. |
||||
|
||||
 |
||||
|
||||
Klick **Aktion → Suche nach veränderter Hardware**. Nun solltest Du wieder in der Lage sein normal zu tippen. Vergewissere dich mit Hilfe von Zadig dass die Tastatur nun `HidUsb` als Treiber verwendet. Wenn dies der Fall ist sollte wieder alles funktionieren. |
@ -0,0 +1,22 @@ |
||||
# Anleitung für absolute Beginner |
||||
QMK ist eine mächtige Open Source Firmware für mechanische Tastaturen. Mit QMK kannst Du deine Tastatur sowohl sehr einfach als auch sehr umfangreich anpassen. Menschen unterschiedlichen Wissensstandes - vom kompletten Anfänger bis zum erfahrenen Programmierer - haben ihre Tastaturen mit QMK erfolgreich auf ihre persönlichen Bedürfnisse angepasst. Diese Anleitung soll Dir unabhängig von deinen Vorkenntnissen dabei helfen dies ebenfalls zu bewältigen. |
||||
|
||||
Bist Du unsicher ob deine Tastatur QMK unterstützt? Wenn es eine mechanische Tastatur ist, die Du selbst gebaut hast, stehen deine Chancen gut. Wir unterstützen eine [Vielzahl](https://qmk.fm/keyboards/) selbst gebauter Tastaturen, sodass selbst wenn deine jetzige Tastatur nicht unterstützt wird Du keine Probleme haben solltest eine für deine Anforderungen zu finden. |
||||
|
||||
## Übersicht |
||||
|
||||
Diese Anleitung ist in 7 Abschnitte unterteilt: |
||||
|
||||
* [Die ersten Schritte](newbs_getting_started.md) |
||||
* [Die erste Firmware auf der Kommandozeile erzeugen](newbs_building_firmware.md) |
||||
* [Die erste Firmware mit der Online GUI erzeugen](newbs_building_firmware_configurator.md) |
||||
* [Firmware flashen](newbs_flashing.md) |
||||
* [Testen und Debuggen](newbs_testing_debugging.md) |
||||
* [Git Leitfaden](newbs_best_practices.md) |
||||
* [Weitere hilfreiche Ressourcen für Anfänger](newbs_learn_more_resources.md) |
||||
|
||||
Diese Anleitung richtet sich an Personen, die vorher noch nie Software kompiliert haben. Die Entscheidungen und Empfehlungen basieren auf dieser Grundannahme. Es gibt unterschiedliche Herangehensweisen für viele der Prozeduren und wir unterstützen die meisten Alternativen. Wenn Du mal nicht weiter weißt oder Dir nicht sicher bist, wie Du an ein Problem herangehen sollst, kannst Du uns gerne [um Hilfe bitten](getting_started_getting_help.md). |
||||
|
||||
## Weitere Ressourcen |
||||
|
||||
* [Thomas Baart's QMK Basics Blog](https://thomasbaart.nl/category/mechanical-keyboards/firmware/qmk/qmk-basics/) – Ein äußerst hilfreicher Blog eines Community-Mitglieds, der einige Grundlagen der QMK-Firmware aus der Sicht des Benutzers erklärt (auf Englisch). |
@ -0,0 +1,78 @@ |
||||
# Eine eigene Firmware erstellen |
||||
|
||||
Nachdem Du nun eine funktionierende Entwicklungsumgebung aufgesetzt hast, bist Du nun bereit, deine eigene Firmware zu erstellen. Dieses Sektion des Guides wird zwischen drei Programmen hin- und herwechseln: deinem Dateimanager, deinem Texteditor und der Befehlszeile. Lasse diese drei Fenster geöffnet, bis Du fertig und zufrieden mit deiner Tastatur-Firmware bist. |
||||
|
||||
Solltest Du die Befehlszeile zwischenzeitlich geschlossen haben, vergiss nicht wieder in das richtige Verzeichnis zu navigieren, benutze dazu den Befehl `cd qmk_firmware`. |
||||
|
||||
## Navigiere in deinen Keymap Ordner |
||||
|
||||
Beginne damit, in das `keymaps` Verzeichnis für deine Tastatur zu navigieren. |
||||
|
||||
Wenn Du macOS oder Windows benutzt, kannst Du einfach in das keymaps Verzeichnis wechseln. |
||||
|
||||
?> macOS:<br> |
||||
open keyboards/<keyboard_folder>/keymaps |
||||
|
||||
?> Windows:<br> |
||||
start .\\keyboards\\<keyboard_folder>\\keymaps |
||||
|
||||
## Eine Kopie der `default` Tastaturbelegung erstellen |
||||
|
||||
Wenn Du den `keymaps` Ordner geöffnet hast, solltest Du zuerst eine Kopie des `default` Verzeichnisses erstellen. Wir empfehlen dafür deinen GitHub Benutzernamen zu verweden, aber Du kannst auch jeden anderen Namen verwenden solange er nur aus Kleinbuchstaben, Zahlen und Unterstrichen besteht. |
||||
|
||||
Um den Prozess zu automatisieren kannst Du dazu auch das Skript `new_keymap.sh` verwenden. |
||||
|
||||
Navigiere dazu in das `qmk_firmware/util` Verzeichnis und gib folgenden Befehl ein: |
||||
|
||||
``` |
||||
./new_keymap.sh <keyboard path> <username> |
||||
``` |
||||
|
||||
Um zum Beispiel den Benutzernamen John für die Tastaturbelegung eines 1up60hse zu verwenden, würdest Du Folgendes eingeben: |
||||
|
||||
``` |
||||
./new_keymap.sh 1upkeyboards/1up60hse john |
||||
``` |
||||
|
||||
## Öffne `keymap.c` in deinem bevorzugtem Text Editor |
||||
|
||||
Öffne deine `keymap.c`. In dieser Datei findest Du die Strukturen, die das Verhalten deiner Tastatur bestimmen. Oben in der `keymap.c` befinden sich Definitionen (defines) und Aufzählungen (enums), die die Tastaturbelegung leserlicher machen sollen. Weiter unten wirst Du eine Zeile finden, die wie folgt aussieht: |
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
||||
|
||||
Diese Zeile markiert den Anfang der Liste der Ebenen (Layers). Darunter befinden sich Zeilen die entweder `LAYOUT` oder `KEYMAP` enthalten, das deutet auf den Start einer Ebene hin. Danach folgt eine Liste von Tasten, die dieser Ebene zugewiesen sind. |
||||
|
||||
!> Beim Bearbeiten einer Tastaturbelegung solltest Du darauf achten, keine Kommata hinzuzufügen oder zu entfernen. Ansonsten kann dies dazu führen, dass deine Firmware nicht mehr kompiliert und es ist nicht immer einfach festzustellen, wo genau ein Komma zuviel oder zu wenig ist. Die letzte Zeile hat am Ende kein Komma, die Zeilen davor jedoch schon. |
||||
|
||||
## Personalisiere die Tastaturbelegung nach deinen Wünschen |
||||
|
||||
Wie Du diesen Schritt abschließt ist vollkommen Dir überlassen. Ändere die eine Sache die Dich stört oder verändere alles von Grund auf. Du kannst Ebenen entfernen die Du nicht brauchst oder Neue hinzufügen, bis zu 32 Stück. Die folgende Dokumentation verrät Dir was Du hier alles definieren kannst: |
||||
|
||||
* [Keycodes](de/keycodes.md) |
||||
* [Features](de/features.md) |
||||
* [FAQ](de/faq.md) |
||||
|
||||
?> Während Du langsam ein Gefühl dafür kriegst wie Keymaps funktionieren, solltest Du darauf achten nicht zuviel auf einmal zu verändern. Größere Änderungen machen es schwieriger, Probleme zu debuggen. |
||||
|
||||
## Deine Firmware erzeugen |
||||
|
||||
Wenn Du damit fertig bist, deine Tastaturbelegung anzupassen, musst Du noch die Firmware erzeugen. Öffne dazu wieder die Befehlszeile und führe folgenden Befehl aus: |
||||
|
||||
make <my_keyboard>:<my_keymap> |
||||
|
||||
Wenn deine Tastaturbelegung z.B. "xyverz" heißt und Du die Belegung für ein rev5 planck erzeugen möchtest, lautet der Befehl: |
||||
|
||||
make planck/rev5:xyverz |
||||
|
||||
Während des Kompiliervorgangs wird viel Text auf dem Bildschirm ausgegeben. Es sollte am Ende mit etwas enden das ungefähr so aussieht: |
||||
|
||||
``` |
||||
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 |
||||
``` |
||||
|
||||
## Deine Firmware flashen |
||||
Bitte fahre mit [Firmware flashen](de/newbs_flashing.md) fort, um zu erfahren, wie Du deine neue Firmware auf deine Tastatur flashen kannst. |
@ -0,0 +1,369 @@ |
||||
# Deine Tastatur flashen |
||||
|
||||
Nachdem deine Firmware nun fertig ist musst Du Sie noch auf deine Tastatur flashen. |
||||
|
||||
## Flash-Vorgang mit QMK Toolbox |
||||
|
||||
Der einfachste Weg deine Tastatur zu flashen ist mit Hilfe der [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) |
||||
|
||||
Leider ist die QMK Toolbox derzeit nur für Windows und macOS verfügbar. Wenn Du Linux benutzt (oder es vorziehst die Firmware mit der Kommandozeile zu flashen) solltest Du die Methode benutzen die [hier](de/newbs_flashing.md#tastatur-mit-der-befehlszeile-flashen) beschrieben wird. |
||||
|
||||
### Lade die Datei in QMK Toolbox |
||||
|
||||
Beginne damit die Datei in der QMK Toolbox Anwendung zu laden. Versichere dich dass Du die Firmware-Datei im Finder oder Explorer findest. Deine Tastatur-Firmware sollte entweder vom Typ `.hex` oder `.bin` sein sein. QMK sollte die für deine Tastatur entsprechende Datei automatisch in das Root-Verzeichnis (normalerweise `qmk_firmware`) kopieren. |
||||
|
||||
?> Wenn Du Windows oder macOS benutzt kannst Du mit folgenden Befehlen ganz einfach das aktuelle Firmware-Verzeichnis im Explorer oder Finder öffnen. |
||||
|
||||
#### Windows: |
||||
|
||||
``` start . ``` |
||||
|
||||
#### macOS: |
||||
|
||||
``` open . ``` |
||||
|
||||
Die Firmware-Dateien folgen dabei immer folgendem Schema: |
||||
|
||||
<meine_Tastatur>_<meine_Tastaturbelegung>.{bin,hex} |
||||
|
||||
Zum Beispiel würde ein `planck/rev5` mit der `default` Tastaturbelegung folgenden Dateinamen haben: |
||||
|
||||
planck_rev5_default.hex |
||||
|
||||
Wenn Du die Firmware-Datei gefunden hast kannst Du sie in das "Local file" ("Lokale Datei") Feld in der QMK Toolbox ziehen, alternativ kannst Du auf "Öffnen" klicken und in das Verzeichnis navigieren indem sich die Firmware-Datei befindet. |
||||
|
||||
### Die Tastatur in den DFU (Bootloader) Modus versetzen |
||||
|
||||
Um deine angepasste Firmware auf deine Tastatur zu flashen musst Du diese erst in einen speziellen "flashing"-Modus versetzen. Während die Tastatur in diesem Modus ist kannst Du nicht auf ihr tippen oder sie wie gewohnt als Tastatur benutzen. Es ist wichtig dass der flashing-Prozesses nicht unterbrochen oder die Tastatur ausstöpselst wird, da der Vorgang ansonst wiederholt werden muss. |
||||
|
||||
Verschiedene Tastaturen verwenden unterschiedliche Methoden um in den Bootloader-Modus zu gelangen. Wenn dein PCB im Moment QMK oder TMK verwendet und Du keine spezifischen Anweisungen erhalten hast probiere die folgenden Methoden in dieser Reihenfolge: |
||||
|
||||
* Halte beide Shift-Tasten und drücke `Pause` |
||||
* Halte beide Shift-Tasten und drücke `B` |
||||
* Entferne deine Tastatur vom Computer, drücke gleichzeitig `Leertaste` und `B`, verbinde die Tastatur wieder mit dem Computer und warte eine Sekunde bevor Du die Tasten wieder loslässt. |
||||
* Drücke den physischen `RESET`-Knopf auf der Unterseite des PCBs |
||||
* Suche auf dem PCB den Pin mit dem Label `RESET`, verbinde diesen mit deinem GND-Pin |
||||
* Suche auf dem PCB den Pin mit dem Label `BOOT0`, verbinde diesen mit GND und schließe die Tastatur wieder an den PC an TODO: DIS IS DANGEROUS!! |
||||
|
||||
Wenn Du damit erfolgreich warst solltest Du in der QMK Toolbox eine Nachricht sehen die ungefähr so aussieht: |
||||
|
||||
``` |
||||
*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390 |
||||
*** DFU device connected |
||||
``` |
||||
|
||||
### Tastatur flashen |
||||
|
||||
Klicke auf den `Flash`-Knopf in der QMK Toolbox. Die Ausgabe wird ungefähr so aussehen: |
||||
|
||||
``` |
||||
*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390 |
||||
*** DFU device connected |
||||
*** Attempting to flash, please don't remove device |
||||
>>> dfu-programmer atmega32u4 erase --force |
||||
Erasing flash... Success |
||||
Checking memory from 0x0 to 0x6FFF... Empty. |
||||
>>> dfu-programmer atmega32u4 flash qmk_firmware/clueboard_66_hotswap_skully.hex |
||||
Checking memory from 0x0 to 0x55FF... Empty. |
||||
0% 100% Programming 0x5600 bytes... |
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success |
||||
0% 100% Reading 0x7000 bytes... |
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success |
||||
Validating... Success |
||||
0x5600 bytes written into 0x7000 bytes memory (76.79%). |
||||
>>> dfu-programmer atmega32u4 reset |
||||
|
||||
*** DFU device disconnected |
||||
*** Clueboard - Clueboard 66% HotSwap connected -- 0xC1ED:0x2390 |
||||
``` |
||||
|
||||
## Tastatur mit der Befehlszeile flashen |
||||
|
||||
Zunächst solltest Du versuchen herauszufinden welchen Bootlader deine Tastatur benutzt. Diese vier Bootloader sind am Weitesten verbreitet: |
||||
|
||||
| MCU | Bootloader | |
||||
| --- | --- | |
||||
| Pro-Micro und Klone | CATERINA | |
||||
| Teensy | Halfkay | |
||||
| OLKB Boards | QMK-DFU | |
||||
| sonstige atmega32u4 | DFU | |
||||
|
||||
Auf der Seite [Flash Anleitung und Bootloader Informationen](de/flashing.md) kannst Du mehr über das Thema erfahren. |
||||
|
||||
Wenn Du weißt welchen Bootloader deine Tastaur verwendet, kannst Du diese Information bei der Kompilation hinzufügen um den Flash-Vorgang mit dem `make`-Befehl zu automatisieren. |
||||
```rules.mk |
||||
... |
||||
BOOTLOADER = caterina |
||||
... |
||||
``` |
||||
|
||||
### DFU |
||||
|
||||
Wenn Du den DFU-Bootloader verwendest und Du bereit bist deine Firmware zu kompilieren und zu flashen, öffne ein Befehlszeile und führe folgenden Befehl aus: |
||||
|
||||
make <meine_Tastatur>:<meine_Tastaturbelegung>:dfu |
||||
|
||||
Wenn deine Tastaturbelegung z.B den Namen "xzverz" trägt und Du ein rev5 planck flashen möchtest sähe der Befehl wie folgt aus: |
||||
|
||||
make planck/rev5:xyverz:dfu |
||||
|
||||
|
||||
Nachdem der Vorgang abgeschlossen ist sollte die Ausgabe ungefähr so aussehen: |
||||
|
||||
``` |
||||
Linking: .build/planck_rev5_xyverz.elf [OK] |
||||
Creating load file for flashing: .build/planck_rev5_xyverz.hex [OK] |
||||
Copying planck_rev5_xyverz.hex to qmk_firmware folder [OK] |
||||
Checking file size of planck_rev5_xyverz.hex |
||||
* File size is fine - 18574/28672 |
||||
``` |
||||
|
||||
Wenn dieser Punkt erreicht ist wird das Build-Skript alle 5 Sekunden nach einem DFU Bootloader suchen. Dieser Vorgang wird wiederholt bis er erfolgreich ist oder abgebrochen wird. |
||||
|
||||
dfu-programmer: no device present. |
||||
Error: Bootloader not found. Trying again in 5s. |
||||
|
||||
Wenn diese Nachricht erscheint konnte das Build-Skript den Controller nicht eigenständig in den DFU Modus versetzen (z.B. weil der Modus in rules.mk falsch gesetzt wurde oder ein Problem mit der Hardware besteht), wenn dies eintritt musst Du die oben beschrieben Schritte benutzen um den Controller in den DFU Modus zu versetzen. Danach sollte die Ausgabe ungefähr so aussehen: |
||||
|
||||
``` |
||||
*** Attempting to flash, please don't remove device |
||||
>>> dfu-programmer atmega32u4 erase --force |
||||
Erasing flash... Success |
||||
Checking memory from 0x0 to 0x6FFF... Empty. |
||||
>>> dfu-programmer atmega32u4 flash qmk_firmware/clueboard_66_hotswap_skully.hex |
||||
Checking memory from 0x0 to 0x55FF... Empty. |
||||
0% 100% Programming 0x5600 bytes... |
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success |
||||
0% 100% Reading 0x7000 bytes... |
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success |
||||
Validating... Success |
||||
0x5600 bytes written into 0x7000 bytes memory (76.79%). |
||||
>>> dfu-programmer atmega32u4 reset |
||||
``` |
||||
|
||||
?> Wenn Du mit diesem Schritt Probleme hast (z.B. `dfu-programmer: no device present`) hilft dir hoffentlich der Abschnitt [Häufig gestellte Fragen (Build/Kompilieren)](de/faq_build.md). |
||||
|
||||
#### DFU Befehle |
||||
|
||||
Es gibt verschiedene DFU Befehle um die Firmware auf ein DFU Gerät zu flashen: |
||||
|
||||
* `:dfu` - Dies ist die default Option. Es wird gecheckt ob ein DFU Gerät verfügbar ist, ist dies der Fall wird die Firmware geflasht. Dieser Check wird alle 5 Sekunden ausgeführt bis ein DFU Gerät erkannt wird. |
||||
* `:dfu-ee` - Der Flash-Vorgang benutzt eine `.eep` Datei anstatt einer `.hex` Datei. Dies ist eher unüblich. |
||||
* `:dfu-split-left` - Dies flasht die Firmware wie gewohnt (`:dfu`). Allerdings nur die "linke Seite" der EEPROM für geteilte Tastaturen. _Dies ist ideal für auf Elite C basierenden geteilten Tastaturen._ |
||||
* `:dfu-split-right` - Dies flasht die Firmware wie gewohnt (`:dfu`). Allerdings nur die "rechte Seite" der EEPROM für geteilte Tastaturen. _Dies ist ideal für auf Elite C basierenden geteilten Tastaturen._ |
||||
|
||||
|
||||
### Caterina |
||||
Für Arduinos und andere ProMicro Klone (z.B. SparkFun ProMicro), wenn Du bereit bist zu kompilieren und die Tastatur zu flashen, öffne ein Befehlszeilen-Fenster und führe den Build-Befehl aus: |
||||
|
||||
make <meine_Tastatur>:<meine_Tastaturbelegung>:avrdude |
||||
|
||||
Wenn deine Tastaturbelegung zum Beispiel den Namen "xyverz" hat und Du eine Tastaturbelegung für ein "rev2 Lets Split" erzeugen möchtest, lautet der Befehl dafür: |
||||
|
||||
make lets_split/rev2:xyverz:avrdude |
||||
|
||||
Nachdem die Kompilation abgeschlossen ist sollte die Ausgabe ungefähr so aussehen: |
||||
|
||||
``` |
||||
Linking: .build/lets_split_rev2_xyverz.elf [OK] |
||||
Creating load file for flashing: .build/lets_split_rev2_xyverz.hex [OK] |
||||
Checking file size of lets_split_rev2_xyverz.hex [OK] |
||||
* File size is fine - 27938/28672 |
||||
Detecting USB port, reset your controller now.............. |
||||
``` |
||||
|
||||
Nun wird die Tastatur automatisch zurückgesetzt und das Skript wird die Firmware flashen sobald es den Bootloader erkennt. Die Ausgabe sollte ungefähr so aussehen: |
||||
|
||||
``` |
||||
Detected controller on USB port at /dev/ttyS15 |
||||
|
||||
Connecting to programmer: . |
||||
Found programmer: Id = "CATERIN"; type = S |
||||
Software Version = 1.0; No Hardware Version given. |
||||
Programmer supports auto addr increment. |
||||
Programmer supports buffered memory access with buffersize=128 bytes. |
||||
|
||||
Programmer supports the following devices: |
||||
Device code: 0x44 |
||||
|
||||
avrdude.exe: AVR device initialized and ready to accept instructions |
||||
|
||||
Reading | ################################################## | 100% 0.00s |
||||
|
||||
avrdude.exe: Device signature = 0x1e9587 (probably m32u4) |
||||
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed |
||||
To disable this feature, specify the -D option. |
||||
avrdude.exe: erasing chip |
||||
avrdude.exe: reading input file "./.build/lets_split_rev2_xyverz.hex" |
||||
avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex auto detected as Intel Hex |
||||
avrdude.exe: writing flash (27938 bytes): |
||||
|
||||
Writing | ################################################## | 100% 2.40s |
||||
|
||||
avrdude.exe: 27938 bytes of flash written |
||||
avrdude.exe: verifying flash memory against ./.build/lets_split_rev2_xyverz.hex: |
||||
avrdude.exe: load data flash data from input file ./.build/lets_split_rev2_xyverz.hex: |
||||
avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex auto detected as Intel Hex |
||||
avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex contains 27938 bytes |
||||
avrdude.exe: reading on-chip flash data: |
||||
|
||||
Reading | ################################################## | 100% 0.43s |
||||
|
||||
avrdude.exe: verifying ... |
||||
avrdude.exe: 27938 bytes of flash verified |
||||
|
||||
avrdude.exe: safemode: Fuses OK (E:CB, H:D8, L:FF) |
||||
|
||||
avrdude.exe done. Thank you. |
||||
``` |
||||
Sollten dabei Probleme auftreten (z.B. "Zugriff verweigert" / "Permission denied") muss der Make-Befehl mit privilegierten Berechtigungen ausgeführt werden: |
||||
|
||||
sudo make <meine_Tastatur>:<meine_Tastaturbelegung>:avrdude |
||||
|
||||
Zusätzlich ist es möglich mehrere Tastaturen in einem Vorgang zu flashen: |
||||
|
||||
make <keyboard>:<keymap>:avrdude-loop |
||||
|
||||
Du kannst den Loop mit STRG + C unterbrechen sobald der Vorgang abgeschlossen ist. Die korrekte Tastenkombination kann abweichen und hängt vom Betriebssystem ab. |
||||
|
||||
|
||||
### HalfKay |
||||
|
||||
Für Tastaturen mit PJRC Controllern (Teensy's), wenn Du bereit bist zu kompilieren und die Tastatur zu flashen, öffne ein Befehlszeilen-Fenster und führe den Build-Befehl aus: |
||||
|
||||
make <meine_Tastatur>:<meine_Tastaturbelegung>:teensy |
||||
|
||||
Wenn deine Tastaturbelegung zum Beispiel den Namen "xyverz" hat und Du eine Tastaturbelegung für ein Ergodox oder Ergodox EZ erzeugen möchtest, lautet der Befehl dafür: |
||||
|
||||
make ergodox_ez:xyverz:teensy |
||||
|
||||
Nachdem die Kompilation abgeschlossen ist sollte die Ausgabe ungefähr so aussehen: |
||||
|
||||
``` |
||||
Linking: .build/ergodox_ez_xyverz.elf [OK] |
||||
Creating load file for flashing: .build/ergodox_ez_xyverz.hex [OK] |
||||
Checking file size of ergodox_ez_xyverz.hex [OK] |
||||
* File size is fine - 25584/32256 |
||||
Teensy Loader, Command Line, Version 2.1 |
||||
Read "./.build/ergodox_ez_xyverz.hex": 25584 bytes, 79.3% usage |
||||
Waiting for Teensy device... |
||||
(hint: press the reset button) |
||||
``` |
||||
|
||||
An diesem Punkt solltest Du die Tastatur zurücksetzen um den Flash-Vorgang auszulösen. Wenn dies abgeschlossen ist sollte die Ausgabe ungefähr so aussehen: |
||||
|
||||
``` |
||||
Found HalfKay Bootloader |
||||
Read "./.build/ergodox_ez_xyverz.hex": 28532 bytes, 88.5% usage |
||||
Programming............................................................. |
||||
................................................... |
||||
Booting |
||||
``` |
||||
|
||||
### BootloadHID |
||||
|
||||
Für auf Bootmapper Client(BMC)/bootloaderHID/ATmega32A basierende Tastaturen, wenn Du bereit bist zu kompilieren und die Tastatur zu flashen, öffne ein Befehlszeilen-Fenster und führe den Build-Befehl aus: |
||||
|
||||
make <meine_Tastatur>:<meine_Tastaturbelegung>:bootloaderHID |
||||
|
||||
Wenn deine Tastaturbelegung zum Beispiel den Namen "xyverz" hat und Du eine Tastaturbelegung für ein jj40 erzeugen möchtest, lautet der Befehl dafür: |
||||
|
||||
make jj40:xyverz:bootloaderHID |
||||
|
||||
Nachdem die Kompilation abgeschlossen ist sollte die Ausgabe ungefähr so aussehen: |
||||
|
||||
``` |
||||
Linking: .build/jj40_default.elf [OK] |
||||
Creating load file for flashing: .build/jj40_default.hex [OK] |
||||
Copying jj40_default.hex to qmk_firmware folder [OK] |
||||
Checking file size of jj40_default.hex [OK] |
||||
* The firmware size is fine - 21920/28672 (6752 bytes free) |
||||
``` |
||||
|
||||
Wenn dieser Punkt erreicht ist wird das Build-Skript alle 5 Sekunden nach einem DFU Bootloader suchen. Dieser Vorgang wird wiederholt bis er erfolgreich ist oder abgebrochen wird. |
||||
|
||||
``` |
||||
Error opening HIDBoot device: The specified device was not found |
||||
Trying again in 5s. |
||||
``` |
||||
|
||||
An diesem Punkt solltest Du die Tastatur zurücksetzen um den Flash-Vorgang auszulösen. Wenn dies abgeschlossen ist sollte die Ausgabe ungefähr so aussehen: |
||||
|
||||
``` |
||||
Page size = 128 (0x80) |
||||
Device size = 32768 (0x8000); 30720 bytes remaining |
||||
Uploading 22016 (0x5600) bytes starting at 0 (0x0) |
||||
0x05580 ... 0x05600 |
||||
``` |
||||
|
||||
### STM32 (ARM) |
||||
|
||||
Für die meisten ARM Tastaturen (inkl. Proton C, Planck Rev 6 und Preonic Rev 3), wenn Du bereit bist zu kompilieren und die Tastatur zu flashen, öffne ein Befehlszeilen-Fenster und führe den Build-Befehl aus: |
||||
|
||||
make <meine_Tastatur>:<meine_Tastaturbelegung>:dfu-util |
||||
|
||||
Wenn deine Tastaturbelegung zum Beispiel den Namen "xyverz" hat und Du eine Tastaturbelegung für ein Planck Revision 6 erzeugen möchtest, benutze dafür den folgenden Befehl und reboote die Tastatur in den Bootloader (kurz bevor der Kompiliervorgang abgeschlossen ist): |
||||
|
||||
make planck/rev6:xyverz:dfu-util |
||||
|
||||
Nachdem der Kompiliervorgang abgeschlossen ist sollte die Ausgabe ungefähr so aussehen: |
||||
|
||||
Für auf Bootmapper Client(BMC)/bootloaderHID/ATmega32A basierende Tastaturen, wenn Du bereit bist zu kompilieren und die Tastatur zu flashen, öffne ein Befehlszeilen-Fenster und führe den Build-Befehl aus: |
||||
|
||||
make <meine_Tastatur>:<meine_Tastaturbelegung>:bootloaderHID |
||||
|
||||
Wenn deine Tastaturbelegung zum Beispiel den Namen "xyverz" hat und Du eine Tastaturbelegung für ein jj40 erzeugen möchtest, lautet der Befehl dafür: |
||||
``` |
||||
Linking: .build/planck_rev6_xyverz.elf [OK] |
||||
Creating binary load file for flashing: .build/planck_rev6_xyverz.bin [OK] |
||||
Creating load file for flashing: .build/planck_rev6_xyverz.hex [OK] |
||||
|
||||
Size after: |
||||
text data bss dec hex filename |
||||
0 41820 0 41820 a35c .build/planck_rev6_xyverz.hex |
||||
|
||||
Copying planck_rev6_xyverz.bin to qmk_firmware folder [OK] |
||||
dfu-util 0.9 |
||||
|
||||
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. |
||||
Copyright 2010-2016 Tormod Volden and Stefan Schmidt |
||||
This program is Free Software and has ABSOLUTELY NO WARRANTY |
||||
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ |
||||
|
||||
Invalid DFU suffix signature |
||||
A valid DFU suffix will be required in a future dfu-util release!!! |
||||
Opening DFU capable USB device... |
||||
ID 0483:df11 |
||||
Run-time device DFU version 011a |
||||
Claiming USB DFU Interface... |
||||
Setting Alternate Setting #0 ... |
||||
Determining device status: state = dfuERROR, status = 10 |
||||
dfuERROR, clearing status |
||||
Determining device status: state = dfuIDLE, status = 0 |
||||
dfuIDLE, continuing |
||||
DFU mode device DFU version 011a |
||||
Device returned transfer size 2048 |
||||
DfuSe interface name: "Internal Flash " |
||||
Downloading to address = 0x08000000, size = 41824 |
||||
Download [=========================] 100% 41824 bytes |
||||
Download done. |
||||
File downloaded successfully |
||||
Transitioning to dfuMANIFEST state |
||||
``` |
||||
|
||||
#### STM32 Befehle |
||||
|
||||
Für Tastaturen mit STM32 Controller sind die DFU Befehle wie folgt: |
||||
|
||||
* `:dfu-util` - The default command for flashing to STM32 devices. |
||||
* `:dfu-util` - Der Standard-Befehl für STM32 Geräte. |
||||
* `:dfu-util-wait` - Funktioniert wie der Standard-Befehl, aber mit einem 10 Sekunden Timeout bevor erneut versucht wird die Firmware zu flashen. Mit dem Parameter `TIME_DELAY=20` auf der Befehlszeile kann der Timeout beeinflusst werden. |
||||
* z.B.: `make <meine_Tastatur>:<meine_Tastaturbelegung>:dfu-util TIME_DELAY=5` |
||||
* `:dfu-util-split-left` - Gleiche Funktionsweise wie `dfu-util`, jedoch wird zusätzlich das EEPROM Setting "linke Seite" für geteilte Tastaturen gesetzt. |
||||
* `:dfu-util-split-right` - Gleiche Funktionsweise wie `dfu-util`, jedoch wird zusätzlich das EEPROM Setting "rechte Seite" für geteilte Tastaturen gesetzt. |
||||
|
||||
## Probier's aus! |
||||
|
||||
Herzlichen Glückwunsch! Deine individuell angepasst Firmware wurde auf deine Tastatur übertragen! |
||||
|
||||
Probiere deine neue Tastatur aus und gehe sicher dass alles wie gewünscht funktioniert. Wir haben einen weiteren Artikel zum Thema [Testen und Debuggen](de/newbs_testing_debugging.md) verfasst der sich mit Problembeseitigung beschäftigt um den Beginnger-Guide abzuschließen. |
@ -0,0 +1,101 @@ |
||||
# Einleitung |
||||
Genau wie in einem Computer befindet sich auch in einer Tastatur ein Prozessor. |
||||
|
||||
Dieser Prozessor führt Software aus, die registriert wenn Tasten gedrückt bzw. wieder losgelassen werden und leitet die entsprechenden Signale an den Computer weiter. |
||||
|
||||
QMK übernimmt die Rolle dieser Software und teilt dem Host-Computer den aktuellen Zustand der Tastatur mit. Wenn Du eine Tastaturbelegung definierst, ist dies äquivalent zu einem ausführbarem Programm, das auf deiner Tastatur läuft. |
||||
|
||||
QMK möchte seine BenutzerInnen in die Lage versetzen, simple Aufgaben möglichst einfach zu gestalten und gleichzeitig komplexe Dinge zu ermöglichen, die mit normalen Tastaturen ohne zusätzliche Software undenkbar wären. Du musst nicht programmieren können, um abgefahrene Tastaturbelegungen zu gestalten - es reicht wenn Du eine Idee hast und ein paar einfache syntaktische Regeln verstehen kannst. |
||||
|
||||
# Los geht's! |
||||
Bevor Du damit loslegen kannst, deine Tastaturbelegung zu erstellen, musst Du ein wenig Software installieren und Dir eine Entwicklungsumgebung aufsetzen. Die gute Nachricht ist, dass das nur einmal erledigt werden muss, egal für wie viele verschiedene Tastaturen Du hinterher Firmware entwickeln willst. |
||||
|
||||
Wenn Du es vorziehst mit einer grafischen Oberfläche zu entwickeln kannst Du auch dazu gerne direkt mit dem online [QMK Konfigurator](https://config.qmk.fm) loslegen. Siehe auch: [Firmware mit der Online GUI erzeugen](de/newbs_building_firmware_configurator.md) |
||||
|
||||
## Software herunterladen |
||||
|
||||
### Text Editor |
||||
|
||||
Du wirst ein Programm benötigen, mit dem Du **plain text** (= reiner Text) Dateien bearbeiten und speichern kannst. Wenn Du Windows benutzt, reicht dafür schon das normale `Notepad` und für Linux z.B. `gedit` oder `leafpad`. Beide sind sehr rudimentäre Editoren deren Funktionsumfang aber vollkommen ausreicht. Für macOS' standard `TextEdit` muss man ein bisschen vorsichtig sein und darauf achten, beim Speichern explizit unter _Format_ die Option _Reiner Text_ auszuwählen. |
||||
|
||||
Ansonsten ist es empfehlenswert, einen Editor herunterzuladen der für die Programmierung und das Bearbeiten von Code ausgelegt ist wie z.b [Notepad++](http://notepad-plus-plus.org/), [Sublime Text](https://www.sublimetext.com/) oder [VS Code](https://code.visualstudio.com/). |
||||
|
||||
?> Immer noch unsicher, welcher Text Editor der Richtige für Dich ist? Laurence Bradford hat eine hervorragende [Einleitung](https://learntocodewith.me/programming/basics/text-editors/) zu dem Thema geschrieben (auf Englisch). |
||||
|
||||
### QMK Toolbox |
||||
|
||||
QMK Toolbox ist ein optionales grafisches Programm für Windows und macOS, das es erleichtern soll, deine Tastatur zu programmieren und zu debuggen. Du wirst es höchstwahrscheinlich früher oder später als unverzichtbar ansehen, wenn es darum geht eine Tastatur einfach zu flashen oder zu debuggen, da es ermöglicht, sich debug-Nachrichten direkt anzeigen zu lassen. |
||||
|
||||
[Hier kannst Du die aktuelle Version herunterladen.](https://github.com/qmk/qmk_toolbox/releases/latest) |
||||
|
||||
* Für Windows: `qmk_toolbox.exe` (portable) oder `qmk_toolbox_install.exe` (installer) |
||||
* Für macOS: `QMK.Toolbox.app.zip` (portable) oder `QMK.Toolbox.pkg` (installer) |
||||
|
||||
## Die Entwicklungsumgebung aufsetzen |
||||
|
||||
|
||||
Wir haben versucht, die Installation der Entwicklungsumgebung für QMK so einfach wie möglich zu gestalten. Alles, was Du tun musst, ist eine Linux oder Unix Umgebung aufzusetzen, danach macht QMK den Rest. |
||||
|
||||
?> Wenn Du das erste Mal mit der Linux/Unix Befehlszeile arbeitest, schadet es nicht, sich mit ein paar Grundlagen und Befehlen vertraut zu machen. Diese Ressourcen sollten ausreichen, um sich das Nötigste anzueignen um mit QMK arbeiten zu können:<br> |
||||
[Erforderliche Linux Grundlagen](https://www.guru99.com/must-know-linux-commands.html)<br> |
||||
[Noch ein paar Linux Befehle](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html) |
||||
|
||||
### Windows |
||||
|
||||
Du wirst MSYS2 (o.Ä.) und Git benötigen. |
||||
|
||||
* Befolge die Installationsanleitung auf der [MSYS2 Homepage](http://www.msys2.org) |
||||
* Schließe alle offenen MSYS2 Fenster und öffne ein neues MSYS2 MinGW 64-bit Terminal |
||||
* Installiere Git mit dem Kommando: `pacman -S git` |
||||
|
||||
### macOS |
||||
|
||||
Du wirst Homebrew benötigen. Folge dafür den Anweisungen auf der [Homebrew homepage](https://brew.sh). |
||||
|
||||
Nachdem Homebrew erfolgreich installiert ist, kannst Du mit _QMK aufsetzen_ fortfahren. |
||||
|
||||
### Linux |
||||
|
||||
Du benötigst Git, aber es ist ziemlich wahrscheinlich, dass es bereits installiert ist. Sollte dies nicht der Fall sein, kannst Du es mit dem folgenden Aufruf installieren: |
||||
|
||||
* Debian / Ubuntu / Devuan: `apt-get install git` |
||||
* Fedora / Red Hat / CentOS: `yum install git` |
||||
* Arch Linux: `pacman -S git` |
||||
|
||||
?> Docker ist ebenfalls eine Option für alle Plattformen. [Hier](de/getting_started_build_tools.md#docker) kannst Du dazu weitere Informationen finden. |
||||
|
||||
## QMK aufsetzen |
||||
Wenn Du damit fertig bist, deine Linux/Unix Umgebung zu installieren, kannst Du damit fortfahren QMK herunterzuladen. Dafür werden wir mit Git das QMK Repository "klonen". Öffne ein Terminal oder ein MSYS2 MinGW Fenster, dies wirst Du für den Rest der Anleitung benötigen. In diesem Fenster rufst Du nun die beiden folgenden Kommandos auf: |
||||
|
||||
```shell |
||||
git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git |
||||
cd qmk_firmware |
||||
``` |
||||
?> Wenn Du bereits weißt, [wie man GitHub benutzt](de/getting_started_github.md), empfehlen wir, dass Du Dir ein eigenen Fork erstellst. Wenn Du nicht weißt, was das bedeuten soll, kannst Du diesen Ratschlag getrost ignorieren. |
||||
|
||||
QMK liefert ein Script mit, das helfen soll, Dir alles Weitere abzunehmen. Du kannst es mit dem folgenden Befehl aufrufen: |
||||
|
||||
util/qmk_install.sh |
||||
|
||||
## Die Build-Umgebung testen |
||||
|
||||
Nun sollte hoffentlich alles Nötige für eine funktionierende QMK Build-Umgebung installiert sein und Du solltest in der Lage sein, die QMK-Firmware zu kompilieren. Um dies mit einer `default` Tastaturbelegung zu testen, kannst Du den folgenden Befehl ausprobieren: |
||||
|
||||
make <keyboard>:default |
||||
|
||||
Der Befehl um z.B. die Firmware für ein _Clueboard 66%_ zu erzeugen lautet: |
||||
|
||||
make clueboard/66/rev3:default |
||||
|
||||
Wenn es fertig ist, sollte der Output ungefähr so ähnlich wie das Folgende aussehen: |
||||
|
||||
``` |
||||
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) |
||||
``` |
||||
|
||||
# Eine eigene Tastaturbelegung erstellen |
||||
Du bist nun fertig mit dem Setup der Entwicklungsumgebung und solltest somit in der Lage sein, deine eigenen Tastaturbelegungen zu erstellen. Um fortzufahren, folge bitte der nächsten Anleitung unter [Die erste Firmware](de/newbs_building_firmware.md). |
@ -0,0 +1,14 @@ |
||||
# Lernmaterial |
||||
|
||||
Diese weiterführenden Ressourcen sind darauf ausgerichtet, Neulingen der QMK Commmunity mehr Informationen und ein besseres Verständnis zu einzelnen Themen zu bieten. |
||||
|
||||
Git Ressourcen: |
||||
|
||||
* [Gutes allgemeines Tutorial](https://www.codecademy.com/learn/learn-git) (auf Englisch) |
||||
* [Git spielerisch anhand von Beispielen lernen](https://learngitbranching.js.org/) (auf Englisch) |
||||
* [Mehr über den allgemeinen Umgang mit Github](getting_started_github.md) |
||||
* [Mehr über Git im Bezug zu QMK](contributing.md) |
||||
|
||||
Mehr über die Arbeit mit der Befehlszeile: |
||||
|
||||
* [Gutes allgemeines Tutorial über die Arbeit mit der Befehlszeile](https://www.codecademy.com/learn/learn-the-command-line) (auf Englisch) |
@ -0,0 +1,100 @@ |
||||
# Testen und Debuggen |
||||
|
||||
Nachdem Du deine Tastatur mit deiner angepassten Firmware geflasht hast, ist es nun an der Zeit sie auszuprobieren. Mit ein bisschen Glück sollte alles ohne Probleme funktionieren, wenn dies nicht der Fall ist, soll dieses Dokument dir dabei helfen, herauszufinden wo das Problem liegt. |
||||
|
||||
## Testen |
||||
|
||||
Die Tastatur zu testen ist relativ selbsterklärend. Drücke jede der Tasten um dich zu versichern, dass der gesendete Keyode der ist, den du erwarten würdest. Dafür gibt es sogar ein paar Programme die helfen sollen, dass keine Taste ausgelassen wurde. |
||||
|
||||
Anmerkung: Diese Programme werden weder von QMK bereitgestellt oder gutgeheißen. |
||||
|
||||
* [Switch Hitter](https://elitekeyboards.com/switchhitter.php) (Nur für Windows) |
||||
* [Keyboard Viewer](https://www.imore.com/how-use-keyboard-viewer-your-mac) (Nur für Mac) |
||||
* [Keyboard Tester](http://www.keyboardtester.com) (Web basiert) |
||||
* [Keyboard Checker](http://keyboardchecker.com) (Web basiert) |
||||
|
||||
## Debuggen |
||||
|
||||
Deine Tastatur wird Debug Informationen liefern wenn Du `CONSOLE_ENABLE = yes` in deiner `rules.mk` gesetzt hast. Die default-Ausgabe ist sehr beschränkt und kann wenn nötig durch die Aktivierung des Debug-Modes erhöht werden. Benutze dafür entweder den `DEBUG` Keycode in deiner Tastaturbelegung, das [Command](de/feature_command.md)-Feature oder füge den folgenden Code zu deiner Tastaturbelegung hinzu. |
||||
|
||||
```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; |
||||
} |
||||
``` |
||||
|
||||
### Debuggen mit der QMK Toolbox |
||||
|
||||
Für kompatible Plattformen kann die [QMK Toolbox](https://github.com/qmk/qmk_toolbox) benutzt werden um Debug-Nachrichten deiner Tastatur anzuzeigen. |
||||
|
||||
### Debuggen mit hid_listen |
||||
|
||||
Bevorzugst Du es lieber auf der Befehlszeile zu debuggen? Dafür eignet sich das Programm [hid_listen](https://www.pjrc.com/teensy/hid_listen.html) von PJRC. Binaries sind für Windows, Linux und MacOS verfügbar. |
||||
|
||||
<!-- FIXME: Describe the debugging messages here. --> |
||||
|
||||
## Eigene Debug-Nachrichten senden |
||||
|
||||
Manchmal ist es hilfreich Debug-Nachrichten innerhalb deines eigenen [Custom Codes](de/custom_quantum_functions.md) zu drucken. Das ist ziemlich einfach. Beginne damit `print.h` am Anfang deiner Datei zu inkludieren: |
||||
|
||||
#include <print.h> |
||||
|
||||
Danach stehen dir verschiedene Druck-Funktionen zur Verfügung: |
||||
|
||||
* `print("string")`: Druckt einen simplen String |
||||
* `uprintf("%s string", var)`: Druckt einen formatierten String |
||||
* `dprint("string")` Druckt einen simplen String, aber nur wenn der Debug-Mode aktiviert ist |
||||
* `dprintf("%s string", var)`: Druckt einen formatierten String, aber nur wenn der Debug-Mode aktiviert ist |
||||
|
||||
## Debug Beispiele |
||||
|
||||
Anbei findest Du eine Sammlung von hilfreichen Beispielen. Für weitere Informationen Informationen sei an dieser Stelle auf [Debugging/Troubleshooting QMK](de/faq_debug.md) verwiesen. |
||||
|
||||
### Which matrix position is this keypress? |
||||
### Welche Matrix Position hat dieser Tastenanschlag |
||||
|
||||
Beim Portieren, oder bei der Fehlerdiagnose von PCB Problemen, ist es nützlich sich anzeigen zu lassen ob ein Tastenanschlag richtig erkannt wurde. Um die Protokollierung für diesen Fall zu aktivieren, füge bitte folgenden Code zu deiner Tastaturbelegung `keymap.c` hinzu. |
||||
|
||||
```c |
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
||||
// Wenn 'console' aktiviert ist wird die Matrix-Position und der Status jedes Tastenanschlags ausgegeben |
||||
#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; |
||||
} |
||||
``` |
||||
|
||||
Beispiel Ausgabe: |
||||
```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 |
||||
``` |
||||
|
||||
### Wieviel Zeit wurde benötigt um einen Tastenanschlag zu detektieren? |
||||
|
||||
Wenn Performance-Probleme auftreten ist es hilfreich die Frequenz, mit der die Matrix gescannt wird, zu wissen. Um dies in diesem Fall zu aktiveren füge, den folgenden Code zu deiner Tastaturbelegung in `config.h` hinzu. |
||||
|
||||
```c |
||||
#define DEBUG_MATRIX_SCAN_RATE |
||||
``` |
||||
|
||||
Beispiel Ausgabe |
||||
```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 |
||||
``` |
@ -0,0 +1,48 @@ |
||||
# Bootloader Driver Installation with Zadig |
||||
|
||||
QMK presents itself to the host as a regular HID keyboard device, and as such requires no special drivers. However, in order to flash your keyboard on Windows, the bootloader device that appears when you reset the board often *does*. |
||||
|
||||
There are two notable exceptions: the Caterina bootloader, usually seen on Pro Micros, and the HalfKay bootloader shipped with PJRC Teensys, appear as a serial port and a generic HID device respectively, and so do not require a driver. |
||||
|
||||
We recommend the use of the [Zadig](https://zadig.akeo.ie/) utility. If you have set up the development environment with MSYS2 or WSL, the `qmk_install.sh` script will have asked if you want it to install the drivers for you. |
||||
|
||||
## Installation |
||||
|
||||
Put your keyboard into bootloader mode, either by hitting the `RESET` keycode (which may be on a different layer), or by pressing the reset switch that's usually located on the underside of the board. If your keyboard has neither, try holding Escape or Space+`B` as you plug it in (see the [Bootmagic](feature_bootmagic.md) docs for more details). Some boards use [Command](feature_command.md) instead of Bootmagic; in this case, you can enter bootloader mode by hitting Left Shift+Right Shift+`B` or Left Shift+Right Shift+Escape at any point while the keyboard is plugged in. |
||||
Some keyboards may have specific instructions for entering the bootloader. For example, the [Bootmagic Lite](feature_bootmagic.md#bootmagic-lite) key (default: Escape) might be on a different key, e.g. Left Control; or the magic combination for Command (default: Left Shift+Right Shift) might require you to hold something else, e.g. Left Control+Right Control. Refer to the board's README file if you are unsure. |
||||
|
||||
To put a device in bootloader mode with USBaspLoader, tap the `RESET` button while holding down the `BOOT` button. |
||||
Alternatively, hold `BOOT` while inserting the USB cable. |
||||
|
||||
Zadig will automatically detect the bootloader device. You may sometimes need to check **Options → List All Devices**. |
||||
|
||||
- For keyboards with Atmel AVR MCUs, the bootloader will be named something similar to `ATm32U4DFU`, and have a Vendor ID of `03EB`. |
||||
- USBasp bootloaders will appear as `USBasp`, with a VID/PID of `16C0:05DC`. |
||||
- AVR keyboards flashed with the QMK-DFU bootloader will be named `<keyboard name> Bootloader` and will also have the VID `03EB`. |
||||
- For most ARM keyboards, it will be called `STM32 BOOTLOADER`, and have a VID/PID of `0483:DF11`. |
||||
|
||||
!> If Zadig lists one or more devices with the `HidUsb` driver, your keyboard is probably not in bootloader mode. The arrow will be colored orange and you will be asked to confirm modifying a system driver. **Do not** proceed if this is the case! |
||||
|
||||
If the arrow appears green, select the driver, and click **Install Driver**. The `libusb-win32` driver will usually work for AVR, and `WinUSB` for ARM, but if you still cannot flash the board, try installing a different driver from the list. For flashing a USBaspLoader device via command line with msys2, the `libusbk` driver is recommended, otherwise `libusb-win32` will work fine if you are using QMK Toolbox for flashing. |
||||
|
||||
 |
||||
|
||||
Finally, unplug and replug the keyboard to make sure the new driver has been loaded. If you are using the QMK Toolbox to flash, exit and restart it too, as it can sometimes fail to recognize the driver change. |
||||
|
||||
## Recovering from Installation to Wrong Device |
||||
|
||||
If you find that you can no longer type with the keyboard, you may have accidentally replaced the driver for the keyboard itself instead of for the bootloader. This can happen when the keyboard is not in the bootloader mode. You can easily confirm this in Zadig - a healthy keyboard has the `HidUsb` driver installed on all of its interfaces: |
||||
|
||||
 |
||||
|
||||
Open the Device Manager and look for a device that looks like your keyboard. |
||||
|
||||
 |
||||
|
||||
Right-click it and hit **Uninstall device**. Make sure to tick **Delete the driver software for this device** first. |
||||
|
||||
 |
||||
|
||||
Click **Action → Scan for hardware changes**. At this point, you should be able to type again. Double check in Zadig that the keyboard device(s) are using the `HidUsb` driver. If so, you're all done, and your board should be functional again! |
||||
|
||||
?> A full reboot of your computer may sometimes be necessary at this point, to get Windows to pick up the new driver. |
@ -0,0 +1,32 @@ |
||||
# Firmware Quantum Mechanical Keyboard |
||||
|
||||
[](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/) |
||||
|
||||
## ¿Qué es el firmware QMK? |
||||
|
||||
QMK (*Quantum Mechanical Keyboard*) es una comunidad open source que mantiene el firmware QMK, QMK Toolbox, qmk.fm, y estos documentos. El firmware QMK es un firmware para teclados basado en [tmk\_keyboard](http://github.com/tmk/tmk_keyboard) con algunas características útiles para controladores Atmel AVR, y más específicamente, la [línea de productos OLKB](http://olkb.com), el teclado [ErgoDox EZ](http://www.ergodox-ez.com), y la [línea de productos Clueboard](http://clueboard.co/). También ha sido portado a chips ARM chips usando ChibiOS. Lo puedes utilizar para manejar tu propio teclado ya sea cableado a mano o basado en una PCB personalizada. |
||||
|
||||
## Cómo conseguirlo |
||||
|
||||
Si estás pensando en contribuir con un keymap, teclado, or característica a QMK, la manera más sencilla es hacer un [fork del repositorio en Github](https://github.com/qmk/qmk_firmware#fork-destination-box), y clonar tu repositorio localmente para hacer los cambios, subirlos, y abir un [Pull Request](https://github.com/qmk/qmk_firmware/pulls) desde tu fork. |
||||
|
||||
De cualquier manera, también puedes descargarlo directamente en formatos ([zip](https://github.com/qmk/qmk_firmware/zipball/master), [tar](https://github.com/qmk/qmk_firmware/tarball/master)), o clonarlo via git (`git@github.com:qmk/qmk_firmware.git`), o https (`https://github.com/qmk/qmk_firmware.git`). |
||||
|
||||
## Cómo compilar |
||||
|
||||
Antes de poder compilar, necesitarás [instalar un entorno](getting_started_build_tools.md) para el desarrollo de AVR y/o ARM. Una vez hayas completado este paso, usarás el comando `make` para compilar un teclado y keymap con la siguiente notación: |
||||
|
||||
make planck/rev4:default |
||||
|
||||
Este ejemplo compilaría la revisión `rev4` del teclado `planck` con el keymap `default`. No todos los teclados tienen revisiones (también llamados subproyectos o carpetas), en ese caso, se puede omitir: |
||||
|
||||
make preonic:default |
||||
|
||||
## Cómo personalizar |
||||
|
||||
QMK tiene montones de [características](features.md) para explorar, y una buena cantidad de [documentación de referencia](http://docs.qmk.fm) en la que sumergirse. Se pueden sacar provecho de la mayoría de las características modificando tu [keymap](keymap.md), y cambiando los [keycodes](keycodes.md). |
@ -0,0 +1,121 @@ |
||||
* [Guía completa para novatos](newbs.md) |
||||
* [Empezando](newbs_getting_started.md) |
||||
* [Construyendo tu primer firmare](newbs_building_firmware.md) |
||||
* [Flasheando el firmware](newbs_flashing.md) |
||||
* [Testeando y depurando ](newbs_testing_debugging.md) |
||||
* [Mejores práticas](newbs_best_practices.md) |
||||
* [Recursos de aprendizaje](newbs_learn_more_resources.md) |
||||
|
||||
* [QMK Basics](README.md) |
||||
* [Introducción a QMK](getting_started_introduction.md) |
||||
* [QMK CLI](cli.md) |
||||
* [Configuración de QMK CLI](cli_configuration.md) |
||||
* [Contribuyendo a QMK](contributing.md) |
||||
* [Cómo usar Github](getting_started_github.md) |
||||
* [Obtener ayuda](getting_started_getting_help.md) |
||||
|
||||
* [Cambios incompatibles](breaking_changes.md) |
||||
* [30 Ago 2019](ChangeLog/20190830.md) |
||||
|
||||
* [Preguntas frecuentes](faq.md) |
||||
* [General](faq_general.md) |
||||
* [Construir/Compilar QMK](faq_build.md) |
||||
* [Depurando/Encontrando problemas en QMK](faq_debug.md) |
||||
* [Keymap](faq_keymap.md) |
||||
* [Instalación de drivers con Zadig](driver_installation_zadig.md) |
||||
|
||||
* Guías detalladas |
||||
* [Instalar herramientas construcción](getting_started_build_tools.md) |
||||
* [Guía Vagrant](getting_started_vagrant.md) |
||||
* [Instrucciones de Construcción/Compilado](getting_started_make_guide.md) |
||||
* [Flasheando Firmware](flashing.md) |
||||
* [Personalizando funcionalidad](custom_quantum_functions.md) |
||||
* [Visión general del Keymap](keymap.md) |
||||
|
||||
* [Hardware](hardware.md) |
||||
* [Procesadores AVR](hardware_avr.md) |
||||
* [Drivers](hardware_drivers.md) |
||||
|
||||
* Referencia |
||||
* [Pautas de teclados](hardware_keyboard_guidelines.md) |
||||
* [Opciones de configuración](config_options.md) |
||||
* [Keycodes](keycodes.md) |
||||
* [Convenciones de código - C](coding_conventions_c.md) |
||||
* [Convenciones de código - Python](coding_conventions_python.md) |
||||
* [Mejores prácticas de documentación](documentation_best_practices.md) |
||||
* [Plantillas de documentación](documentation_templates.md) |
||||
* [Glosario](reference_glossary.md) |
||||
* [Tests unitarios](unit_testing.md) |
||||
* [Funciones útiles](ref_functions.md) |
||||
* [Sporte configurador](reference_configurator_support.md) |
||||
* [Formato info.json](reference_info_json.md) |
||||
* [Desarrollo Python CLI](cli_development.md) |
||||
|
||||
* [Características](features.md) |
||||
* [Keycodes Básicos](keycodes_basic.md) |
||||
* [Teclas US ANSI Shifted](keycodes_us_ansi_shifted.md) |
||||
* [Keycodes Quantum](quantum_keycodes.md) |
||||
* [Keycodes Avanzados](feature_advanced_keycodes.md) |
||||
* [Audio](feature_audio.md) |
||||
* [Auto Shift](feature_auto_shift.md) |
||||
* [Retroiluminación](feature_backlight.md) |
||||
* [Bluetooth](feature_bluetooth.md) |
||||
* [Bootmagic](feature_bootmagic.md) |
||||
* [Combos](feature_combo.md) |
||||
* [Comando](feature_command.md) |
||||
* [API Debounce](feature_debounce_type.md) |
||||
* [Switch DIP](feature_dip_switch.md) |
||||
* [Macros Dinámicas](feature_dynamic_macros.md) |
||||
* [Encoders](feature_encoders.md) |
||||
* [Grave Escape](feature_grave_esc.md) |
||||
* [Feedback Háptico](feature_haptic_feedback.md) |
||||
* [Controlador LCD HD44780](feature_hd44780.md) |
||||
* [Key Lock](feature_key_lock.md) |
||||
* [Layouts](feature_layouts.md) |
||||
* [Tecla Leader](feature_leader_key.md) |
||||
* [Matriz LED](feature_led_matrix.md) |
||||
* [Macros](feature_macros.md) |
||||
* [Teclas del ratón](feature_mouse_keys.md) |
||||
* [Driver OLED](feature_oled_driver.md) |
||||
* [Teclas One Shot](feature_advanced_keycodes.md#one-shot-keys) |
||||
* [Dispositivo de apuntado](feature_pointing_device.md) |
||||
* [Ratón PS/2](feature_ps2_mouse.md) |
||||
* [Iluminación RGB](feature_rgblight.md) |
||||
* [Matriz RGB](feature_rgb_matrix.md) |
||||
* [Cadete espacial](feature_space_cadet.md) |
||||
* [Teclado dividido](feature_split_keyboard.md) |
||||
* [Stenografía](feature_stenography.md) |
||||
* [Swap Hands](feature_swap_hands.md) |
||||
* [Tap Dance](feature_tap_dance.md) |
||||
* [Terminal](feature_terminal.md) |
||||
* [Impresora Térmica](feature_thermal_printer.md) |
||||
* [Unicode](feature_unicode.md) |
||||
* [Userspace](feature_userspace.md) |
||||
* [Velocikey](feature_velocikey.md) |
||||
|
||||
* Para Makers y Modders |
||||
* [Guía de cableado a mano](hand_wire.md) |
||||
* [Guía de flasheado de ISP](isp_flashing_guide.md) |
||||
* [Guía de depuración de ARM](arm_debugging.md) |
||||
* [Driver I2C](i2c_driver.md) |
||||
* [Controles GPIO](internals_gpio_control.md) |
||||
* [Conversión Proton C](proton_c_conversion.md) |
||||
|
||||
* Para entender en profundidad |
||||
* [Cómo funcionan los teclados](how_keyboards_work.md) |
||||
* [Entendiendo QMK](understanding_qmk.md) |
||||
|
||||
* Otros temas |
||||
* [Usando Eclipse con QMK](other_eclipse.md) |
||||
* [Usando VSCode con QMK](other_vscode.md) |
||||
* [Soporte](support.md) |
||||
* [Cómo añadir traducciones](translating.md) |
||||
|
||||
* QMK Internals (En progreso) |
||||
* [Defines](internals_defines.md) |
||||
* [Input Callback Reg](internals_input_callback_reg.md) |
||||
* [Dispositivo Midi](internals_midi_device.md) |
||||
* [Proceso de configuración de un dispositivo Midi](internals_midi_device_setup_process.md) |
||||
* [Utilidad Midi](internals_midi_util.md) |
||||
* [Funciones Send](internals_send_functions.md) |
||||
* [Herramientas Sysex](internals_sysex_tools.md) |
@ -0,0 +1,9 @@ |
||||
# Llegar a ser un colaborador QMK |
||||
|
||||
Un colaborador QMK es un maker o diseñador de teclados que tiene interés en ayudar a QMK a crecer y mantener sus teclado(s), y alentar a los usuarios y clientes a presentar herramientas, ideas, y keymaps. Siempre procuramos agregar más teclados y colaboradores, pero pedimos que cumplan los siguientes requisitos: |
||||
|
||||
* **Tener un PCB disponible a la venta.** Desafortunadamente, hay demasiada variación y complicaciones con teclados cableados a mano. |
||||
* **Realizar el mantenimiento de tu teclado en QMK.** Este podría requirir un setup inicial para hacer que tu teclado funcione, pero también podría incluir adaptarse a cambios hecho al base de QMK que podrían descomponer o rendir código superfluo. |
||||
* **Aprobar e incorporar pull requests de keymaps para tu teclado.** Nos gusta alentar a los usuarios a contribuir sus keymaps para que otros los vean y los puedan usar para crear sus propios. |
||||
|
||||
Si sientes que cumples los requisitos, ¡mándanos un email a hello@qmk.fm con una introducción y algunos enlaces para tu teclado! |
@ -0,0 +1,8 @@ |
||||
# Hardware |
||||
|
||||
QMK es compatible con una variedad de hardware. Si tu procesador puede ser dirigido por [LUFA](http://www.fourwalledcubicle.com/LUFA.php) o [ChibiOS](http://www.chibios.com), probablemente puedes hacer que QMK se ejecute en él. Esta sección explora cómo hacer que QMK se ejecute y se comunique con hardware de todo tipo. |
||||
|
||||
* [Pautas de teclados](hardware_keyboard_guidelines.md) |
||||
* [Procesadores AVR](hardware_avr.md) |
||||
* Procesadores ARM (TBD) |
||||
* [Drivers](hardware_drivers.md) |
@ -0,0 +1,181 @@ |
||||
# Teclados con Procesadores AVR |
||||
|
||||
Esta página describe el soporte para procesadores AVR en QMK. Los procesadores AVR incluyen el atmega32u4, atmega32u2, at90usb1286, y otros procesadores de la Corporación Atmel. Los procesadores AVR son MCUs de 8-bit que son diseñados para ser fáciles de trabajar. Los procesadores AVR más comunes en los teclados tienen USB y un montón de GPIO para permitir grandes matrices de teclado. Son los MCUs más populares para el uso en los teclados hoy en día. |
||||
|
||||
Si aún no lo has hecho, debes leer las [Pautas de teclados](hardware_keyboard_guidelines.md) para tener una idea de cómo los teclados encajan en QMK. |
||||
|
||||
## Añadir tu Teclado AVR a QMK |
||||
|
||||
QMK tiene varias características para simplificar el trabajo con teclados AVR. Para la mayoría de los teclados no tienes que escribir ni una sola línea de código. Para empezar, ejecuta el archivo `util/new_keyboard.sh`: |
||||
|
||||
``` |
||||
$ ./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. |
||||
``` |
||||
|
||||
Esto creará todos los archivos necesarios para tu nuevo teclado, y rellenará la configuración con valores predeterminados. Ahora sólo tienes que personalizarlo para tu teclado. |
||||
|
||||
## `readme.md` |
||||
|
||||
Aquí es donde describirás tu teclado. Por favor sigue la [Plantilla del readme de teclados](documentation_templates.md#keyboard-readmemd-template) al escribir tu `readme.md`. Te animamos a colocar una imagen en la parte superior de tu `readme.md`. Por favor, utiliza un servicio externo como [Imgur](http://imgur.com) para alojar las imágenes. |
||||
|
||||
## `<keyboard>.c` |
||||
|
||||
Aquí es donde pondrás toda la lógica personalizada para tu teclado. Muchos teclados no necesitan nada aquí. Puedes aprender más sobre cómo escribir lógica personalizada en [Funciones Quantum Personalizadas](custom_quantum_functions.md). |
||||
|
||||
## `<keyboard>.h` |
||||
|
||||
Este es el archivo en el que defines tu(s) [Macro(s) de Layout](feature_layouts.md). Por lo menos deberías tener un `#define LAYOUT` para tu teclado que se ve algo así: |
||||
|
||||
```c |
||||
#define LAYOUT( \ |
||||
k00, k01, k02, \ |
||||
k10, k11 \ |
||||
) { \ |
||||
{ k00, k01, k02 }, \ |
||||
{ k10, KC_NO, k11 }, \ |
||||
} |
||||
``` |
||||
|
||||
La primera mitad de la macro pre-procesador `LAYOUT` define la disposición física de las llaves. La segunda mitad de la macro define la matriz a la que están conectados los interruptores. Esto te permite tener una disposición física de las llaves que difiere de la matriz de cableado. |
||||
|
||||
Cada una de las variables `k__` tiene que ser única, y normalmente sigue el formato `k<row><col>`. |
||||
|
||||
La matriz física (la segunda mitad) debe tener un número de filas igualando `MATRIX_ROWS`, y cada fila debe tener exactamente `MATRIX_COLS` elementos. Si no tienes tantas teclas físicas puedes usar `KC_NO` para rellenar los espacios en blanco. |
||||
|
||||
## `config.h` |
||||
|
||||
El archivo `config.h` es donde configuras el hardware y el conjunto de características para tu teclado. Hay un montón de opciones que se pueden colocar en ese archivo, demasiadas para listar allí. Para obtener una visión de conjunto completa de las opciones disponibles consulta la página de [Opciones de Configuración](config_options.md). |
||||
|
||||
### Configuración de hardware |
||||
|
||||
|
||||
En la parte superior de `config.h` encontrarás ajustes relacionados con USB. Estos controlan la apariencia de tu teclado en el Sistema Operativo. Si no tienes una buena razón para cambiar debes dejar el `VENDOR_ID` como `0xFEED`. Para el `PRODUCT_ID` debes seleccionar un número que todavía no esté en uso. |
||||
|
||||
Cambia las líneas de `MANUFACTURER`, `PRODUCT`, y `DESCRIPTION` para reflejar con precisión tu teclado. |
||||
|
||||
```c |
||||
#define VENDOR_ID 0xFEED |
||||
#define PRODUCT_ID 0x6060 |
||||
#define DEVICE_VER 0x0001 |
||||
#define MANUFACTURER Tú |
||||
#define PRODUCT mi_teclado_fantastico |
||||
#define DESCRIPTION Un teclado personalizado |
||||
``` |
||||
|
||||
?> Windows y macOS mostrarán el `MANUFACTURER` y `PRODUCT` en la lista de dispositivos USB. `lsusb` en Linux toma estos de la lista mantenida por el [Repositorio de ID USB](http://www.linux-usb.org/usb-ids.html) por defecto. `lsusb -v` mostrará los valores reportados por el dispositivo, y también están presentes en los registros del núcleo después de conectarlo. |
||||
|
||||
### Configuración de la matriz del teclado |
||||
|
||||
La siguiente sección del archivo `config.h` trata de la matriz de tu teclado. Lo primero que debes establecer es el tamaño de la matriz. Esto es generalmente, pero no siempre, el mismo número de filas y columnas como la disposición física de las teclas. |
||||
|
||||
```c |
||||
#define MATRIX_ROWS 2 |
||||
#define MATRIX_COLS 3 |
||||
``` |
||||
|
||||
Una vez que hayas definido el tamaño de tu matriz, necesitas definir qué pines en tu MCU están conectados a filas y columnas. Para hacerlo simplemente especifica los nombres de esos pines: |
||||
|
||||
```c |
||||
#define MATRIX_ROW_PINS { D0, D5 } |
||||
#define MATRIX_COL_PINS { F1, F0, B0 } |
||||
#define UNUSED_PINS |
||||
``` |
||||
|
||||
El número de entradas debe ser el mismo que el número que asignaste a `MATRIX_ROWS`, y del mismo modo para `MATRIX_COL_PINS` y `MATRIX_COLS`. No tienes que especificar `UNUSED_PINS`, pero puedes si deseas documentar qué pines están abiertos. |
||||
|
||||
Finalmente, puedes especificar la dirección en la que apuntan tus diodos. Esto puede ser `COL2ROW` o `ROW2COL`. |
||||
|
||||
```c |
||||
#define DIODE_DIRECTION COL2ROW |
||||
``` |
||||
|
||||
#### Matriz de patas directas |
||||
Para configurar un teclado en el que cada interruptor está conectado a un pin y tierra separados en lugar de compartir los pines de fila y columna, usa `DIRECT_PINS`. La asignación define los pines de cada interruptor en filas y columnas, de izquierda a derecha. Debe ajustarse a los tamaños dentro de `MATRIX_ROWS` y `MATRIX_COLS`. Usa `NO_PIN` para rellenar espacios en blanco. Sobreescribe el comportamiento de `DIODE_DIRECTION`, `MATRIX_ROW_PINS` y `MATRIX_COL_PINS`. |
||||
|
||||
```c |
||||
// #define MATRIX_ROW_PINS { D0, D5 } |
||||
// #define MATRIX_COL_PINS { F1, F0, B0 } |
||||
#define DIRECT_PINS { \ |
||||
{ F1, E6, B0, B2, B3 }, \ |
||||
{ F5, F0, B1, B7, D2 }, \ |
||||
{ F6, F7, C7, D5, D3 }, \ |
||||
{ B5, C6, B6, NO_PIN, NO_PIN } \ |
||||
} |
||||
#define UNUSED_PINS |
||||
|
||||
/* COL2ROW, ROW2COL */ |
||||
//#define DIODE_DIRECTION |
||||
``` |
||||
|
||||
### Configuración de retroiluminación |
||||
|
||||
QMK soporta retroiluminación en la mayoría de los pines GPIO. Algunos de ellos pueden ser manejados por el MCU en hardware. Para más detalles, consulta la [Documentación de Retroiluminación](feature_backlight.md). |
||||
|
||||
```c |
||||
#define BACKLIGHT_PIN B7 |
||||
#define BACKLIGHT_LEVELS 3 |
||||
#define BACKLIGHT_BREATHING |
||||
#define BREATHING_PERIOD 6 |
||||
``` |
||||
|
||||
### Otras opciones de configuración |
||||
|
||||
Hay un montón de características que se pueden configurar o ajustar en `config.h`. Debes consultar la página de [Opciones de Configuración](config_options.md) para más detalles. |
||||
|
||||
## `rules.mk` |
||||
|
||||
Usa el archivo `rules.mk` para decirle a QMK qué archivos construir y qué características habilitar. Si estás construyendo sobre un atmega32u4 deberías poder dejar mayormente los valores predeterminados. Si estás usando otro MCU es posible que tengas que ajustar algunos parámetros. |
||||
|
||||
### Opciones MCU |
||||
|
||||
Estas opciones le indican al sistema de compilación para qué CPU construir. Ten mucho cuidado si cambias cualquiera de estos ajustes. Puedes inutilizar tu teclado. |
||||
|
||||
```make |
||||
MCU = atmega32u4 |
||||
F_CPU = 16000000 |
||||
ARCH = AVR8 |
||||
F_USB = $(F_CPU) |
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT |
||||
``` |
||||
|
||||
### Gestores de arranque |
||||
|
||||
El gestor de arranque es una sección especial de tu MCU que te permite actualizar el código almacenado en el MCU. Piensa en ello como una partición de rescate para tu teclado. |
||||
|
||||
#### Ejemplo de gestor de arranque |
||||
|
||||
```make |
||||
BOOTLOADER = halfkay |
||||
``` |
||||
|
||||
#### Ejemplo de cargador DFU Atmel |
||||
|
||||
```make |
||||
BOOTLOADER = atmel-dfu |
||||
``` |
||||
|
||||
#### Ejemplo de gestor de arranque Pro Micro |
||||
|
||||
```make |
||||
BOOTLOADER = caterina |
||||
``` |
||||
|
||||
### Opciones de construcción |
||||
|
||||
Hay un serie de características que se pueden activar o desactivar en `rules.mk`. Consulta la página de [Opciones de Configuración](config_options.md#feature-options) para obtener una lista detallada y una descripción. |
@ -0,0 +1,36 @@ |
||||
# Controladores de hardware QMK |
||||
|
||||
QMK se utiliza en un montón de hardware diferente. Mientras que el soporte para los MCUs y las configuraciones de matriz más comunes está integrado, hay una serie de controladores que se pueden añadir para soportar hardware adicional al teclado. Los ejemplos incluyen ratones y otros dispositivos de apuntamiento, extensores de i/o para teclados divididos, modúlos Bluetooth, y pantallas LCD, OLED y TFT. |
||||
|
||||
<!-- FIXME: Esto debe hablar de cómo se integran los controladores en QMK y cómo puedes añadir su propio controlador. |
||||
|
||||
# Descripción del sistema de controladores |
||||
|
||||
--> |
||||
|
||||
# Controladores disponibles |
||||
|
||||
## ProMicro (Solo AVR) |
||||
|
||||
Soporte para direccionar pines en el ProMicro por su nombre Arduino en lugar de su nombre AVR. Esto necesita ser mejor documentado. Si estás tratando de hacer esto y leer el código no ayuda por favor [abre una issue](https://github.com/qmk/qmk_firmware/issues/new) y podemos ayudarte por el proceso. |
||||
|
||||
## Controlador OLED SSD1306 |
||||
|
||||
Soporte para pantallas OLED basadas en SSD1306. Para obtener más información consulta la página de [Característica de Controlador OLED](feature_oled_driver.md). |
||||
|
||||
## uGFX |
||||
|
||||
Puedes hacer uso de uGFX dentro de QMK para manejar LCDs de caracteres y gráficos, matrices de LED, OLED, TFT, y otras tecnologías de visualización. Esto necesita ser mejor documentado. Si estás tratando de hacer esto y leer el código no ayuda por favor [abre una issue](https://github.com/qmk/qmk_firmware/issues/new) y podemos ayudarte por el proceso. |
||||
|
||||
## WS2812 (Solo AVR) |
||||
|
||||
Soporte para LEDs WS2811/WS2812{a,b,c}. Para obtener más información consulta la página de [Luz RGB](feature_rgblight.md). |
||||
|
||||
## IS31FL3731 |
||||
|
||||
Soporte para hasta 2 controladores. Cada controlador implementa 2 matrices charlieplex para direccionar LEDs individualmente usando I2C. Esto permite hasta 144 LEDs del mismo color o 32 LEDs RGB. Para obtener más información sobre cómo configurar el controlador, consulta la página de [Matriz RGB](feature_rgb_matrix.md). |
||||
|
||||
## IS31FL3733 |
||||
|
||||
Soporte para hasta un solo controlador con espacio para expansión. Cada controlador puede controlar 192 LEDs individuales o 64 LEDs RGB. Para obtener más información sobre cómo configurar el controlador, consulta la página de [Matriz RGB](feature_rgb_matrix.md). |
||||
|
@ -0,0 +1,149 @@ |
||||
# Pautas del teclado QMK |
||||
|
||||
Desde sus inicios, QMK ha crecido a pasos agigantados gracias a personas como tú que contribuyes a la creación y mantenimiento de nuestros teclados comunitarios. A medida que hemos crecido hemos descubierto algunos patrones que funcionan bien, y pedimos que te ajustes a ellos para que sea más fácil para que otras personas se beneficien de tu duro trabajo. |
||||
|
||||
|
||||
## Nombrar tu Teclado/Proyecto |
||||
|
||||
Todos los nombres de teclado están en minúsculas, consistiendo sólo de letras, números y guiones bajos (`_`). Los nombres no pueden comenzar con un guión bajo. La barra de desplazamiento (`/`) se utiliza como un carácter de separación de subcarpetas. |
||||
|
||||
Los nombres `test`, `keyboard`, y `all` están reservados para las órdenes de make y no pueden ser usados como un nombre de teclado o subcarpeta. |
||||
|
||||
Ejemplos Válidos: |
||||
|
||||
* `412_64` |
||||
* `chimera_ortho` |
||||
* `clueboard/66/rev3` |
||||
* `planck` |
||||
* `v60_type_r` |
||||
|
||||
## Subcarpetas |
||||
|
||||
QMK utiliza subcarpetas tanto para organización como para compartir código entre las revisiones del mismo teclado. Puedes anidar carpetas hasta 4 niveles de profundidad: |
||||
|
||||
qmk_firmware/keyboards/top_folder/sub_1/sub_2/sub_3/sub_4 |
||||
|
||||
Si una subcarpeta tiene un archivo `rules.mk` será considerado un teclado compilable. Estará disponible en el configurador de QMK y se probará con `make all`. Si estás utilizando una carpeta para organizar varios teclados del mismo fabricante no debes tener un archivo `rules.mk`. |
||||
|
||||
Ejemplo: |
||||
|
||||
Clueboard utiliza subcarpetas para ambos propósitos: organización y revisiones de teclado. |
||||
|
||||
* [`qmk_firmware`](https://github.com/qmk/qmk_firmware/tree/master) |
||||
* [`keyboards`](https://github.com/qmk/qmk_firmware/tree/master/keyboards) |
||||
* [`clueboard`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard) ← This is the organization folder, there's no `rules.mk` file |
||||
* [`60`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/60) ← This is a compilable keyboard, it has a `rules.mk` file |
||||
* [`66`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66) ← This is also compilable- it uses `DEFAULT_FOLDER` to specify `rev3` as the default revision |
||||
* [`rev1`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66/rev1) ← compilable: `make clueboard/66/rev1` |
||||
* [`rev2`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66/rev2) ← compilable: `make clueboard/66/rev2` |
||||
* [`rev3`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66/rev3) ← compilable: `make clueboard/66/rev3` or `make clueboard/66` |
||||
|
||||
## Estructura de carpetas de teclado |
||||
|
||||
Su teclado debe estar ubicado en `qmk_firm cuidada/keyboards/` y el nombre de la carpeta debe ser el nombre de su teclado como se describe en la sección anterior. Dentro de esta carpeta debe haber varios archivos: |
||||
|
||||
* `readme.md` |
||||
* `info.json` |
||||
* `config.h` |
||||
* `rules.mk` |
||||
* `<keyboard_name>.c` |
||||
* `<keyboard_name>.h` |
||||
|
||||
### `readme.md` |
||||
|
||||
Todos los proyectos necesitan tener un archivo `readme.md` que explica lo que es el teclado, quién lo hizo y dónde está disponible. Si es aplicable, también debe contener enlaces a más información, como el sitio web del fabricante. Por favor, sigue la [plantilla publicada](documentation_templates.md#keyboard-readmemd-template). |
||||
|
||||
### `info.json` |
||||
|
||||
Este archivo es utilizado por la [API de QMK](https://github.com/qmk/qmk_api). Contiene la información que [configurador de QMK](https://config.qmk.fm/) necesita mostrar en una representación de su teclado. También puede establecer metadatos aquí. Para más información, consulta la [página de referencia](reference_info_json.md). |
||||
|
||||
### `config.h` |
||||
|
||||
Todos los proyectos necesitan tener un archivo `config.h` que establece cosas como el tamaño de la matriz, nombre del producto, USB VID/PID, descripción y otros ajustes. En general, usa este archivo para establecer la información esencial y los valores predeterminados para tu teclado que siempre funcionarán. |
||||
|
||||
### `rules.mk` |
||||
|
||||
La presencia de este archivo indica que la carpeta es un destino de teclado y se puede utilizar en las órdenes `make`. Aquí es donde estableces el entorno de compilación para tu teclado y configuras el conjunto predeterminado de características. |
||||
|
||||
### `<keyboard_name.c>` |
||||
|
||||
Aquí es donde escribirás código personalizado para tu teclado. Típicamente escribirás código para inicializar e interactuar con el hardware de tu teclado. Si tu teclado se compone de sólo una matriz de teclas sin LEDs, altavoces u otro hardware auxiliar este archivo puede estar en blanco. |
||||
|
||||
Las funciones siguientes se definen típicamente en este archivo: |
||||
|
||||
* `void matrix_init_kb(void)` |
||||
* `void matrix_scan_kb(void)` |
||||
* `bool process_record_kb(uint16_t keycode, keyrecord_t *record)` |
||||
* `void led_set_kb(uint8_t usb_led)` |
||||
|
||||
### `<keyboard_name.h>` |
||||
|
||||
Este archivo se utiliza para definir la matriz para tu teclado. Debes definir al menos un macro de C que traduce una serie en una matriz que representa la matriz de interruptor físico para tu teclado. Si es posible construir tu teclado con múltiples diseños debes definir macros adicionales. |
||||
|
||||
Si solo tienes un diseño debes llamar a esta macro `LAYOUT`. |
||||
|
||||
Al definir diseños múltiples debes tener un diseño base, llamado `LAYOUT_all`, que soporte todas las posibles posiciones de switch en tu matriz, incluso si ese diseño es imposible de construir físicamente. Esta es la macro que deberías usar en tu keymap `predeterminado`. Debes tener keymaps adicionales llamados `default_ término layout>` que usen tus otras macros de diseño. Esto hará que sea más fácil para las personas utilizar los diseños que defines. |
||||
|
||||
Los nombres de las macros de diseño son completamente minúsculas, excepto por la palabra `LAYOUT` en el frente. |
||||
|
||||
Por ejemplo, si tienes un PCB de 60% que soporta ANSI e ISO podría definir los siguientes diseños y keymaps: |
||||
|
||||
| Nombre de diseño | Nombre de keymap | Descripción | |
||||
|-------------|-------------|-------------| |
||||
| LAYOUT_all | default | Un diseño que soporta tanto ISO como ANSI | |
||||
| LAYOUT_ansi | default_ansi | Un diseño ANSI | |
||||
| LAYOUT_iso | default_iso | Un diseño ISO | |
||||
|
||||
## Archivos de Imagen/Hardware |
||||
|
||||
En un esfuerzo por mantener el tamaño de repo abajo ya no estamos aceptando archivos binarios de cualquier formato, con pocas excepciones. Alojarlos en otro lugar (por ejemplo <https://imgur.com>) y enlazarlos en el `readme.md` es preferible. |
||||
|
||||
Para archivos de hardware (tales como placas, casos, pcb) puedes contribuir a [qmk.fm repo](https://github.com/qmk/qmk.fm) y estarán disponibles en [qmk.fm](http://qmk.fm). Archivos descargables se almacenan en `/<teclado>/` (nombre sigue el mismo formato que el anterior), se sirven en `http://qmk.fm/<teclado>/`, y se generan páginas de `/_pages/<teclado>/` que se sirven en la misma ubicación (Los archivos .md se generan en archivos .html mediante Jekyll). Echa un vistazo a la carpeta `lets_split` para ver un ejemplo. |
||||
|
||||
## Predeterminados de teclado |
||||
|
||||
Dada la cantidad de funcionalidad que expone QMK, es muy fácil confundir a los nuevos usuarios. Al armar el firmware predeterminado para tu teclado, te recomendamos limitar tus funciones y opciones habilitadas al conjunto mínimo necesario para soportar tu hardware. A continuación se formulan recomendaciones sobre características específicas. |
||||
|
||||
### Bootmagic y Command |
||||
|
||||
[Bootmagic](feature_bootmagic.md) and [Command](feature_command.md) son dos características relacionadas que permiten a un usuario controlar su teclado de manera no obvia. Te recomendamos que piense largo y tendido acerca de si vas a habilitar cualquiera de las características, y cómo vas a exponer esta funcionalidad. Tengas en cuenta que los usuarios que quieren esta funcionalidad puede habilitarla en sus keymaps personales sin afectar a todos los usuarios novatos que pueden estar usando tu teclado como su primera tarjeta programable. |
||||
|
||||
De lejos el problema más común con el que se encuentran los nuevos usuarios es la activación accidental de Bootmagic mientras están conectando su teclado. Están sosteniendo el teclado por la parte inferior, presionando sin saberlo en alt y barra espaciadora, y luego se dan cuenta de que estas teclas han sido intercambiadas en ellos. Recomendamos dejar esta característica deshabilitada de forma predeterminada, pero si la activas consideres establecer la opción `BOOTMAGIC_KEY_SALT` a una tecla que es difícil de presionar al conectar el teclado. |
||||
|
||||
Si tu teclado no tiene 2 teclas de cambio debes proporcionar un predeterminado de trabajo para `IS_COMMAND`, incluso cuando haya definido `COMMAND_ENABLE = no`. Esto dará a sus usuarios un valor predeterminado para ajustarse a si lo hacen enable Command. |
||||
|
||||
## Programación de teclado personalizado |
||||
|
||||
Como se documenta en [Funcionalidad de Adaptación](custom_quantum_functions.md) puedes definir funciones personalizadas para tu teclado. Por favor, tengas en cuenta que sus usuarios pueden querer personalizar ese comportamiento así, y hacer que sea posible para que puedan hacer eso. Si está proporcionando una función personalizada, por ejemplo `process_record_kb()`, asegúrese de que su función también llame a la versión` `_user()` de la llamada. También debes tener en cuenta el valor de retorno de la versión `_user()`, y ejecutar sólo tu código personalizado si el usuario devuelve `true`. |
||||
|
||||
## Proyectos Sin Producción/Conectados A Mano |
||||
|
||||
Estamos encantados de aceptar cualquier proyecto que utilice QMK, incluidos los prototipos y los cableados de mano, pero tenemos una carpeta `/keyboards/handwired/` separada para ellos, por lo que la carpeta `/keyboards/` principal no se llena. Si un proyecto prototipo se convierte en un proyecto de producción en algún momento en el futuro, ¡estaremos encantados de moverlo a la carpeta `/keyboards/` principal! |
||||
|
||||
## Advertencias como errores |
||||
|
||||
Al desarrollar su teclado, tengas en cuenta que todas las advertencias serán tratadas como errores - estas pequeñas advertencias pueden acumularse y causar errores más grandes en el camino (y pierdan es generalmente una mala práctica). |
||||
|
||||
## Derechos de autor |
||||
|
||||
Si estás adaptando la configuración de tu teclado de otro proyecto, pero no utilizando el mismo código, asegúrese de actualizar la cabecera de derechos de autor en la parte superior de los archivos para mostrar tu nombre, en este formato: |
||||
|
||||
Copyright 2017 Tu nombre <tu@email.com> |
||||
|
||||
Si estás modificando el código de otra persona y sólo ha hecho cambios triviales debes dejar su nombre en la declaración de derechos de autor. Si has hecho un trabajo significativo en el archivo debe agregar tu nombre a la de ellos, así: |
||||
|
||||
Copyright 2017 Su nombre <original_author@ejemplo.com> Tu nombre <tu@ejemplo.com> |
||||
|
||||
El año debe ser el primer año en que se crea el archivo. Si el trabajo se hizo a ese archivo en años posteriores puedes reflejar que mediante la adición del segundo año a la primera, como así: |
||||
|
||||
Copyright 2015-2017 Tu nombre <tu@ejemplo.com> |
||||
|
||||
## Licencia |
||||
|
||||
El núcleo de QMC está licenciado bajo la [GNU General Public License](https://www.gnu.org/licenses/licenses.en.html). Si estás enviando binarios para los procesadores AVR puedes elegir cualquiera [GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) o [GPLv3](https://www.gnu.org/licenses/gpl.html). Si estás enviando binarios para ARM procesadores debes elegir [GPL Versión 3](https://www.gnu.org/licenses/gpl.html) para cumplir con los [ChibiOS](http://www.chibios.org) licencia GPLv3. |
||||
|
||||
Si tu teclado hace uso de la [uGFX](https://gfx.io) características dentro de QMK debes cumplir con la [Licencia de uGFX](https://ugfx.io/license.html), que requiere una licencia comercial separada antes de vender un dispositivo que contiene uGFX. |
||||
|
||||
## Detalles técnicos |
||||
|
||||
Si estás buscando más información sobre cómo hacer que su teclado funcione con QMK, [echa un vistazo a la sección hardware](hardware.md)! |
@ -0,0 +1,23 @@ |
||||
# La guía completa de QMK para novatos |
||||
|
||||
QMK es un poderoso firmware Open Source para tu teclado mecánico. Puedes utilizar QMK para personalizar tu teclado en maneras a la vez simples y potentes. Gente de todos los niveles de habilidad, desde completos novatos hasta expertos programadores, han utilizado con éxito QMK para personalizar sus teclados. Esta guía te ayudará a hacer lo mismo, sin importar tu nivel de habilidad. |
||||
|
||||
¿No estás seguro de si tu teclado puede ejecutar QMK? Si es un teclado mecánico construido por ti mismo probablemente puedas. Damos soporte a [gran número de placas de hobbistas](http://qmk.fm/keyboards/), e incluso si tu teclado actual no pudiera ejecutar QMK no deberías tener problemas encontrando uno que cumpliera tus necesidades. |
||||
|
||||
## Visión general |
||||
|
||||
Hay 7 secciones principales en esta guía: |
||||
|
||||
* [Empezando](newbs_getting_started.md) |
||||
* [Construyendo tu primer firmware](newbs_building_firmware.md) |
||||
* [Construyendo tu primer firmware usando la GUI](newbs_building_firmware_configurator.md) |
||||
* [Flasheando el firmware](newbs_flashing.md) |
||||
* [Testeando y depurando](newbs_testing_debugging.md) |
||||
* [Mejores práticas](newbs_best_practices.md) |
||||
* [Recursos de aprendizaje](newbs_learn_more_resources.md) |
||||
|
||||
Esta guía está enfocada en ayudar a alguien que nunca ha compilado software con anterioridad. Toma decisiones y hace recomendaciones teniendo en cuenta este punto de vista. Hay métodos alternativos para muchos de estos procedimientos, y soportamos la mayoría de esas alternativas. Si tienes alguna duda sobre cómo llevar a cabo una tarea nos puedes [preguntar para que te guiemos](getting_started_getting_help.md). |
||||
|
||||
## Recursos adicionales |
||||
|
||||
* [Blog de Básicos de Thomas Baart's QMK](https://thomasbaart.nl/category/mechanical-keyboards/firmware/qmk/qmk-basics/) – Un blog creado por un usuario que cubre lo básico sobre cómo usar el firmware QMK Firmware, visto desde la perspectiva de un usuario nuevo. |
@ -0,0 +1,159 @@ |
||||
# Mejores prácticas |
||||
|
||||
## O, "Cómo aprendí a dejar de preocuparme y amarle a Git." |
||||
|
||||
Este documento procura instruir a los novatos en las mejores prácticas para tener una experiencia más fácil en contribuir a QMK. Te guiaremos por el proceso de contribuir a QMK, explicando algunas maneras de hacerlo más fácilmente, y luego romperemos algunas cosas para enseñarte cómo arreglarlas. |
||||
|
||||
En este documento suponemos un par de cosas: |
||||
|
||||
1. Tienes una cuenta de Github, y has hecho un [fork del repo qmk_firmware](getting_started_github.md) en tu cuenta. |
||||
2. Has [configurado tu entorno de desarrollo](newbs_getting_started.md?id=environment-setup). |
||||
|
||||
|
||||
## La rama master de tu fork: Actualizar a menudo, nunca commit |
||||
|
||||
Se recomienda que para desarrollo con QMK, lo que sea que estés haciendo, mantener tu rama `master` actualizada, pero **nunca** commit en ella. Mejor, haz todos tus cambios en una rama de desarrollo y manda pull requests de tus ramas mientras programas. |
||||
|
||||
Para evitar los conflictos de merge — cuando dos o más usuarios han editado la misma parte de un archivo al mismo tiempo — mantén tu rama `master` actualizada, y empieza desarrollo nuevo creando una nueva rama. |
||||
|
||||
### Actualizando tu rama master |
||||
|
||||
Para mantener tu rama `master` actualizada, se recomienda agregar el repository ("repo") de Firmware QMK como un repo remoto en git. Para hacer esto, abre tu interfaz de línea de mandatos y ingresa: |
||||
``` |
||||
git remote add upstream https://github.com/qmk/qmk_firmware.git |
||||
``` |
||||
|
||||
Para verificar que el repo ha sido agregado, ejecuta `git remote -v`, y lo siguiente debe aparecer: |
||||
|
||||
``` |
||||
$ 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) |
||||
``` |
||||
|
||||
Ya que has hecho esto, puedes buscar actualizaciones del repo ejecutando `git fetch upstream`. Esto busca las ramas y etiquetas — juntos conocidos como "refs" — del repo QMK, que ahora tiene el apodo `upstream`. Ahora podemos comparar los archivos en nuestro fork `origin` con los de QMK. |
||||
|
||||
Para actualizar la rama master de tu fork, ejecuta lo siguiente, pulsando Intro después de cada línea: |
||||
|
||||
``` |
||||
git checkout master |
||||
git fetch upstream |
||||
git pull upstream master |
||||
git push origin master |
||||
``` |
||||
|
||||
Esto te coloca en tu rama master, busca los refs del repo de QMK, descarga la rama `master` actual a tu computadora, y después lo sube a tu fork. |
||||
|
||||
### Hacer cambios |
||||
|
||||
Para hacer cambios, crea una nueva rama ejecutando: |
||||
|
||||
``` |
||||
git checkout -b dev_branch |
||||
git push --set-upstream origin dev_branch |
||||
``` |
||||
|
||||
Esto crea una nueva rama llamada `dev_branch`, te coloca en ella, y después guarda la nueva rama a tu fork. El parámetro `--set-upstream` le dice a git que use tu fork y la rama `dev_branch` cada vez que uses `git push` o `git pull` en esta rama. Solo necesitas usarlo la primera que que subes cambios; ya después, puedes usar `git push` o `git pull`, sin usar los demás parámetros. |
||||
|
||||
!> Con `git push`, puedes usar `-u` en vez de `--set-upstream` — `-u` es un alias de `--set-upstream`. |
||||
|
||||
Puedes nombrar tu rama casi cualquier cosa, pero se recomienda ponerle algo con relación a los cambios que vas a hacer. |
||||
|
||||
Por defecto `git checkout -b` se basará tu nueva rama en la rama en la cual estás actualmente. Puedes basar tu rama en otra rama existente agregando el nombre de la rama al comando: |
||||
|
||||
``` |
||||
git checkout -b dev_branch master |
||||
``` |
||||
|
||||
Ahora que tienes una rama development, abre tu editor de texto y haz los cambios que quieres. Se recomienda hacer varios commits pequeños a tu rama; de este modo cualquier cambio que causa problemas puede ser rastreado y deshecho si fuera necesario. Para hacer tus cambios, edita y guarda los archivos que necesitas actualizar, agrégalos al *staging area* de Git, y luego haz un commit a tu rama: |
||||
|
||||
``` |
||||
git add path/to/updated_file |
||||
git commit -m "My commit message." |
||||
``` |
||||
`git add` agrega los archivos que han sido cambiados al *staging area* de Git, lo cual es la "zona de preparación"de Git. Este contiene los cambios que vas a *commit* usando `git commit`, que guarda los cambios en el repo. Usa un mensaje de commit descriptivo para que puedas saber que ha cambiado fácilmente. |
||||
|
||||
!> Si has cambiado muchos archivos, pero todos los archivos son parte del mismo cambio, puedes usar `git add .` para agregar todos los archivos cambiados que están en tu directiro actual, en vez de agregar cada archivo manualmente. |
||||
|
||||
### Publicar tus cambios |
||||
|
||||
El útimo paso es subir tus cambios a tu fork. Para hacerlo, ejecuta `git push`. Ahora Git publicará el estado actual de `dev_branch` a tu fork. |
||||
|
||||
|
||||
## Resolver los conflictos del merge |
||||
|
||||
A veces cuando el trabajo en una rama tarda mucho tiempo en completarse, los cambios que han sido hechos por otros chocan con los cambios que has hecho en tu rama cuando abres un pull request. Esto se llama un *merge conflict*, y es algo que ocurre cuando varias personas editan las mismas partes de los mismos archivos. |
||||
|
||||
### Rebase tus cambios |
||||
|
||||
Un *rebase* es la manera de Git de tomar los cambios que se aplicaron en un punto, deshacerlos, y aplicar estos mismos cambios en otro punto. En el caso de un conflicto de merge, puedes hacer un rebase de tu rama para recoger los cambios que has hecho. |
||||
|
||||
Para empezar, ejecuta lo siguiente: |
||||
|
||||
``` |
||||
git fetch upstream |
||||
git rev-list --left-right --count HEAD...upstream/master |
||||
``` |
||||
|
||||
El comando `git rev-list` ejecutado aquí muestra el número de commits que difieren entre la rama actual y la rama master de QMK. Ejecutamos `git fetch` primero para asegurarnos de que tenemos los refs que representan es estado actual del repo upstream. El output del comando `git rev-list` muestra dos números: |
||||
|
||||
``` |
||||
$ git rev-list --left-right --count HEAD...upstream/master |
||||
7 35 |
||||
``` |
||||
|
||||
El primer número representa el número de commits en la rama actual desde que fue creada, y el segundo número es el número de commits hecho a `upstream/master` desde que la rama actual fue creada, o sea los cambios que no están registrados en la rama actual. |
||||
|
||||
Ahora que sabemos el estado actual de la rama actual y el del repo upstream, podemos empezar una operación rebase: |
||||
|
||||
``` |
||||
git rebase upstream/master |
||||
``` |
||||
Esto le dice a Git que deshaga los commits en la rama actual, y después los re-aplica en la rama master de 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". |
||||
``` |
||||
|
||||
Esto nos dice que tenemos un conflicto de merge, y nos dice el nombre del archivo con el conflict. Abre el archivo en tu editor de texto, y en alguna parte del archivo verás algo así: |
||||
|
||||
``` |
||||
<<<<<<< HEAD |
||||
<p>For help with any issues, email us at support@webhost.us.</p> |
||||
======= |
||||
<p>Need help? Email support@webhost.us.</p> |
||||
>>>>>>> Commit #1 |
||||
``` |
||||
La línea `<<<<<<< HEAD` marca el principio de un conflicto de merge, y la línea `>>>>>>> Commit #1` marca el final, con las secciones de conflicto separadas por `=======`. La parte del lado `HEAD` is de la versión de QMK master del archivo, y la parte marcada con el mensaje de commit es de la rama actual. |
||||
|
||||
Ya que Git rastrea *cambios de archivos* en vez del contenido de los archivos directamente, si Git no puede encontrar el texto que estaba en el archivo antes del último commit, no sabrá cómo editar el archivo. El editar el archivo de nuevo resolverá este conflicto. Haz tus cambios, y guarda el archivo. |
||||
|
||||
``` |
||||
<p>Need help? Email support@webhost.us.</p> |
||||
``` |
||||
|
||||
Ahora ejecuta: |
||||
|
||||
``` |
||||
git add conflicting_file_1.txt |
||||
git rebase --continue |
||||
``` |
||||
|
||||
Git registra los cambios al archivo con conflictos, y sigue aplicando los commits de nuestra rama hasta llegar al final. |
@ -0,0 +1,81 @@ |
||||
# Construyendo tu primer firmware |
||||
|
||||
Ahora que has configurado tu entorno de construcción estas listo para empezar a construir firmwares personalizados. Para esta sección de la guía alternaremos entre 3 programas - tu gestor de ficheros, tu editor de texto , y tu ventana de terminal. Manten los 3 abiertos hasta que hayas acabado y estés contento con el firmware de tu teclado. |
||||
|
||||
Si has cerrado y reabierto la ventana de tu terminal después de seguir el primero paso de esta guía, no olvides hacer `cd qmk_firmware` para que tu terminal esté en el directorio correcto. |
||||
|
||||
## Navega a tu carpeta de keymaps |
||||
|
||||
Comienza navegando a la carpeta `keymaps` correspondiente a tu teclado. |
||||
|
||||
?> Si estás en macOS o Windows hay comandos que puedes utilizar fácilmente para abrir la carpeta keymaps. |
||||
|
||||
?> macOS: |
||||
|
||||
abre keyboards/<keyboard_folder>/keymaps |
||||
|
||||
?> Windows: |
||||
|
||||
inicia .\\keyboards\\<keyboard_folder>\\keymaps |
||||
|
||||
## Crea una copia del keymap `default` |
||||
|
||||
Una vez que tengas la carpeta `keymaps` abierta querrás crear una copia de la carpeta `default`. Recomendamos encarecidamente que nombres la carpeta igual que tu nombre de usuario de GitHub, pero puedes utilizar el nombre que quieras siempre que contenga sólo letras en minúscula, números y el caracter de guión bajo. |
||||
|
||||
Para automatizar el proceso, también tienes la opción de ejecutar el script `new_keymap.sh`. |
||||
|
||||
Navega a la carpeta `qmk_firmware/util` e introduce lo siguiente: |
||||
|
||||
``` |
||||
./new_keymap.sh <keyboard path> <username> |
||||
``` |
||||
|
||||
Por ejemplo, para un usuario llamado John, intentando hacer un keymap nuevo para el 1up60hse, tendría que teclear |
||||
|
||||
``` |
||||
./new_keymap.sh 1upkeyboards/1up60hse john |
||||
``` |
||||
|
||||
## Abre `keymap.c` con tu editor de texto favorito |
||||
|
||||
Abre tu `keymap.c`. Dentro de este fichero encontrarás la estructura que controla cómo se comporta tu teclado. En lo alto de `keymap.c` puede haber distintos defines y enums que hacen el keymap más fácil de leer. Continuando por abajo encontrarás una línea con este aspecto: |
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
||||
|
||||
Esta línea indica el comienzo del listado de Capas. Debajo encontrarás líneas que contienen o bien `LAYOUT` o `KEYMAP`, y estas líneas indican el comienzo de una capa. Debajo de esa línea está la lista de teclas que pertenecen a esa capa concreta. |
||||
|
||||
!> Cuando estés editando tu fichero de keymap ten cuidado con no añadir ni eliminar ninguna coma. Si lo haces el firmware dejará de compilar y puede no ser fácil averiguar dónde está la coma faltante o sobrante. |
||||
|
||||
## Personaliza el Layout a tu gusto |
||||
|
||||
Cómo completar esta paso depende enteramente de ti. Haz ese pequeño cambio que querías o rehaz completamente todo. Puedes eliminar capas si no las necesitas todas, o añadir nuevas hasta un total de 32. Comprueba la siguiente documentación para descubrir qué es lo que puedes definir aquí: |
||||
|
||||
* [Keycodes](keycodes.md) |
||||
* [Características](features.md) |
||||
* [Preguntas frecuentes](faq.md) |
||||
|
||||
?> Mientras estás descubriendo cómo funcionan los keymaps, haz pequeños cambios. Cambios mayores pueden hacer difícil la depuración de problemas que puedan aparecer. |
||||
|
||||
## Construye tu firmware |
||||
|
||||
Cuando los cambios a tu keymap están completos necesitarás construir el firmware. Para hacerlo vuelve a la ventana de tu terminal y ejecuta el siguiente comando: |
||||
|
||||
make <my_keyboard>:<my_keymap> |
||||
|
||||
Por ejemplo, si tu keymap se llama "xyverz" y estás construyendo un keymap para un planck rev5, utilizarás el siguiente comando: |
||||
|
||||
make planck/rev5:xyverz |
||||
|
||||
Mientras compila, recibirás un montón de información de salida en la pantalla informándote de qué ficheros están siendo compilados. Debería acabar con una información similar a esta: |
||||
|
||||
``` |
||||
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 |
||||
``` |
||||
|
||||
## Flashea tu firmware |
||||
|
||||
Continua con [Flasheando el firmware](newbs_flashing.md) para aprender cómo escribir tu firmware nuevo en tu teclado. |
@ -0,0 +1,105 @@ |
||||
# Configurador QMK |
||||
|
||||
El [Configurador QMK](https://config.qmk.fm) es un entorno gráfico online que genera ficheros hexadecimales de Firmware QMK. |
||||
|
||||
?> **Por favor sigue estos pasos en orden.** |
||||
|
||||
Ve el [Video tutorial](https://youtu.be/tx54jkRC9ZY) |
||||
|
||||
El Configurador QMK functiona mejor con Chrome/Firefox. |
||||
|
||||
|
||||
!> **Ficheros de otras herramientas como KLE, o kbfirmware no serán compatibles con el Configurador QMK. No las cargues, no las importes. El configurador Configurador QMK es una herramienta DIFERENTE. ** |
||||
|
||||
## Seleccionando tu teclado |
||||
|
||||
Haz click en el desplegable y selecciona el teclado para el que quieres crear el keymap. |
||||
|
||||
?> Si tu teclado tiene varias versiones, asegúrate de que seleccionas la correcta.** |
||||
|
||||
Lo diré otra vez porque es importante |
||||
|
||||
!> **ASEGÚRATE DE QUE SELECCIONAS LA VERSIÓN CORRECTA!** |
||||
|
||||
Si se ha anunciado que tu teclado funciona con QMK pero no está en la lista, es probable que un desarrollador no se haya encargado de él aún o que todavía no hemos tenido la oportunidad de incluirlo. Abre un issue en [qmk_firmware](https://github.com/qmk/qmk_firmware/issues) solicitando soportar ese teclado un particular, si no hay un [Pull Request](https://github.com/qmk/qmk_firmware/pulls?q=is%3Aopen+is%3Apr+label%3Akeyboard) activo para ello. Hay también teclados que funcionan con QMK que están en las cuentas de github de sus manufacturantes. Acuérdate de comprobar esto también. |
||||
|
||||
## Eligiendo el layout de tu teclado |
||||
|
||||
Elige el layout que mejor represente el keymap que quieres crear. Algunos teclados no tienen suficientes layouts o layouts correctos definidos aún. Serán soportados en el futuro. |
||||
|
||||
## Nombre del keymap |
||||
|
||||
Llama a este keymap como quieras. |
||||
|
||||
?> Si estás teniendo problemas para compilar, puede merecer la pena probar un cambio de nombre, ya que puede que ya exista en el repositorio de QMK Firmware. |
||||
|
||||
## Creando Tu keymap |
||||
|
||||
La adición de keycodes se puede hacer de 3 maneras. |
||||
1. Arrastrando y soltando |
||||
2. Clickando en un hueco vacío en el layout y haciendo click en el keycode que deseas |
||||
3. Clickando en un hueco vacío en el layout, presionando la tecla física en tu teclado. |
||||
|
||||
Mueve el puntero de tu ratón sobre una tecla y un pequeño extracto te dirá que es lo que hace la tecla. Para una descripción más detallada por favor, mira |
||||
|
||||
[Referencia básica de keycodes](https://docs.qmk.fm/#/keycodes_basic) |
||||
[Referencia avanzada de keycodes](https://docs.qmk.fm/#/feature_advanced_keycodes) |
||||
|
||||
En el caso de que no puedas encontrar un layout que suporte tu keymap, por ejemplo, tres huecos para la barra espaciadora, dos huecos para el retroceso o dos huecos para shift etc etc, rellènalos TODOS. |
||||
|
||||
### Ejemplo: |
||||
|
||||
3 huecos para barra espaciadora: Rellena TODOS con barra espaciadora |
||||
|
||||
2 huecos para retroceso: Rellena AMBOS con retroceso |
||||
|
||||
2 huecos para el shift derecho: Rellena AMBOS con shift derecho |
||||
|
||||
1 hueco para el shift izquierdo y 1 hueco para soporte iso: Rellena ambos con el shift izquierdo |
||||
|
||||
5 huecos , pero sólo 4 teclas: Intuye y comprueba o pregunta a alguien que lo haya hecho anteriormente. |
||||
|
||||
## Guardando tu keymap para ediciones futuras |
||||
|
||||
Cuando estés satisfecho con un teclado o quieres trabajar en el después, pulsa el botón `Exportar Keymap`. Guardára tu keymap con el nombre que elijas seguido de .json. |
||||
|
||||
Entonces podrás cargar este fichero .json en el futuro pulsando el botón `Importar Keymap`. |
||||
|
||||
!> **PRECAUCIÓN:** No es el mismo tipo de fichero .json usado en kbfirmware.com ni ninguna otra herramienta. Si intentas utilizar un fichero .json de alguna de estas herramientas con el Configurador QMK, existe la posibilidad de que tu teclado **explote**. |
||||
|
||||
## Generando tu fichero de firmware |
||||
|
||||
Pulsa el botón verde `Compilar`. |
||||
|
||||
Cuando la compilación haya acabado, podrás presionar el botón verde `Descargar Firmware`. |
||||
|
||||
## Flasheando tu teclado |
||||
|
||||
Por favor, dirígete a la sección de [Flashear firmware](newbs_flashing.md) |
||||
|
||||
## Problemas comunes |
||||
|
||||
#### Mi fichero .json no funciona |
||||
|
||||
Si el fichero .json fue generado con el Configurador QMK, enhorabuena, has dado con un bug. Abre una issue en [qmk_configurator](https://github.com/qmk/qmk_configurator/issues) |
||||
|
||||
Si no....cómo no viste el mensaje en negrita que puse arriba diciendo que no hay que utilizar otros ficheros .json? |
||||
|
||||
#### Hay espacios extra en mi layout ¿Qué hago? |
||||
|
||||
Si te refieres a tener tres espacios para la barra espaciadora, la mejor decisión es rellenar los tres con la barra espaciadora. También se puede hacer lo mismo con las teclas retroceso y las de shift |
||||
|
||||
#### Para qué sirve el keycode....... |
||||
|
||||
Por favor, mira |
||||
|
||||
[Referencia básica de keycodes](https://docs.qmk.fm/#/keycodes_basic) |
||||
[Referencia avanzada de keycodes](https://docs.qmk.fm/#/feature_advanced_keycodes) |
||||
|
||||
#### No compila |
||||
|
||||
Por favor, revisa las otras capas de tu keymap para asegurarte de que no hay teclas aleatorias presentes. |
||||
|
||||
## Problemas y bugs |
||||
|
||||
Siempre aceptamos peticiones de clientes y reportes de bug. Por favor, indícalos en [qmk_configurator](https://github.com/qmk/qmk_configurator/issues) |
@ -0,0 +1,351 @@ |
||||
# Flasheando tu teclado |
||||
|
||||
Ahora que has construido tu fichero de firmware personalizado querrás flashear tu teclado. |
||||
|
||||
## Flasheando tu teclado con QMK Toolbox |
||||
|
||||
La manera más simple de flashear tu teclado sería con [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases). |
||||
|
||||
De todos modos, QMK Toolbox actualmente sólo está disponible para Windows y macOS. Si estás usando Linux (o sólo quisieras flashear el firmware desde la línea de comandos), tendrás que utilizar el [método indicado abajo](newbs_flashing.md#flash-your-keyboard-from-the-command-line). |
||||
|
||||
### Cargar el fichero en QMK Toolbox |
||||
|
||||
Empieza abriendo la aplicación QMK Toolbox. Tendrás que buscar el fichero de firmware usando Finder o Explorer. El firmware de teclado puede estar en uno de estos dos formatos- `.hex` o `.bin`. QMK intenta copiar el apropiado para tu teclado en el fichero raíz `qmk_firmware`. |
||||
|
||||
?> Si tu estás on Windows o macOS hay comandos que puedes usar para abrir fácilmente la carpeta del firmware actual en Explorer o Finder. |
||||
|
||||
?> Windows: |
||||
|
||||
start . |
||||
|
||||
?> macOS: |
||||
|
||||
open . |
||||
|
||||
El fichero de firmware sempre sigue el siguiente formato de nombre: |
||||
|
||||
<nombre_teclado>_<nombre_keymap>.{bin,hex} |
||||
|
||||
Por ejemplo, un `plank/rev5` con un keymap `default` tendrá este nombre de fichero: |
||||
|
||||
planck_rev5_default.hex |
||||
|
||||
Una vez que hayas localizado el fichero de tu firmware arrástralo a la caja "Fichero local" en QMK Toolbox, o haz click en "Abrir" y navega allí donde tengas almacenado tu fichero de firmware. |
||||
|
||||
### Pon tu teclado en modo DFU (Bootloader) |
||||
|
||||
Para poder flashear tu firmware personalizado tienes que poner tu teclado en un modo especial que permite flasheado. Cuando está en este modo no podrás teclear o utilizarlo para ninguna otra cosa. Es muy importante que no desconectes tu teclado, de lo contrario interrumpirás el proceso de flasheo mientras el firmware se está escribiendo. |
||||
|
||||
Diferentes teclados tienen diferentes maneras de entrar en este modo especial. Si tu PCB actualmente ejecuta QMK o TMK y no has recibido instrucciones específicas, intenta los siguientes pasos en orden: |
||||
|
||||
* Manten pulsadas ambas teclas shift y pulsa `Pause` |
||||
* Manten pulsadas ambas teclas shift y pulsa `B` |
||||
* Desconecta tu teclado, mantén pulsada la barra espaciadora y `B` al mismo tiempo, conecta tu teclado y espera un segundo antes de dejar de pulsar las teclas |
||||
* Pulsa el botón físico `RESET` situado en el fondo de la PCB |
||||
* Localiza los pines en la PCB etiquetados on `BOOT0` o `RESET`, puentea estos dos juntos cuando enchufes la PCB |
||||
|
||||
Si has tenido éxito verás un mensaje similar a este en QMK Toolbox: |
||||
|
||||
``` |
||||
*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390 |
||||
*** DFU device connected |
||||
``` |
||||
|
||||
### Flashea tu teclado |
||||
|
||||
Haz click en el botón `Flash` de QMK Toolbox. Verás una información de salida similar a esta: |
||||
|
||||
``` |
||||
*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390 |
||||
*** DFU device connected |
||||
*** Attempting to flash, please don't remove device |
||||
>>> dfu-programmer atmega32u4 erase --force |
||||
Erasing flash... Success |
||||
Checking memory from 0x0 to 0x6FFF... Empty. |
||||
>>> dfu-programmer atmega32u4 flash /Users/skully/qmk_firmware/clueboard_66_hotswap_gen1_skully.hex |
||||
Checking memory from 0x0 to 0x55FF... Empty. |
||||
0% 100% Programming 0x5600 bytes... |
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success |
||||
0% 100% Reading 0x7000 bytes... |
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success |
||||
Validating... Success |
||||
0x5600 bytes written into 0x7000 bytes memory (76.79%). |
||||
>>> dfu-programmer atmega32u4 reset |
||||
|
||||
*** DFU device disconnected |
||||
*** Clueboard - Clueboard 66% HotSwap connected -- 0xC1ED:0x2390 |
||||
``` |
||||
|
||||
## Flashea tu teclado desde la línea de comandos |
||||
|
||||
Lo primero que tienes que saber es qué bootloader utiliza tu teclado. Hay cuatro bootloaders pincipales que se usan habitualmente . Pro-Micro y sus clones usan CATERINA, Teensy's usa Halfkay, las placas OLKB usan QMK-DFU, y otros chips atmega32u4 usan DFU. |
||||
|
||||
Puedes encontrar más información sobre bootloaders en la página [Instrucciones de flasheado e información de Bootloader](flashing.md). |
||||
|
||||
Si sabes qué bootloader estás usando, en el momento de compilar el firmware, podrás añadir algún texto extra al comando `make` para automatizar el proceso de flasheado. |
||||
|
||||
### DFU |
||||
|
||||
Para eo bootloader DFU, cuando estés listo para compilar y flashear tu firmware, abre tu ventana de terminal y ejecuta el siguiente comando de construcción: |
||||
|
||||
make <my_keyboard>:<my_keymap>:dfu |
||||
|
||||
Por ejemplo, si tu keymap se llama "xyverz" y estás construyendo un keymap para un planck rev5, utilizarás este comando: |
||||
|
||||
make planck/rev5:xyverz:dfu |
||||
|
||||
Una vez que finalice de compilar, deberá aparecer lo siguiente: |
||||
|
||||
``` |
||||
Linking: .build/planck_rev5_xyverz.elf [OK] |
||||
Creating load file for flashing: .build/planck_rev5_xyverz.hex [OK] |
||||
Copying planck_rev5_xyverz.hex to qmk_firmware folder [OK] |
||||
Checking file size of planck_rev5_xyverz.hex |
||||
* File size is fine - 18574/28672 |
||||
``` |
||||
|
||||
Después de llegar a este punto, el script de construcción buscará el bootloader DFU cada 5 segundos. Repetirá lo siguiente hasta que se encuentre el dispositivo o lo canceles: |
||||
|
||||
dfu-programmer: no device present. |
||||
Error: Bootloader not found. Trying again in 5s. |
||||
|
||||
Una vez haya hecho esto, tendrás que reiniciar el controlador. Debería mostrar una información de salida similar a esta: |
||||
|
||||
``` |
||||
*** Attempting to flash, please don't remove device |
||||
>>> dfu-programmer atmega32u4 erase --force |
||||
Erasing flash... Success |
||||
Checking memory from 0x0 to 0x6FFF... Empty. |
||||
>>> dfu-programmer atmega32u4 flash /Users/skully/qmk_firmware/clueboard_66_hotswap_gen1_skully.hex |
||||
Checking memory from 0x0 to 0x55FF... Empty. |
||||
0% 100% Programming 0x5600 bytes... |
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success |
||||
0% 100% Reading 0x7000 bytes... |
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success |
||||
Validating... Success |
||||
0x5600 bytes written into 0x7000 bytes memory (76.79%). |
||||
>>> dfu-programmer atmega32u4 reset |
||||
``` |
||||
|
||||
?> Si tienes problemas con esto- del estilo de `dfu-programmer: no device present` - por favor consulta las [Preguntas frecuentes de construcción](faq_build.md). |
||||
|
||||
#### Comandos DFU |
||||
|
||||
Hay un número de comandos DFU que puedes usar para flashear firmware a un dispositivo DFU: |
||||
|
||||
* `:dfu` - Esta es la opción normal y espera hasta que un dispositivo DFU esté disponible, entonces flashea el firmware. Esperará reintentando cada 5 segundos, para ver si un dispositivo DFU ha aparecido. |
||||
* `:dfu-ee` - Esta flashea un fichero `eep` en vez del hex normal. Esto no es lo común. |
||||
* `:dfu-split-left` - Esta flashea el firmware normal, igual que la opción por defecto (`:dfu`). Sin embargo, también flashea el fichero EEPROM "Lado Izquierdo" para teclados divididos. _Esto es ideal para los ficheros divididos basados en Elite C._ |
||||
* `:dfu-split-right` - Esto flashea el firmware normal, igual que la opción por defecto (`:dfu`). Sin embargo, también flashea el fichero EEPROM "Lado Derecho" para teclados divididos. _Esto es ideal para los ficheros divididos basados en Elite C._ |
||||
|
||||
|
||||
### Caterina |
||||
|
||||
Para placas Arduino y sus clones (como la SparkFun ProMicro), cuando estés listo para compilar y flashear tu firmware, abre tu ventana de terminal y ejecuta el siguiente comando de construcción: |
||||
|
||||
make <my_keyboard>:<my_keymap>:avrdude |
||||
|
||||
Por ejemplo, si tu keymap se llama "xyverz" y estás construyendo un keymap para un Lets Split rev2, usarás este comando: |
||||
|
||||
make lets_split/rev2:xyverz:avrdude |
||||
|
||||
Una vez que finalice de compilar, deberá aparecer lo siguiente: |
||||
|
||||
``` |
||||
Linking: .build/lets_split_rev2_xyverz.elf [OK] |
||||
Creating load file for flashing: .build/lets_split_rev2_xyverz.hex [OK] |
||||
Checking file size of lets_split_rev2_xyverz.hex [OK] |
||||
* File size is fine - 27938/28672 |
||||
Detecting USB port, reset your controller now.............. |
||||
``` |
||||
|
||||
En este punto, reinicia la placa y entonces el script detectará el bootloader y procederá a flashear la placa. La información de salida deber ser algo similar a esto: |
||||
|
||||
``` |
||||
Detected controller on USB port at /dev/ttyS15 |
||||
|
||||
Connecting to programmer: . |
||||
Found programmer: Id = "CATERIN"; type = S |
||||
Software Version = 1.0; No Hardware Version given. |
||||
Programmer supports auto addr increment. |
||||
Programmer supports buffered memory access with buffersize=128 bytes. |
||||
|
||||
Programmer supports the following devices: |
||||
Device code: 0x44 |
||||
|
||||
avrdude.exe: AVR device initialized and ready to accept instructions |
||||
|
||||
Reading | ################################################## | 100% 0.00s |
||||
|
||||
avrdude.exe: Device signature = 0x1e9587 (probably m32u4) |
||||
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed |
||||
To disable this feature, specify the -D option. |
||||
avrdude.exe: erasing chip |
||||
avrdude.exe: reading input file "./.build/lets_split_rev2_xyverz.hex" |
||||
avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex auto detected as Intel Hex |
||||
avrdude.exe: writing flash (27938 bytes): |
||||
|
||||
Writing | ################################################## | 100% 2.40s |
||||
|
||||
avrdude.exe: 27938 bytes of flash written |
||||
avrdude.exe: verifying flash memory against ./.build/lets_split_rev2_xyverz.hex: |
||||
avrdude.exe: load data flash data from input file ./.build/lets_split_rev2_xyverz.hex: |
||||
avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex auto detected as Intel Hex |
||||
avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex contains 27938 bytes |
||||
avrdude.exe: reading on-chip flash data: |
||||
|
||||
Reading | ################################################## | 100% 0.43s |
||||
|
||||
avrdude.exe: verifying ... |
||||
avrdude.exe: 27938 bytes of flash verified |
||||
|
||||
avrdude.exe: safemode: Fuses OK (E:CB, H:D8, L:FF) |
||||
|
||||
avrdude.exe done. Thank you. |
||||
``` |
||||
Si tienes problemas con esto, puede ser necesario que hagas esto: |
||||
|
||||
sudo make <my_keyboard>:<my_keymap>:avrdude |
||||
|
||||
|
||||
Adicionalmente, si quisieras flashear múltiples placas, usa el siguiente comando: |
||||
|
||||
make <keyboard>:<keymap>:avrdude-loop |
||||
|
||||
Cuando hayas acabado de flashear placas, necesitarás pulsar Ctrl + C o cualquier combinación que esté definida en tu sistema operativo para finalizar el bucle. |
||||
|
||||
|
||||
### HalfKay |
||||
|
||||
Para dispositivos PJRC (Teensy's), cuando estés listo para compilar y flashear tu firmware, abre tu ventana de terminal y ejecuta el siguiente comando de construcción: |
||||
|
||||
make <my_keyboard>:<my_keymap>:teensy |
||||
|
||||
Por ejemplo, si tu keymap se llama "xyverz" y estás construyendo un keymap para un Ergodox o un Ergodox EZ, usarás este comando: |
||||
|
||||
make ergodox_ez:xyverz:teensy |
||||
|
||||
Una vez que el firmware acabe de compilar, deberá mostrar una información de salida como esta: |
||||
|
||||
``` |
||||
Linking: .build/ergodox_ez_xyverz.elf [OK] |
||||
Creating load file for flashing: .build/ergodox_ez_xyverz.hex [OK] |
||||
Checking file size of ergodox_ez_xyverz.hex [OK] |
||||
* File size is fine - 25584/32256 |
||||
Teensy Loader, Command Line, Version 2.1 |
||||
Read "./.build/ergodox_ez_xyverz.hex": 25584 bytes, 79.3% usage |
||||
Waiting for Teensy device... |
||||
(hint: press the reset button) |
||||
``` |
||||
|
||||
En este punto, reinicia tu placa. Una vez que lo hayas hecho, deberás ver una información de salida como esta: |
||||
|
||||
``` |
||||
Found HalfKay Bootloader |
||||
Read "./.build/ergodox_ez_xyverz.hex": 28532 bytes, 88.5% usage |
||||
Programming............................................................................................................................................................................ |
||||
................................................... |
||||
Booting |
||||
``` |
||||
|
||||
### BootloadHID |
||||
|
||||
Para placas basadas en Bootmapper Client(BMC)/bootloadHID/ATmega32A, cuando estés listo para compilar y flashear tu firmware, abre tu ventana de terminal y ejecuta el comando de construcción: |
||||
|
||||
make <my_keyboard>:<my_keymap>:bootloaderHID |
||||
|
||||
Por ejemplo, si tu keymap se llama "xyverz" y estás construyendo un keymap para un jj40, usarás esté comando: |
||||
|
||||
make jj40:xyverz:bootloaderHID |
||||
|
||||
Una vez que el firmware acaba de compilar, mostrará una información de salida como esta: |
||||
|
||||
``` |
||||
Linking: .build/jj40_default.elf [OK] |
||||
Creating load file for flashing: .build/jj40_default.hex [OK] |
||||
Copying jj40_default.hex to qmk_firmware folder [OK] |
||||
Checking file size of jj40_default.hex [OK] |
||||
* The firmware size is fine - 21920/28672 (6752 bytes free) |
||||
``` |
||||
|
||||
Después de llegar a este punto, el script de construcción buscará el bootloader DFU cada 5 segundos. Repetirá lo siguiente hasta que se encuentre el dispositivo o hasta que lo canceles. |
||||
|
||||
``` |
||||
Error opening HIDBoot device: The specified device was not found |
||||
Trying again in 5s. |
||||
``` |
||||
|
||||
Una vez que lo haga, querrás reinicar el controlador. Debería entonces mostrar una información de salida similar a esta: |
||||
|
||||
``` |
||||
Page size = 128 (0x80) |
||||
Device size = 32768 (0x8000); 30720 bytes remaining |
||||
Uploading 22016 (0x5600) bytes starting at 0 (0x0) |
||||
0x05580 ... 0x05600 |
||||
``` |
||||
|
||||
### STM32 (ARM) |
||||
|
||||
Para la mayoría de placas ARM (incluyendo la Proton C, Planck Rev 6, y Preonic Rev 3), cuando estés listo para compilar y flashear tu firmware, abre tu ventana de terminal y ejecuta el siguiente comando de construcción: |
||||
|
||||
make <my_keyboard>:<my_keymap>:dfu-util |
||||
|
||||
Por ejemplo, si tu keymap se llama "xyverz" y estás construyendo un keymap para un teclado Planck Revision 6, utilizarás este comando y a continuación reiniciarás el teclado con el bootloader (antes de que acabe de compilar): |
||||
|
||||
make planck/rev6:xyverz:dfu-util |
||||
|
||||
Una vez que el firmware acaba de compilar, mostrará una información de salida similar a esta: |
||||
|
||||
``` |
||||
Linking: .build/planck_rev6_xyverz.elf [OK] |
||||
Creating binary load file for flashing: .build/planck_rev6_xyverz.bin [OK] |
||||
Creating load file for flashing: .build/planck_rev6_xyverz.hex [OK] |
||||
|
||||
Size after: |
||||
text data bss dec hex filename |
||||
0 41820 0 41820 a35c .build/planck_rev6_xyverz.hex |
||||
|
||||
Copying planck_rev6_xyverz.bin to qmk_firmware folder [OK] |
||||
dfu-util 0.9 |
||||
|
||||
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. |
||||
Copyright 2010-2016 Tormod Volden and Stefan Schmidt |
||||
This program is Free Software and has ABSOLUTELY NO WARRANTY |
||||
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ |
||||
|
||||
Invalid DFU suffix signature |
||||
A valid DFU suffix will be required in a future dfu-util release!!! |
||||
Opening DFU capable USB device... |
||||
ID 0483:df11 |
||||
Run-time device DFU version 011a |
||||
Claiming USB DFU Interface... |
||||
Setting Alternate Setting #0 ... |
||||
Determining device status: state = dfuERROR, status = 10 |
||||
dfuERROR, clearing status |
||||
Determining device status: state = dfuIDLE, status = 0 |
||||
dfuIDLE, continuing |
||||
DFU mode device DFU version 011a |
||||
Device returned transfer size 2048 |
||||
DfuSe interface name: "Internal Flash " |
||||
Downloading to address = 0x08000000, size = 41824 |
||||
Download [=========================] 100% 41824 bytes |
||||
Download done. |
||||
File downloaded successfully |
||||
Transitioning to dfuMANIFEST state |
||||
``` |
||||
|
||||
#### STM32 Commands |
||||
|
||||
Hay un número de comandos DFU que puedes usar para flashear firmware a un dispositivo DFU: |
||||
|
||||
* `:dfu-util` - El comando por defecto para flashing en dispositivos STM32. |
||||
* `:dfu-util-wait` - Esto funciona como el comando por defecto, pero te da (configurable) 10 segundos de tiempo antes de que intente flashear el firmware. Puedes usar `TIME_DELAY=20` desde la líena de comandos para cambiar este tiempo de retardo. |
||||
* Eg: `make <keyboard>:<keymap>:dfu-util TIME_DELAY=5` |
||||
* `:dfu-util-split-left` - Flashea el firmware normal, igual que la opción por defecto (`:dfu-util`). Sin embargo, también flashea el fichero EEPROM "Lado Izquierdo" para teclados divididos. |
||||
* `:dfu-util-split-right` - Flashea el firmware normal, igual que la opción por defecto (`:dfu-util`). Sin embargo, también flashea el fichero EEPROM "Lado Derecho" para teclados divididos. |
||||
|
||||
## ¡Pruébalo! |
||||
|
||||
¡Felicidades! ¡Tu firmware personalizado ha sido programado en tu teclado! |
||||
|
||||
Pruébalo y asegúrate de que todo funciona de la manera que tu quieres. Hemos escrito [Testeando y depurando](newbs_testing_debugging.md) para redondear esta guía de novatos, así que pásate por allí para aprender cómo resolver problemas con tu funcionalidad personalizada. |
@ -0,0 +1,103 @@ |
||||
# Introducción |
||||
|
||||
El teclado de tu computador tiene un procesador dentro de él, no muy distinto del que está dentro de tu ordenador. Este procesador ejecuta software que es responsable de detectar la pulsación de las teclas y enviar informes sobre el estado del teclado cuando las teclas son pulsadas y liberadas. QMK ocupa el rol de ese software. Cuando construyes un keymap personalizado , estas creando el equivalente de un programa ejecutable en tu teclado. |
||||
|
||||
QMK intenta poner un montón de poder en tus manos haciendo que las cosas fáciles sean fáciles, y las cosas difíciles posibles. No tienes que saber cómo programar para crear keymaps potentes — sólo tienes que seguir un conjunto simple de reglas sintácticas. |
||||
|
||||
# Comenzando |
||||
|
||||
Antes de que puedas construir keymaps, necesitarás instalar algun software y configurar tu entorno de construcción. Esto sólo hay que hacerlo una vez sin importar en cuántos teclados planeas configurar el software. |
||||
|
||||
Si prefieres hacerlo mediante un interfaz gráfico , por favor, considera utilizar el [Configurador QMK](https://config.qmk.fm). En ese caso dirígete a [Construyendo tu primer firmware usando la GUI](newbs_building_firmware_configurator.md). |
||||
|
||||
|
||||
## Descarga el software |
||||
|
||||
### Editor de texto |
||||
|
||||
Necesitarás un programa con el que puedas editar y guardar archivos de **texto plano**, en windows puedes utilizar Notepad y en tu Linux puedes utilizar gedit. Estos dos programas son editores simples y funcionales. En macOS ten cuidado con la aplicación de edición de texto por defecto TextEdit: no guardará texto plano a menos de que se le seleccione explícitamente _Make Plain Text_ desde el menú _Format_. |
||||
|
||||
También puedes descargar e instalar un editor de texto dedicado como [Sublime Text](https://www.sublimetext.com/) o [VS Code](https://code.visualstudio.com/). Esta es probablemente la mejor manera independientemente de la plataforma, ya que estos programas fueron creados específicamente para editar código. |
||||
|
||||
?> ¿No estás seguro de qué editor de texto utilizar? Laurence Bradford escribió una [estupenda introducción](https://learntocodewith.me/programming/basics/text-editors/) al tema. |
||||
|
||||
### QMK Toolbox |
||||
|
||||
QMK Toolbox is an optional graphical program for Windows and macOS that allows you to both program and debug your custom keyboard. You will likely find it invaluable for easily flashing your keyboard and viewing debug messages that it prints. |
||||
|
||||
[Download the latest release here.](https://github.com/qmk/qmk_toolbox/releases/latest) |
||||
|
||||
* For Windows: `qmk_toolbox.exe` (portable) or `qmk_toolbox_install.exe` (installer) |
||||
* For macOS: `QMK.Toolbox.app.zip` (portable) or `QMK.Toolbox.pkg` (installer) |
||||
|
||||
## Configura tu entorno |
||||
|
||||
Hemos intentado hacer QMK lo más fácil de configurar posible. Sólo tienes que preparar tu entorno Linux o Unix, y luego dejar que QMK |
||||
instale el resto. |
||||
|
||||
?> Si no has trabajado con la línea de comandos de Linux/Unix con anterioridad, hay algunos conceptos y comandos básicos que deberías aprender. Estos recursos te enseñarán lo suficiente para poder trabajar con QMK:<br> |
||||
[Comandos de Linux que debería saber](https://www.guru99.com/must-know-linux-commands.html)<br> |
||||
[Algunos comandos básicos de Unix](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html) |
||||
|
||||
### Windows |
||||
|
||||
Necesitarás instalar MSYS2 y Git. |
||||
|
||||
* Sigue las instrucciones de instalación en la [página de MSYS2](http://www.msys2.org). |
||||
* Cierra las terminales abiertas de MSYS2 y abre una nueva termial de MSYS2 MinGW 64-bit. |
||||
* Instala Git ejecutando este comando: `pacman -S git`. |
||||
|
||||
### macOS |
||||
|
||||
Necesitarás instalar Homebrew. Sigue las instrucciones que encontrarás en la [página de Homebrew](https://brew.sh). |
||||
|
||||
Despueś de que se haya inastalado Homebrew, continúa con _Set Up QMK_. En ese paso ejecutará un script que instalará el resto de paquetes. |
||||
|
||||
### Linux |
||||
|
||||
Necesitarás instalar Git. Es bastante probable que ya lo tengas, pero si no, uno de los siguientes comandos debería instalarlo: |
||||
|
||||
* Debian / Ubuntu / Devuan: `apt-get install git` |
||||
* Fedora / Red Hat / CentOS: `yum install git` |
||||
* Arch: `pacman -S git` |
||||
|
||||
?> Docker es también una opción en todas las plataformas. [Haz click aquí si quieres detalles.](getting_started_build_tools.md#docker) |
||||
|
||||
## Configura QMK |
||||
|
||||
Una vez que hayas configurado tu entorno Linux/Unix, estarás listo para descargar QMK. Haremos esto utilizando Git para "clonar" el respositorio de QMK. Abre una ventana de Terminal o MSYS2 MinGW y mantenla abierta mientras sigues esta guía. Dentro de esa ventana ejecuta estos dos comandos: |
||||
|
||||
```shell |
||||
git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git |
||||
cd qmk_firmware |
||||
``` |
||||
|
||||
?> Si ya sabes [cómo usar GitHub](getting_started_github.md), te recomendamos en vez de eso, crees y clones tu propio fork. Si no sabes lo que significa, puedes ignorar este mensaje sin problemas. |
||||
|
||||
QMK viene con un script para ayudarte a configurar el resto de cosas que necesitarás. Deberías ejecutarlo introduciendo este comando: |
||||
|
||||
util/qmk_install.sh |
||||
|
||||
## Prueba tu entorno de construcción |
||||
|
||||
Ahora que tu entorno de construcción de QMK está configurado, puedes construcir un firmware para tu teclado. Comienza intentado construir el keymap por defecto del teclado. Deberías ser capaz de hacerlo con un comando con este formato: |
||||
|
||||
make <keyboard>:default |
||||
|
||||
Por ejemplo, para construir el firmware para un Clueboard 66% deberías usar: |
||||
|
||||
make clueboard/66/rev3:default |
||||
|
||||
Cuando esté hecho, deberías tener un montón de información de salida similar a esta: |
||||
|
||||
``` |
||||
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) |
||||
``` |
||||
|
||||
# Creando tu keymap |
||||
|
||||
Ya estás listo para crear tu propio keymap personal! Para hacerlo continua con [Construyendo tu primer firmware](newbs_building_firmware.md). |
@ -0,0 +1,15 @@ |
||||
# Recursos de aprendizaje |
||||
|
||||
Estos recursos procuran dar miembros nuevos en la communidad QMK un mayor entendimiento de la información proporcionada en la documentación para novatos. |
||||
|
||||
Recursos de Git: |
||||
|
||||
* [Excelente tutorial general](https://www.codecademy.com/learn/learn-git) |
||||
* [Juego de Git para aprender usando ejemplos](https://learngitbranching.js.org/) |
||||
* [Recursos de Git para aprender más sobre Github](getting_started_github.md) |
||||
* [Recursos de Git dirigidos específicamente a QMK](contributing.md) |
||||
|
||||
|
||||
Recursos para línea de mandatos: |
||||
|
||||
* [Excelente tutorial general sobre la línea de mandatos](https://www.codecademy.com/learn/learn-the-command-line) |
@ -0,0 +1,99 @@ |
||||
# Testeando y depurando |
||||
|
||||
Una vez que hayas flasheado tu teclado con un firmware personalizado estarás listo para probarlo. Con un poco de suerte todo funcionará a la primera, pero si no es así, este documento te ayudará a averiguar qué está mal. |
||||
|
||||
## Probando |
||||
|
||||
Probar tu teclado es generalmente bastante sencillo. Persiona cada una de las teclas y asegúrate de que envía la tecla correcta. Existen incluso programas que te ayudarán a asegurarte de que no te dejas ninguna tecla sin comprobar. |
||||
|
||||
Nota: Estos programas no los provée ni están relacionados con QMK. |
||||
|
||||
* [Switch Hitter](https://elitekeyboards.com/switchhitter.php) (Sólo Windows) |
||||
* [Keyboard Viewer](https://www.imore.com/how-use-keyboard-viewer-your-mac) (Sólo Mac) |
||||
* [Keyboard Tester](http://www.keyboardtester.com) (Aplicación web) |
||||
* [Keyboard Checker](http://keyboardchecker.com) (Aplicación web) |
||||
|
||||
## Depurando |
||||
|
||||
Tu teclado mostrará información de depuración si tienes `CONSOLE_ENABLE = yes` en tu `rules.mk`. Por defecto la información de salida es muy limitada, pero puedes encender el modo de depuración para incrementar la información de salida. Utiliza el keycode `DEBUG` de tu keymap, usa la característica [Comando](feature_command.md) para activar el modo depuración, o añade el siguiente código a tu keymap. |
||||
|
||||
```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; |
||||
} |
||||
``` |
||||
|
||||
### Depurando con QMK Toolbox |
||||
|
||||
Para plataformas compatibles, [QMK Toolbox](https://github.com/qmk/qmk_toolbox) se puede usar para mostrar mensajes de depuración de tu teclado. |
||||
|
||||
### Depurando con hid_listen |
||||
|
||||
¿Prefieres una solución basada en una terminal? [hid_listen](https://www.pjrc.com/teensy/hid_listen.html), provista por PJRC, se puede usar también para mostrar mensajes de depuración. Hay binarios preconstruídos para Windows,Linux,y MacOS. |
||||
|
||||
<!-- FIXME: Describe the debugging messages here. --> |
||||
|
||||
## Enviando tus propios mensajes de depuración |
||||
|
||||
A veces, es útil imprimir mensajes de depuración desde tu [código personalizado](custom_quantum_functions.md). Hacerlo es bastante simple. Comienza incluyendo `print.h` al principio de tu fichero: |
||||
|
||||
#include <print.h> |
||||
|
||||
Después de eso puedes utilzar algunas funciones print diferentes: |
||||
|
||||
* `print("string")`: Imprime un string simple |
||||
* `uprintf("%s string", var)`: Imprime un string formateado |
||||
* `dprint("string")` Imprime un string simple, pero sólo cuando el modo de depuración está activo |
||||
* `dprintf("%s string", var)`: Imprime un string formateado, pero sólo cuando el modo de depuración está activo |
||||
|
||||
## Ejemplos de depuración |
||||
|
||||
Debajo hay una colección de ejemplos de depuración del mundo real. Para información adicional, Dirígete a [Depurando/Encontrando problemas en QMK](faq_debug.md). |
||||
|
||||
### ¿Que posición en la matriz tiene esta pulsación de tecla? |
||||
|
||||
Cuando estés portando, o intentando diagnosticar problemas en la pcb, puede ser útil saber si la pulsación de una tecla es escaneada correctamente. Para hablitar la información de registro en este escenario, añade el siguiente código al `keymap.c` de tus keymaps |
||||
|
||||
```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; |
||||
} |
||||
``` |
||||
|
||||
Ejemplo de salida |
||||
```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 |
||||
``` |
||||
|
||||
### ¿Cuanto tiempo tardó en escanear la pulsación de una tecla? |
||||
|
||||
Cuando estés probando problemas en el rendimiento, puede ser útil saber la frecuenta a la cual la matríz de pulsadores se está escaneando. Para hablitar la información de registro en este escenario, añade el siguiente código al `config.h` de tus keymaps |
||||
|
||||
```c |
||||
#define DEBUG_MATRIX_SCAN_RATE |
||||
``` |
||||
|
||||
Ejemplo de salida |
||||
```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 |
||||
``` |
@ -0,0 +1,90 @@ |
||||
# DIP Switches |
||||
|
||||
DIP switches are supported by adding this to your `rules.mk`: |
||||
|
||||
DIP_SWITCH_ENABLE = yes |
||||
|
||||
and this to your `config.h`: |
||||
|
||||
```c |
||||
#define DIP_SWITCH_PINS { B14, A15, A10, B9 } |
||||
``` |
||||
|
||||
## Callbacks |
||||
|
||||
The callback functions can be inserted into your `<keyboard>.c`: |
||||
|
||||
```c |
||||
void dip_switch_update_kb(uint8_t index, bool active) { |
||||
dip_switch_update_user(index, active); |
||||
} |
||||
``` |
||||
|
||||
|
||||
or `keymap.c`: |
||||
|
||||
```c |
||||
void dip_switch_update_user(uint8_t index, bool active) { |
||||
switch (index) { |
||||
case 0: |
||||
if(active) { audio_on(); } else { audio_off(); } |
||||
break; |
||||
case 1: |
||||
if(active) { clicky_on(); } else { clicky_off(); } |
||||
break; |
||||
case 2: |
||||
if(active) { music_on(); } else { music_off(); } |
||||
break; |
||||
case 3: |
||||
if (active) { |
||||
#ifdef AUDIO_ENABLE |
||||
PLAY_SONG(plover_song); |
||||
#endif |
||||
layer_on(_PLOVER); |
||||
} else { |
||||
#ifdef AUDIO_ENABLE |
||||
PLAY_SONG(plover_gb_song); |
||||
#endif |
||||
layer_off(_PLOVER); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
``` |
||||
|
||||
Additionally, we support bit mask functions which allow for more complex handling. |
||||
|
||||
|
||||
```c |
||||
void dip_switch_update_mask_kb(uint32_t state) { |
||||
dip_switch_update_mask_user(state); |
||||
} |
||||
``` |
||||
|
||||
|
||||
or `keymap.c`: |
||||
|
||||
```c |
||||
void dip_switch_update_mask_user(uint32_t state) { |
||||
if (state & (1UL<<0) && state & (1UL<<1)) { |
||||
layer_on(_ADJUST); // C on esc |
||||
} else { |
||||
layer_off(_ADJUST); |
||||
} |
||||
if (state & (1UL<<0)) { |
||||
layer_on(_TEST_A); // A on ESC |
||||
} else { |
||||
layer_off(_TEST_A); |
||||
} |
||||
if (state & (1UL<<1)) { |
||||
layer_on(_TEST_B); // B on esc |
||||
} else { |
||||
layer_off(_TEST_B); |
||||
} |
||||
} |
||||
``` |
||||
|
||||
|
||||
## Hardware |
||||
|
||||
One side of the DIP switch should be wired directly to the pin on the MCU, and the other side to ground. It should not matter which side is connected to which, as it should be functionally the same. |
@ -0,0 +1,211 @@ |
||||
# Split Keyboard |
||||
|
||||
Many keyboards in the QMK Firmware repo are "split" keyboards. They use two controllers—one plugging into USB, and the second connected by a serial or an I<sup>2</sup>C connection over a TRRS or similar cable. |
||||
|
||||
Split keyboards can have a lot of benefits, but there is some additional work needed to get them enabled. |
||||
|
||||
QMK Firmware has a generic implementation that is usable by any board, as well as numerous board specific implementations. |
||||
|
||||
For this, we will mostly be talking about the generic implementation used by the Let's Split and other keyboards. |
||||
|
||||
!> ARM is not yet supported for Split Keyboards. Progress is being made, but we are not quite there, yet. |
||||
|
||||
|
||||
## Hardware Configuration |
||||
|
||||
This assumes that you're using two Pro Micro-compatible controllers, and are using TRRS jacks to connect to two halves. |
||||
|
||||
### Required Hardware |
||||
|
||||
Apart from diodes and key switches for the keyboard matrix in each half, you will need 2x TRRS sockets and 1x TRRS cable. |
||||
|
||||
Alternatively, you can use any sort of cable and socket that has at least 3 wires. |
||||
|
||||
If you want to use I<sup>2</sup>C to communicate between halves, you will need a cable with at least 4 wires and 2x 4.7kΩ pull-up resistors. |
||||
|
||||
#### Considerations |
||||
|
||||
The most commonly used connection is a TRRS cable and jacks. These provide 4 wires, making them very useful for split keyboards, and are easy to find. |
||||
|
||||
However, since one of the wires carries VCC, this means that the boards are not hot pluggable. You should always disconnect the board from USB before unplugging and plugging in TRRS cables, or you can short the controller, or worse. |
||||
|
||||
Another option is to use phone cables (as in, old school RJ-11/RJ-14 cables). Make sure that you use one that actually supports 4 wires/lanes. |
||||
|
||||
However, USB cables, SATA cables, and even just 4 wires have been known to be used for communication between the controllers. |
||||
|
||||
!> Using USB cables for communication between the controllers works just fine, but the connector could be mistaken for a normal USB connection and potentially short out the keyboard, depending on how it's wired. For this reason, they are not recommended for connecting split keyboards. |
||||
|
||||
### Serial Wiring |
||||
|
||||
The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and D0 (aka PDO or pin 3) between the two Pro Micros. |
||||
|
||||
?> Note that the pin used here is actually set by `SOFT_SERIAL_PIN` below. |
||||
|
||||
 |
||||
|
||||
### I<sup>2</sup>C Wiring |
||||
|
||||
The 4 wires of the TRRS cable need to connect GND, VCC, and SCL and SDA (aka PD0/pin 3 and PD1/pin 2, respectively) between the two Pro Micros. |
||||
|
||||
The pull-up resistors may be placed on either half. If you wish to use the halves independently, it is also possible to use 4 resistors and have the pull-ups in both halves. |
||||
|
||||
 |
||||
|
||||
## Firmware Configuration |
||||
|
||||
To enable the split keyboard feature, add the following to your `rules.mk`: |
||||
|
||||
```make |
||||
SPLIT_KEYBOARD = yes |
||||
``` |
||||
|
||||
If you're using a custom transport (communication method), then you will also need to add: |
||||
|
||||
```make |
||||
SPLIT_TRANSPORT = custom |
||||
``` |
||||
|
||||
### Setting Handedness |
||||
|
||||
By default, the firmware does not know which side is which; it needs some help to determine that. There are several ways to do this, listed in order of precedence. |
||||
|
||||
#### Handedness by Pin |
||||
|
||||
You can configure the firmware to read a pin on the controller to determine handedness. To do this, add the following to your `config.h` file: |
||||
|
||||
```c |
||||
#define SPLIT_HAND_PIN B7 |
||||
``` |
||||
|
||||
This will read the specified pin. If it's high, then the controller assumes it is the left hand, and if it's low, it's assumed to be the right side. |
||||
|
||||
#### Handedness by EEPROM |
||||
|
||||
This method sets the keyboard's handedness by setting a flag in the persistent storage (`EEPROM`). This is checked when the controller first starts up, and determines what half the keyboard is, and how to orient the keyboard layout. |
||||
|
||||
|
||||
To enable this method, add the following to your `config.h` file: |
||||
|
||||
```c |
||||
#define EE_HANDS |
||||
``` |
||||
|
||||
However, you'll have to flash the EEPROM files for the correct hand to each controller. You can do this manually, or there are targets for avrdude and dfu to do this, while flashing the firmware: |
||||
|
||||
* `:avrdude-split-left` |
||||
* `:avrdude-split-right` |
||||
* `:dfu-split-left` |
||||
* `:dfu-split-right` |
||||
* `:dfu-util-split-left` |
||||
* `:dfu-util-split-right` |
||||
|
||||
This setting is not changed when re-initializing the EEPROM using the `EEP_RST` key, or using the `eeconfig_init()` function. However, if you reset the EEPROM outside of the firmware's built in options (such as flashing a file that overwrites the `EEPROM`, like how the [QMK Toolbox]()'s "Reset EEPROM" button works), you'll need to re-flash the controller with the `EEPROM` files. |
||||
|
||||
You can find the `EEPROM` files in the QMK firmware repo, [here](https://github.com/qmk/qmk_firmware/tree/master/quantum/split_common). |
||||
|
||||
#### Handedness by `#define` |
||||
|
||||
You can set the handedness at compile time. This is done by adding the following to your `config.h` file: |
||||
|
||||
```c |
||||
#define MASTER_RIGHT |
||||
``` |
||||
|
||||
or |
||||
|
||||
```c |
||||
#define MASTER_LEFT |
||||
``` |
||||
|
||||
If neither are defined, the handedness defaults to `MASTER_LEFT`. |
||||
|
||||
|
||||
### Communication Options |
||||
|
||||
Because not every split keyboard is identical, there are a number of additional options that can be configured in your `config.h` file. |
||||
|
||||
```c |
||||
#define USE_I2C |
||||
``` |
||||
|
||||
This enables I<sup>2</sup>C support for split keyboards. This isn't strictly for communication, but can be used for OLED or other I<sup>2</sup>C-based devices. |
||||
|
||||
```c |
||||
#define SOFT_SERIAL_PIN D0 |
||||
``` |
||||
|
||||
This sets the pin to be used for serial communication. If you're not using serial, you shouldn't need to define this. |
||||
|
||||
However, if you are using serial and I<sup>2</sup>C on the board, you will need to set this, and to something other than D0 and D1 (as these are used for I<sup>2</sup>C communication). |
||||
|
||||
```c |
||||
#define SELECT_SOFT_SERIAL_SPEED {#}` |
||||
``` |
||||
|
||||
If you're having issues with serial communication, you can change this value, as it controls the communication speed for serial. The default is 1, and the possible values are: |
||||
|
||||
* **`0`**: about 189kbps (Experimental only) |
||||
* **`1`**: about 137kbps (default) |
||||
* **`2`**: about 75kbps |
||||
* **`3`**: about 39kbps |
||||
* **`4`**: about 26kbps |
||||
* **`5`**: about 20kbps |
||||
|
||||
### Hardware Configuration Options |
||||
|
||||
There are some settings that you may need to configure, based on how the hardware is set up. |
||||
|
||||
```c |
||||
#define MATRIX_ROW_PINS_RIGHT { <row pins> } |
||||
#define MATRIX_COL_PINS_RIGHT { <col pins> } |
||||
``` |
||||
|
||||
This allows you to specify a different set of pins for the matrix on the right side. This is useful if you have a board with differently-shaped halves that requires a different configuration (such as Keebio's Quefrency). |
||||
|
||||
```c |
||||
#define DIRECT_PINS_RIGHT { { F1, F0, B0, C7 }, { F4, F5, F6, F7 } } |
||||
``` |
||||
|
||||
This allows you to specify a different set of direct pins for the right side. |
||||
|
||||
```c |
||||
#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a } |
||||
#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b } |
||||
``` |
||||
|
||||
This allows you to specify a different set of encoder pins for the right side. |
||||
|
||||
```c |
||||
#define RGBLIGHT_SPLIT |
||||
``` |
||||
|
||||
This option enables synchronization of the RGB Light modes between the controllers of the split keyboard. This is for keyboards that have RGB LEDs that are directly wired to the controller (that is, they are not using the "extra data" option on the TRRS cable). |
||||
|
||||
```c |
||||
#define RGBLED_SPLIT { 6, 6 } |
||||
``` |
||||
|
||||
This sets how many LEDs are directly connected to each controller. The first number is the left side, and the second number is the right side. |
||||
|
||||
?> This setting implies that `RGBLIGHT_SPLIT` is enabled, and will forcibly enable it, if it's not. |
||||
|
||||
|
||||
```c |
||||
#define SPLIT_USB_DETECT |
||||
``` |
||||
This option changes the startup behavior to detect an active USB connection when delegating master/slave. If this operation times out, then the half is assume to be a slave. This is the default behavior for ARM, and required for AVR Teensy boards (due to hardware limitations). |
||||
|
||||
?> This setting will stop the ability to demo using battery packs. |
||||
|
||||
```c |
||||
#define SPLIT_USB_TIMEOUT 2500 |
||||
``` |
||||
This sets the maximum timeout when detecting master/slave when using `SPLIT_USB_DETECT`. |
||||
|
||||
## Additional Resources |
||||
|
||||
Nicinabox has a [very nice and detailed guide](https://github.com/nicinabox/lets-split-guide) for the Let's Split keyboard, that covers most everything you need to know, including troubleshooting information. |
||||
|
||||
However, the RGB Light section is out of date, as it was written long before the RGB Split code was added to QMK Firmware. Instead, wire each strip up directly to the controller. |
||||
|
||||
<!-- I may port this information later, but for now ... it's very nice, and covers everything --> |
@ -0,0 +1,70 @@ |
||||
# BootloadHID Flashing Instructions and Bootloader Information |
||||
|
||||
ps2avr(GB) boards use an ATmega32A microcontroller and a different bootloader. It is not flashable using the regular QMK methods. |
||||
|
||||
General flashing sequence: |
||||
|
||||
1. Enter the bootloader using any of the following methods: |
||||
* Tap the `RESET` keycode (may not work on all devices) |
||||
* Hold the salt key while plugging the keyboard in (usually documented within keyboard readme) |
||||
2. Wait for the OS to detect the device |
||||
3. Flash a .hex file |
||||
4. Reset the device into application mode (may be done automatically) |
||||
|
||||
## bootloadHID Flashing Target |
||||
|
||||
Using the QMK installation script, detailed [here](newbs_getting_started.md), the required bootloadHID tools should be automatically installed. |
||||
|
||||
To flash via the command line, use the target `:bootloadHID` by executing the following command: |
||||
|
||||
make <keyboard>:<keymap>:bootloadHID |
||||
|
||||
## GUI Flashing |
||||
|
||||
### Windows |
||||
1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). |
||||
2. Place your keyboard into reset. |
||||
3. Ensure the configured VendorID is `16c0` and ProductID is `05df` |
||||
4. Press the `Find Device` button and ensure that your keyboard is found. |
||||
5. Press the `Open .hex File` button and locate the `.hex` file you created. |
||||
6. Press the `Flash Device` button and wait for the process to complete. |
||||
|
||||
## Command Line Flashing |
||||
|
||||
1. Place your keyboard into reset. |
||||
2. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. |
||||
|
||||
### Windows Manual Installation |
||||
For MSYS2: |
||||
1. Download the BootloadHID firmware package from https://www.obdev.at/downloads/vusb/bootloadHID.2012-12-08.tar.gz. |
||||
2. Extract contents using a compatible tool, for example 7-Zip. |
||||
3. Add to the MSYS path by copying `commandline/bootloadHID.exe` from the extracted archive to your MSYS2 installation, typically `C:\msys64\usr\bin`. |
||||
|
||||
For native Windows flashing, the `bootloadHID.exe` can be used outside of the MSYS2 environment. |
||||
|
||||
### Linux Manual Installation |
||||
1. Install libusb development dependency: |
||||
```bash |
||||
# This depends on OS - for Debian the following works |
||||
sudo apt-get install libusb-dev |
||||
``` |
||||
2. Download the BootloadHID firmware package: |
||||
``` |
||||
wget https://www.obdev.at/downloads/vusb/bootloadHID.2012-12-08.tar.gz -O - | tar -xz -C /tmp |
||||
``` |
||||
3. Build the bootloadHID executable: |
||||
``` |
||||
cd /tmp/bootloadHID.2012-12-08/commandline/ |
||||
make |
||||
sudo cp bootloadHID /usr/local/bin |
||||
``` |
||||
|
||||
### MacOS Manual Installation |
||||
1. Install Homebrew by typing the following: |
||||
``` |
||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
||||
``` |
||||
2. Install the following packages: |
||||
``` |
||||
brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb |
||||
``` |
@ -0,0 +1,52 @@ |
||||
# QMK Breaking Change - 30 août 2019 |
||||
|
||||
Quatre fois par an, QMK lance un processus pour fusionner les Breaking Changes. Un Breaking Change est un changement qui modifie la manière dont QMK fonctionne introduisant des incompatibilités ou des comportements dangereux. Nous n'effectuons ces changements que 4 fois par an afin que les utilisateurs n'aient pas peur de casser leurs keymaps en mettant à jour leur version de QMK. |
||||
|
||||
Ce document présente les fusions de Breaking Change. Voici la liste des changements. |
||||
|
||||
## Formattage de code Core avec clang-format |
||||
|
||||
* Tous les fichiers core (`drivers/`, `quantum/`, `tests/`, et `tmk_core/`) seront formatés avec clang-format |
||||
* Un processus travis pour reformatter les PRs lors de la fusion a été mis en place |
||||
* Vous pouvez utiliser la nouvelle commande CLI `qmk cformat` afin de formater avant de soumettre votre PR si vous le souhaitez. |
||||
|
||||
## Nettoyage des descripteurs LUFA USB |
||||
|
||||
* Nettoyage du code lié aux descripteurs USB HID sur les claviers AVR, afin de les rendre plus simple à lire et compréhensibles |
||||
* Plus d'information: https://github.com/qmk/qmk_firmware/pull/4871 |
||||
* Normalement pas de changement de fonctionnement et aucune keymap modifiée. |
||||
|
||||
## Migration des entrées de `ACTION_LAYER_MOMENTARY()` dans `fn_actions` vers des keycodes `MO()` |
||||
|
||||
* `fn_actions` est déprécié, et ses fonctionnalités ont été remplacées par des keycodes directs et `process_record_user()` |
||||
* Supprimer cette fonctionnalité obsolète devrait aboutir à une réduction importante de la taille du firmware et de la complexité du code |
||||
* Il est recommandé que toutes les keymaps affectées remplacent `fn_actions` vers les fonctionnalités de [keycode custom](https://docs.qmk.fm/#/custom_quantum_functions) et [macro](https://docs.qmk.fm/#/feature_macros) |
||||
|
||||
## Mise à jour Atreus vers les conventions de codage courantes |
||||
|
||||
* Les doublons include guards ont contourné le comportement de traitement des headers attendu |
||||
* Il est recommandé pour toutes les keymaps affectées de supprimer le doublon de `<keyboard>/config.h` et `<keyboard>/keymaps/<user>/config.h` et de ne garder que des surcharges au niveau keymap |
||||
|
||||
## Récupération des changements de fichier keymap langage de la fork ZSA |
||||
|
||||
* Corrige une issue dans le fichier `keymap_br_abnt2.h` qui inclut la mauvaise souce (`keymap_common.h` au lieu de `keymap.h`) |
||||
* Met à jour le fichier `keymap_swedish.h` afin d'être spécifique au suédois et plus "nordique" en général. |
||||
* Toutes les keymaps qui utilisent ceci devront supprimer `NO_*` et le remplacer par `SE_*`. |
||||
|
||||
## Mise à jour du repo afin d'utiliser LUFA comme un sous-module git |
||||
|
||||
* `/lib/LUFA` supprimé du dépôt |
||||
* LUFA, définis comme un sous-module, pointe vers qmk/lufa |
||||
* Ceci devrait ajouter plus de flexibilité vers LUFA, et nous permet de garder le sous-module à jour bien plus facilement. Il avait environ 2 ans de retard, sans manière simple de corriger. Ce changement devrait simplifier la mise à jour dans le futur. |
||||
|
||||
## Migration des entrées `ACTION_BACKLIGHT_*()` dans `fn_actions` vers des keycodes `BL_` |
||||
|
||||
* `fn_actions` est déprécié, et ses fonctionnalités ont été remplacées par des keycodes directs et `process_record_user()` |
||||
* Toutes les keymaps utilisant ces actions doivent avoir les clés `KC_FN*` remplacées par les clés `BL_*` équivalentes |
||||
* Si vous utilisez actuellement `KC_FN*` vous devrez remplacer `fn_actions` avec les fonctionnalités de [keycode custom](https://docs.qmk.fm/#/custom_quantum_functions) et [macro](https://docs.qmk.fm/#/feature_macros) |
||||
|
||||
## Remplacer l'alias `KC_DELT` par `KC_DEL` |
||||
|
||||
* `KC_DELT` était un alias redondant et non documenté pour `KC_DELETE` |
||||
* Il a été supprimé et toutes ses utilisations ont été remplacées par l'alias plus courant `KC_DEL` |
||||
* Environ 90 keymaps (surtout des boards ErgoDox) ont été modifiées à cette fin |
@ -0,0 +1,125 @@ |
||||
**En Français** |
||||
|
||||
* [Guide pour débutant complet](fr-fr/newbs.md) |
||||
* [Pour débuter](fr-fr/newbs_getting_started.md) |
||||
* [Compiler son premier firmware](fr-fr/newbs_building_firmware.md) |
||||
* [Flasher le Firmware](fr-fr/newbs_flashing.md) |
||||
* [Test et Débuggage](fr-fr/newbs_testing_debugging.md) |
||||
* [Bonnes pratiques Git](fr-fr/newbs_best_practices.md) |
||||
* [Ressources d'apprentissage](fr-fr/newbs_learn_more_resources.md) |
||||
|
||||
* [Les bases de QMK](fr-fr/README.md) |
||||
* [Indroduction à QMK](fr-fr/getting_started_introduction.md) |
||||
* [QMK CLI](fr-fr/cli.md) |
||||
* [Configuration de la CLI QMK](fr-fr/cli_configuration.md) |
||||
* [Contribuer à QMK](fr-fr/contributing.md) |
||||
* [Comment utiliser GitHub](fr-fr/getting_started_github.md) |
||||
* [Trouver de l'aide](fr-fr/getting_started_getting_help.md) |
||||
|
||||
* [Breaking changes](fr-fr/breaking_changes.md) |
||||
* [30 août 2019](fr-fr/ChangeLog/20190830.md) |
||||
|
||||
* [FAQ](fr-fr/faq.md) |
||||
* [FAQ Générale](fr-fr/faq_general.md) |
||||
* [Compiler QMK](fr-fr/faq_build.md) |
||||
* [Débugguer / Dépanner QMK](fr-fr/faq_debug.md) |
||||
* [Keymap / Disposition](fr-fr/faq_keymap.md) |
||||
* [Installer les drivers avec Zadig](fr-fr/driver_installation_zadig.md) |
||||
|
||||
**En Anglais** |
||||
|
||||
* Guides détaillés |
||||
* [Installation des outils de compilation](getting_started_build_tools.md) |
||||
* [Guide Vagrant](getting_started_vagrant.md) |
||||
* [Commandes de compilations](getting_started_make_guide.md) |
||||
* [Flasher les firmwares](fr-fr/flashing.md) |
||||
* [Personnaliser les fonctionnalités](custom_quantum_functions.md) |
||||
* [Aperçu des fonctionnalités des dispositions](keymap.md) |
||||
|
||||
* [Hardware](hardware.md) |
||||
* [Processeurs AVR](hardware_avr.md) |
||||
* [Pilotes / Drivers](hardware_drivers.md) |
||||
|
||||
* Réferences |
||||
* [Lignes de conduite des claviers](hardware_keyboard_guidelines.md) |
||||
* [Options de configurations](config_options.md) |
||||
* [Keycodes / Codes des caractères](keycodes.md) |
||||
* [Conventions de codage - C](coding_conventions_c.md) |
||||
* [Conventions de codage - Python](coding_conventions_python.md) |
||||
* [Meilleurs pratiques sur la documentation](documentation_best_practices.md) |
||||
* [Modèles de documentation](documentation_templates.md) |
||||
* [Glossaire](reference_glossary.md) |
||||
* [Tests unitaires](unit_testing.md) |
||||
* [Fonctions utiles](ref_functions.md) |
||||
* [Support de configuration](reference_configurator_support.md) |
||||
* [Format du fichier info.json](reference_info_json.md) |
||||
* [Développer la CLI en Python](cli_development.md) |
||||
|
||||
* [Fonctionnalités](features.md) |
||||
* [Keycodes basiques](keycodes_basic.md) |
||||
* [Touches utilisées avec Shift (US ANSI)](keycodes_us_ansi_shifted.md) |
||||
* [Keycodes quantiques](quantum_keycodes.md) |
||||
* [Keycodes avancés](feature_advanced_keycodes.md) |
||||
* [Fonctionnalités audio](feature_audio.md) |
||||
* [Majuscule automatique](feature_auto_shift.md) |
||||
* [Rétroéclairage](feature_backlight.md) |
||||
* [Bluetooth](feature_bluetooth.md) |
||||
* [Bootmagic](feature_bootmagic.md) |
||||
* [Combos](feature_combo.md) |
||||
* [Commande](feature_command.md) |
||||
* [API anti-rebond](feature_debounce_type.md) |
||||
* [DIP Switch](feature_dip_switch.md) |
||||
* [Macros dynamiques](feature_dynamic_macros.md) |
||||
* [Interrupteurs rotatifs](feature_encoders.md) |
||||
* [Grave Escape](feature_grave_esc.md) |
||||
* [Retour haptique](feature_haptic_feedback.md) |
||||
* [Contrôleur LCD HD44780](feature_hd44780.md) |
||||
* [Touche à verrou / Lock-key](feature_key_lock.md) |
||||
* [Dispositions / layouts](feature_layouts.md) |
||||
* [Touche leader](feature_leader_key.md) |
||||
* [Matrice LED](feature_led_matrix.md) |
||||
* [Macros](feature_macros.md) |
||||
* [Boutons de souris](feature_mouse_keys.md) |
||||
* [Pilotes / Drivers OLED](feature_oled_driver.md) |
||||
* [Touche one-shot](feature_advanced_keycodes.md#one-shot-keys) |
||||
* [Périphériques de pointage](feature_pointing_device.md) |
||||
* [Souris PS/2](feature_ps2_mouse.md) |
||||
* [Éclairage RGB](feature_rgblight.md) |
||||
* [Matrice RGB](feature_rgb_matrix.md) |
||||
* [Space Cadet](feature_space_cadet.md) |
||||
* [Claviers scindés / splittés](feature_split_keyboard.md) |
||||
* [Stenographie](feature_stenography.md) |
||||
* [Inversion des mains](feature_swap_hands.md) |
||||
* [Tap Dance](feature_tap_dance.md) |
||||
* [Terminale](feature_terminal.md) |
||||
* [Imprimante thermique](feature_thermal_printer.md) |
||||
* [Caractères unicodes](feature_unicode.md) |
||||
* [Dossier utilisateur](feature_userspace.md) |
||||
* [Velocikey](feature_velocikey.md) |
||||
|
||||
* Pour les makers et les bricoleurs |
||||
* [Guide des claviers soudés à la main](hand_wire.md) |
||||
* [Guide de flash de l’ISP](isp_flashing_guide.md) |
||||
* [Guide du débogage ARM](arm_debugging.md) |
||||
* [Drivers i2c](i2c_driver.md) |
||||
* [Contrôles des GPIO](internals_gpio_control.md) |
||||
* [Conversion en Proton C](proton_c_conversion.md) |
||||
|
||||
* Pour aller plus loin |
||||
* [Comment fonctionnent les claviers](how_keyboards_work.md) |
||||
* [Comprendre QMK](understanding_qmk.md) |
||||
|
||||
* Autres sujets |
||||
* [Utiliser Eclipse avec QMK](other_eclipse.md) |
||||
* [Utiliser VSCode avec QMK](other_vscode.md) |
||||
* [Support](support.md) |
||||
* [Comment ajouter des traductions](translating.md) |
||||
|
||||
* À l’intérieur de QMK (En cours de documentation) |
||||
* [Définitions](internals_defines.md) |
||||
* [Input Callback Reg](internals_input_callback_reg.md) |
||||
* [Appareils Midi](internals_midi_device.md) |
||||
* [Installation d’un appareil Midi](internals_midi_device_setup_process.md) |
||||
* [Utilitaires Midi](internals_midi_util.md) |
||||
* [Fonctions Midi](internals_send_functions.md) |
||||
* [Outils Sysex](internals_sysex_tools.md) |
@ -0,0 +1,107 @@ |
||||
# Breaking changes |
||||
|
||||
Ce document décrit le processus de QMK pour la gestion des breaking changes. Un breaking change est un changement qui modifie la manière dont QMK fonctionne introduisant des incompatibilités ou des comportements dangereux. Nous limitons ces changements afin que les utilisateurs n'aient pas peur de casser leurs keymaps en mettant à jour leur version de QMK. |
||||
|
||||
La période de breaking change est quand nous allons fusionner un PR qui change QMK d'une manière dangereuse ou inattendue. Il y a une période interne de test afin de nous assurer que les problèmes résiduels sont rares ou impossible à prévoir. |
||||
|
||||
## Qu'est-ce qui a été inclus dans des Breaking Changes précédents? |
||||
|
||||
* [30 août 2019](ChangeLog/20190830.md) |
||||
|
||||
## Quand va être le prochain Breaking Change? |
||||
|
||||
Le prochain Breaking Change est planifié pour le 29 novembre. |
||||
|
||||
### Dates importantes |
||||
|
||||
* [x] 21 septembre 2019 - `future` est créé. Il va être rebasé de manière hebdomadaire. |
||||
* [ ] 01 novembre 2019 - `future` fermé aux nouveaux PRs. |
||||
* [ ] 01 novembre 2019 - Appel aux testeurs. |
||||
* [ ] 27 novembre 2019 - `master` est bloqué, pas de PRs fusionnés. |
||||
* [ ] 29 novembre 2019 - `future` est fusionné dans `master`. |
||||
* [ ] 30 novembre 2019 - `master` est débloqué. Les PRs peuvent à nouveau être fusionnés. |
||||
|
||||
## Quels changements seront inclus? |
||||
|
||||
Pour voir une liste de candidats de breaking changes, vous pouvez regarder la liste des [labels `breaking_change`](https://github.com/qmk/qmk_firmware/pulls?q=is%3Aopen+label%3Abreaking_change+is%3Apr). De nouveaux changements peuvent être ajoutés entre maintenant et lorsque `future` est fermée, et un PR avec ce label n'est pas garanti d'être fusionné. |
||||
|
||||
Si vous souhaitez que votre breaking change soit inclus dans ce tour, vous devez créer un PR avec le label `breaking_change` et faire en sorte qu'il soit accepté avant que `future` ne soit fermé. Une fois `future` fermé, aucun nouveau breaking change sera accepté. |
||||
|
||||
Critère d'acceptation: |
||||
|
||||
* Le PR est complété et prêt à fusionner |
||||
* Le PR a un ChangeLog |
||||
|
||||
# Checklists |
||||
|
||||
Cette section documente plusieurs processus que nous utilisons en lançant le processus de Breaking Change. |
||||
|
||||
## Rebase `future` de `master` |
||||
|
||||
Ceci est lancé chaque vendredi tant que `future` est ouvert. |
||||
|
||||
Processus: |
||||
|
||||
``` |
||||
cd qmk_firmware |
||||
git checkout master |
||||
git pull --ff-only |
||||
git checkout future |
||||
git rebase master |
||||
git push --force |
||||
``` |
||||
|
||||
## Créer la branche `future` |
||||
|
||||
Ceci est fait immédiatement après la fusion de la branche `future` précédente. |
||||
|
||||
* `qmk_firmware` git commands |
||||
* [ ] `git checkout master` |
||||
* [ ] `git pull --ff-only` |
||||
* [ ] `git checkout -b future` |
||||
* [ ] Modifie `readme.md` |
||||
* [ ] Ajoute un message en haut qui indique que c'est une branche de test. |
||||
* [ ] Ajoute un lien vers ce document |
||||
* [ ] `git commit -m 'Branch point for <DATE> Breaking Change'` |
||||
* [ ] `git tag breakpoint_<YYYY>_<MM>_<DD>` |
||||
* [ ] `git tag <next_version>` # Evite que le label point d'arrêt soit confondu par un incrément de version |
||||
* [ ] `git push origin future` |
||||
* [ ] `git push --tags` |
||||
|
||||
## 4 Semaines Avant la Fusion |
||||
|
||||
* `future` est maintenant fermé aux nouveaux PRs, seul des correctifs pour les PRs courants peuvent être mergés |
||||
* Envoi de l'appel aux testeurs |
||||
* [ ] Discord |
||||
* [ ] GitHub PR |
||||
* [ ] https://reddit.com/r/olkb |
||||
|
||||
## 1 Semaine Avant la Fusion |
||||
|
||||
* Annonce que master sera fermée entre <2 jours avant> à <Jour de la fusion> |
||||
* [ ] Discord |
||||
* [ ] GitHub PR |
||||
* [ ] https://reddit.com/r/olkb |
||||
|
||||
## 2 Jours Avant la Fusion |
||||
|
||||
* Annonce que master est fermé pour 2 jours |
||||
* [ ] Discord |
||||
* [ ] GitHub PR |
||||
* [ ] https://reddit.com/r/olkb |
||||
|
||||
## Jour de la fusion |
||||
|
||||
* `qmk_firmware` git commands |
||||
* [ ] `git checkout future` |
||||
* [ ] `git pull --ff-only` |
||||
* [ ] `git rebase origin/master` |
||||
* [ ] Modifie `readme.md` |
||||
* [ ] Supprimer les notes à propos de `future` |
||||
* [ ] Regroupe ChangeLog dans un fichier. |
||||
* [ ] `git commit -m 'Merge point for <DATE> Breaking Change'` |
||||
* [ ] `git push origin future` |
||||
* Actions sur Github |
||||
* [ ] Crée un PR pour `future` |
||||
* [ ] S'assurer que Travis ne relève aucun problème |
||||
* [ ] Fusion le PR `future` |
@ -0,0 +1,146 @@ |
||||
# La CLI de QMK |
||||
|
||||
Cette page décrit comment configurer et utiliser la CLI QMK. |
||||
|
||||
# Vue d'ensemble |
||||
|
||||
La CLI de QMK permet de simplifier la compilation et l'interaction avec les claviers QMK. Nous avons défini plusieurs commandes pour simplifier et rationaliser les tâches telles qu'obtenir et compiler le firmware QMK, créer de nouvelles keymaps, et plus. |
||||
|
||||
* [CLI globale](#global-cli) |
||||
* [CLI locale](#local-cli) |
||||
* [Les commandes CLI](#cli-commands) |
||||
|
||||
# Pré-requis |
||||
|
||||
La CLI nécessite Python 3.5 ou plus récent. Nous essayons de limiter le nombre de pré-requis, mais vous allez aussi devoir installer les paquets listés dans le fichier [`requirements.txt`](https://github.com/qmk/qmk_firmware/blob/master/requirements.txt). |
||||
|
||||
# CLI globale |
||||
|
||||
QMK met à disposition une CLI installable qui peut être utilisée pour configurer votre environnement de compilation QMK, fonctionne avec QMK, et qui rend l'utilisation de plusieurs copies de `qmk_firmware` plus simple. Nous recommandons d'installer et de mettre à jour ceci régulièrement. |
||||
|
||||
## Installer en utilisant Homebrew (macOS, quelques Linux) |
||||
|
||||
Si vous avez installé [Homebrew](https://brew.sh) vous pouvez entrer ce qui suit et installer QMK: |
||||
|
||||
``` |
||||
brew tap qmk/qmk |
||||
brew install qmk |
||||
export QMK_HOME='~/qmk_firmware' # Optional, set the location for `qmk_firmware` |
||||
qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build environment |
||||
``` |
||||
|
||||
## Installer en utilisant easy_install ou pip |
||||
|
||||
Si votre système n'est pas listé ci-dessus, vous pouvez installer QMK manuellement. Premièrement, vérifiez que vous avez bien installé Python 3.5 (ou plus récent) et pip. Ensuite, installez QMK avec cette commande: |
||||
|
||||
``` |
||||
pip3 install qmk |
||||
export QMK_HOME='~/qmk_firmware' # Optional, set the location for `qmk_firmware` |
||||
qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build environment |
||||
``` |
||||
|
||||
## Paquets pour d'autres systèmes d'exploitation |
||||
|
||||
Nous recherchons des gens pour créer et maintenir un paquet `qmk` pour plus de systèmes d'exploitation. Si vous voulez créer un paquet pour votre système d'exploitation, suivez ces directives: |
||||
|
||||
* Suivez les bonnes pratiques pour votre système d'exploitation lorsqu'elles entrent en conflit avec ces directives |
||||
* Documentez pourquoi dans un commentaire lorsque vous ne les suivez pas |
||||
* Installez en utilisant un virtualenv |
||||
* Expliquez à l'utilisateur de définir la variable d'environnement `QMK_Home` pour "check out" les sources du firmware à un autre endroit que `~/qmk_firmware`. |
||||
|
||||
# CLI locale |
||||
|
||||
Si vous ne voulez pas utiliser la CLI globale, il y a une CLI locale empaquetée avec `qmk_firmware`. Vous pouvez le trouver dans `qmk_firmware/bin/qmk`. Vous pouvez lancer la commande `qmk` depuis n'importe quel répertoire et elle fonctionnera toujours sur cette copie de `qmk_firmware`. |
||||
|
||||
**Exemple**: |
||||
|
||||
``` |
||||
$ ~/qmk_firmware/bin/qmk hello |
||||
Ψ Hello, World! |
||||
``` |
||||
|
||||
## Limitations de la CLI locale |
||||
|
||||
Il y a quelques limitations à la CLI locale comparé à la globale: |
||||
|
||||
* La CLI locale ne supporte pas `qmk setup` ou `qmk clone` |
||||
* La CLI locale n'opère pas sur le même arbre `qmk_firmware`, même si vous avez plusieurs dépôts clonés. |
||||
* La CLI locale ne s'exécute pas dans un virtualenv, donc il y a des risques que des dépendances seront en conflit |
||||
|
||||
# Les commandes CLI |
||||
|
||||
## `qmk compile` |
||||
|
||||
Cette commande permet de compiler le firmware de n'importe quel répertoire. Vous pouvez compiler des exports JSON de <https://config.qmk.fm> ou compiler des keymaps du dépôt. |
||||
|
||||
**Utilisation pour les exports de configuration**: |
||||
|
||||
``` |
||||
qmk compile <configuratorExport.json> |
||||
``` |
||||
|
||||
**Utilisation pour les Keymaps**: |
||||
|
||||
``` |
||||
qmk compile -kb <keyboard_name> -km <keymap_name> |
||||
``` |
||||
|
||||
## `qmk cformat` |
||||
|
||||
Cette commande formatte le code C en utilisant clang-format. Lancez-la sans arguments pour formatter tout le code core, ou passez les noms de fichiers à la ligne de commande pour la lancer sur des fichiers spécifiques. |
||||
|
||||
**Utilisation**: |
||||
|
||||
``` |
||||
qmk cformat [file1] [file2] [...] [fileN] |
||||
``` |
||||
|
||||
## `qmk config` |
||||
|
||||
Cette commande vous permet de configurer le comportement de QMK. Pour la documentation complète de `qmk config`, regardez [Configuration de CLI](cli_configuration.md). |
||||
|
||||
**Utilisation**: |
||||
|
||||
``` |
||||
qmk config [-ro] [config_token1] [config_token2] [...] [config_tokenN] |
||||
``` |
||||
|
||||
## `qmk doctor` |
||||
|
||||
Cette commande examine votre environnement et vous alertes des potentiels problèmes de compilation ou de flash. |
||||
|
||||
**Utilisation**: |
||||
|
||||
``` |
||||
qmk doctor |
||||
``` |
||||
|
||||
## `qmk new-keymap` |
||||
|
||||
Cette commande crée une nouvelle keymap basée sur une keymap par défaut d'un clavier existant. |
||||
|
||||
**Utilisation**: |
||||
|
||||
``` |
||||
qmk new-keymap [-kb KEYBOARD] [-km KEYMAP] |
||||
``` |
||||
|
||||
## `qmk pyformat` |
||||
|
||||
Cette commande formate le code python dans `qmk_firmware`. |
||||
|
||||
**Utilisation**: |
||||
|
||||
``` |
||||
qmk pyformat |
||||
``` |
||||
|
||||
## `qmk pytest` |
||||
|
||||
Cette commande démarre la suite de test python. Si vous faites des changements dans le code Python, assurez-vous que les tests se lancent avec succès. |
||||
|
||||
**Utilisation**: |
||||
|
||||
``` |
||||
qmk pytest |
||||
``` |
@ -0,0 +1,121 @@ |
||||
# Configuration de QMK CLI |
||||
|
||||
Ce document explique comment fonctionne la commande `qmk config`. |
||||
|
||||
# Introduction |
||||
|
||||
La configuration pour QMK CLI est un système clé/valeur. Chaque clé est composée d'une sous-commande et d'un argument séparé par une virgule. Cela permet une traduction simple et directe entre les clés de configuration et l'argument qu'elle définit. |
||||
|
||||
## Exemple simple |
||||
|
||||
Comme exemple, regardons la commande `qmk compile --keyboard clueboard/66/rev4 --keymap default`. |
||||
|
||||
Il y a deux arguments de ligne de commande qui peuvent être lu de la configuration: |
||||
|
||||
* `compile.keyboard` |
||||
* `compile.keymap` |
||||
|
||||
Essayons de les définir: |
||||
|
||||
```shell |
||||
$ qmk config compile.keyboard=clueboard/66/rev4 compile.keymap=default |
||||
compile.keyboard: None -> clueboard/66/rev4 |
||||
compile.keymap: None -> default |
||||
Ψ Wrote configuration to '/Users/example/Library/Application Support/qmk/qmk.ini' |
||||
``` |
||||
|
||||
Maintenant, je peux lancer la commande `qmk compile` sans avoir à spécifier mon clavier et keymap à chaque fois. |
||||
|
||||
## Définir les options par défaut |
||||
|
||||
Parfois, il est utile de partager une configuration entre plusieurs commandes. Par exemple, plusieurs commandes prennent un argument `--keyboard`. Plutôt que de devoir définir cette valeur pour chaque commande, vous pouvez définir une valeur d'utilisateur qui sera utilisée par toutes les commandes qui prennent cet argument. |
||||
|
||||
Exemple: |
||||
|
||||
``` |
||||
$ qmk config user.keyboard=clueboard/66/rev4 user.keymap=default |
||||
user.keyboard: None -> clueboard/66/rev4 |
||||
user.keymap: None -> default |
||||
Ψ Wrote configuration to '/Users/example/Library/Application Support/qmk/qmk.ini' |
||||
``` |
||||
|
||||
# CLI Documentation (`qmk config`) |
||||
|
||||
La commande `qmk config` est utilisée pour interagir avec la configuration sous-jacente. Lancée sans argument, elle affiche la configuration courante. Lorsque des arguments sont définis, ils sont considérés comme étant des jetons de configuration, qui sont des chaînes de caractère ne contenant aucun espace avec le format suivant: |
||||
|
||||
<subcommand|general|default>[.<key>][=<value>] |
||||
|
||||
## Définir des valeurs de configuration |
||||
|
||||
Vous pouvez définir des valeurs de configuration en mettant le caractère égal (=) dans votre clé de configuration. La clé doit toujours être dans le format complet `<section>.<key>`. |
||||
|
||||
Exemple: |
||||
|
||||
``` |
||||
$ qmk config default.keymap=default |
||||
default.keymap: None -> default |
||||
Ψ Wrote configuration to '/Users/example/Library/Application Support/qmk/qmk.ini' |
||||
``` |
||||
|
||||
## Lire des valeurs de configuration |
||||
|
||||
Vous pouvez lire les valeurs de configuration pour la totalité de la configuration, une seule clé, ou une section entière. Vous pouvez aussi spécifier plusieurs clés pour afficher plus d'une valeur. |
||||
|
||||
### Exemple avec la totalité de la configuration |
||||
|
||||
qmk config |
||||
|
||||
### Exemple avec une section entière |
||||
|
||||
qmk config compile |
||||
|
||||
### Exemple avec une clé unique |
||||
|
||||
qmk config compile.keyboard |
||||
|
||||
### Exemple avec plusieurs clés |
||||
|
||||
qmk config user compile.keyboard compile.keymap |
||||
|
||||
## Supprimer des valeurs de configuration |
||||
|
||||
Vous pouvez supprimer une valeur de configuration en la définissant avec la chaîne spéciale `None`. |
||||
|
||||
Exemple: |
||||
|
||||
``` |
||||
$ qmk config default.keymap=None |
||||
default.keymap: default -> None |
||||
Ψ Wrote configuration to '/Users/example/Library/Application Support/qmk/qmk.ini' |
||||
``` |
||||
|
||||
## Plusieurs opérations |
||||
|
||||
Vous pouvez combiner plusieurs opérations d'écriture et de lecture en une seule commande. Elles seront exécutées et affichées dans l'ordre: |
||||
|
||||
``` |
||||
$ qmk config compile default.keymap=default compile.keymap=None |
||||
compile.keymap=skully |
||||
compile.keyboard=clueboard/66_hotswap/gen1 |
||||
default.keymap: None -> default |
||||
compile.keymap: skully -> None |
||||
Ψ Wrote configuration to '/Users/example/Library/Application Support/qmk/qmk.ini' |
||||
``` |
||||
|
||||
# Options de configuration utilisateur |
||||
|
||||
| Clé | Valeur par défaut | Description | |
||||
|-----|---------------|-------------| |
||||
| user.keyboard | None | Le chemin d'accès vers le clavier (Exemple: `clueboard/66/rev4`) | |
||||
| user.keymap | None | Le nom de la keymap (Exemple: `default`) | |
||||
| user.name | None | Le nom d'utilisateur GitHub de l'utilisateur. | |
||||
|
||||
# Toutes les options de configuration |
||||
|
||||
| Clé | Valeur par défaut | Description | |
||||
|-----|---------------|-------------| |
||||
| compile.keyboard | None | Le chemin d'accès vers le clavier (Exemple: `clueboard/66/rev4`) | |
||||
| compile.keymap | None | Le nom de la keymap (Exemple: `default`) | |
||||
| hello.name | None | Le nom à saluer lorsque démarré. | |
||||
| new_keyboard.keyboard | None | Le chemin d'accès vers le clavier (Exemple: `clueboard/66/rev4`) | |
||||
| new_keyboard.keymap | None | Le nom de la keymap (Example: `default`) | |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue