diff --git a/bin/qmk b/bin/qmk index 60555d3d70..7592eefd93 100755 --- a/bin/qmk +++ b/bin/qmk @@ -2,10 +2,8 @@ """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__)) @@ -35,16 +33,6 @@ with open(os.path.join(qmk_dir, 'requirements.txt'), 'r') as fd: 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 diff --git a/common_features.mk b/common_features.mk index 461b9effd6..7dad1ee8ed 100644 --- a/common_features.mk +++ b/common_features.mk @@ -322,6 +322,11 @@ ifeq ($(strip $(USB_HID_ENABLE)), yes) include $(TMK_DIR)/protocol/usb_hid.mk endif +ifeq ($(strip $(WPM_ENABLE)), yes) + SRC += $(QUANTUM_DIR)/wpm.c + OPT_DEFS += -DWPM_ENABLE +endif + ifeq ($(strip $(ENCODER_ENABLE)), yes) SRC += $(QUANTUM_DIR)/encoder.c OPT_DEFS += -DENCODER_ENABLE diff --git a/docs/_summary.md b/docs/_summary.md index 336def3dc7..50b11f40a9 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -80,6 +80,7 @@ * [Terminal](feature_terminal.md) * [Unicode](feature_unicode.md) * [Userspace](feature_userspace.md) + * [WPM Calculation](feature_wpm.md) * Hardware Features * Displays diff --git a/docs/feature_macros.md b/docs/feature_macros.md index 99dd564bf8..1bd2d74e7d 100644 --- a/docs/feature_macros.md +++ b/docs/feature_macros.md @@ -88,6 +88,46 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; ``` +### Advanced Macros + +In addition to the `process_record_user()` function, is the `post_process_record_user()` function. This runs after `process_record` and can be used to do things after a keystroke has been sent. This is useful if you want to have a key pressed before and released after a normal key, for instance. + +In this example, we modify most normal keypresses so that `F22` is pressed before the keystroke is normally sent, and release it __only after__ it's been released. + +```c +static uint8_t f22_tracker; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_A ... KC_F21: //notice how it skips over F22 + case KC_F23 ... KC_EXSEL: //exsel is the last one before the modifier keys + if (record->event.pressed) { + register_code(KC_F22); //this means to send F22 down + f22_tracker++; + register_code(keycode); + return false; + } + break; + } + return true; +} + +void post_process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_A ... KC_F21: //notice how it skips over F22 + case KC_F23 ... KC_EXSEL: //exsel is the last one before the modifier keys + if (!record->event.pressed) { + f22_tracker--; + if (!f22_tracker) { + unregister_code(KC_F22); //this means to send F22 up + } + } + break; + } +} +``` + + ### TAP, DOWN and UP You may want to use keys in your macros that you can't write down, such as `Ctrl` or `Home`. diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 7bc2193472..2cec55ee77 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -396,18 +396,88 @@ The EEPROM for it is currently shared with the RGBLIGHT system (it's generally a Where `28` is an unused index from `eeconfig.h`. -## Suspended state :id=suspended-state +## Functions :id=functions -To use the suspend feature, add this to your `.c`: +### Direct Operation :id=direct-operation +|Function |Description | +|--------------------------------------------|-------------| +|`rgb_matrix_set_color_all(r, g, b)` |Set all of the LEDs to the given RGB value, where `r`/`g`/`b` are between 0 and 255 (not written to EEPROM) | +|`rgb_matrix_set_color(index, r, g, b)` |Set a single LED to the given RGB value, where `r`/`g`/`b` are between 0 and 255, and `index` is between 0 and `DRIVER_LED_TOTAL` (not written to EEPROM) | + +### Disable/Enable Effects :id=disable-enable-effects +|Function |Description | +|--------------------------------------------|-------------| +|`rgb_matrix_toggle()` |Toggle effect range LEDs between on and off | +|`rgb_matrix_toggle_noeeprom()` |Toggle effect range LEDs between on and off (not written to EEPROM) | +|`rgb_matrix_enable()` |Turn effect range LEDs on, based on their previous state | +|`rgb_matrix_enable_noeeprom()` |Turn effect range LEDs on, based on their previous state (not written to EEPROM) | +|`rgb_matrix_disable()` |Turn effect range LEDs off | +|`rgb_matrix_disable_noeeprom()` |Turn effect range LEDs off (not written to EEPROM) | + +### Change Effect Mode :id=change-effect-mode +|Function |Description | +|--------------------------------------------|-------------| +|`rgb_matrix_mode(mode)` |Set the mode, if RGB animations are enabled | +|`rgb_matrix_mode_noeeprom(mode)` |Set the mode, if RGB animations are enabled (not written to EEPROM) | +|`rgb_matrix_step()` |Change the mode to the next RGB animation in the list of enabled RGB animations | +|`rgb_matrix_step_reverse()` |Change the mode to the previous RGB animation in the list of enabled RGB animations | +|`rgb_matrix_increase_speed()` |Increases the speed of the animations | +|`rgb_matrix_decrease_speed()` |Decreases the speed of the animations | + +### Change Color :id=change-color +|Function |Description | +|--------------------------------------------|-------------| +|`rgb_matrix_increase_hue()` |Increase the hue for effect range LEDs. This wraps around at maximum hue | +|`rgb_matrix_decrease_hue()` |Decrease the hue for effect range LEDs. This wraps around at minimum hue | +|`rgb_matrix_increase_sat()` |Increase the saturation for effect range LEDs. This wraps around at maximum saturation | +|`rgb_matrix_decrease_sat()` |Decrease the saturation for effect range LEDs. This wraps around at minimum saturation | +|`rgb_matrix_increase_val()` |Increase the value for effect range LEDs. This wraps around at maximum value | +|`rgb_matrix_decrease_val()` |Decrease the value for effect range LEDs. This wraps around at minimum value | +|`rgb_matrix_sethsv(h, s, v)` |Set LEDs to the given HSV value where `h`/`s`/`v` are between 0 and 255 | +|`rgb_matrix_sethsv_noeeprom(h, s, v)` |Set LEDs to the given HSV value where `h`/`s`/`v` are between 0 and 255 (not written to EEPROM) | + +### Query Current Status :id=query-current-status +|Function |Description | +|-----------------------|-----------------| +|`rgb_matrix_get_mode()` |Get current mode | +|`rgb_matrix_get_hue()` |Get current hue | +|`rgb_matrix_get_sat()` |Get current sat | +|`rgb_matrix_get_val()` |Get current val | + +## Callbacks :id=callbacks + +### Indicators :id=indicators + +If you want to set custom indicators, such as an LED for Caps Lock, or layer indication, you can use the `rgb_matrix_indicators_kb` or `rgb_matrix_indicators_user` function for that: +```c +void rgb_matrix_indicators_kb(void) { + rgb_matrix_set_color(index, red, green, blue); +} +``` + +### Suspended state :id=suspended-state +To use the suspend feature, make sure that `#define RGB_DISABLE_WHEN_USB_SUSPENDED true` is added to the `config.h` file. + +Additionally add this to your `.c`: ```c -void suspend_power_down_kb(void) -{ +void suspend_power_down_kb(void) { + rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); +} + +void suspend_wakeup_init_kb(void) { + rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); +} +``` +or add this to your `keymap.c`: +```c +void suspend_power_down_user(void) { rgb_matrix_set_suspend_state(true); } -void suspend_wakeup_init_kb(void) -{ +void suspend_wakeup_init_user(void) { rgb_matrix_set_suspend_state(false); } ``` diff --git a/docs/feature_wpm.md b/docs/feature_wpm.md new file mode 100644 index 0000000000..12dd080579 --- /dev/null +++ b/docs/feature_wpm.md @@ -0,0 +1,25 @@ +# Word Per Minute (WPM) Calculcation + +The WPM feature uses time between keystrokes to compute a rolling average words +per minute rate and makes this available for various uses. + +Enable the WPM system by adding this to your `rules.mk`: + + WPM_ENABLE = yes + +For split keyboards using soft serial, the computed WPM +score will be available on the master AND slave half. + +## Public Functions + +`uint8_t get_current_wpm(void);` +This function returns the current WPM as an unsigned integer. + + +## Customized keys for WPM calc + +By default, the WPM score only includes letters, numbers, space and some +punctuation. If you want to change the set of characters considered as part of +the WPM calculation, you can implement `wpm_keycode_user(uint16_t keycode)` +and return true for any characters you would like included in the calculation, +or false to not count that particular keycode. diff --git a/docs/hardware_keyboard_guidelines.md b/docs/hardware_keyboard_guidelines.md index 5d9968f6d7..a862bc0ca8 100644 --- a/docs/hardware_keyboard_guidelines.md +++ b/docs/hardware_keyboard_guidelines.md @@ -61,10 +61,76 @@ This file is used by the [QMK API](https://github.com/qmk/qmk_api). It contains All projects need to have a `config.h` file that sets things like the matrix size, product name, USB VID/PID, description and other settings. In general, use this file to set essential information and defaults for your keyboard that will always work. +The `config.h` files can also be placed in sub-folders, and the order in which they are read is as follows: + +* `keyboards/top_folder/config.h` + * `keyboards/top_folder/sub_1/config.h` + * `keyboards/top_folder/sub_1/sub_2/config.h` + * `keyboards/top_folder/sub_1/sub_2/sub_3/config.h` + * `keyboards/top_folder/sub_1/sub_2/sub_3/sub_4/config.h` + * `users/a_user_folder/config.h` + * `keyboards/top_folder/keymaps/a_keymap/config.h` + * `keyboards/top_folder/sub_1/sub_2/sub_3/sub_4/post_config.h` + * `keyboards/top_folder/sub_1/sub_2/sub_3/post_config.h` + * `keyboards/top_folder/sub_1/sub_2/post_config.h` + * `keyboards/top_folder/sub_1/post_config.h` +* `keyboards/top_folder/post_config.h` + +The `post_config.h` file can be used for additional post-processing, depending on what is specified in the `config.h` file. For example, if you define the `IOS_DEVICE_ENABLE` macro in your keymap-level `config.h` file as follows, you can configure more detailed settings accordingly in the `post_config.h` file: + +* `keyboards/top_folder/keymaps/a_keymap/config.h` + ```c + #define IOS_DEVICE_ENABLE + ``` +* `keyboards/top_folder/post_config.h` + ```c + #ifndef IOS_DEVICE_ENABLE + // USB_MAX_POWER_CONSUMPTION value for this keyboard + #define USB_MAX_POWER_CONSUMPTION 400 + #else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 + #endif + + #ifdef RGBLIGHT_ENABLE + #ifndef IOS_DEVICE_ENABLE + #define RGBLIGHT_LIMIT_VAL 200 + #define RGBLIGHT_VAL_STEP 17 + #else + #define RGBLIGHT_LIMIT_VAL 35 + #define RGBLIGHT_VAL_STEP 4 + #endif + #ifndef RGBLIGHT_HUE_STEP + #define RGBLIGHT_HUE_STEP 10 + #endif + #ifndef RGBLIGHT_SAT_STEP + #define RGBLIGHT_SAT_STEP 17 + #endif + #endif + ``` + +?> If you define options using `post_config.h` as in the above example, you should not define the same options in the keyboard- or user-level `config.h`. + ### `rules.mk` The presence of this file means that the folder is a keyboard target and can be used in `make` commands. This is where you setup the build environment for your keyboard and configure the default set of features. +The `rules.mk` file can also be placed in a sub-folder, and its reading order is as follows: + +* `keyboards/top_folder/rules.mk` + * `keyboards/top_folder/sub_1/rules.mk` + * `keyboards/top_folder/sub_1/sub_2/rules.mk` + * `keyboards/top_folder/sub_1/sub_2/sub_3/rules.mk` + * `keyboards/top_folder/sub_1/sub_2/sub_3/sub_4/rules.mk` + * `keyboards/top_folder/keymaps/a_keymap/rules.mk` + * `users/a_user_folder/rules.mk` +* `common_features.mk` + +Many of the settings written in the `rules.mk` file are interpreted by `common_features.mk`, which sets the necessary source files and compiler options. + +?> See `build_keyboard.mk` and `common_features.mk` for more details. + ### `` This is where you will write custom code for your keyboard. Typically you will write code to initialize and interface with the hardware in your keyboard. If your keyboard consists of only a key matrix with no LEDs, speakers, or other auxiliary hardware this file can be blank. diff --git a/docs/ja/README.md b/docs/ja/README.md index 8959a9dd95..c02a14b487 100644 --- a/docs/ja/README.md +++ b/docs/ja/README.md @@ -1,8 +1,8 @@ # Quantum Mechanical Keyboard Firmware [![現在のバージョン](https://img.shields.io/github/tag/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/tags) @@ -12,26 +12,37 @@ [![GitHub 貢献者](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) [![GitHub フォーク](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) -## QMK ファームウェアとは何か? +## QMK ファームウェアとは何でしょうか? -QMK (*Quantum Mechanical Keyboard*)は QMK ファームウェア、QMK ツールボックス、qmk.fm およびそれらのドキュメントを保守するオープンソースコミュニティです。QMK ファームウェアは[tmk\_keyboard](http://github.com/tmk/tmk_keyboard) を元にしたキーボードファームウェアで、Atmel AVR コントローラ、より具体的には [OLKB 製品](http://olkb.com)、[ErgoDox EZ](http://www.ergodox-ez.com) キーボードおよび [Clueboard 製品](http://clueboard.co/) のための幾つかの便利な機能を持ちます。また、ChibiOS を使って ARM チップに移植されています。これを使ってあなたの作った手配線のキーボードあるいはカスタムキーボード PCB で作ったキーボードを動かすことができます。 +QMK (*Quantum Mechanical Keyboard*)は、コンピュータ入力デバイスの開発を中心としたオープンソースコミュニティです。コミュニティには、キーボード、マウス、MIDI デバイスなど、全ての種類の入力デバイスが含まれます。協力者の中心グループは、[QMK ファームウェア](https://github.com/qmk/qmk_firmware)、[QMK Configurator](https://config.qmk.fm)、[QMK ツールボックス](https://github.com/qmk/qmk_toolbox)、[qmk.fm](https://qmk.fm)、そして、このドキュメントを、あなたのようなコミュニティメンバーの助けを借りて保守しています。 -## 入手方法 +## 始めましょう -QMK のキーマップ、キーボード、機能に貢献をする予定がある場合、最も簡単なのは、[Github を介してリポジトリをフォークし](https://github.com/qmk/qmk_firmware#fork-destination-box)、リポジトリをあなたの開発環境にクローンして変更を加え、それらをプッシュし、[プルリクエスト](https://github.com/qmk/qmk_firmware/pulls)を開くことです。 +QMK は初めてですか?始めるには2つの方法があります: -それ以外の場合は、`git clone https://github.com/qmk/qmk_firmware` を介して直接クローンすることができます。zip または tar ファイルをダウンロードしないでください。コンパイルするためのサブモジュールをダウンロードするために git リポジトリが必要です。 +* 基本: [QMK Configurator](https://config.qmk.fm) + * ドロップダウンからあなたのキーボードを選択し、キーボードをプログラムします。 + * 見ることができる [紹介ビデオ](https://www.youtube.com/watch?v=-imgglzDMdY) があります。 + * 読むことができる概要 [ドキュメント](ja/newbs_building_firmware_configurator.md) があります。 +* 発展: [ソースを使用します](ja/newbs.md) + * より強力ですが、使うのはより困難です。 -## コンパイル方法 +## 自分用にアレンジします -コンパイルをする前に、AVR または ARM 開発のための[環境をインストール](ja/getting_started_build_tools.md)する必要があります。それが完了したら、`make` コマンドを使用して、以下の表記でキーボードとキーマップをビルドします。 +QMK には、探求すべき多くの[機能](ja/features.md)と、深く知るためのリファレンスドキュメントがたくさんあります。ほとんどの機能は[キーマップ](ja/keymap.md)を変更し、[キーコード](ja/keycodes.md)を変更することで活用されます。 - make planck/rev4:default +## 手助けが必要ですか? -これは、`planck` の `rev4` リビジョンを `default` キーマップでビルドします。全てのキーボードにリビジョン(サブプロジェクトまたはフォルダとも呼ばれます)があるわけではありません。その場合は省略されます: +[サポートページ](ja/support.md) をチェックして、QMK の使い方について手助けを得る方法を確認してください。 - make preonic:default +## 貢献する -## カスタマイズ方法 +QMK コミュニティに貢献する方法はたくさんあります。始める最も簡単な方法は、それを使って友人に QMK という単語を広めることです。 -QMK には、探求すべき多くの[機能](ja/features.md)と、深堀りするための[リファレンス ドキュメント](http://docs.qmk.fm)がたくさんあります。ほとんどの機能は[キーマップ](ja/keymap.md)を変更し、[キーコード](ja/keycodes.md)を変更することで活用されます。 +* フォーラムやチャットルームで人々を支援します: + * [/r/olkb](https://www.reddit.com/r/olkb/) + * [Discord サーバ](https://discord.gg/Uq7gcHh) +* 下にある「Edit This Page」をクリックしてドキュメントに貢献します +* [ドキュメントをあなたの言語に翻訳します](ja/translating.md) +* [バグを報告します](https://github.com/qmk/qmk_firmware/issues/new/choose) +* [プルリクエストを開きます](ja/contributing.md) diff --git a/docs/ja/_summary.md b/docs/ja/_summary.md index 6f4c14f4c7..10279471ad 100644 --- a/docs/ja/_summary.md +++ b/docs/ja/_summary.md @@ -1,130 +1,162 @@ -* [完全な初心者のガイド](ja/newbs.md) - * [はじめに](ja/newbs_getting_started.md) - * [初めてのファームウェアの構築](ja/newbs_building_firmware.md) - * [ファームウェアのフラッシュ](ja/newbs_flashing.md) - * [テストとデバッグ](ja/newbs_testing_debugging.md) - * [QMK における Git 運用作法](ja/newbs_git_best_practices.md) - * [あなたのフォークの master ブランチ](ja/newbs_git_using_your_master_branch.md) - * [マージの競合の解決](ja/newbs_git_resolving_merge_conflicts.md) - * [同期のとれていない git ブランチの再同期](ja/newbs_git_resynchronize_a_branch.md) - * [学習リソース](ja/newbs_learn_more_resources.md) +* チュートリアル + * [入門](ja/newbs.md) + * [セットアップ](ja/newbs_getting_started.md) + * [初めてのファームウェアの構築](ja/newbs_building_firmware.md) + * [ファームウェアのフラッシュ](ja/newbs_flashing.md) + * [テストとデバッグ](ja/newbs_testing_debugging.md) + * [手助けを得る/サポート](ja/support.md) + * [他のリソース](ja/newbs_learn_more_resources.md) -* [QMKの基本](ja/README.md) - * [QMK の導入](ja/getting_started_introduction.md) - * [QMK CLI](ja/cli.md) - * [QMK CLI 設定](ja/cli_configuration.md) - * [QMK への貢献](ja/contributing.md) - * [Github の使い方](ja/getting_started_github.md) - * [ヘルプ](ja/getting_started_getting_help.md) +* FAQ + * [一般的な FAQ](ja/faq_general.md) + * [QMK のビルド/コンパイル](ja/faq_build.md) + * [QMK のデバッグ/トラブルシューティング](ja/faq_debug.md) + * [キーマップ FAQ](ja/faq_keymap.md) + * [用語](ja/reference_glossary.md) -* [破壊的な変更](ja/breaking_changes.md) - * [プルリクエストにフラグが付けられた](ja/breaking_changes_instructions.md) - * [2019年8月30日](ja/ChangeLog/20190830.md) +* Configurator + * [概要](ja/newbs_building_firmware_configurator.md) + * [ステップ・バイ・ステップ](ja/configurator_step_by_step.md) + * [トラブルシューティング](ja/configurator_troubleshooting.md) + * QMK API + * [概要](ja/api_overview.md) + * [API ドキュメント](ja/api_docs.md) + * [キーボードサポート](ja/reference_configurator_support.md) -* [FAQ](ja/faq.md) - * [一般的な FAQ](ja/faq_general.md) - * [QMK のビルド/コンパイル](ja/faq_build.md) - * [QMK のデバッグ/トラブルシューティング](ja/faq_debug.md) - * [キーマップ](ja/faq_keymap.md) - * [Zadig を使ったドライバのインストール](ja/driver_installation_zadig.md) +* CLI + * [概要](ja/cli.md) + * [設定](ja/cli_configuration.md) + * [コマンド](ja/cli_commands.md) -* 詳細なガイド - * [ビルドツールのインストール](ja/getting_started_build_tools.md) - * [Vagrant のガイド](ja/getting_started_vagrant.md) - * [ビルド/コンパイルの説明](ja/getting_started_make_guide.md) - * [ファームウェアのフラッシュ](ja/flashing.md) - * [機能のカスタマイズ](ja/custom_quantum_functions.md) - * [キーマップの概要](ja/keymap.md) +* QMK を使う + * ガイド + * [機能のカスタマイズ](ja/custom_quantum_functions.md) + * [Zadig を使ったドライバのインストール](ja/driver_installation_zadig.md) + * [キーマップの概要](ja/keymap.md) + * [Vagrant のガイド](ja/getting_started_vagrant.md) + * 書き込み + * [書き込み](ja/flashing.md) + * [ATmega32A の書き込み (ps2avrgb)](ja/flashing_bootloadhid.md) + * IDE + * [Eclipse で QMK を使用](ja/other_eclipse.md) + * [VSCode で QMK を使用](ja/other_vscode.md) + * Git のベストプラクティス + * [入門](ja/newbs_git_best_practices.md) + * [フォーク](ja/newbs_git_using_your_master_branch.md) + * [マージの競合の解決](ja/newbs_git_resolving_merge_conflicts.md) + * [ブランチの修正](ja/newbs_git_resynchronize_a_branch.md) + * キーボードを作る + * [Hand Wiring ガイド](ja/hand_wire.md) + * [ISP 書き込みガイド](ja/isp_flashing_guide.md) -* [ハードウェア](ja/hardware.md) - * [互換性のあるマイクロコントローラ](ja/compatible_microcontrollers.md) - * [AVR プロセッサ](ja/hardware_avr.md) - * [ドライバ](ja/hardware_drivers.md) + * 単純なキーコード + * [完全なリスト](ja/keycodes.md) + * [基本的なキーコード](ja/keycodes_basic.md) + * [修飾キー](ja/feature_advanced_keycodes.md) + * [Quantum キーコード](ja/quantum_keycodes.md) -* リファレンス - * [キーボード ガイドライン](ja/hardware_keyboard_guidelines.md) - * [設定オプション](ja/config_options.md) - * [キーコード](ja/keycodes.md) - * [コーディング規約 - C](ja/coding_conventions_c.md) - * [コーディング規約 - Python](ja/coding_conventions_python.md) - * [ドキュメント ベストプラクティス](ja/documentation_best_practices.md) - * [ドキュメント テンプレート](ja/documentation_templates.md) - * [用語](ja/reference_glossary.md) - * [ユニットテスト](ja/unit_testing.md) - * [便利な関数](ja/ref_functions.md) - * [Configurator サポート](ja/reference_configurator_support.md) - * [info.json 形式](ja/reference_info_json.md) - * [Python CLI 開発](ja/cli_development.md) + * 高度なキーコード + * [コマンド](ja/feature_command.md) + * [動的マクロ](ja/feature_dynamic_macros.md) + * [グレイブ エスケープ](ja/feature_grave_esc.md) + * [リーダーキー](ja/feature_leader_key.md) + * [モッドタップ](ja/mod_tap.md) + * [マクロ](ja/feature_macros.md) + * [マウスキー](ja/feature_mouse_keys.md) + * [Space Cadet Shift](ja/feature_space_cadet.md) + * [US ANSI シフトキー](ja/keycodes_us_ansi_shifted.md) -* [機能](ja/features.md) - * [基本的なキーコード](ja/keycodes_basic.md) - * [US ANSI シフトキー](ja/keycodes_us_ansi_shifted.md) - * [Quantum キーコード](ja/quantum_keycodes.md) - * [Advanced キーコード](ja/feature_advanced_keycodes.md) - * [オーディオ](ja/feature_audio.md) - * [自動シフト](ja/feature_auto_shift.md) - * [バックライト](ja/feature_backlight.md) - * [ブルートゥース](ja/feature_bluetooth.md) - * [ブートマジック](ja/feature_bootmagic.md) - * [コンボ](ja/feature_combo.md) - * [コマンド](ja/feature_command.md) - * [デバウンス API](ja/feature_debounce_type.md) - * [DIP スイッチ](ja/feature_dip_switch.md) - * [動的マクロ](ja/feature_dynamic_macros.md) - * [エンコーダ](ja/feature_encoders.md) - * [グレイブ エスケープ](ja/feature_grave_esc.md) - * [触覚フィードバック](ja/feature_haptic_feedback.md) - * [HD44780 LCD コントローラ](ja/feature_hd44780.md) - * [キーロック](ja/feature_key_lock.md) - * [レイアウト](ja/feature_layouts.md) - * [リーダー キー](ja/feature_leader_key.md) - * [LED マトリックス](ja/feature_led_matrix.md) - * [マクロ](ja/feature_macros.md) - * [マウスキー](ja/feature_mouse_keys.md) - * [OLED ドライバ](ja/feature_oled_driver.md) - * [One Shot Keys](ja/one_shot_keys.md) - * [ポインティング デバイス](ja/feature_pointing_device.md) - * [PS/2 マウス](ja/feature_ps2_mouse.md) - * [RGB ライト](ja/feature_rgblight.md) - * [RGB マトリックス](ja/feature_rgb_matrix.md) - * [Space Cadet](ja/feature_space_cadet.md) - * [分割キーボード](ja/feature_split_keyboard.md) - * [Stenography](ja/feature_stenography.md) - * [Swap Hands](ja/feature_swap_hands.md) - * [タップ ダンス](ja/feature_tap_dance.md) - * [ターミナル](ja/feature_terminal.md) - * [感熱式プリンタ](ja/feature_thermal_printer.md) - * [ユニコード](ja/feature_unicode.md) - * [ユーザスペース](ja/feature_userspace.md) - * [Velocikey](ja/feature_velocikey.md) + * ソフトウェア機能 + * [自動シフト](ja/feature_auto_shift.md) + * [コンボ](ja/feature_combo.md) + * [デバウンス API](ja/feature_debounce_type.md) + * [キーロック](ja/feature_key_lock.md) + * [レイヤー](ja/feature_layers.md) + * [One Shot Keys](ja/one_shot_keys.md) + * [ポインティング デバイス](ja/feature_pointing_device.md) + * [Swap Hands](ja/feature_swap_hands.md) + * [タップダンス](ja/feature_tap_dance.md) + * [タップホールド設定](ja/tap_hold.md) + * [ターミナル](ja/feature_terminal.md) + * [ユニコード](ja/feature_unicode.md) + * [ユーザスペース](ja/feature_userspace.md) + * [WPM 計算](ja/feature_wpm.md) -* メーカーおよびモッダーのために - * [Hand Wiring ガイド](ja/hand_wire.md) - * [ISP 書き込みガイド](ja/isp_flashing_guide.md) - * [ARM デバッグ ガイド](ja/arm_debugging.md) - * [ADC ドライバ](ja/adc_driver.md) - * [I2C ドライバ](ja/i2c_driver.md) - * [WS2812 ドライバ](ja/ws2812_driver.md) - * [EEPROM ドライバ](ja/eeprom_driver.md) - * [GPIO コントロール](ja/internals_gpio_control.md) - * [カスタムマトリックス](ja/custom_matrix.md) - * [Proton C 規約](ja/proton_c_conversion.md) + * ハードウェア機能 + * 表示 + * [HD44780 LCD コントローラ](ja/feature_hd44780.md) + * [OLED ドライバ](ja/feature_oled_driver.md) + * 電飾 + * [バックライト](ja/feature_backlight.md) + * [LED マトリックス](ja/feature_led_matrix.md) + * [RGB ライト](ja/feature_rgblight.md) + * [RGB マトリックス](ja/feature_rgb_matrix.md) + * [オーディオ](ja/feature_audio.md) + * [Bluetooth](ja/feature_bluetooth.md) + * [ブートマジック](ja/feature_bootmagic.md) + * [カスタムマトリックス](ja/custom_matrix.md) + * [DIP スイッチ](ja/feature_dip_switch.md) + * [エンコーダ](ja/feature_encoders.md) + * [触覚フィードバック](ja/feature_haptic_feedback.md) + * [Proton C 規約](ja/proton_c_conversion.md) + * [PS/2 マウス](ja/feature_ps2_mouse.md) + * [分割キーボード](ja/feature_split_keyboard.md) + * [Stenography](ja/feature_stenography.md) + * [感熱式プリンタ](ja/feature_thermal_printer.md) + * [Velocikey](ja/feature_velocikey.md) -* より深く知るために - * [キーボードがどのように動作するか](ja/how_keyboards_work.md) - * [QMK の理解](ja/understanding_qmk.md) +* QMK の開発 + * 破壊的な変更 + * [概要](ja/breaking_changes.md) + * [プルリクエストにフラグが付けられた](ja/breaking_changes_instructions.md) + * 履歴 + * [2020年2月29日](ja/ChangeLog/20200229.md) + * [2019年8月30日](ja/ChangeLog/20190830.md) -* 他の話題 - * [Eclipse で QMK を使用](ja/other_eclipse.md) - * [VSCode で QMK を使用](ja/other_vscode.md) - * [サポート](ja/getting_started_getting_help.md) - * [翻訳を追加する方法](ja/translating.md) + * C 開発 + * [ARM デバッグ ガイド](ja/arm_debugging.md) + * [AVR プロセッサ](ja/hardware_avr.md) + * [コーディング規約](ja/coding_conventions_c.md) + * [互換性のあるマイクロコントローラ](ja/compatible_microcontrollers.md) + * [ドライバ](ja/hardware_drivers.md) + * [ADC ドライバ](ja/adc_driver.md) + * [I2C ドライバ](ja/i2c_driver.md) + * [WS2812 ドライバ](ja/ws2812_driver.md) + * [EEPROM ドライバ](ja/eeprom_driver.md) + * [GPIO コントロール](ja/internals_gpio_control.md) + * [キーボード ガイドライン](ja/hardware_keyboard_guidelines.md) -* QMK の内部詳細(作成中) - * [定義](ja/internals_defines.md) - * [Input Callback Reg](ja/internals_input_callback_reg.md) - * [Midi ドライバ](ja/internals_midi_device.md) - * [Midi デバイスのセットアップ手順](ja/internals_midi_device_setup_process.md) - * [Midi ユーティリティ](ja/internals_midi_util.md) - * [Send Functions](ja/internals_send_functions.md) - * [Sysex Tools](ja/internals_sysex_tools.md) + * Python 開発 + * [コーディング規約](ja/coding_conventions_python.md) + * [QMK CLI 開発](ja/cli_development.md) + + * Configurator 開発 + * QMK API + * [開発環境](ja/api_development_environment.md) + * [アーキテクチャの概要](ja/api_development_overview.md) + + * QMK Reference + * [QMK への貢献](ja/contributing.md) + * [QMK ドキュメントの翻訳](ja/translating.md) + * [設定オプション](ja/config_options.md) + * [Make ドキュメント](ja/getting_started_make_guide.md) + * [ドキュメント ベストプラクティス](ja/documentation_best_practices.md) + * [ドキュメント テンプレート](ja/documentation_templates.md) + * [コミュニティレイアウト](ja/feature_layouts.md) + * [ユニットテスト](ja/unit_testing.md) + * [便利な関数](ja/ref_functions.md) + * [info.json 形式](ja/reference_info_json.md) + + * より深く知るために + * [キーボードがどのように動作するか](ja/how_keyboards_work.md) + * [マトリックスがどのように動作するか](ja/how_a_matrix_works.md) + * [QMK を理解する](ja/understanding_qmk.md) + + * QMK の内部詳細(作成中) + * [定義](ja/internals_defines.md) + * [Input Callback Reg](ja/internals_input_callback_reg.md) + * [Midi デバイス](ja/internals_midi_device.md) + * [Midi デバイスのセットアップ手順](ja/internals_midi_device_setup_process.md) + * [Midi ユーティリティ](ja/internals_midi_util.md) + * [Send Functions](ja/internals_send_functions.md) + * [Sysex Tools](ja/internals_sysex_tools.md) diff --git a/docs/ja/contributing.md b/docs/ja/contributing.md index 401cabcd4e..75cedf0b34 100644 --- a/docs/ja/contributing.md +++ b/docs/ja/contributing.md @@ -1,8 +1,8 @@ # 貢献方法 👍🎉 まず、これを読み貢献する時間を作ってくれてありがとうございます!🎉👍 @@ -106,7 +106,7 @@ enum my_keycodes { }; ``` -### ドキュメントのプレビュー +### ドキュメントのプレビュー :id=previewing-the-documentation 開発環境をセットアップした場合は、プルリクエストを開く前に以下のコマンドを `qmk_firmware/` フォルダから実行することで、あなたの変更をプレビューすることができます: @@ -122,7 +122,7 @@ enum my_keycodes { ほとんどの初めての QMK 貢献者は、個人のキーマップから始めます。キーマップの標準はかなりカジュアルなものにしようとしています(キーマップは結局のところ作成者の性格を反映しています)が、他の人があなたのキーマップを簡単に見つけて学ぶことができるように、これらのガイドラインに従うようにお願いします。 -* [the template](documentation_templates.md) を使って `readme.md` を書きます。 +* [テンプレート](documentation_templates.md) を使って `readme.md` を書きます。 * 全てのキーマップの PR は squash されるため、コミットがどのように squash されるかを気にする場合は、自分で行う必要があります。 * キーマップの PR に機能をまとめないでください。最初に機能をサブミットし、次にキーマップのための2つ目の PR をサブミットします。 * `Makefile` をキーマップフォルダに含めないでください(もう使われていません)。 @@ -134,7 +134,7 @@ enum my_keycodes { また以下のガイドラインに従うことをお願いします: -* [the template](ja/documentation_templates.md) を使って `readme.md` を書きます。 +* [テンプレート](ja/documentation_templates.md) を使って `readme.md` を書きます。 * コミットの数を適切に保ってください。そうでなければあなたの PR を squash します。 * コア機能を新しいキーボードにまとめないでください。最初に機能をサブミットし、次にキーボード用に別の PR をサブミットしてください。 * `.c`/`.h` ファイルにすぐ上の親フォルダに従って名前を付けます。例えば、`/keyboards///.[ch]` diff --git a/docs/ja/custom_quantum_functions.md b/docs/ja/custom_quantum_functions.md index f49df8f65b..7e4fbd897e 100644 --- a/docs/ja/custom_quantum_functions.md +++ b/docs/ja/custom_quantum_functions.md @@ -1,8 +1,8 @@ # キーボードの挙動をカスタマイズする方法 多くの人にとって、カスタムキーボードはボタンの押下をコンピュータに送信するだけではありません。単純なボタンの押下やマクロよりも複雑なことを実行できるようにしたいでしょう。QMK にはコードを挿入したり、機能を上書きしたり、様々な状況でキーボードの挙動をカスタマイズできるフックがあります。 @@ -39,7 +39,7 @@ enum my_keycodes { }; ``` -## 任意のキーコードの挙動のプログラミング +## 任意のキーコードの挙動のプログラミング :id=programming-the-behavior-of-any-keycode 既存のキーの挙動を上書きしたい場合、あるいは新しいキーについて挙動を定義する場合、`process_record_kb()` および `process_record_user()` 関数を使うべきです。これらは実際のキーイベントが処理される前のキー処理中に QMK によって呼び出されます。これらの関数が `true` を返す場合、QMK はキーコードを通常通りに処理します。これは、キーを置き換えるのではなく、キーの機能を拡張するのに便利です。これらの関数が `false` を返す場合、QMK は通常のキー処理をスキップし、必要なキーのアップまたはダウンイベントを送信するのかはユーザ次第です。 @@ -316,7 +316,7 @@ void suspend_wakeup_init_user(void) { * キーボード/リビジョン : `void suspend_power_down_kb(void)` および `void suspend_wakeup_init_user(void)` * キーマップ: `void suspend_power_down_kb(void)` および `void suspend_wakeup_init_user(void)` -# レイヤー切り替えコード +# レイヤー切り替えコード :id=layer-change-code これはレイヤーが切り替えられるたびにコードを実行します。レイヤー表示あるいはカスタムレイヤー処理に役立ちます。 @@ -491,14 +491,24 @@ void eeconfig_init_user(void) { // EEPROM がリセットされます! # カスタムタッピング期間 -デフォルトでは、タッピング期間はグローバルに設定されていて、キーでは設定することができません。ほとんどのユーザにとって、これは全然問題ありません。しかし、場合によっては、`LT` キーとは異なるタイムアウトによって、デュアルファンクションキーが大幅に改善されます。なぜなら、一部のキーは他のキーよりも押し続けやすいためです。それぞれにカスタムキーコードを使う代わりに、キーごとに設定可能な `TAPPING_TERM` を使用できます。 +デフォルトでは、タッピング期間と(`IGNORE_MOD_TAP_INTERRUPT` のような)関連オプションはグローバルに設定されていて、キーでは設定することができません。ほとんどのユーザにとって、これは全然問題ありません。しかし、場合によっては、`LT` キーとは異なるタイムアウトによって、デュアルファンクションキーが大幅に改善されます。なぜなら、一部のキーは他のキーよりも押し続けやすいためです。それぞれにカスタムキーコードを使う代わりに、キーごとに設定可能なタイムアウトの挙動を設定できます。 -この機能を有効にするには、最初に `config.h` に `#define TAPPING_TERM_PER_KEY` を追加する必要があります。 +キーごとのタイムアウトの挙動を制御するための2つの設定可能なオプションがあります: + +- `TAPPING_TERM_PER_KEY` +- `IGNORE_MOD_TAP_INTERRUPT_PER_KEY` + +必要な機能ごとに、`config.h` に `#define` 行を追加する必要があります。 + +``` +#define TAPPING_TERM_PER_KEY +#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY +``` ## `get_tapping_term` の実装例 -キーコードに基づいて `TAPPING TERM` を変更するには、次のようなものを `keymap.c` ファイルに追加します: +キーコードに基づいて `TAPPING_TERM` を変更するには、次のようなものを `keymap.c` ファイルに追加します: ```c uint16_t get_tapping_term(uint16_t keycode) { @@ -513,6 +523,21 @@ uint16_t get_tapping_term(uint16_t keycode) { } ``` -### `get_tapping_term` 関数のドキュメント +## `get_ignore_mod_tap_interrupt` の実装例 + +キーコードに基づいて `IGNORE_MOD_TAP_INTERRUPT` の値を変更するには、次のようなものを `keymap.c` ファイルに追加します: + +```c +bool get_ignore_mod_tap_interrupt(uint16_t keycode) { + switch (keycode) { + case SFT_T(KC_SPC): + return true; + default: + return false; + } +} +``` + +## `get_tapping_term` / `get_ignore_mod_tap_interrupt` 関数のドキュメント ここにある他の多くの関数とは異なり、quantum あるいはキーボードレベルの関数を持つ必要はありません (または理由さえありません)。ここではユーザレベルの関数だけが有用なため、そのようにマークする必要はありません。 diff --git a/docs/ja/flashing.md b/docs/ja/flashing.md index 1118fb5e2f..62baa907d1 100644 --- a/docs/ja/flashing.md +++ b/docs/ja/flashing.md @@ -1,13 +1,13 @@ # 書き込みの手順とブートローダ情報 キーボードが使用するブートローダにはかなり多くの種類があり、ほぼ全てが異なる書き込みの方法を使います。幸いなことに、[QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) のようなプロジェクトは、あまり深く考える必要無しに様々なタイプと互換性を持つことを目指していますが、この文章では様々なタイプのブートローダとそれらを書き込むために利用可能な方法について説明します。 -`rules.mk` の `BOOTLOADER` 変数で選択されたブートローダがある場合、QMK は .hex ファイルがデバイスに書き込むのに適切なサイズかどうかを自動的に計算し、合計サイズをバイト単位で(最大値とともに)出力します。この処理を手動で実行するには、`check-size` を付けてコンパイルします。例えば、`make planck/rev4:default:check-size`。 +`rules.mk` の `BOOTLOADER` 変数で選択されたブートローダがある場合、QMK は .hex ファイルがデバイスに書き込むのに適切なサイズかどうかを自動的に計算し、合計サイズをバイト単位で(最大値とともに)出力します。 ## DFU @@ -105,7 +105,7 @@ BOOTLOADER = caterina make ::avrdude -#### Caterina コマンド +### Caterina コマンド ファームウェアを DFU デバイスに書き込むために使用できる DFU コマンドがいくつかあります。 diff --git a/docs/ja/keymap.md b/docs/ja/keymap.md index 29eb1adc08..48b2a5cd57 100644 --- a/docs/ja/keymap.md +++ b/docs/ja/keymap.md @@ -1,14 +1,14 @@ # キーマップの概要 QMK のキーマップは C のソースファイルの中で定義されます。そのデータ構造は配列の配列です。外側はレイヤーを要素とする配列で、レイヤーはキーを要素とする配列。ほとんどのキーボードは `LAYOUT()` マクロを定義して、この配列の配列を作成しやすくしています。 -## キーマップとレイヤー +## キーマップとレイヤー :id=keymap-and-layers QMKでは、**`const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]`**は、**アクションコード**を保持している **16 bit** データの中でキーマップ情報の複数の**レイヤー**を保持します。最大で**32個のレイヤー**を定義することができます。 普通のキー定義の場合、**アクションコード**の上位8ビットは全て0で、下位8ビットは**キーコード**としてキーによって生成された USB HID usage コードを保持します。 @@ -32,7 +32,8 @@ QMKでは、**`const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]`**は TMK の歴史的経緯から、キーマップに保存されたアクションコードは、一部のドキュメントではキーコードと呼ばれる場合があります。 -### キーマップレイヤーステータス +### キーマップレイヤーステータス :id=keymap-layer-status + キーマップレイヤーの状態は、2つの32ビットパラメータによって決定されます。 * **`default_layer_state`** は、常に有効で参照される基本キーマップレイヤー (0-31) を示します (デフォルトレイヤー)。 diff --git a/docs/newbs_getting_started.md b/docs/newbs_getting_started.md index 01d9c9d09e..67dd5290c3 100644 --- a/docs/newbs_getting_started.md +++ b/docs/newbs_getting_started.md @@ -50,7 +50,7 @@ After opening a new MSYS2 MinGW 64-bit terminal, make sure `pacman` is up to dat You may be asked to close and reopen the window. Do this and keep running the above command until it says `there is nothing to do`. Then run the following: - pacman -S git python3-pip + pacman -S git mingw-w64-x86_64-toolchain mingw-w64-x86_64-python3-pip python3 -m pip install qmk ### macOS diff --git a/docs/understanding_qmk.md b/docs/understanding_qmk.md index 81cedfcf53..9396424258 100644 --- a/docs/understanding_qmk.md +++ b/docs/understanding_qmk.md @@ -162,6 +162,15 @@ The `process_record()` function itself is deceptively simple, but hidden within At any step during this chain of events a function (such as `process_record_kb()`) can `return false` to halt all further processing. +After this is called, `post_process_record()` is called, which can be used to handle additional cleanup that needs to be run after the keycode is normally handled. + +* [`void post_process_record(keyrecord_t *record)`]() + * [`void post_process_record_quantum(keyrecord_t *record)`]() + * [Map this record to a keycode]() + * [`void post_process_clicky(uint16_t keycode, keyrecord_t *record)`]() + * [`void post_process_record_kb(uint16_t keycode, keyrecord_t *record)`]() + * [`void post_process_record_user(uint16_t keycode, keyrecord_t *record)`]() +