diff options
| author | ymzcdg <49898694+ymzcdg@users.noreply.github.com> | 2019-06-05 02:06:17 +0800 | 
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-06-04 11:06:17 -0700 | 
| commit | e0a0d80bd329b4a289e3c4f817c96857c25b0f16 (patch) | |
| tree | 88d7f5693ec3afc041589d7968da4be595c897ad /docs | |
| parent | e7711b3b665c7df0a2a1d7272580cc01be28590d (diff) | |
| download | firmware-e0a0d80bd329b4a289e3c4f817c96857c25b0f16.tar.gz firmware-e0a0d80bd329b4a289e3c4f817c96857c25b0f16.tar.bz2 firmware-e0a0d80bd329b4a289e3c4f817c96857c25b0f16.zip  | |
docs to Mandarin Chinese (#5960)
* faq_general.md to Chinese
faq_general.md to Chinese
faq finished
* custom_quantum_functions.md to Chinese
custom_quantum_functions.md to Chinese
* custom_quantum_functions.md fix 
custom_quantum_functions.md fix
* custom_quantum_functions.md fix translate 
custom_quantum_functions.md fix translate
* !ver.English! _summary.md bug fix
 _summary.md bug fix of English doc. add".md" behind "feature_combo"
* !ver.English! custom_quantum_functions.md fix#5869
custom_quantum_functions.md in English : delete redundant "is" . issue#5869
* !ver.English! how_keyboards_work.md link fix
change 
https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input
to 
https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_input
"#Hexadecimal_code_input" not exist
* !English! how_keyboards_work.md add missing "t"
Tied to a specific OS a a time (need recompilation when changing OS);
change to
Tied to a specific OS at a time (need recompilation when changing OS);
* _summary.md improve translation
_summary.md improve translation
* reference_glossary.md into Chinese
reference_glossary.md into Chinese
术语表翻译,这个术语表英文版似乎不太全,应该补充英文版,并在中文版添加其他具有中国特色的术语。
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/custom_quantum_functions.md | 2 | ||||
| -rw-r--r-- | docs/how_keyboards_work.md | 4 | ||||
| -rw-r--r-- | docs/zh-cn/_summary.md | 66 | ||||
| -rw-r--r-- | docs/zh-cn/custom_quantum_functions.md | 490 | ||||
| -rw-r--r-- | docs/zh-cn/faq_general.md | 19 | ||||
| -rw-r--r-- | docs/zh-cn/reference_glossary.md | 170 | 
6 files changed, 715 insertions, 36 deletions
diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index 6287b9530..7be82c650 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -267,7 +267,7 @@ You should use this function if you need custom matrix scanning code. It can als  If the board supports it, it can be "idled", by stopping a number of functions.  A good example of this is RGB lights or backlights.   This can save on power consumption, or may be better behavior for your keyboard. -This is controlled by two functions: `suspend_power_down_*` and `suspend_wakeup_init_*`, which are called when the system is board is idled and when it wakes up, respectively. +This is controlled by two functions: `suspend_power_down_*` and `suspend_wakeup_init_*`, which are called when the system board is idled and when it wakes up, respectively.  ### Example suspend_power_down_user() and suspend_wakeup_init_user() Implementation diff --git a/docs/how_keyboards_work.md b/docs/how_keyboards_work.md index 0772f055d..5697a2187 100644 --- a/docs/how_keyboards_work.md +++ b/docs/how_keyboards_work.md @@ -63,10 +63,10 @@ You may wonder why a keyboard layout containing all of Unicode is not devised th  ## How to (Maybe) Enter Unicode Characters -You can have the firmware send *sequences of keys* to use the [software Unicode Input Method](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input) of the target operating system, thus effectively entering characters independently of the layout defined in the OS. +You can have the firmware send *sequences of keys* to use the [software Unicode Input Method](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_input) of the target operating system, thus effectively entering characters independently of the layout defined in the OS.  Yet, it does come with multiple disadvantages: - - Tied to a specific OS a a time (need recompilation when changing OS); + - Tied to a specific OS at a time (need recompilation when changing OS);   - Within a given OS, does not work in all software;   - Limited to a subset of Unicode on some systems. diff --git a/docs/zh-cn/_summary.md b/docs/zh-cn/_summary.md index df25a3ccd..b0d9f1c06 100644 --- a/docs/zh-cn/_summary.md +++ b/docs/zh-cn/_summary.md @@ -7,27 +7,27 @@    * [学习资源](newbs_learn_more_resources.md)  * [QMK基础](README.md) -  * [QMK 简介](getting_started_introduction.md) -  * [贡献 QMK](contributing.md) +  * [QMK简介](getting_started_introduction.md) +  * [向QMK贡献](contributing.md)    * [如何使用Github](getting_started_github.md)    * [获得帮助](getting_started_getting_help.md)  * [问题解答](faq.md)    * [一般问题](faq_general.md) -  * [构建/编译QMK](faq_build.md) -  * [调试/故障排除 QMK](faq_debug.md) -  * [键盘布局](faq_keymap.md) +  * [构建/编译](faq_build.md) +  * [调试/故障排除](faq_debug.md) +  * [键盘映射](faq_keymap.md)  * 详细指南    * [安装构建工具](getting_started_build_tools.md) -  * [流浪者指南](getting_started_vagrant.md) +  * [vagrant指南](getting_started_vagrant.md)    * [构建/编译指令](getting_started_make_guide.md)    * [刷新固件](flashing.md)    * [定制功能](custom_quantum_functions.md) -  * [布局概述](keymap.md) +  * [映射概述](keymap.md)  * [硬件](hardware.md) -  * [AVR 处理器](hardware_avr.md) +  * [AVR处理器](hardware_avr.md)    * [驱动](hardware_drivers.md)  * 参考 @@ -35,8 +35,8 @@    * [配置选项](config_options.md)    * [键码](keycodes.md)    * [记录最佳实践](documentation_best_practices.md) -  * [文档指南](documentation_templates.md) -  * [词汇表](reference_glossary.md) +  * [文档模板](documentation_templates.md) +  * [术语表](reference_glossary.md)    * [单元测试](unit_testing.md)    * [有用的功能](ref_functions.md)    * [配置器支持](reference_configurator_support.md) @@ -44,35 +44,35 @@  * [特性](features.md)    * [基本键码](keycodes_basic.md) -  * [US ANSI 控制键](keycodes_us_ansi_shifted.md) +  * [US ANSI控制码](keycodes_us_ansi_shifted.md)    * [量子键码](quantum_keycodes.md)    * [高级键码](feature_advanced_keycodes.md)    * [音频](feature_audio.md) -  * [自动控制](feature_auto_shift.md) +  * [自动shift](feature_auto_shift.md)    * [背光](feature_backlight.md)    * [蓝牙](feature_bluetooth.md) -  * [Bootmagic](feature_bootmagic.md) +  * [热改键](feature_bootmagic.md)    * [组合](feature_combo)    * [命令](feature_command.md)    * [动态宏指令](feature_dynamic_macros.md)    * [编码器](feature_encoders.md) -  * [Grave Escape](feature_grave_esc.md) -  * [键锁](feature_key_lock.md) -  * [层](feature_layouts.md) -  * [引导键](feature_leader_key.md) -  * [LED 阵列](feature_led_matrix.md) +  * [重音号Esc复合键](feature_grave_esc.md) +  * [自锁键](feature_key_lock.md) +  * [布局](feature_layouts.md) +  * [前导键](feature_leader_key.md) +  * [LED阵列](feature_led_matrix.md)    * [宏指令](feature_macros.md)    * [鼠标键](feature_mouse_keys.md)    * [一键功能](feature_advanced_keycodes.md#one-shot-keys)    * [指针设备](feature_pointing_device.md) -  * [PS/2 鼠标](feature_ps2_mouse.md) -  * [RGB 光](feature_rgblight.md) -  * [RGB 矩阵](feature_rgb_matrix.md) +  * [PS/2鼠标](feature_ps2_mouse.md) +  * [RGB灯光](feature_rgblight.md) +  * [RGB矩阵](feature_rgb_matrix.md)    * [空格候补换挡](feature_space_cadet_shift.md)    * [空格候补换挡回车](feature_space_cadet_shift_enter.md)    * [速录机](feature_stenography.md)    * [换手](feature_swap_hands.md) -  * [踢踏舞](feature_tap_dance.md) +  * [多击键](feature_tap_dance.md)    * [终端](feature_terminal.md)    * [热敏打印机](feature_thermal_printer.md)    * [Unicode](feature_unicode.md) @@ -80,16 +80,16 @@    * [速度键](feature_velocikey.md)  * 针对制造者和定制者 -  * [飞线指南](hand_wire.md) -  * [ISP 刷新指南](isp_flashing_guide.md) -  * [ARM 调试指南](arm_debugging.md) -  * [I2C 驱动](i2c_driver.md) -  * [GPIO 控制器](internals_gpio_control.md) -  * [Proton C 转换](proton_c_conversion.md) +  * [手工连线指南](hand_wire.md) +  * [ISP刷新指南](isp_flashing_guide.md) +  * [ARM调试指南](arm_debugging.md) +  * [I2C驱动](i2c_driver.md) +  * [GPIO控制器](internals_gpio_control.md) +  * [Proton C转换](proton_c_conversion.md)  * 深入了解    * [键盘如何工作](how_keyboards_work.md) -  * [理解 QMK](understanding_qmk.md) +  * [理解QMK](understanding_qmk.md)  * 其他话题    * [使用Eclipse开发QMK](other_eclipse.md) @@ -99,8 +99,8 @@  * QMK 内构 (正在编写)    * [定义](internals_defines.md)    * [输入回调寄存器](internals_input_callback_reg.md) -  * [Midi 设备](internals_midi_device.md) -  * [Midi 设备设置过程](internals_midi_device_setup_process.md) -  * [Midi 工具库](internals_midi_util.md) +  * [Midi设备](internals_midi_device.md) +  * [Midi设备设置过程](internals_midi_device_setup_process.md) +  * [Midi工具库](internals_midi_util.md)    * [发送函数](internals_send_functions.md) -  * [Sysex 工具](internals_sysex_tools.md) +  * [Sysex工具](internals_sysex_tools.md) diff --git a/docs/zh-cn/custom_quantum_functions.md b/docs/zh-cn/custom_quantum_functions.md new file mode 100644 index 000000000..42ceba9ca --- /dev/null +++ b/docs/zh-cn/custom_quantum_functions.md @@ -0,0 +1,490 @@ +# ζ̵Ĺ + +ںܶ˵ƻ̿ɲֻĵԷ㰴Ǹô϶ʵֱȼͺӵĹܡQMKעĹ, ǹ, ⣬ԶڲͬµΪ + +ҳٶκQMK֪ʶĶ[QMK](understanding_qmk.md)ڸIJⷢʲô + +## A Word on Core vs  vs  + +ǰqmk֯һνṹ + +* Core (`_quantum`) +  * Keyboard/Revision (`_kb`) +    * Keymap (`_user`) + +ÿһڶϼһ`_kb()` `_user()`  ڼ/ʹ`_kb()`ڲֲʹ`_user()` + +ڼ/㶨庯ʱ`_kb()`ִκδǰȵ`_user()`DZҪģȻֲ㺯ͲҪá +<!-- ⣺Ǿ䷭IJ̫--> +# Զ + +ĿǰΪֹǸмΪµļ롣ӴǶЩơ + +## һ¼ + +һöٳȫҲǸֲΨһֵQMKûֱֵСṩһ`SAFE_RANGE`ꡣöʱ`SAFE_RANGE`֤ȡΨһļֵ + + +öӡӵ`keymap.c`Ļڲ`FOO``BAR`ˡ + +```c +enum my_keycodes { +  FOO = SAFE_RANGE, +  BAR +}; +``` + +## ΪΪ + +㸲һѴڰΪʱΪ¼ʱҪ`process_record_kb()``process_record_user()`ڼʵ¼ǰQMKá`true`QMKķʽ롣ԺܷչĹܶ滻`false` QMKȻͼ̧ǰ¼ˡ + +ij»ͷʱᱻá + +### process_record_user()`ʾʵ + +¡Զһ`FOO`ļΪڰ»سʱ + +```c +bool process_record_user(uint16_t keycode, keyrecord_t *record) { +  switch (keycode) { +    case FOO: +      if (record->event.pressed) { +        // ʱЩʲô +      } else { +        // ͷʱЩʲô +      } +      return false; // ˼нһ +    case KC_ENTER: +      // »سʱ +      if (record->event.pressed) { +        PLAY_NOTE_ARRAY(tone_qwerty); +      } +      return true; // QMKس/ͷ¼ +    default: +      return true; //  +  } +} +``` + +### `process_record_*` ĵ + +* /: `bool process_record_kb(uint16_t keycode, keyrecord_t *record)` +* : `bool process_record_user(uint16_t keycode, keyrecord_t *record)` + +`keycode()`ڲ϶ģ`MO(1)`, `KC_L`, ȵȡ Ҫ `switch...case` Щ¼ + +`record`ʵʰϢ + +```c +keyrecord_t record { +  keyevent_t event { +    keypos_t key { +      uint8_t col +      uint8_t row +    } +    bool     pressed +    uint16_t time +  } +} +``` + +# LED + +qmkṩ˶ȡHID淶5LEDķ: + +* `USB_LED_NUM_LOCK` +* `USB_LED_CAPS_LOCK` +* `USB_LED_SCROLL_LOCK` +* `USB_LED_COMPOSE` +* `USB_LED_KANA` + +ӦLED״̬λλ +ַԻLED״̬ + +* ִͨ `led_set_user()` +* ͨ `host_keyboard_leds()` + +## `led_set_user()` + +5LEDκһ״̬Ҫıʱ˺á˺ͨLED +ʹ`IS_LED_ON(usb_led, led_name)``IS_LED_OFF(usb_led, led_name)`LED״̬ + +!> `host_keyboard_leds()`ܻ`led_set_user()`ǰֵ + +### `led_set_user()`ʾʵ + +```c +void led_set_user(uint8_t usb_led) { +    if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { +        writePinLow(B0); +    } else { +        writePinHigh(B0); +    } +    if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { +        writePinLow(B1); +    } else { +        writePinHigh(B1); +    } +    if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { +        writePinLow(B2); +    } else { +        writePinHigh(B2); +    } +    if (IS_LED_ON(usb_led, USB_LED_COMPOSE)) { +        writePinLow(B3); +    } else { +        writePinHigh(B3); +    } +    if (IS_LED_ON(usb_led, USB_LED_KANA)) { +        writePinLow(B4); +    } else { +        writePinHigh(B4); +    } +} +``` + +### `led_set_*`ĵ + +* /: `void led_set_kb(uint8_t usb_led)` +* : `void led_set_user(uint8_t usb_led)` + +## `host_keyboard_leds()` + +᷵յLED״̬`led_set_*`֮ȡLED״̬ʱã[`matrix_scan_user()`](#ɨ). +Ϊ˱ݣ`IS_HOST_LED_ON(led_name)``IS_HOST_LED_OFF(led_name)` ֱ꣬ӵúͼ`host_keyboard_leds()` + +## LED״̬ + +һЩʵΪLED״̬ṩ˷ķ + +### Ergodox Boards + +Ergodoxʵṩ`ergodox_right_led_1`/`2`/`3_on`/`off()`ÿLED, Ҳ `ergodox_right_led_on`/`off(uint8_t led)` رǡ + +⣬ʹ`ergodox_led_all_set(uint8_t n)`ָLEDȼÿLED`ergodox_right_led_1`/`2`/`3_set(uint8_t n)`ʹĻ`ergodox_right_led_set(uint8_t led, uint8_t n)` + +Ergodox boards ͬʱȼ`LED_BRIGHTNESS_LO`ȼ`LED_BRIGHTNESS_HI`(Ĭ). + +# ̳ʼ + +̳ʼм衣ǸȡҪʲô + +Ҫʼ˳г + +* `keyboard_pre_init_*` - ڴǰСЩҪǰеӲʼ +* `matrix_init_*` - ڹ̼м䱻áʱӲѳʼδʼ +* `keyboard_post_init_*` - ڹ̼á£ġƻ붼Է + +!> ڴ˵`keyboard_post_init_user`Ҫõĺ, ʱRGBƷ⡣ + +## Ԥʼ + +뼫УUSBʼǰС + +֮þͱʼˡ + +ڴû˵,òΪҪӲijʼ + +ӲʼĻٺò(ʼLEDһ). + +### `keyboard_pre_init_user()`ʾʵ + +ڼ̼趨 B0, B1, B2, B3,  B4 LEDš + +```c +void keyboard_pre_init_user(void) { +  // üԤʼ + +  // LEDΪģʽ +  setPinOutput(B0); +  setPinOutput(B1); +  setPinOutput(B2); +  setPinOutput(B3); +  setPinOutput(B4); +} +``` + +### `keyboard_pre_init_*` ĵ + +* /: `void keyboard_pre_init_kb(void)` +* : `void keyboard_pre_init_user(void)` + +## ʼ + +⽫ھʼʱãijЩӲúúһЩܱʼǰ  + +طõĶʱãӲأҲλá + + +### `matrix_init_*`ĵ + +* /: `void matrix_init_kb(void)` +* : `void matrix_init_user(void)` + + +## ̺ʼ + +Ǽ̳ʼеһijЩԣãΪʱӦöǽгʼ + + +### `keyboard_post_init_user()`ʾʵ + +ʾгʼɺУRGBơ + +```c +void keyboard_post_init_user(void) { +  // úʼ +  rgblight_enable_noeeprom(); // ʹRgb +  rgblight_sethsv_noeeprom(180, 255, 255); // ɫõɫ(ɫ) +  rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); // ÿٺģʽ +} +``` + +### `keyboard_post_init_*` ĵ + +* /: `void keyboard_post_init_kb(void)` +* : `void keyboard_post_init_user(void)` + +# ɨ + +ܵĻҪ`process_record_*()`Զַ̣ʽӵ¼Уȷ벻Լ̲Ӱ졣Ȼڼ£бҪоɨ衣ЩҪرעܣΪÿٱ10Ρ + +### `matrix_scan_*`ʾʵ + +ӱʡˡhookһܼе֮ǰӦ㹻˽qmkڲṹԱûʾ±дҪ[һissue](https://github.com/qmk/qmk_firmware/issues/new)[Discordǽ](https://discord.gg/Uq7gcHh). + +### `matrix_scan_*` ĵ + +* /: `void matrix_scan_kb(void)` +* : `void matrix_scan_user(void)` + +úÿξɨʱãMCUͬдҪΪкܶΡ + +ԶɨʱõҲԶ״̬(LEDƻĻ)ûҲ붨еĹܡ + + +#  /  + +֧־ͿֹͨͣһƱﵽ""RGBƺͱǺܺõӡԽԼܺģҲ̷ζѡ + +: `suspend_power_down_*``suspend_wakeup_init_*`, ֱϵͳкͻʱá + + +### suspend_power_down_user()suspend_wakeup_init_user()ʾʵ + + +```c +void suspend_power_down_user(void) { +    rgb_matrix_set_suspend_state(true); +} + +void suspend_wakeup_init_user(void) { +    rgb_matrix_set_suspend_state(false); +} +``` + +###  / ĵ + +* /: `void suspend_power_down_kb(void)` `void suspend_wakeup_init_user(void)` +* : `void suspend_power_down_kb(void)`  `void suspend_wakeup_init_user(void)` + +# ı + +ÿıд롣ڲָʾԶ㴦á + +### `layer_state_set_*` ʾʵ + +ʹPlanckʾ [RGB](feature_rgblight.md)ʹ֮Ӧ + +```c +uint32_t layer_state_set_user(uint32_t state) { +    switch (biton32(state)) { +    case _RAISE: +        rgblight_setrgb (0x00,  0x00, 0xFF); +        break; +    case _LOWER: +        rgblight_setrgb (0xFF,  0x00, 0x00); +        break; +    case _PLOVER: +        rgblight_setrgb (0x00,  0xFF, 0x00); +        break; +    case _ADJUST: +        rgblight_setrgb (0x7A,  0x00, 0xFF); +        break; +    default: //  for any other layers, or the default layer +        rgblight_setrgb (0x00,  0xFF, 0xFF); +        break; +    } +  return state; +} +``` +### `layer_state_set_*` ĵ + +* /: `uint32_t layer_state_set_kb(uint32_t state)` +* : `uint32_t layer_state_set_user(uint32_t state)` + + +`״̬`ǻbitmask, [ָ](keymap.md#ֵIJ״̬) + + +# 籣 (EEPROM) + +óڵıڼСЩñصEEPROM粻ʧ ÿ`eeconfig_read_kb``eeconfig_read_user`ȡ`eeconfig_update_kb``eeconfig_update_user`д롣ϣܹлĹܺ(лRGBָʾ⣬`eeconfig_init_kb``eeconfig_init_user`EEPROMĬֵ  + +ӵIJֿǣкܶͨEEPROM洢ͷݣҲûַǡȷġÿֻһ˫(ֽ)ռ䡣 + +סEEPROMдġдܸߣDzֻдEEPROMСдƵMCU̡ + +* ӣôϣʹԣΪ൱ӡ + +### ʾʵ + +ãҶдʹû֡һӵĺкܶҪʵϣʹ˺ܶ + + +keymap.cļУ´: +```c +typedef union { +  uint32_t raw; +  struct { +    bool     rgb_layer_change :1; +  }; +} user_config_t; + +user_config_t user_config; +``` + +ϴ뽨һṹ壬ýṹԴ洢òдEEPROM㽫趨ΪڽṹȻ塣Ҫס`bool` ()ֵʹ1λ, `uint8_t`ʹ8λ, `uint16_t`ʹ16λԻϴʹã˳Ǵܻ鷳Ϊǻıддֵ  + + `layer_state_set_*`ʹ`rgb_layer_change`ʹ`keyboard_post_init_user``process_record_user`һС + +Ҫʹ`keyboard_post_init_userҪ`eeconfig_read_user()`ոմĽṹ塣ȻʹṹIJеĹܡ  +```c +void keyboard_post_init_user(void) { +  // òּľʼ + +  // EEPROMû +  user_config.raw = eeconfig_read_user(); + +  // ʹܣĬϲ +  if (user_config.rgb_layer_change) { +    rgblight_enable_noeeprom(); +    rgblight_sethsv_noeeprom_cyan();  +    rgblight_mode_noeeprom(1); +  } +} +``` +ϺڶEEPROMúʹøĬϲRGBɫ"raw"ֵǴ"union"Ľṹתġ  + +```c +uint32_t layer_state_set_user(uint32_t state) { +    switch (biton32(state)) { +    case _RAISE: +        if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); } +        break; +    case _LOWER: +        if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_red(); rgblight_mode_noeeprom(1); } +        break; +    case _PLOVER: +        if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_green(); rgblight_mode_noeeprom(1); } +        break; +    case _ADJUST: +        if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_white(); rgblight_mode_noeeprom(1); } +        break; +    default: //  Ĭϲ +        if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_cyan(); rgblight_mode_noeeprom(1); } +        break; +    } +  return state; +} +``` +ֵʹʱıRGBơֵ, Ϊ`process_record_user`һ¼`RGB_LYR`ҪȷʹRGB룬ʹʾرգ뽫Ϊ +```c + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { +  switch (keycode) { +    case FOO: +      if (record->event.pressed) { +        // ʱʲô +      } else { +        // ͷʱʲô +      } +      return false; // ˼Ľһ +    case KC_ENTER: +        // ڰ»سʱ +        if (record->event.pressed) { +            PLAY_NOTE_ARRAY(tone_qwerty); +        } +        return true; // QMKس/ͷ¼ +    case RGB_LYR:  // underglowΪָʾʹá +        if (record->event.pressed) {  +            user_config.rgb_layer_change ^= 1; // л״̬ +            eeconfig_update_user(user_config.raw); // EEPROMд״̬ +            if (user_config.rgb_layer_change) { // ״̬ʹ +                layer_state_set(layer_state);   // ô̸²ɫ +            } +        } +        return false; break; +    case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // еRGB (see quantum_keycodes.h, L400 Բο) +        if (record->event.pressed) { //ʧָܲʾıҪ +            if (user_config.rgb_layer_change) {        // ʹʱ +                user_config.rgb_layer_change = false;  // ʧܣȻ  +                eeconfig_update_user(user_config.raw); // EEPROMд +            } +        } +        return true; break; +    default: +      return true; //  +  } +} +``` +Ҫ`eeconfig_init_user`ԵEEPROMʱָĬֵ, ԶǿEEPROM`EEP_RST`[Bootmagic](feature_bootmagic.md)磬ҪĬRGBָʾĬֵ + +```c +void eeconfig_init_user(void) {  // EEPROM +  user_config.raw = 0; +  user_config.rgb_layer_change = true; // ҪĬʹ +  eeconfig_update_user(user_config.raw); // EEPROMдĬֵ + +  // use the non noeeprom versions, ҪEEPROMдЩֵ +  rgblight_enable(); // ĬʹRGB +  rgblight_sethsv_cyan();  // Ĭɫ +  rgblight_mode(1); // Ĭó +} +``` + +ȻˡRGBָʾʱûһֱ棬¼̡ʹRGB룬ָʾʧܣˡ  + +### 'EECONFIG' ĵ + +* /: `void eeconfig_init_kb(void)`, `uint32_t eeconfig_read_kb(void)``void eeconfig_update_kb(uint32_t val)` +* : `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)``void eeconfig_update_user(uint32_t val)` + +`val` дEEPROMֵ`eeconfig_read_*`EEPROMһ32λ(˫)ֵ + +# Զ-ٽֵ(TAPPING_TERM) +Ĭ,-ٽֵȫͳһģҲͨáڴû˵ܺáЩ£`LT`˵ʱ˫ܼΪЩļװסΪ˲ÿԶ룬ܿΪÿ`TAPPING_TERM` + +ʹܵĻ, Ҫ`config.h``#define TAPPING_TERM_PER_KEY` + + +## `get_tapping_term`ʾʵ + +ҪĻڼ`TAPPING TERM`,Ҫ`keymap.c`ļ´:  + +```c +uint16_t get_tapping_term(uint16_t keycode) { +  switch (keycode) { +    case SFT_T(KC_SPC): +      return TAPPING_TERM + 1250; +    case LT(1, KC_GRV): +      return 130; +    default: +      return TAPPING_TERM; +  } +} +``` + +### `get_tapping_term` ĵ + +ƪ,Ҫquantum̼ĺֻҪûɡ diff --git a/docs/zh-cn/faq_general.md b/docs/zh-cn/faq_general.md new file mode 100644 index 000000000..4949acb8c --- /dev/null +++ b/docs/zh-cn/faq_general.md @@ -0,0 +1,19 @@ +#  + +## QMKʲô? + +[QMK](https://github.com/qmk), ӻе(Quantum Mechanical Keyboard)дһȺԴΪƼ̿ĹߡǴ[QMK̼](https://github.com/qmk/qmk_firmware)ʼ[TMK](https://github.com/tmk/tmk_keyboard)ħķֲ档 + +### Ϊʲô(Quantum)? + +<!--  ²ۣĵ߾ȻҲ֪Ϊɶ --> + +## QMKTMKʲô? + +TMK[Jun Wako](https://github.com/tmk)ƺִСQMKʼ[Jack Humbert](https://github.com/jackhumbert)ΪPlanck̴TMKֲ档һʱJackķֲͺTMKȥԶˣ2015꣬JackQMK + +Ӽ۵QMKTMKһЩ¹ܶɵġQMKչ˿õļ룬ʹܽһḻ `S()`, `LCTL()`,  `MO()`ȫ[](keycodes.md). + +ӹ̵TMKԼάйٷֵ֧ļֻ̣кСһ֧֡άѴڷֲΪ̴ķֲ档Ĭֺ֧ٵļ룬ûͨ˷֡QMKͨйֺֿͼ̣ǻзPRͼı֤άͬʱQMKСҲڱҪʱ + +ַŵȱ㣬ҴʱTMKQMK֮ diff --git a/docs/zh-cn/reference_glossary.md b/docs/zh-cn/reference_glossary.md new file mode 100644 index 000000000..7b9adcc2a --- /dev/null +++ b/docs/zh-cn/reference_glossary.md @@ -0,0 +1,170 @@ +# QMK术语表 + +## ARM +多家公司生产的32位单片机系列,例如Atmel, Cypress, Kinetis, NXP, ST, 和 TI等公司。 + +## AVR +[Atmel](http://www.microchip.com/)公司的单片机系列。 AVR是TMK的初始支持平台。 + +## AZERTY +Français (法国)标准键盘布局。用键盘的前六个字母命名。 + +## Backlight(背光) +键盘上照明的通称。背光通常是一组LED灯,通过键帽或者按轴发光,但也不总是这样。 + +## Bluetooth(蓝牙) +一种短距离点对点无线协议。许多多无线键盘使用此协议。 + +## Bootloader(引导加载程序) +一种写到你单片机的保护区的特殊的程序,该程序可以使单片机升级自己的固件,通常是通过USB来升级。 + +## Bootmagic(热改键) +允许各种键盘行为动态变化的功能,如交换或禁用常用键。 + +## C +一种适用于系统代码的低级编程语言。大多数qmk代码是用C编写的。 + +## Colemak +一种流行的键盘布局。 + +## Compile(编译) +把人可读的代码转换成你的单片机可以运行的机器代码的过程。 + +## Dvorak +一个由August Dvorak博士在20世纪30年代创建的布局。Dvorak简化键盘(Dvorak Simplified Keyboard)的缩写。 + +## Dynamic Macro(动态宏) +一种记录在键盘上的宏,当键盘拔出或计算机重新启动时,宏将丢失。 + +* [动态宏文档](feature_dynamic_macros.md) + +## Eclipse +是一种受C语言开发者追捧的集成开发环境(IDE)。 + +* [Eclipse安装说明](eclipse.md) + +## Firmware(固件) +用来控制单片机的软件。 + +## FLIP +爱特梅尔(Atmel)提供的AVR器件刷写软件。我们一般推荐 [QMK刷写工具](https://github.com/qmk/qmk_flasher),但是对于一些高级用例,需要FLIP。 + +## git +命令行版本控制软件 + +## GitHub +负责大多数QMK项目的网站。它是Git、问题跟踪和其他帮助我们运行qmk的功能的集成平台。 + +## ISP(在系统编程) +在系统编程(In-system programming), 使用外部硬件和JTAG管脚对AVR芯片进行编程的一种方法。 + +## hid_listen +从键盘接收调试消息的接口。 您可以使用[QMK Flasher](https://github.com/qmk/qmk_flasher)或[PJRC's hid_listen](https://www.pjrc.com/teensy/hid_listen.html)查看这些消息 + +## Keycode(键码) +表示特定键的2字节数据。`0x00`-`0xFF`用于[基本键码](keycodes_basic.md)而`0x100`-`0xFFFF`用于[量子键码](quantum_keycodes.md). + +## Key Down +一个键按下尚未抬起时触发的事件。 + +## Key Up +一个键抬起时触发的事件。 + +## Keymap(键映射) +映射到物理键盘布局的一组键码,在按键和按键释放时进行处理。有时翻译为布局,意为软件上表示的布局,即映射。 + +## Layer(层) +为了让一个键实现多个功能的抽象结构。最高活动层有限。 + +## Leader Key(前导键、设置菜单键) +本功能允许您点击前导键,然后按顺序按1-3个键子来激活按键或其他量子功能。 + +* [前导键文档](feature_leader_key.md) + +## LED +发光二极管,键盘上最常用的指示灯装置。 + +## Make +用于编译所有源文件的软件包。可以使用`make`命令和其他参数来编译你的固件。 + +## Matrix(矩阵) +一种由列和行组成的接线模式,使单片机能够用较少的引脚检测按键。矩阵通常包含二极管,以达到全键无冲。 + +## Macro(宏) +本功能可以在敲击单个键后发送多个按键事件(hid报告)。 + +* [宏文档](feature_macros.md) + +## MCU(单片机、微控制单元) +微控制单元,键盘的处理器。 + +## Modifier(修改键、修饰键、功能键) +按住该键将会改变其他键的功能,修饰键包括 Ctrl, Alt, 和 Shift。 + +## Mousekeys(鼠标键) +本功能在您敲击键盘时会控制鼠标光标。 + +* [鼠标键文档](feature_mouse_keys.md) + +## N-Key Rollover (NKRO、全键无冲) +一种术语,适用于能够同时报告任意数量按键的键盘。 + +## Oneshot Modifier(粘滞键) +一种能让你的功能键一直保持按下,直到你按下其他键的功能。它叫做粘滞键或叫做粘连键,该功能由软件实现而非机械结构。 + +## ProMicro +一种低成本AVR开发板。这种板子很容易在购物网站找到(价格不到20RMB),但是据说刷写pro micro有点令人抓狂。 + +## Pull Request(拉请求、PR) +向QMK请求提交代码。我们鼓励所有用户提交你们自己的键盘的代码。 + +## QWERTY +标准英文键盘,通常也用于其他语言,例如中文。是用键盘前6个字母命名的。 + +## QWERTZ +标准Deutsche(德语)键盘布局。使用前6个字母明名。 + +## Rollover(允许翻转、无冲形式) +该术语表示在一个键已按下时按下另一个键。形式包括2KRO(双键无冲),6KRO(6键无冲),和NKRO(全键无冲),无冲表示可同时按下而不产生冲突的键的数量。 + +## Scancode(扫描码) +HID报告中的一个1字节的数字,表示一个键子。这些数字在下列文档中[HID Usage Tables](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf)该文档发布于[USB-IF](http://www.usb.org/)。 + +## Space Cadet键盘的shift键 +一种特使的shift设置,能让你通过敲击左或右shift一次或多次键入不同的括号。 + +* [Space Cadet键盘文档](feature_space_cadet.md) + +## Tap(敲击、单击) +按下并释放一个键。在某些情况下您需要区分键按下和键抬起,但是单击把两个事件都包括了。 + +## Tap Dance(多击键) +本功能允许向同一个键子分配多个键码,并根据按键次数区分。 + +* [多击键文档](feature_tap_dance.md) + +## Teensy +一种低成本AVR开发板<!--译者吐槽:我怎么感觉成本不低。好吧,我穷。 -->,通常用于手工连线键盘。这个teensy是有点小贵但是halfkay bootloader会让它刷写十分简单,所以也很常用。 + +## Underlight(背光) +用于照亮电路板底面的LED的总称。这些LED通常从印刷电路板的底部向键盘所在的表面发光。 + +## Unicode +在较大的计算机世界中,Unicode是一组编码方案,用于表示任何语言中的字符。 与qmk相关的是,它意味着使用各种操作系统方案来发送Unicode代码点,而不是扫描码。 + +* [Unicode文档](feature_unicode.md) + +## Unit Testing(单元测试) +针对qmk的自动运行测试框架。单元测试帮助我们确信我们的更改不会破坏任何东西。 + +* [单元测试文档](unit_testing.md) + +## USB +通用串行总线,键盘最常见的有线接口。 + +## USB 主机 (或简易主机) +USB诸暨市你的电脑,或者你的键盘所插的任何设备。 + +# 并没有找到你想找到的术语? + +[建立一个issue](https://github.com/qmk/qmk_firmware/issues) ,想好你的问题,或许你所问的术语就会添加到这里。创建一个PR帮我们添加需要添加的术语当然坠吼了:)  | 
