2
0
Просмотр исходного кода

Merge remote-tracking branch 'upstream/master'

Stick 8 лет назад
Родитель
Сommit
4ba9917f82
100 измененных файлов с 5926 добавлено и 86 удалено
  1. 1 0
      .gitignore
  2. 3 6
      Dockerfile
  3. 23 0
      book.json
  4. 7 0
      docs/Adding-features-to-QMK.md
  5. 0 0
      docs/BUILD_GUIDE.md
  6. 7 0
      docs/Becoming-a-QMK-Collaborator.md
  7. 119 0
      docs/Build-Environment-Setup.md
  8. 0 0
      doc/CYGWIN_GUIDE.md
  9. 25 0
      docs/Compatible-Microcontrollers.md
  10. 123 0
      docs/Custom-Quantum-Functions.md
  11. 7 0
      docs/Differences-from-TMK.md
  12. 84 0
      docs/Eclipse.md
  13. 64 0
      docs/Embedding.md
  14. 151 0
      docs/FAQ-Build.md
  15. 248 0
      docs/FAQ-Keymap.md
  16. 238 0
      docs/FAQ.md
  17. 0 0
      docs/FUSE.txt
  18. 7 0
      docs/Git-subtree.md
  19. 0 0
      docs/HAND_WIRE.md
  20. 5 0
      docs/HHKB-Alt-controller.md
  21. 183 0
      docs/Home.md
  22. 94 0
      docs/Key-Functions.md
  23. 228 0
      docs/Keycodes.md
  24. 37 0
      docs/Keymap-examples.md
  25. 222 0
      docs/Keymap.md
  26. 29 0
      docs/Kiibohd.asciidoc
  27. 37 0
      docs/Leader-Key.md
  28. 1272 0
      docs/License-Clarification-Details.md
  29. 38 0
      docs/License-Clarification.md
  30. 215 0
      docs/Macros.md
  31. 167 0
      docs/Make-Instructions.md
  32. 21 0
      docs/Memory-write-error,-use-debug-for-more-info.md
  33. 379 0
      docs/Modding-your-keyboard.md
  34. 17 0
      docs/Mouse-keys.md
  35. 62 0
      docs/Other-Projects.md
  36. 0 0
      docs/PCB_GUIDE.md
  37. 0 0
      docs/POWER.txt
  38. 70 0
      docs/Porting-Your-Keyboard-to-QMK-(ARM-and-other-ChibiOS-CPUs).md
  39. 59 0
      docs/Porting-your-keyboard-to-QMK.md
  40. 14 0
      docs/Previously-Asked-Questions.asciidoc
  41. 75 0
      docs/QMK-Overview.md
  42. 1 0
      docs/Report-Descriptor.md
  43. 26 0
      docs/SUMMARY.md
  44. 24 0
      docs/Space-Cadet-Shift.md
  45. 34 0
      docs/TMK-Based-Projects.md
  46. 69 0
      docs/TMK-Own-Projects.md
  47. 0 0
      docs/TMK_README.md
  48. 144 0
      docs/Tap-Dance.md
  49. 17 0
      docs/Test-for-ASCIIDOC.asciidoc
  50. 11 0
      docs/USB-HID.md
  51. 0 0
      docs/USB_NKRO.txt
  52. 54 0
      docs/Unicode-and-additional-language-support.md
  53. 68 0
      docs/Unit-testing.md
  54. 0 0
      docs/VAGRANT_GUIDE.md
  55. 21 0
      docs/_Sidebar.md
  56. 0 0
      docs/basic_how_keyboards_work.md
  57. 0 0
      docs/build_old.md
  58. BIN
      docs/gitbook/images/favicon.ico
  59. BIN
      docs/gitbook/images/favicon.png
  60. 0 0
      docs/keycode.txt
  61. 0 0
      docs/keymap_config_h_example.h
  62. 0 0
      docs/keymap_makefile_example.mk
  63. 0 0
      docs/keymap_old.md
  64. 36 0
      docs/mbed-cortex-porting.md
  65. 0 0
      docs/other_projects.md
  66. 15 0
      keyboards/amj60/amj60.h
  67. 61 0
      keyboards/amj60/keymaps/maximized/keymap.c
  68. 16 1
      keyboards/amjpad/amjpad.h
  69. 102 0
      keyboards/amjpad/keymaps/max/keymap.c
  70. 65 0
      keyboards/amjpad/keymaps/ortho_left/keymap.c
  71. 65 0
      keyboards/amjpad/keymaps/ortho_right/keymap.c
  72. 2 2
      keyboards/atomic/keymaps/pvc/keymap.c
  73. 5 5
      keyboards/atreus/keymaps/xyverz/keymap.c
  74. 5 5
      keyboards/atreus62/keymaps/xyverz/keymap.c
  75. 86 0
      keyboards/clueboard/keymaps/jokrik/keymap.c
  76. 11 0
      keyboards/clueboard/keymaps/jokrik/readme.md
  77. 7 14
      keyboards/clueboard/keymaps/mac_optimized/keymap.c
  78. 4 0
      keyboards/clueboard/keymaps/serubin/Makefile
  79. 103 0
      keyboards/clueboard/keymaps/serubin/keymap.c
  80. BIN
      keyboards/clueboard/keymaps/serubin/layout-base.png
  81. BIN
      keyboards/clueboard/keymaps/serubin/layout-fn.png
  82. BIN
      keyboards/clueboard/keymaps/serubin/layout-media.png
  83. 23 0
      keyboards/clueboard/keymaps/serubin/readme.md
  84. 4 4
      keyboards/clueboard/keymaps/shift_fn/keymap.c
  85. 19 16
      keyboards/clueboard/keymaps/skully/keymap.c
  86. 181 0
      keyboards/clueboard/keymaps/smt/keymap.c
  87. BIN
      keyboards/clueboard/keymaps/smt/layout.png
  88. 30 0
      keyboards/clueboard/keymaps/smt/readme.md
  89. 5 5
      keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c
  90. 0 0
      keyboards/dk60/Makefile
  91. 55 0
      keyboards/dk60/config.h
  92. 34 0
      keyboards/dk60/dk60.c
  93. 41 0
      keyboards/dk60/dk60.h
  94. 80 0
      keyboards/dk60/keymaps/default/keymap.c
  95. 8 0
      keyboards/dk60/readme.md
  96. 21 0
      keyboards/dk60/rules.mk
  97. 2 2
      keyboards/ergodox/config.h
  98. 3 1
      keyboards/ergodox/ez/config.h
  99. 37 25
      keyboards/ergodox/ez/matrix.c
  100. 0 0
      keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h

+ 1 - 0
.gitignore

@@ -22,6 +22,7 @@ quantum/version.h
 .idea/
 CMakeLists.txt
 .DS_STORE
+/util/wsl_downloaded
 
 # Eclipse/PyCharm/Other IDE Settings
 .cproject

+ 3 - 6
Dockerfile

@@ -1,8 +1,7 @@
 FROM debian:jessie
 MAINTAINER Erik Dasque <erik@frenchguys.com>
 
-RUN apt-get update
-RUN apt-get install --no-install-recommends -y build-essential \
+RUN apt-get update && apt-get install --no-install-recommends -y build-essential \
     gcc \
     unzip \
     wget \
@@ -15,10 +14,8 @@ RUN apt-get install --no-install-recommends -y build-essential \
     gcc-arm-none-eabi \
     binutils-arm-none-eabi \
     libnewlib-arm-none-eabi \
-    git
-
-RUN apt-get clean
-RUN rm -rf /var/lib/apt/lists/*
+    git \
+    && rm -rf /var/lib/apt/lists/*
 
 ENV keyboard=ergodox
 ENV subproject=ez

+ 23 - 0
book.json

@@ -0,0 +1,23 @@
+{
+    "structure": {
+        "readme": "Home.md"
+    },
+    "plugins" : ["toolbar", "edit-link", "anchors"],
+    "pluginsConfig": {
+            "edit-link": {
+                "base": "https://github.com/qmk/qmk_firmware/edit/master/docs",
+                "label": "Suggest an edit"
+            },
+        "toolbar": {
+            "buttons":
+            [
+                {
+                    "label": "QMK Firmware",
+                    "icon": "fa fa-github",
+                    "url": "https://github.com/qmk/qmk_firmware"
+                }
+            ]
+        }
+    },
+    "root": "./docs/"
+}

+ 7 - 0
docs/Adding-features-to-QMK.md

@@ -0,0 +1,7 @@
+If you have an idea for a custom feature or extra hardware connection, we'd love to accept it into QMK! These are generally done via [pull request](https://github.com/qmk/qmk_firmware/pulls) after forking, and here are some things to keep in mind when creating one:
+
+* **Disable by default** - memory is a pretty limited on most chips QMK supports, and it's important that current keymaps aren't broken, so please allow your feature to be turned **on**, rather than being turned off. If you think it should be on by default, or reduces the size of the code, [open an issue](https://github.com/qmk/qmk_firmware/issues) for everyone to discuss it!
+* **Compile locally before submitting** - hopefully this one is obvious, but things need to compile! Our Travis system will catch any issues, but it's generally faster for you to compile a few keyboards locally instead of waiting for the results to come back.
+* **Consider subprojects and different chip-bases** - there are several keyboards that have subprojects that have allow for slightly different configurations, and even different chip-bases. Try to make a feature supported in ARM and AVR, or automatically disabled in one that doesn't work.
+* **Explain your feature** - submitting a markdown write-up of what your feature does with your PR may be needed, and it will allow a collaborator to easily copy it into the wiki for documentation (after proofing and editing).
+* **Don't refactor code** - to maintain a clear vision of how things are laid out in QMK, we try to plan out refactors in-depth, and have a collaborator make the changes. If you have an idea for refactoring, or suggestions, [open an issue](https://github.com/qmk/qmk_firmware/issues).

doc/BUILD_GUIDE.md → docs/BUILD_GUIDE.md


+ 7 - 0
docs/Becoming-a-QMK-Collaborator.md

@@ -0,0 +1,7 @@
+A QMK collaborator is a keyboard maker/designer that is interested in helping QMK grow and fully support their keyboard(s), and encouraging their users/customers to submit features, ideas, and keymaps. We're always looking to add more keyboards and collaborators, but we ask that they fulfill these requirements:
+
+* **Have a PCB available for sale** - unfortunately there's just too much variation and complications with handwired keyboards.
+* **Maintain the your keyboard's directory** - this may just require an initial setup to get your keyboard working, but it could also include accommodating changes made to QMK's core.
+* **Approve and merge your keyboard's keymap pull requests** - we like to encourage users to contribute their keymaps for others to see and work from when creating their own.
+
+If you feel you meet these requirements, shoot us an email at hello@qmk.fm with an introduction and some links to your keyboard!

Разница между файлами не показана из-за своего большого размера
+ 119 - 0
docs/Build-Environment-Setup.md


+ 0 - 0
doc/CYGWIN_GUIDE.md


+ 25 - 0
docs/Compatible-Microcontrollers.md

@@ -0,0 +1,25 @@
+# Atmel AVR
+
+QMK should run on any Atmel AVR processor with enough Flash. It has been tested on the following:
+
+* 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...
+
+NOTE: To enable full features of firmware you'll need 32KB flash size.
+
+Please add any tested microcontrollers to this list.
+
+# ARM
+
+You can also use any ARM processor that [ChibiOS](http://www.chibios.org) supports. The following processors have been tested:
+
+* [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)

+ 123 - 0
docs/Custom-Quantum-Functions.md

@@ -0,0 +1,123 @@
+A custom keyboard is about more than sending button presses to your computer. QMK has designed hooks to allow you to inject code, override functionality, and otherwise customize how your keyboard responds in different situations. 
+
+## A Word on Keyboards vs Keymap
+
+We have structured QMK as a hierarchy:
+
+* Core
+  * Keyboard/Revision (`_kb`)
+    * Keymap (`_user`)
+
+Each of the functions described below can be defined with a `_kb()` suffix or an `_user()` suffix. We intend for you to use the `_kb()` suffix at the Keyboard/Revision level, while the `_user()` suffix should be used at the Keymap level.
+
+When defining functions at the Keyboard/Revision level it is important that your `_kb()` implementation call `_user()` before executing anything else- otherwise the keymap level function will never be called.
+
+## Matrix Initialization Code
+
+* Keyboard/Revision: `void matrix_init_kb(void)` 
+* Keymap: `void matrix_init_user(void)`
+
+This function gets called when the matrix is initiated. You should use this function to initialize any custom hardware you may have, such as speakers, LED drivers, or other features which need to be setup after the keyboard powers on.
+
+### Example
+
+```
+void matrix_init_kb(void) {
+        // put your keyboard start-up code here
+        // runs once when the firmware starts up
+        matrix_init_user();
+
+        // JTAG disable for PORT F. write JTD bit twice within four cycles.
+        MCUCR |= (1<<JTD);
+        MCUCR |= (1<<JTD);
+
+        // * Set our LED pins as output
+        DDRB |= (1<<0);
+        DDRB |= (1<<1);
+        DDRB |= (1<<2);
+        DDRB |= (1<<3);
+        DDRB |= (1<<4);
+}
+```
+
+## Matrix Scanning Code
+
+* Keyboard/Revision: `void matrix_scan_kb(void)`
+* Keymap: `void matrix_scan_user(void)`
+
+This function gets called at every matrix scan, which is basically as often as the MCU can handle. Be careful what you put here, as it will get run a lot.
+
+You should use this function if you need custom matrix scanning code. It can also be used for custom status output (such as LED's or a display) or other functionality that you want to trigger regularly even when the user isn't typing.
+
+## Hook Into Key Presses
+
+* Keyboard/Revision: `bool process_record_kb(uint16_t keycode, keyrecord_t *record)` 
+* Keymap: `bool process_record_user(uint16_t keycode, keyrecord_t *record)`
+
+This function gets called every time a key is pressed or released. This is particularly useful when defining custom keys or overriding the behavior of existing keys.
+
+The return value is whether or not QMK should continue processing the keycode - returning `false` stops the execution.
+
+The `keycode` variable is whatever is defined in your keymap, eg `MO(1)`, `KC_L`, etc. and can be switch-cased to execute code whenever a particular code is pressed.
+
+The `record` variable contains infomation about the actual press:
+
+```
+keyrecord_t record {
+  keyevent_t event {
+    keypos_t key {
+      uint8_t col
+      uint8_t row
+    }
+    bool     pressed
+    uint16_t time
+  }
+}
+```
+
+The conditional `if (record->event.pressed)` can tell if the key is being pressed or released, and you can execute code based on that.
+
+## LED Control
+
+* Keyboard/Revision: `void led_set_kb(uint8_t usb_led)` 
+* Keymap: `void led_set_user(uint8_t usb_led)`
+
+This allows you to control the 5 LED's defined as part of the USB Keyboard spec. It will be called when the state of one of those 5 LEDs changes.
+
+* `USB_LED_NUM_LOCK`
+* `USB_LED_CAPS_LOCK`
+* `USB_LED_SCROLL_LOCK`
+* `USB_LED_COMPOSE`
+* `USB_LED_KANA`
+
+### Example:
+
+```
+void led_set_kb(uint8_t usb_led) {
+    if (usb_led & (1<<USB_LED_NUM_LOCK)) {
+        PORTB |= (1<<0);
+    } else {
+        PORTB &= ~(1<<0);
+    }
+    if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+        PORTB |= (1<<1);
+    } else {
+        PORTB &= ~(1<<1);
+    }
+    if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
+        PORTB |= (1<<2);
+    } else {
+        PORTB &= ~(1<<2);
+    }
+    if (usb_led & (1<<USB_LED_COMPOSE_LOCK)) {
+        PORTB |= (1<<3);
+    } else {
+        PORTB &= ~(1<<3);
+    }
+    if (usb_led & (1<<USB_LED_KANA_LOCK)) {
+        PORTB |= (1<<4);
+    } else {
+        PORTB &= ~(1<<4);
+    }
+}
+```

+ 7 - 0
docs/Differences-from-TMK.md

@@ -0,0 +1,7 @@
+Understanding the essential changes made on the [tmk_keyboard firmware](http://github.com/tmk/tmk_keyboard) should help you understand the QMK Firmware.
+
+| Firmware                     |TMK                    |QMK                      |
+|------------------------------|-----------------------|-------------------------|
+| Maintainer                   |hasu  (@tmk)           |Jack Humbert et al.      |
+| Build path customization     | `TMK_DIR = ...`       | `include .../Makefile`  |
+| `keymaps` array data | 3D array of `uint8_t`  holding **keycode**      | 3D array of `uint16_t` holding **keycode**  |

+ 84 - 0
docs/Eclipse.md

@@ -0,0 +1,84 @@
+[Eclipse](https://en.wikipedia.org/wiki/Eclipse_(software)) is an open-source [Integrated Development Environment](https://en.wikipedia.org/wiki/Integrated_development_environment) (IDE) widely used for Java development, but with an extensible plugin system that allows to customize it for other languages and usages.
+
+Using an IDE such as Eclipse provides many advantages over a plain text editor, such as:
+* intelligent code completion
+* convenient navigation in the code
+* refactoring tools
+* build automation (no need for the command-line)
+* a GUI for GIT
+* static code analysis
+* many other tools such as debugging, code formatting, showing call hierarchies etc.
+
+The purpose of the is page is to document how to set-up Eclipse for developing AVR software, and working on the QMK code base.
+
+Note that this set-up has been tested on Ubuntu 16.04 only for the moment.
+
+# Prerequisites
+## Build environment
+Before starting, you must have followed the [Getting Started](/Home.md#getting-started) section corresponding to your system. In particular, you must have been able to build the firmware with [the `make` command](../#the-make-command).
+
+## Java
+Eclipse is a Java application, so you will need to install Java 8 or more recent to be able to run it. You may choose between the JRE or the JDK, the latter being useful if you intend to do Java development.
+
+# Install Eclipse and its plugins
+Eclipse comes in [several flavours](http://www.eclipse.org/downloads/eclipse-packages/) depending on the target usage that you will have. There is no package comprising the AVR stack, so we will need to start from Eclipse CDT (C/C++ Development Tooling) and install the necessary plugins.
+
+## Download and install Eclipse CDT
+If you already have Eclipse CDT on your system, you can skip this step. However it is advised to keep it up-to-date for better support.
+
+If you have another Eclipse package installed, it is normally possible to [install the CDT plugin over it](https://eclipse.org/cdt/downloads.php). However it is probably better to reinstall it from scratch to keep it light and avoid the clutter of tools that you don't need for the projects you will be working on.
+
+Installation is very simple: follow the [5 Steps to Install Eclipse](https://eclipse.org/downloads/eclipse-packages/?show_instructions=TRUE), and choose **Eclipse IDE for C/C++ Developers** at Step 3.
+
+Alternatively, you can also directly [download Eclipse IDE for C/C++ Developers](http://www.eclipse.org/downloads/eclipse-packages/) ([direct link to current version](http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/neonr)) and extract the package to the location of your choice (this creates an `eclipse` folder).
+
+## First Launch
+When installation is complete, click the <kbd>Launch</kbd> button. (If you extracted the package manually, open the Eclipse installation folder and double-click the `eclipse` executable)
+
+When you are prompted with the Workspace Selector, select a directory that will hold Eclipse metadata and usually your projects. **Do not select the `qmk_firmware` directory**, this will be the project directory. Select the parent folder instead, or another (preferably empty) folder of your choice (the default is fine if you do not use it yet).
+
+Once started, click the <kbd>Workbench</kbd> button at the top right to switch to the workbench view (there is a also checkbox at the bottom to skip the welcome screen at startup).
+
+## Install the necessary plugins
+Note: you do not need to restart Eclipse after installing each plugin. Simply restart once all plugins are installed.
+
+### [The AVR plugin](http://avr-eclipse.sourceforge.net/)
+This is the most important plugin as it will allow Eclipse to _understand_ AVR C code. Follow [the instructions for using the update site](http://avr-eclipse.sourceforge.net/wiki/index.php/Plugin_Download#Update_Site), and agree with the security warning for unsigned content.
+
+### [ANSI Escape in Console](https://marketplace.eclipse.org/content/ansi-escape-console)
+This plugin is necessary to properly display the colored build output generated by the QMK makefile.
+
+1. Open <kbd><kbd>Help</kbd> > <kbd>Eclipse Marketplace…</kbd></kbd>
+2. Search for _ANSI Escape in Console_
+3. Click the <samp>Install</samp> button of the plugin
+4. Follow the instructions and agree again with the security warning for unsigned content.
+
+Once both plugins are installed, restart Eclipse as prompted.
+
+# Configure Eclipse for QMK
+## Importing the project
+1. Click <kbd><kbd>File</kbd> > <kbd>New</kbd> > <kbd>Makefile Project with Existing Code</kbd></kbd>
+2. On the next screen:
+  * Select the directory where you cloned the repository as _Existing Code Location_;
+  * (Optional) Give a different name to the project¹, e.g. _QMK_ or _Quantum_;
+  * Select the _AVR-GCC Toolchain_;
+  * Keep the rest as-is and click <kbd>Finish</kbd>
+
+  ![Importing QMK in Eclipse](http://i.imgur.com/oHYR1yW.png)
+
+3. The project will now be loaded and indexed. Its files can be browsed easily through the _Project Explorer_ on the left.
+
+¹ There might be issues for importing the project with a custom name. If it does not work properly, try leaving the default project name (i.e. the name of the directory, probably `qmk_firmware`).
+
+## Build your keyboard
+We will now configure a make target that cleans the project and builds the keymap of your choice.
+
+1. On the right side of the screen, select the <kbd>Make Target</kbd> tab
+2. Expand the folder structure to the keyboard of your choice, e.g. `qmk_firmware/keyboards/ergodox`
+3. Right-click on the keyboard folder and select <kbd>New…</kbd> (or select the folder and click the <kbd>New Make Target</kbd> icon above the tree)
+4. Choose a name for your build target, e.g. _clean \<your keymap\>_
+5. Make Target: this is the arguments that you give to `make` when building from the command line. If your target name does not match these arguments, uncheck <kbd>Same as target name</kbd> and input the correct arguments, e.g. `clean <your keymap>`
+6. Leave the other options checked and click <kbd>OK</kbd>. Your make target will now appear under the selected keyboard.
+7. (Optional) Toggle the <kbd>Hide Empty Folders</kbd> icon button above the targets tree to only show your build target.
+8. Double-click the build target you created to trigger a build.
+9. Select the <kbd>Console</kbd> view at the bottom to view the running build.

+ 64 - 0
docs/Embedding.md

@@ -0,0 +1,64 @@
+# WARNING: Until issue [#173](https://github.com/tmk/tmk_keyboard/issues/173) goes through, the [core][1] repository will not be up-to-date with the latest changes and fixes, but can still be used.
+
+If you want to use TMK for your own keyboard project, you've got three options for embedding the [core][1].  
+The recommended option is [subtrees](#1-git-subtree).
+
+After adding the embed you'll need to [modify the Makefile](#modifications-to-the-makefile) of your project to point to the core correctly.
+
+## 1. git subtree
+
+In order to set up the subtree in your project, first add the core repository as a remote:  
+```
+git remote add -f core https://github.com/tmk/tmk_core
+```
+
+Then add the core as a subtree (directory) in your local repository:  
+```
+git subtree add -P tmk_core core master --squash
+```
+
+And that's it!
+
+When you want to update the subtree in your repository to match the master on [tmk_core][1], do this:  
+```
+git subtree pull -P tmk_core core master --squash
+```
+
+## 2. git submodule
+
+In order to set up the submodule in your project, first add a new submodule:  
+```
+git submodule add https://github.com/tmk/tmk_core tmk_core
+```
+
+Then pull, sync and update the submodule:  
+```
+git pull
+git submodule sync --recursive
+git submodule update --init --recursive
+```
+
+And that's it!
+
+When you want to update the subtree in your repository to match the master on [tmk_core][1], follow the same steps as above.
+
+If you want to clone a repository from GitHub that has submodule(s) in it, pass <kbd>--recursive</kbd> when cloning, like so:  
+`git clone --recursive https://github.com/<username>/<repository>`
+
+## 3. Manually (without git)
+
+*Note: This is not recommended in any way, but it's still possible.*
+
+Download a zipped version of the [tmk_core][1] repository using this link:  
+<https://github.com/tmk/tmk_core/archive/master.zip>
+
+Extract the zip in your project's directory, then rename the folder to <kbd>tmk_core</kbd>.
+
+## Modifications to the *Makefile*
+
+The one thing you have to make sure to change in the *Makefile* (compared to [tmk_keyboard](https://github.com/tmk/tmk_keyboard) drivers' *[Makefile](https://github.com/tmk/tmk_keyboard/blob/master/keyboard/gh60/Makefile#L45)*) is the "TMK_DIR" variable, which needs to point to the embed directory:  
+```Makefile
+TMK_DIR = ./tmk_core
+```
+
+[1]: https://github.com/tmk/tmk_core

Разница между файлами не показана из-за своего большого размера
+ 151 - 0
docs/FAQ-Build.md


+ 248 - 0
docs/FAQ-Keymap.md

@@ -0,0 +1,248 @@
+## READ FIRST
+https://github.com/tmk/tmk_core/blob/master/doc/keymap.md
+
+## How to get keycode
+See [Keycodes](Keycodes). Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
+
+## Sysrq key
+Use keycode for Print Screen(`KC_PSCREEN` or `KC_PSCR`) instead of `KC_SYSREQ`. Key combination of 'Alt + Print Screen' is recognized as 'System request'.
+
+See [issue #168](https://github.com/tmk/tmk_keyboard/issues/168) and
+- http://en.wikipedia.org/wiki/Magic_SysRq_key
+- http://en.wikipedia.org/wiki/System_request
+
+## Power key doesn't work
+Use `KC_PWR` instead of `KC_POWER` or vice versa.
+- `KC_PWR` works with Windows and Linux, not with OSX.
+- `KC_POWER` works with OSX and Linux, not with Windows.
+
+http://geekhack.org/index.php?topic=14290.msg1327264#msg1327264
+
+## Oneshot modifier
+Solves my personal 'the' problem. I often got 'the' or 'THe' wrongly instead of 'The'.  Oneshot Shift mitgates this for me.
+https://github.com/tmk/tmk_keyboard/issues/67
+
+## Modifier/Layer stuck
+Modifier keys or layers can be stuck unless layer switching is configured properly.
+For Modifier keys and layer actions you have to place `KC_TRANS` on same position of destination layer to  unregister the modifier key or return to previous layer on release event.
+
+- https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#31-momentary-switching
+- http://geekhack.org/index.php?topic=57008.msg1492604#msg1492604
+- https://github.com/tmk/tmk_keyboard/issues/248
+
+
+## Mechanical Lock Switch Support
+https://github.com/tmk/tmk_keyboard#mechanical-locking-support
+
+This feature is for *mechanical lock switch* like this Alps one.
+http://deskthority.net/wiki/Alps_SKCL_Lock
+
+Using enabling this feature and using keycodes `LCAP`, `LNUM` or `LSCR` in keymap you can use physical locking CapsLock, NumLock or ScrollLock keys as you expected.
+
+Old vintage mechanical keyboards occasionally have lock switches but modern ones don't have. ***You don't need this feature in most case and just use keycodes `CAPS`, `NLCK` and `SLCK`.***
+
+
+## Input special charactors other than ASCII like Cédille 'Ç'
+NO UNIVERSAL METHOD TO INPUT THOSE WORKS OVER ALL SYSTEMS. You have to define **MACRO** in way specific to your OS or layout.
+
+See this post for example **MACRO** code.
+
+http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-120.html#p195620
+
+On **Windows** you can use `AltGr` key or **Alt code**.
+- http://en.wikipedia.org/wiki/AltGr_key
+- http://en.wikipedia.org/wiki/Alt_code
+
+On **Mac** OS defines `Option` key combinations.
+- http://en.wikipedia.org/wiki/Option_key#Alternative_keyboard_input
+
+On **Xorg** you can use `compose` key, instead.
+- http://en.wikipedia.org/wiki/Compose_key
+
+And see this for **Unicode** input.
+- http://en.wikipedia.org/wiki/Unicode_input
+
+
+## Apple/Mac keyboard Fn
+Not supported.
+
+Apple/Mac keyboard sends keycode for Fn unlike most of other keyboards.
+I think you can send Apple Fn key using Apple venter specific Page 0xff01 and usage 0x0003. But you have to change HID Report Descriptor for this, of course.
+
+https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-606.1.7/IOHIDFamily/AppleHIDUsageTables.h
+
+
+## Media control keys in Mac OSX
+#### KC_MNXT and KC_MPRV does not work on Mac
+Use `KC_MFFD`(`KC_MEDIA_FAST_FORWARD`) and `KC_MRWD`(`KC_MEDIA_REWIND`) instead of `KC_MNXT` and `KC_MPRV`.
+See https://github.com/tmk/tmk_keyboard/issues/195
+
+
+## Keys supported in Mac OSX?
+You can know which keycodes are supported in OSX from this source code.
+
+`usb_2_adb_keymap` array maps Keyboard/Keypad Page usages to ADB scancodes(OSX internal keycodes).
+
+https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-606.1.7/IOHIDFamily/Cosmo_USB2ADB.c
+
+And `IOHIDConsumer::dispatchConsumerEvent` handles Consumer page usages.
+
+https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-606.1.7/IOHIDFamily/IOHIDConsumer.cpp
+
+
+## JIS keys in Mac OSX
+Japanese JIS keyboard specific keys like `無変換(Muhenkan)`, `変換(Henkan)`, `ひらがな(hiragana)` are not recognized on OSX. You can use **Seil** to enable those keys, try following options.
+
+* Enable NFER Key on PC keyboard
+* Enable XFER Key on PC keyboard
+* Enable KATAKANA Key on PC keyboard
+
+https://pqrs.org/osx/karabiner/seil.html
+
+
+## RN-42 Bluetooth doesn't work with Karabiner
+Karabiner - Keymapping tool on Mac OSX - ignores inputs from RN-42 module by default. You have to enable this option to make Karabiner working with your keyboard.
+https://github.com/tekezo/Karabiner/issues/403#issuecomment-102559237
+
+See these for the deail of this problem.
+https://github.com/tmk/tmk_keyboard/issues/213
+https://github.com/tekezo/Karabiner/issues/403
+
+
+## Esc and `~ on a key
+
+
+You can define FC660 and Poker style ESC with `ACTION_LAYER_MODS`.
+https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#35-momentary-switching-with-modifiers
+
+```
+#include "keymap_common.h"
+
+
+/* Leopold FC660
+ * https://elitekeyboards.com/products.php?sub=leopold,compact&pid=fc660c
+ * Shift + Esc = ~
+ * Fn    + Esc = `
+ *
+ * Votex Poker II
+ * https://adprice.fedorapeople.org/poker2_manual.pdf
+ * Fn         + Esc = `
+ * Fn + Shift + Esc = ~
+ */
+const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    /* 0: qwerty */
+    [0] = KEYMAP( \
+        ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, NUHS,BSPC, \
+        TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS, \
+        LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,  \
+        FN0, NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,ESC, \
+        LCTL,LGUI,LALT,          SPC,                     RALT,FN1, RGUI,RCTL),
+    [1] = KEYMAP( \
+        GRV, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
+        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,\
+        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
+        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
+        TRNS,TRNS,TRNS,          TRNS,                    TRNS,TRNS,TRNS,TRNS),
+    [2] = KEYMAP( \
+        GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, TRNS,TRNS, \
+        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,\
+        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
+        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
+        TRNS,TRNS,TRNS,          TRNS,                    TRNS,TRNS,TRNS,TRNS),
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+    // https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#35-momentary-switching-with-modifiers
+    [0] = ACTION_LAYER_MODS(1, MOD_LSFT),
+    [1] = ACTION_LAYER_MOMENTARY(2),
+};
+```
+
+Otherwise, you can write code, see this.
+https://github.com/p3lim/keyboard_firmware/commit/fd799c12b69a5ab5addd1d4c03380a1b8ef8e9dc
+
+
+## 32 Fn keys are not enough?
+### actionmap
+It uses 16 bit codes and has no limitation of 32 Fn at the expense of memory space. TMK keymap is actually is 8 bit codes as subset of the actionmap.
+https://github.com/tmk/tmk_keyboard/issues?utf8=%E2%9C%93&q=is%3Aissue+actionmap
+
+### extension for modified keys
+https://geekhack.org/index.php?topic=41989.msg1885526#msg1885526
+
+
+## Arrow on Right Modifier keys with Dual-Role
+This turns right modifer keys into arrow keys when the keys are tapped while still modifiers when the keys are hold. In TMK the dual-role function is dubbed **TAP**.
+```
+#include "keymap_common.h"
+
+
+/* Arrow keys on right modifier keys with TMK dual role feature
+ *
+ *  https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#213-modifier-with-tap-keydual-role
+ *  https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys
+ */
+const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    /* 0: qwerty */
+    [0] = KEYMAP( \
+        ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, NUHS,BSPC, \
+        TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS, \
+        LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,  \
+        LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,FN0, ESC, \
+        FN4, LGUI,LALT,          SPC,                     APP, FN2, FN1, FN3),
+    [1] = KEYMAP( \
+        GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, TRNS,TRNS, \
+        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,\
+        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
+        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN5, TRNS, \
+        TRNS,TRNS,TRNS,          TRNS,                    TRNS,FN7, FN6, FN8),
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+    [0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_UP),
+    [1] = ACTION_MODS_TAP_KEY(MOD_RGUI, KC_DOWN),
+    [2] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_LEFT),
+    [3] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_RIGHT),
+    [4] = ACTION_LAYER_MOMENTARY(1),
+    [5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_PGUP),
+    [6] = ACTION_MODS_TAP_KEY(MOD_RGUI, KC_PGDN),
+    [7] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_HOME),
+    [8] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_END),
+};
+
+```
+
+
+Dual-role key: https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys
+
+
+## Eject on Mac OSX
+`EJCT` keycode works on OSX. https://github.com/tmk/tmk_keyboard/issues/250
+It seems Windows 10 ignores the code and Linux/Xorg recognizes but has no mapping by default.
+
+Not sure what keycode Eject is on genuine Apple keyboard actually. HHKB uses `F20` for Eject key(`Fn+f`) on Mac mode but this is not same as Apple Eject keycode probably.
+
+
+
+## What's weak_mods and real_mods in action_util.c
+___TO BE IMPROVED___
+
+real_mods is intended to retains state of real/physical modifier key state, while
+weak_mods retains state of virtual or temprary modifiers which should not affect state real modifier key.
+
+Let's say you hold down physical left shift key and type ACTION_MODS_KEY(LSHIFT, KC_A), 
+
+with weak_mods,
+* (1) hold down left shift: real_mods |= MOD_BIT(LSHIFT)
+* (2) press ACTION_MODS_KEY(LSHIFT, KC_A): weak_mods |= MOD_BIT(LSHIFT)
+* (3) release ACTION_MODS_KEY(LSHIFT, KC_A): waek_mods &= ~MOD_BIT(LSHIFT)
+real_mods still keeps modifier state.
+
+without weak mods,
+* (1) hold down left shift: real_mods |= MOD_BIT(LSHIFT)
+* (2) press ACTION_MODS_KEY(LSHIFT, KC_A): real_mods |= MOD_BIT(LSHIFT)
+* (3) release ACTION_MODS_KEY(LSHIFT, KC_A): real_mods &= ~MOD_BIT(LSHIFT)
+here real_mods lost state for 'physical left shift'.
+
+weak_mods is ORed with real_mods when keyboard report is sent.
+https://github.com/tmk/tmk_core/blob/master/common/action_util.c#L57

+ 238 - 0
docs/FAQ.md

@@ -0,0 +1,238 @@
+## READ FIRST
+- **README** of top directory : https://github.com/tmk/tmk_keyboard/blob/master/README.md
+- **README** of target project(keyboard/converter) directory.
+
+Note that you'll need to read **both**.
+
+
+# Build
+- [[FAQ/Build]]
+
+
+# Keymap
+- [[FAQ/Keymap]]
+
+
+# Debug Console
+## hid_listen can't recognize device
+When debug console of your device is not ready you will see like this:
+
+    Waiting for device:.........
+
+once the device is pluged in then *hid_listen* finds it you will get this message:
+
+    Waiting for new device:.........................
+    Listening:
+
+Check if you can't get this 'Listening:' message:
+- build with `CONSOLE_ENABLE=yes` in **Makefile**.
+
+You may need privilege to access the device on OS like Linux.
+- try `sudo hid_listen`
+
+## Can't get message on console
+Check:
+- *hid_listen* finds your device. See above.
+- Enable debug with pressing **Magic**+d. See [Magic Commands](https://github.com/tmk/tmk_keyboard#magic-commands).
+- set `debug_enable=true` usually in `matrix_init()` in **matrix.c**.
+- try using 'print' function instead of debug print. See **common/print.h**.
+- disconnect other devices with console function. See [Issue #97](https://github.com/tmk/tmk_keyboard/issues/97).
+
+## Linux or UNIX like system requires Super User privilege
+Just use 'sudo' to execute *hid_listen* with privilege.
+```
+$ sudo hid_listen
+```
+
+Or add an *udev rule* for TMK devices with placing a file in rules directory. The directory may vary on each system.
+
+File: /etc/udev/rules.d/52-tmk-keyboard.rules(in case of Ubuntu)
+```
+# tmk keyboard products     https://github.com/tmk/tmk_keyboard
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"
+```
+
+***
+
+# Miscellaneous
+## NKRO Doesn't work
+First you have to compile frimware with this build option `NKRO_ENABLE` in **Makefile**.
+
+Try `Magic` **N** command(`LShift+RShift+N` by default) when **NKRO** still doesn't work. You can use this command to toggle between **NKRO** and **6KRO** mode temporarily. In some situations **NKRO** doesn't work you need to switch to **6KRO** mode, in particular when you are in BIOS.
+
+If your firmeare built with `BOOTMAGIC_ENABLE` you need to turn its switch on by `BootMagic` **N** command(`Space+N` by default). This setting is stored in EEPROM and keeped over power cycles.
+
+https://github.com/tmk/tmk_keyboard#boot-magic-configuration---virtual-dip-switch
+
+
+## TrackPoint needs reset circuit(PS/2 mouse support)
+Without reset circuit you will have inconsistent reuslt due to improper initialize of the hardware. See circuit schematic of TPM754.
+
+- http://geekhack.org/index.php?topic=50176.msg1127447#msg1127447
+- http://www.mikrocontroller.net/attachment/52583/tpm754.pdf
+
+
+## Can't read column of matrix beyond 16 
+Use `1UL<<16` instead of `1<<16` in `read_cols()` in **matrix.h** when your columns goes beyond 16.
+
+In C `1` means one of **int** type which is **16bit** in case of AVR so you can't shift left more than 15. You will get unexpected zero when you say `1<<16`. You have to use **unsigned long** type with `1UL`.
+
+http://deskthority.net/workshop-f7/rebuilding-and-redesigning-a-classic-thinkpad-keyboard-t6181-60.html#p146279
+
+
+
+## Pull-up Resistor
+In some case converters needed to have pull-up resistors to work correctly. Place the resistor between VCC and signal line in parallel.
+
+For example:
+```
+Keyboard       Conveter
+               ,------.
+5V------+------|VCC   |
+        |      |      |
+        R      |      |
+        |      |      |
+Signal--+------|PD0   |
+               |      |
+GND------------|GND   |
+               `------'
+R: 1K Ohm resistor
+```
+
+https://github.com/tmk/tmk_keyboard/issues/71
+
+
+## Arduino Micro's pin naming is confusing
+Note that Arduino Micro PCB marking is different from real AVR port name. D0 of Arduino Micro is not PD0, PD0 is D3. Check schematic yourself.
+http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf
+
+
+
+## Bootloader jump doesn't work
+Properly configure bootloader size in **Makefile**. With wrong section size bootloader won't probably start with **Magic command** and **Boot Magic**.
+```
+# Size of Bootloaders in bytes:
+#   Atmel DFU loader(ATmega32U4)   4096    
+#   Atmel DFU loader(AT90USB128)   8192    
+#   LUFA bootloader(ATmega32U4)    4096             
+#   Arduino Caterina(ATmega32U4)   4096             
+#   USBaspLoader(ATmega***)        2048             
+#   Teensy   halfKay(ATmega32U4)   512              
+#   Teensy++ halfKay(AT90USB128)   2048
+OPT_DEFS += -DBOOTLOADER_SIZE=4096
+```
+AVR Boot section size are defined by setting **BOOTSZ** fuse in fact. Consult with your MCU datasheet.
+Note that **Word**(2 bytes) size and address are used in datasheet while TMK uses **Byte**.
+
+AVR Boot section is located at end of Flash memory like the followings.
+```
+byte     Atmel/LUFA(ATMega32u4)          byte     Atmel(AT90SUB1286)
+0x0000   +---------------+               0x00000  +---------------+
+         |               |                        |               |
+         |               |                        |               |
+         |  Application  |                        |  Application  |
+         |               |                        |               | 
+         =               =                        =               =
+         |               | 32KB-4KB               |               | 128KB-8KB
+0x6000   +---------------+               0x1E000  +---------------+
+         |  Bootloader   | 4KB                    |  Bootloader   | 8KB
+0x7FFF   +---------------+               0x1FFFF  +---------------+
+
+ 
+byte     Teensy(ATMega32u4)              byte     Teensy++(AT90SUB1286)
+0x0000   +---------------+               0x00000  +---------------+
+         |               |                        |               |
+         |               |                        |               |
+         |  Application  |                        |  Application  |
+         |               |                        |               |
+         =               =                        =               =
+         |               | 32KB-512B              |               | 128KB-2KB
+0x7E00   +---------------+               0x1FC00  +---------------+
+         |  Bootloader   | 512B                   |  Bootloader   | 2KB
+0x7FFF   +---------------+               0x1FFFF  +---------------+
+```
+
+And see this discussion for further reference.
+https://github.com/tmk/tmk_keyboard/issues/179
+
+
+## Special Extra key doesn't work(System, Audio control keys)
+You need to define `EXTRAKEY_ENABLE` in **makefile** to use them in TMK.
+```
+EXTRAKEY_ENABLE = yes          # Audio control and System control
+```
+http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-60.html#p157919
+
+
+## Wakeup from sleep doesn't work
+In Windows check `Allow this device to wake the computer` setting in Power **Management property** tab of **Device Manager**. Also check BIOS setting.
+
+Pressing any key during sleep should wake host.
+
+
+## Using Arduino?
+**Note that Arduino pin naming is different from actual chip.** For example, Arduino pin `D0` is not `PD0`. Check circuit with its schematics yourself.
+
+- http://arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf
+- http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf
+
+Arduino leonardo and micro have **ATMega32U4** and can be used for TMK, though Arduino bootloader may be a problem.
+
+
+## Using PF4-7 pins of USB AVR?
+You need to set JTD bit of MCUCR yourself to use PF4-7 as GPIO. Those pins are configured to serve JTAG function by default. MCUs like ATMega*U* or AT90USB* are affeteced with this.
+
+If you are using Teensy this isn't needed. Teensy is shipped with JTAGEN fuse bit unprogrammed to disable the function.
+
+See this code.
+```
+    // JTAG disable for PORT F. write JTD bit twice within four cycles.
+    MCUCR |= (1<<JTD);
+    MCUCR |= (1<<JTD);
+```
+https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hbkb/matrix.c#L67
+
+And read **26.5.1 MCU Control Register – MCUCR** of ATMega32U4 datasheet.
+
+
+## Adding LED indicators of Lock keys
+You need your own LED indicators for CapsLock, ScrollLock and NumLock? See this post.
+
+http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-120.html#p191560
+
+## Program Arduino Micro/Leonardo
+Push reset button and then run command like this within 8 seconds.
+
+```
+avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:adb_usb.hex -P/dev/ttyACM0
+```
+
+Device name will vary depending on your system.
+
+http://arduino.cc/en/Main/ArduinoBoardMicro
+https://geekhack.org/index.php?topic=14290.msg1563867#msg1563867
+
+
+## USB 3 compatibility
+I heard some people have a problem with USB 3 port, try USB 2 port.
+
+
+## Mac compatibility
+### OS X 10.11 and Hub
+https://geekhack.org/index.php?topic=14290.msg1884034#msg1884034
+
+
+## Problem on BIOS(UEFI)/Resume(Sleep&Wake)/Power cycles
+Some people reported their keyboard stops working on BIOS and/or after resume(power cycles).
+
+As of now root of its cause is not clear but some build options seem to be related. In Makefile try to disable those options like `CONSOLE_ENABLE`, `NKRO_ENABLE`, `SLEEP_LED_ENABLE` and/or others. 
+
+https://github.com/tmk/tmk_keyboard/issues/266
+https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
+
+
+
+## FLIP doesn't work
+### AtLibUsbDfu.dll not found
+Remove current driver and reinstall one FLIP provides from DeviceManager.
+http://imgur.com/a/bnwzy

doc/FUSE.txt → docs/FUSE.txt


+ 7 - 0
docs/Git-subtree.md

@@ -0,0 +1,7 @@
+## Update core branch procedure
+    git co master
+    git subtree split -P tmk_core -b <tmp_branch>
+    git co core
+    git merge <tmp_branch>
+    git co master
+    git subtree merge -P tmk_core --squash

doc/HAND_WIRE.md → docs/HAND_WIRE.md


+ 5 - 0
docs/HHKB-Alt-controller.md

@@ -0,0 +1,5 @@
+# Alternative Controller for HHKB
+
+* [Geekhack.org thread](https://geekhack.org/index.php?topic=12047.0)
+
+* [Connector unmate](https://geekhack.org/index.php?topic=12047.msg1543860#msg1543860)

Разница между файлами не показана из-за своего большого размера
+ 183 - 0
docs/Home.md


Разница между файлами не показана из-за своего большого размера
+ 94 - 0
docs/Key-Functions.md


+ 228 - 0
docs/Keycodes.md

@@ -0,0 +1,228 @@
+# Overview
+
+When defining a [keymap](Keymap.md) each key needs a valid key definition.
+
+This page documents the symbols that correspond to keycodes that are available to you in QMK.
+
+To customize your board, they can be used by themselves or as **action codes** in combination with one of the [many C macros](https://github.com/qmk/qmk_firmware/wiki#c-macros-for-action-code).
+
+The source of truth for these codes is [tmk_core/common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h) file in the qmk source code.
+
+# The Keycodes
+
+Keycodes in QMK are based on [HID Usage Keyboard/Keypad Page(0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) with following exceptions:
+
+* `KC_NO` = 0 for no action
+* `KC_TRNS` = 1 for layer transparency
+* internal special keycodes in the `0xA5-DF` range (tmk heritage).
+
+## Letters and Numbers
+
+|KC_1|KC_2|KC_3|KC_4|KC_5|KC_6|KC_7|KC_8|
+|----|----|----|----|----|----|----|----|
+|KC_9|KC_0|KC_F1|KC_F2|KC_F3|KC_F4|KC_F5|KC_F6|
+|KC_F7|KC_F8|KC_F9|KC_F10|KC_F11|KC_F12|KC_F13|KC_F14|
+|KC_F15|KC_F16|KC_F17|KC_F18|KC_F19|KC_F20|KC_F21|KC_F22|
+|KC_F23|KC_F24|KC_A|KC_B|KC_C|KC_D|KC_E|KC_F|
+|KC_G|KC_H|KC_I|KC_J|KC_K|KC_L|KC_M|KC_N|
+|KC_O|KC_P|KC_Q|KC_R|KC_S|KC_T|KC_U|KC_V|
+|KC_W|KC_X|KC_Y|KC_Z|||||
+
+## Punctuation
+
+|Long Name|Short Name|Description|
+|---------|----------|-----------|
+|KC_ENTER|KC_ENT|`Return (ENTER)`|
+|KC_ESCAPE|KC_ESC|`ESCAPE`|
+|KC_BSPACE|KC_BSPC|`DELETE (Backspace)`|
+|KC_TAB||`Tab`|
+|KC_SPACE|KC_SPC|Spacebar|
+|KC_MINUS|KC_MINS|`-` and `_`|
+|KC_EQUAL|KC_EQL|`=` and `+`|
+|KC_LBRACKET|KC_LBRC|`[` and `{`|
+|KC_RBRACKET|KC_RBRC|`]` and `}`|
+|KC_BSLASH|KC_BSLS|`\` and <code>&#124;</code> |
+|KC_NONUS_HASH|KC_NUHS|Non-US `#` and `~`|
+|KC_NONUS_BSLASH|KC_NUBS|Non-US `\` and <code>&#124;</code> |
+|KC_INT1|KC_RO|JIS `\` and <code>&#124;</code> |
+|KC_INT2|KC_KANA|International216|
+|KC_INT3|KC_JYEN|Yen Symbol (`¥`)|
+|KC_SCOLON|KC_SCLN|`;` and `:`|
+|KC_QUOTE|KC_QUOT|`‘` and `“`|
+|KC_GRAVE|KC_GRV|Grave Accent and Tilde|
+|KC_COMMA|KC_COMM|`,` and `<`|
+|KC_DOT||`.` and `>`|
+|KC_SLASH|KC_SLSH|`/` and `?`|
+|KC_CAPSLOCK|KC_CAPS|Caps Lock|
+
+## Modifiers
+
+|Long Name|Short Name|Description|
+|---------|----------|-----------|
+|KC_LCTRL|KC_LCTL|LeftControl|
+|KC_LSHIFT|KC_LSFT|LeftShift|
+|KC_LALT||LeftAlt|
+|KC_LGUI||Left GUI(Windows/Apple/Meta key)|
+|KC_RCTRL|KC_RCTL|RightControl|
+|KC_RSHIFT|KC_RSFT|RightShift|
+|KC_RALT||RightAlt|
+|KC_RGUI||Right GUI(Windows/Apple/Meta key)|
+|KC_LOCKING_CAPS||Locking Caps Lock12|
+|KC_LOCKING_NUM||Locking Num Lock12|
+|KC_LOCKING_SCROLL||Locking Scroll Lock12|
+|KC_INT4|KC_HENK|JIS Henken|
+|KC_INT5|KC_MHEN|JIS Muhenken|
+
+## Commands
+
+|Long Name|Short Name|Description|
+|---------|----------|-----------|
+|KC_PSCREEN|KC_PSCR|PrintScreen1|
+|KC_SCKLOCK|KC_SLCK|Scroll Lock11|
+|KC_PAUSE|KC_PAUS|Pause1|
+|KC_INSERT|KC_INS|Insert1|
+|KC_HOME||Home1|
+|KC_PGUP||PageUp1|
+|KC_DELETE|KC_DEL|Delete Forward|
+|KC_END||End1|
+|KC_PGDOWN|KC_PGDN|PageDown1|
+|KC_RIGHT|KC_RGHT|RightArrow1|
+|KC_LEFT||LeftArrow1|
+|KC_DOWN||DownArrow1|
+|KC_UP||UpArrow1|
+|KC_APPLICATION|KC_APP|Application10|
+|KC_POWER||Power9|
+|KC_EXECUTE||Execute|
+|KC_HELP||Help|
+|KC_MENU||Menu|
+|KC_SELECT||Select|
+|KC_AGAIN||Again|
+|KC_UNDO||Undo|
+|KC_CUT||Cut|
+|KC_COPY||Copy|
+|KC_PASTE||Paste|
+|KC_FIND||Find|
+|KC_ALT_ERASE||Alternate Erase7|
+|KC_SYSREQ||SysReq/Attention1|
+|KC_CANCEL||Cancel|
+|KC_CLEAR||Clear|
+|KC_PRIOR||Prior|
+|KC_RETURN||Return|
+|KC_SEPARATOR||Separator|
+|KC_OUT||Out|
+|KC_OPER||Oper|
+|KC_CLEAR_AGAIN||Clear/Again|
+|KC_CRSEL||CrSel/Props|
+|KC_EXSEL||ExSel|
+|KC_SYSTEM_POWER|KC_PWR|System Power Down|
+|KC_SYSTEM_SLEEP|KC_SLEP|System Sleep|
+|KC_SYSTEM_WAKE|KC_WAKE|System Wake|
+|KC_MAIL|KC_MAIL||
+|KC_CALCULATOR|KC_CALC||
+|KC_MY_COMPUTER|KC_MYCM||
+|KC_WWW_SEARCH|KC_WSCH||
+|KC_WWW_HOME|KC_WHOM||
+|KC_WWW_BACK|KC_WBAK||
+|KC_WWW_FORWARD|KC_WFWD||
+|KC_WWW_STOP|KC_WSTP||
+|KC_WWW_REFRESH|KC_WREF||
+|KC_WWW_FAVORITES|KC_WFAV||
+
+## Media Keys
+
+Windows and Mac use different key codes for next track and previous track. Make sure you choose the keycode that corresponds to your OS.
+
+|Long Name|Short Name|Description|
+|---------|----------|-----------|
+|KC_STOP||Stop|
+|KC__MUTE||Mute|
+|KC__VOLUP||Volume Up|
+|KC__VOLDOWN||Volume Down|
+|KC_AUDIO_MUTE|KC_MUTE||
+|KC_AUDIO_VOL_UP|KC_VOLU||
+|KC_AUDIO_VOL_DOWN|KC_VOLD||
+|KC_MEDIA_NEXT_TRACK|KC_MNXT|Next Track (Windows)|
+|KC_MEDIA_PREV_TRACK|KC_MPRV|Previous Track (Windows)|
+|KC_MEDIA_FAST_FORWARD|KC_MFFD|Next Track (macOS)|
+|KC_MEDIA_REWIND|KC_MRWD|Previous Track (macOS)|
+|KC_MEDIA_STOP|KC_MSTP||
+|KC_MEDIA_PLAY_PAUSE|KC_MPLY||
+|KC_MEDIA_SELECT|KC_MSEL||
+
+## Numpad
+
+|Long Name|Short Name|Description|
+|---------|----------|-----------|
+|KC_NUMLOCK|KC_NLCK|Keypad Num Lock and Clear11|
+|KC_KP_SLASH|KC_PSLS|Keypad /|
+|KC_KP_ASTERISK|KC_PAST|Keypad *|
+|KC_KP_MINUS|KC_PMNS|Keypad -|
+|KC_KP_PLUS|KC_PPLS|Keypad +|
+|KC_KP_ENTER|KC_PENT|Keypad ENTER5|
+|KC_KP_1|KC_P1|Keypad 1 and End|
+|KC_KP_2|KC_P2|Keypad 2 and Down Arrow|
+|KC_KP_3|KC_P3|Keypad 3 and PageDn|
+|KC_KP_4|KC_P4|Keypad 4 and Left Arrow|
+|KC_KP_5|KC_P5|Keypad 5|
+|KC_KP_6|KC_P6|Keypad 6 and Right Arrow|
+|KC_KP_7|KC_P7|Keypad 7 and Home|
+|KC_KP_8|KC_P8|Keypad 8 and Up Arrow|
+|KC_KP_9|KC_P9|Keypad 9 and PageUp|
+|KC_KP_0|KC_P0|Keypad 0 and Insert|
+|KC_KP_DOT|KC_PDOT|Keypad . and Delete|
+|KC_KP_EQUAL|KC_PEQL|Keypad =|
+|KC_KP_COMMA|KC_PCMM|Keypad Comma27|
+|KC_KP_EQUAL_AS400||Keypad Equal Sign29|
+
+## Special Keys
+
+|Long Name|Short Name|Description|
+|---------|----------|-----------|
+|KC_NO||Ignore this key. (NOOP) |
+
+## Mousekey
+
+|Long Name|Short Name|Description|
+|---------|----------|-----------|
+|KC_MS_UP|KC_MS_U|Mouse Cursor Up|
+|KC_MS_DOWN|KC_MS_D|Mouse Cursor Down|
+|KC_MS_LEFT|KC_MS_L|Mouse Cursor Left|
+|KC_MS_RIGHT|KC_MS_R|Mouse Cursor Right|
+|KC_MS_BTN1|KC_BTN1|Mouse Button 1|
+|KC_MS_BTN2|KC_BTN2|Mouse Button 2|
+|KC_MS_BTN3|KC_BTN3|Mouse Button 3|
+|KC_MS_BTN4|KC_BTN4|Mouse Button 4|
+|KC_MS_BTN5|KC_BTN5|Mouse Button 5|
+|KC_MS_WH_UP|KC_WH_U|Mouse Wheel Up|
+|KC_MS_WH_DOWN|KC_WH_D|Mouse Wheel Down|
+|KC_MS_WH_LEFT|KC_WH_L|Mouse Wheel Left|
+|KC_MS_WH_RIGHT|KC_WH_R|Mouse Wheel Right|
+|KC_MS_ACCEL0|KC_ACL0|Mouse Acceleration 0|
+|KC_MS_ACCEL1|KC_ACL1|Mouse Acceleration 1|
+|KC_MS_ACCEL2|KC_ACL2|Mouse Acceleration 2|
+
+## Magic Keys
+
+The following keys can be used to turn on and off various "Magic" features. These include Boot Magic (holding certain keys down while plugging the keyboard in) and the Magic Key.
+
+|Long Name|Short Name|Description|
+|---------|----------|-----------|
+|MAGIC_SWAP_CONTROL_CAPSLOCK||Swap Capslock and Control|
+|MAGIC_CAPSLOCK_TO_CONTROL||Change Capslock to Control|
+|MAGIC_SWAP_ALT_GUI||Swap ALT and GUI|
+|MAGIC_SWAP_LALT_LGUI||Swap LALT and LGUI|
+|MAGIC_SWAP_RALT_RGUI||Swap RALT and RGUI|
+|MAGIC_NO_GUI||Disable off the GUI key|
+|MAGIC_SWAP_GRAVE_ESC||Swap the GRAVE (~ `) and Esc keys|
+|MAGIC_SWAP_BACKSLASH_BACKSPACE||Swap Backslash and Backspace|
+|MAGIC_UNSWAP_CONTROL_CAPSLOCK||Disable the Control/Caps Swap|
+|MAGIC_UNCAPSLOCK_TO_CONTROL||Turn Capslock back into Capslock|
+|MAGIC_UNSWAP_ALT_GUI||Turn the ALT/GUI swap off|
+|MAGIC_UNSWAP_LALT_LGUI||Turn the LALT/LGUI swap off|
+|MAGIC_UNSWAP_RALT_RGUI||Turn the RALT/RGUI swap off|
+|MAGIC_UNNO_GUI||Enable the GUI key|
+|MAGIC_UNSWAP_GRAVE_ESC||Turn the GRAVE/ESC swap off|
+|MAGIC_UNSWAP_BACKSLASH_BACKSPACE||Turn the Backslash/Backspace swap off|
+|MAGIC_HOST_NKRO||Turn NKRO on|
+|MAGIC_UNHOST_NKRO||Turn NKRO off|
+|MAGIC_TOGGLE_NKRO||Toggle NKRO on or off|

+ 37 - 0
docs/Keymap-examples.md

@@ -0,0 +1,37 @@
+# Share your keymap idea here!
+https://github.com/tmk/tmk_keyboard/issues/265
+
+---
+
+## Reverse-shifted for numbers
+With pressing Shift and '1' key you get **1** while with just '1' key you get **!**.
+- https://geekhack.org/index.php?topic=41989.msg1959718#msg1959718
+
+
+## KBT Pure layout
+Keymap code on Alps64
+https://github.com/thisisshi/tmk_keyboard/blob/15fe63e8d181a8a95988dcc71929f0024df55caa/keyboard/alps64/keymap_pure.c
+
+and guide.
+https://github.com/thisisshi/tmk_keyboard/blob/77ac0805ade565fb23657e3644c920ada71edccf/keyboard/alps64/Guide.md
+
+## Prevent stuck modifiers
+
+Consider the following scenario:
+
+1. Layer 0 has a key defined as Shift.
+2. The same key is defined on layer 1 as the letter A.
+3. User presses Shift.
+4. User switches to layer 1 for whatever reason.
+5. User releases Shift, or rather the letter A.
+6. User switches back to layer 0.
+
+Shift was actually never released and is still considered pressed.
+
+If such situation bothers you add this to your `config.h`:
+
+    #define PREVENT_STUCK_MODIFIERS
+
+This option uses 5 bytes of memory per every 8 keys on the keyboard
+rounded up (5 bits per key). For example on Planck (48 keys) it uses
+(48/8)\*5 = 30 bytes.

+ 222 - 0
docs/Keymap.md

@@ -0,0 +1,222 @@
+# Keymap Overview
+
+QMK keymaps are defined inside a C source file. The data structure is an array of arrays. The outer array is a list of layer arrays while the inner layer array is a list of keys. Most keyboards define a `KEYMAP()` macro to help you create this array of arrays.
+
+
+## Keymap and layers
+In QMK,  **`const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]`** holds multiple **layers** of keymap information in **16 bit** data holding the **action code**. You can define **32 layers** at most.
+
+For trivial key definitions, the higher 8 bits of the **action code** are all 0 and the lower 8 bits holds the USB HID usage code generated by the key as **keycode**.
+
+Respective layers can be validated simultaneously. Layers are indexed with 0 to 31 and higher layer has precedence.
+
+    Keymap: 32 Layers                   Layer: action code matrix
+    -----------------                   ---------------------
+    stack of layers                     array_of_action_code[row][column]
+           ____________ precedence               _______________________
+          /           / | high                  / ESC / F1  / F2  / F3   ....
+      31 /___________// |                      /-----/-----/-----/-----
+      30 /___________// |                     / TAB /  Q  /  W  /  E   ....
+      29 /___________/  |                    /-----/-----/-----/-----
+       :   _:_:_:_:_:__ |               :   /LCtrl/  A  /  S  /  D   ....
+       :  / : : : : : / |               :  /  :     :     :     :
+       2 /___________// |               2 `--------------------------
+       1 /___________// |               1 `--------------------------
+       0 /___________/  V low           0 `--------------------------
+
+
+Sometimes, the action code stored in keymap may be referred as keycode in some documents due to the TMK history.
+
+### Keymap layer status
+Keymap layer has its state in two 32 bit parameters:
+
+* **`default_layer_state`** indicates a base keymap layer(0-31) which is always valid and to be referred.
+* **`layer_state`** () has current on/off status of the layer on its each bit.
+
+Keymap has its state in two parameter **`default_layer`** indicates a base keymap layer(0-31) which is always valid and to be referred, **`keymap_stat`** is 16bit variable which has current on/off status of layers on its each bit.
+Keymap layer '0' is usually `default_layer` and which is the only valid layer and other layers is initially off after boot up firmware, though, you can configured them in `config.h`.
+To change `default_layer` will be useful when you switch key layout completely, say you want Colmak instead of Qwerty.
+
+    Initial state of Keymap          Change base layout              
+    -----------------------          ------------------              
+
+      31                               31
+      30                               30
+      29                               29
+       :                                :
+       :                                :   ____________
+       2   ____________                 2  /           /
+       1  /           /              ,->1 /___________/
+    ,->0 /___________/               |  0
+    |                                |
+    `--- default_layer = 0           `--- default_layer = 1
+         layer_state   = 0x00000001       layer_state   = 0x00000002
+
+On the other hand, you shall change `layer_state` to overlay base layer with some layers for feature such as navigation keys, function key(F1-F12), media keys or special actions.
+
+    Overlay feature layer
+    ---------------------      bit|status
+           ____________        ---+------
+      31  /           /        31 |   0
+      30 /___________// -----> 30 |   1
+      29 /___________/  -----> 29 |   1
+       :                        : |   :
+       :   ____________         : |   :
+       2  /           /         2 |   0
+    ,->1 /___________/  ----->  1 |   1
+    |  0                        0 |   0
+    |                                 +
+    `--- default_layer = 1            |
+         layer_state   = 0x60000002 <-'
+
+
+
+### Layer Precedence and Transparency
+Note that ***higher layer has higher priority on stack of layers***, namely firmware falls down from top layer to bottom to look up keycode. Once it spots keycode other than **`KC_TRNS`**(transparent) on a layer it stops searching and lower layers aren't referred.
+
+You can place `KC_TRANS` on overlay layer changes just part of layout to fall back on lower or base layer.
+Key with `KC_TRANS` (`KC_TRNS` and `_______` are the alias) doesn't has its own keycode and refers to lower valid layers for keycode, instead.
+
+## Anatomy Of A `keymap.c`
+
+For this example we will walk through the [default Clueboard keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/keymaps/default/keymap.c). You'll find it helpful to open that file in another browser window so you can look at everything in context.
+
+There are 3 main sections of a `keymap.c` file you'll want to concern yourself with:
+
+* [The Definitions](#definitions)
+* [The Layer/Keymap Datastructure](#layers-and-keymaps)
+* [Custom Functions](#custom-functions), if any
+
+### Definitions
+
+At the top of the file you'll find this:
+
+    #include "clueboard.h"
+
+    // Helpful defines
+    #define GRAVE_MODS  (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
+    #define _______ KC_TRNS
+
+    // Each layer gets a name for readability.
+    // The underscores don't mean anything - you can
+    // have a layer called STUFF or any other name.
+    // Layer names don't all need to be of the same 
+    // length, and you can also skip them entirely
+    // and just use numbers.
+    #define _BL 0
+    #define _FL 1
+    #define _CL 2
+
+These are some handy definitions we can use when building our keymap and our custom function. The `GRAVE_MODS` definition will be used later in our custom function. The `_______` define makes it easier to see what keys a layer is overriding, while the `_BL`, `_FL`, and `_CL` defines make it easier to refer to each of our layers.
+
+### Layers and Keymaps
+
+The main part of this file is the `keymaps[]` definition. This is where you list your layers and the contents of those layers. This part of the file begins with this definition:
+
+    const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+After this you'll find a list of KEYMAP() macros. A KEYMAP() is simply a list of keys to define a single layer. Typically you'll have one or more "base layers" (such as QWERTY, Dvorak, or Colemak) and then you'll layer on top of that one or more "function" layers. Due to the way layers are processed you can't overlay a "lower" layer on top of a "higher" layer. 
+
+`keymaps[][MATRIX_ROWS][MATRIX_COLS]` in QMK holds the 16 bit action code (sometimes referred as the quantum keycode) in it.  For the keycode representing typical keys, its high byte is 0 and its low byte is the USB HID usage ID for keyboard. 
+
+> TMK from which QMK was forked uses `const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]` instead and holds the 8 bit keycode.  Some keycode values are reserved to induce execution of certain action codes via the `fn_actions[]` array.
+
+#### Base Layer
+
+Here is an example of the Clueboard's base layer:
+
+      /* Keymap _BL: Base Layer (Default Layer)
+       */
+    [_BL] = KEYMAP(
+      F(0),    KC_1,    KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,    KC_0,     KC_MINS,  KC_EQL,   KC_GRV,  KC_BSPC,          KC_PGUP, \
+      KC_TAB,  KC_Q,    KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,    KC_P,     KC_LBRC,  KC_RBRC,  KC_BSLS,                   KC_PGDN, \
+      KC_CAPS, KC_A,    KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,    KC_SCLN,  KC_QUOT,  KC_NUHS,  KC_ENT,                             \
+      KC_LSFT, KC_NUBS, KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM, KC_DOT,   KC_SLSH,  KC_RO,    KC_RSFT,          KC_UP,            \
+      KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN,          KC_SPC,KC_SPC,                        KC_HENK,  KC_RALT,  KC_RCTL,  MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
+
+Some interesting things to note about this:
+
+* From a C source point of view it's only a single array, but we have embedded whitespace to more easily visualize where each key is on the physical device.
+* Plain keyboard scancodes are prefixed with KC_, while "special" keys are not.
+* The upper left key activates custom function 0 (`F(0)`)
+* The "Fn" key is defined with `MO(_FL)`, which moves to the `_FL` layer while that key is being held down.
+
+#### Function Overlay Layer
+
+Our function layer is, from a code point of view, no different from the base layer. Conceptually, however, you will build that layer as an overlay, not a replacement. For many people this distinction does not matter, but as you build more complicated layering setups it matters more and more.
+
+    [_FL] = KEYMAP(
+      KC_GRV,  KC_F1,   KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9,   KC_F10,   KC_F11,   KC_F12,   _______, KC_DEL,           BL_STEP, \
+      _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS,  _______,  _______,  _______,                   _______, \
+      _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,                           \
+      _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,          KC_PGUP,         \
+      _______, _______, _______, _______,        _______,_______,                        _______,  _______,  _______,  MO(_FL), KC_HOME, KC_PGDN, KC_END),
+
+Some interesting things to note:
+
+* We have used our `_______` definition to turn `KC_TRNS` into `_______`. This makes it easier to spot the keys that have changed on this layer.
+* While in this layer if you press one of the `_______` keys it will activate the key in the next lowest active layer. 
+
+### Custom Functions
+
+At the bottom of the file we've defined a single custom function. This function defines a key that sends `KC_ESC` when pressed without modifiers and `KC_GRAVE` when modifiers are held. There are a couple pieces that need to be in place for this to work, and we will go over both of them. 
+
+#### `fn_actions[]`
+
+We define the `fn_actions[]` array to point to custom functions. `F(N)` in a keymap will call element N of that array. For the Clueboard's that looks like this:
+
+    const uint16_t PROGMEM fn_actions[] = {
+      [0] = ACTION_FUNCTION(0),  // Calls action_function()
+    };
+
+In this case we've instructed QMK to call the `ACTION_FUNCTION` callback, which we will define in the next section.
+
+> This `fn_actions[]` interface is mostly for backward compatibility.  In QMK, you don't need to use `fn_actions[]`.  You can directly use `ACTION_FUNCTION(N)` or any other action code value itself normally generated by the macro in `keymaps[][MATRIX_ROWS][MATRIX_COLS]`.  N in `F(N)` can only be 0 to 31.  Use of the action code directly in `keymaps` unlocks this limitation.
+
+#### `action_function()`
+
+To actually handle the keypress event we define an `action_function()`. This function will be called when the key is pressed, and then again when the key is released. We have to handle both situations within our code, as well as determining whether to send/release `KC_ESC` or `KC_GRAVE`.
+
+    void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
+      static uint8_t mods_pressed;
+
+      switch (id) {
+        case 0:
+          /* Handle the combined Grave/Esc key
+           */
+          mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
+
+          if (record->event.pressed) {
+            /* The key is being pressed.
+             */
+            if (mods_pressed) {
+              add_key(KC_GRV);
+              send_keyboard_report();
+            } else {
+              add_key(KC_ESC);
+              send_keyboard_report();
+            }
+          } else {
+            /* The key is being released.
+             */
+            if (mods_pressed) {
+              del_key(KC_GRV);
+              send_keyboard_report();
+            } else {
+              del_key(KC_ESC);
+              send_keyboard_report();
+            }
+          }
+          break;
+      }
+    }
+
+# Nitty Gritty Details
+
+This should have given you a basic overview for creating your own keymap. For more details see the following resources:
+
+* https://github.com/qmk/qmk_firmware/wiki/Keycodes
+* https://github.com/qmk/qmk_firmware/wiki/FAQ-Keymap
+* https://github.com/qmk/qmk_firmware/wiki/Keymap-examples
+
+We are actively working to improve these docs. If you have suggestions for how they could be made better please [file an issue](https://github.com/qmk/qmk_firmware/issues/new)!

+ 29 - 0
docs/Kiibohd.asciidoc

@@ -0,0 +1,29 @@
+== KLL vs TMK
+1. **Shift** = Memontary
+1. Latch = One shot
+1. Lock  = Toggle
+
+## KLL terminology
+### Fall-through
+When a key is undefined on a particular layer, the key
+definition on the previously stacked layer will be used. Eventually
+the key definition will be set to using the default layer. If the None
+keyword is used, then the fall-through will stop and no action will
+take place.
+###Latch
+When referring to keyboards, a key function that is only enabled
+until the release of the next keypress.
+###Lock
+When referring to keyboards, a key function that is enabled until
+that key is pressed again (e.g. Caps Lock).
+### NKRO
+N-Key Rollover is the capability to press N number of keys at the
+same time on a keyboard and have them all register on the OS simultaneously.
+### Scan Code
+Row x Column code or native protocol code used by the keyboard.
+### Shift
+When referring to keyboards, a key function that is enabled while
+that key is held.
+### USB Code
+Keyboard Press/Release codes as defined by the USB HID
+Spec.

+ 37 - 0
docs/Leader-Key.md

@@ -0,0 +1,37 @@
+# The Leader key: A new kind of modifier
+
+If you've ever used Vim, you know what a Leader key is. If not, you're about to discover a wonderful concept. :) Instead of hitting Alt+Shift+W for example (holding down three keys at the same time), what if you could hit a _sequence_ of keys instead? So you'd hit our special modifier (the Leader key), followed by W and then C (just a rapid succession of keys), and something would happen.
+
+That's what `KC_LEAD` does. Here's an example:
+
+1. Pick a key on your keyboard you want to use as the Leader key. Assign it the keycode `KC_LEAD`. This key would be dedicated just for this -- it's a single action key, can't be used for anything else.
+2. Include the line `#define LEADER_TIMEOUT 300` somewhere in your keymap.c file, probably near the top. The 300 there is 300ms -- that's how long you have for the sequence of keys following the leader. You can tweak this value for comfort, of course.
+3. Within your `matrix_scan_user` function, do something like this:
+
+```
+LEADER_EXTERNS();
+
+void matrix_scan_user(void) {
+  LEADER_DICTIONARY() {
+    leading = false;
+    leader_end();
+
+    SEQ_ONE_KEY(KC_F) {
+      register_code(KC_S);
+      unregister_code(KC_S);
+    }
+    SEQ_TWO_KEYS(KC_A, KC_S) {
+      register_code(KC_H);
+      unregister_code(KC_H);
+    }
+    SEQ_THREE_KEYS(KC_A, KC_S, KC_D) {
+      register_code(KC_LGUI);
+      register_code(KC_S);
+      unregister_code(KC_S);
+      unregister_code(KC_LGUI);
+    }
+  }
+}
+```
+
+As you can see, you have three function. you can use - `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS` and `SEQ_THREE_KEYS` for longer sequences. Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously.

Разница между файлами не показана из-за своего большого размера
+ 1272 - 0
docs/License-Clarification-Details.md


Разница между файлами не показана из-за своего большого размера
+ 38 - 0
docs/License-Clarification.md


+ 215 - 0
docs/Macros.md

@@ -0,0 +1,215 @@
+# Macro shortcuts: Send a whole string when pressing just one key
+
+Instead of using the `ACTION_MACRO` function, you can simply use `M(n)` to access macro *n* - *n* will get passed into the `action_get_macro` as the `id`, and you can use a switch statement to trigger it. This gets called on the keydown and keyup, so you'll need to use an if statement testing `record->event.pressed` (see keymap_default.c).
+
+```c
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is.
+{
+  switch(id) {
+    case 0: // this would trigger when you hit a key mapped as M(0)
+      if (record->event.pressed) {
+        return MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END  ); // this sends the string 'hello' when the macro executes
+      }
+      break;
+  }
+  return MACRO_NONE;
+};
+```
+A macro can include the following commands:
+
+* I() change interval of stroke in milliseconds.
+* D() press key.
+* U() release key.
+* T() type key(press and release).
+* W() wait (milliseconds).
+* END end mark.
+
+So above you can see the stroke interval changed to 255ms between each keystroke, then a bunch of keys being typed, waits a while, then the macro ends.
+
+Note: Using macros to have your keyboard send passwords for you is possible, but a bad idea.
+
+## Advanced macro functions
+
+To get more control over the keys/actions your keyboard takes, the following functions are available to you in the `action_get_macro` function block:
+
+* `record->event.pressed`
+
+This is a boolean value that can be tested to see if the switch is being pressed or released. An example of this is
+
+```c
+if (record->event.pressed) {
+  // on keydown
+} else {
+  // on keyup
+}
+```
+
+* `register_code(<kc>);`
+
+This sends the `<kc>` keydown event to the computer. Some examples would be `KC_ESC`, `KC_C`, `KC_4`, and even modifiers such as `KC_LSFT` and `KC_LGUI`.
+
+* `unregister_code(<kc>);`
+
+Parallel to `register_code` function, this sends the `<kc>` keyup event to the computer. If you don't use this, the key will be held down until it's sent.
+
+* `layer_on(<n>);`
+
+This will turn on the layer `<n>` - the higher layer number will always take priority. Make sure you have `KC_TRNS` for the key you're pressing on the layer you're switching to, or you'll get stick there unless you have another plan.
+
+* `layer_off(<n>);`
+
+This will turn off the layer `<n>`.
+
+* `clear_keyboard();`
+
+This will clear all mods and keys currently pressed.
+
+* `clear_mods();`
+
+This will clear all mods currently pressed.
+
+* `clear_keyboard_but_mods();`
+
+This will clear all keys besides the mods currently pressed.
+
+* `update_tri_layer(layer_1, layer_2, layer_3);`
+
+If the user attempts to activate layer 1 AND layer 2 at the same time (for example, by hitting their respective layer keys), layer 3 will be activated. Layers 1 and 2 will _also_ be activated, for the purposes of fallbacks (so a given key will fall back from 3 to 2, to 1 -- and only then to 0).
+
+### Naming your macros
+
+If you have a bunch of macros you want to refer to from your keymap, while keeping the keymap easily readable, you can just name them like so:
+
+```
+#define AUD_OFF M(6)
+#define AUD_ON M(7)
+#define MUS_OFF M(8)
+#define MUS_ON M(9)
+#define VC_IN M(10)
+#define VC_DE M(11)
+#define PLOVER M(12)
+#define EXT_PLV M(13)
+```
+
+As was done on the [Planck default keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/default/keymap.c#L33-L40)
+
+#### Timer functionality
+
+It's possible to start timers and read values for time-specific events - here's an example:
+
+```c
+static uint16_t key_timer;
+key_timer = timer_read();
+if (timer_elapsed(key_timer) < 100) {
+  // do something if less than 100ms have passed
+} else {
+  // do something if 100ms or more have passed
+}
+```
+
+It's best to declare the `static uint16_t key_timer;` outside of the macro block (top of file, etc).
+
+### Example: Single-key copy/paste (hold to copy, tap to paste)
+
+With QMK, it's easy to make one key do two things, as long as one of those things is being a modifier. :) So if you want a key to act as Ctrl when held and send the letter R when tapped, that's easy: `CTL_T(KC_R)`. But what do you do when you want that key to send Ctrl-V (paste) when tapped, and Ctrl-C (copy) when held?
+
+Here's what you do:
+
+
+```
+static uint16_t key_timer;
+
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+      switch(id) {
+        case 0: {
+            if (record->event.pressed) {
+                key_timer = timer_read(); // if the key is being pressed, we start the timer.
+            }
+            else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down").
+                if (timer_elapsed(key_timer) > 150) { // 150 being 150ms, the threshhold we pick for counting something as a tap.
+                    return MACRO( D(LCTL), T(C), U(LCTL), END  );
+                }
+                else {
+                    return MACRO( D(LCTL), T(V), U(LCTL), END  );
+                }
+            }
+            break;
+        }
+      }
+    return MACRO_NONE;
+};
+```
+
+And then, to assign this macro to a key on your keyboard layout, you just use `M(0)` on the key you want to press for copy/paste.
+
+# Dynamic macros: record and replay macros in runtime
+
+In addition to the static macros described above, you may enable the dynamic macros which you may record while writing. They are forgotten as soon as the keyboard is unplugged. Only two such macros may be stored at the same time, with the total length of 64 keypresses (by default).
+
+To enable them, first add a new element to the `planck_keycodes` enum — `DYNAMIC_MACRO_RANGE`:
+
+    enum planck_keycodes {
+      QWERTY = SAFE_RANGE,
+      COLEMAK,
+      DVORAK,
+      PLOVER,
+      LOWER,
+      RAISE,
+      BACKLIT,
+      EXT_PLV,
+      DYNAMIC_MACRO_RANGE,
+    };
+
+It must be the last element because `dynamic_macros.h` will add some more keycodes after it.
+
+Below it include the `dynamic_macro.h` header:
+
+    #include "dynamic_macro.h"`
+
+Add the following keys to your keymap:
+
+- `DYN_REC_START1` — start recording the macro 1,
+- `DYN_REC_START2` — start recording the macro 2,
+- `DYN_MACRO_PLAY1` — replay the macro 1,
+- `DYN_MACRO_PLAY2` — replay the macro 2,
+- `DYN_REC_STOP` — finish the macro that is currently being recorded.
+
+Add the following code to the very beginning of your `process_record_user()` function:
+
+    if (!process_record_dynamic_macro(keycode, record)) {
+        return false;
+    }
+
+That should be everything necessary. To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. To finish the recording, press the `DYN_REC_STOP` layer button. To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`.
+
+Note that it's possible to replay a macro as part of a macro. It's ok to replay macro 2 while recording macro 1 and vice versa but never create recursive macros i.e. macro 1 that replays macro 1. If you do so and the keyboard will get unresponsive, unplug the keyboard and plug it again.
+
+For users of the earlier versions of dynamic macros: It is still possible to finish the macro recording using just the layer modifier used to access the dynamic macro keys, without a dedicated `DYN_REC_STOP` key. If you want this behavior back, use the following snippet instead of the one above:
+
+    uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode);
+    if (!process_record_dynamic_macro(macro_kc, record)) {
+        return false;
+    }
+
+If the LED-s start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 128; please read the comments for it in the header).
+
+For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header.
+
+# Sending strings
+Some people want to have a password or some text on a key. This is possible without having to do every key individually using `SEND_STRING("<text>");`. Note the caps, because `send_string("<text>");` does something else. For example:
+```c
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is.
+{
+  switch(id) {
+    case 0: // this would trigger when you hit a key mapped as M(0)
+      if (record->event.pressed) {
+				SEND_STRING("QMK is the best thing ever!"); // This would type "QMK is the best thing ever!" (without quotation marks).
+        return false; // This is false because it has to return something.
+      }
+      break;
+  }
+  return MACRO_NONE;
+};
+```
+If you'd want it to press enter as well, just replace `return false;` with `return MACRO( T(ENT), END );`.

Разница между файлами не показана из-за своего большого размера
+ 167 - 0
docs/Make-Instructions.md


+ 21 - 0
docs/Memory-write-error,-use-debug-for-more-info.md

@@ -0,0 +1,21 @@
+In rare circumstances, your keyboard/device can become unwritable, and `dfu-programmer` will give you an error like this:  
+
+    Erasing flash...  Success
+    Checking memory from 0x0 to 0x6FFF...  Empty.
+    Checking memory from 0x0 to 0x607F...  Empty.
+    0%                            100%  Programming 0x6080 bytes...
+    [ X  ERROR
+    Memory write error, use debug for more info.
+
+Currently the only way to solve this is to [reprogram the chip via ISP](https://www.reddit.com/r/olkb/comments/4rjzen/flashing_error_on_mac_os_x/d52rj8o/). This requires another device to be hooked up to a couple of exposed pins on the PCB. There is a guide on how to do this [here](https://learn.sparkfun.com/tutorials/installing-an-arduino-bootloader), and [this is where things are on the Planck PCB](http://imgur.com/lvbxbHt).
+
+An example command to flash the board once things are hooked up is:
+
+    avrdude -c usbtiny -p m32u4 -U flash:w:planck_default_rev4.hex
+
+Research is still being done on why this happens, but here are some cases:
+
+* [`make -f Makefile.rn42 dfu` and not the dfu-programmer commands worked for @tybenz](https://github.com/tmk/tmk_keyboard/issues/316) - also see [the hhkb keyboard on tmk](https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hhkb)
+* [Doing a force erase works here](https://geekhack.org/index.php?topic=12047.msg1520147#msg1520147)
+* [`dfu-programmer atmega32u4 erase --force` works here as well](https://forum.fhem.de/index.php?topic=29777.0) [DE]
+* [Unresolved, but some data dumps](https://github.com/dfu-programmer/dfu-programmer/issues/29)

+ 379 - 0
docs/Modding-your-keyboard.md

@@ -0,0 +1,379 @@
+
+## Audio output from a speaker
+
+Your keyboard can make sounds! If you've got a Planck, Preonic, or basically any keyboard that allows access to the C6 port, you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes.
+
+The audio code lives in [quantum/audio/audio.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/audio.h) and in the other files in the audio directory. It's enabled by default on the Planck [stock keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/default/keymap.c). Here are the important bits:
+
+```
+#include "audio.h"
+```
+
+Then, lower down the file:
+
+```
+float tone_startup[][2] = {
+    ED_NOTE(_E7 ),
+    E__NOTE(_CS7),
+    E__NOTE(_E6 ),
+    E__NOTE(_A6 ),
+    M__NOTE(_CS7, 20)
+};
+```
+
+This is how you write a song. Each of these lines is a note, so we have a little ditty composed of five notes here.
+
+Then, we have this chunk:
+
+```
+float tone_qwerty[][2]     = SONG(QWERTY_SOUND);
+float tone_dvorak[][2]     = SONG(DVORAK_SOUND);
+float tone_colemak[][2]    = SONG(COLEMAK_SOUND);
+float tone_plover[][2]     = SONG(PLOVER_SOUND);
+float tone_plover_gb[][2]  = SONG(PLOVER_GOODBYE_SOUND);
+
+float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
+float goodbye[][2] = SONG(GOODBYE_SOUND);
+```
+
+Wherein we bind predefined songs (from [quantum/audio/song_list.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/song_list.h)) into named variables. This is one optimization that helps save on memory: These songs only take up memory when you reference them in your keymap, because they're essentially all preprocessor directives.
+
+So now you have something called `tone_plover` for example. How do you make it play the Plover tune, then? If you look further down the keymap, you'll see this:
+
+```
+PLAY_NOTE_ARRAY(tone_plover, false, 0); // Signature is: Song name, repeat, rest style
+```
+
+This is inside one of the macros. So when that macro executes, your keyboard plays that particular chime.
+
+"Rest style" in the method signature above (the last parameter) specifies if there's a rest (a moment of silence) between the notes.
+
+
+## Recording And Playing back Music
+* ```Music On``` - Turn music mode on. The default mapping is ```Lower+Upper+C```
+* ```LCTL``` - start a recording
+* play some tones
+* ```LALT``` - stop recording, stop playing
+* ```LGUI``` - play recording
+* ```LALT``` - stop playing
+* ```Music Off``` - Turn music mode off. The default mapping is ```Lower+Upper+V```
+
+
+## MIDI functionalty
+
+This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile.
+
+## Bluetooth functionality
+
+This requires [some hardware changes](https://www.reddit.com/r/MechanicalKeyboards/comments/3psx0q/the_planck_keyboard_with_bluetooth_guide_and/?ref=search_posts), but can be enabled via the Makefile. The firmware will still output characters via USB, so be aware of this when charging via a computer. It would make sense to have a switch on the Bluefruit to turn it off at will.
+
+## RGB Under Glow Mod
+
+![Planck with RGB Underglow](https://raw.githubusercontent.com/qmk/qmk_firmware/master/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg)
+
+Here is a quick demo on Youtube (with NPKC KC60) (https://www.youtube.com/watch?v=VKrpPAHlisY).
+
+For this mod, you need an unused pin wiring to DI of WS2812 strip. After wiring the VCC, GND, and DI, you can enable the underglow in your Makefile.
+
+    RGBLIGHT_ENABLE = yes
+
+In order to use the underglow animation functions, you need to have `#define RGBLIGHT_ANIMATIONS` in your `config.h`.
+
+Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default:
+
+    #define RGB_DI_PIN F4     // The pin your RGB strip is wired to
+    #define RGBLIGHT_ANIMATIONS    // Require for fancier stuff (not compatible with audio)
+    #define RGBLED_NUM 14     // Number of LEDs
+    #define RGBLIGHT_HUE_STEP 10
+    #define RGBLIGHT_SAT_STEP 17
+    #define RGBLIGHT_VAL_STEP 17
+
+You'll need to edit `RGB_DI_PIN` to the pin you have your `DI` on your RGB strip wired to.
+
+The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. For details, please check this keymap. `keyboards/planck/keymaps/yang/keymap.c`
+
+### WS2812 Wiring
+
+![WS2812 Wiring](https://raw.githubusercontent.com/qmk/qmk_firmware/master/keyboards/planck/keymaps/yang/WS2812-wiring.jpg)
+
+Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20.
+
+## PS/2 Mouse Support
+
+Its possible to hook up a PS/2 mouse (for example touchpads or trackpoints) to your keyboard as a composite device.
+
+To hook up a Trackpoint, you need to obtain a Trackpoint module (i.e. harvest from a Thinkpad keyboard), identify the function of each pin of the module, and make the necessary circuitry between controller and Trackpoint module. For more information, please refer to [Trackpoint Hardware](https://deskthority.net/wiki/TrackPoint_Hardware) page on Deskthority Wiki.
+
+There are three available modes for hooking up PS/2 devices: USART (best), interrupts (better) or busywait (not recommended).
+
+### Busywait version
+
+Note: This is not recommended, you may encounter jerky movement or unsent inputs. Please use interrupt or USART version if possible.
+
+In rules.mk:
+
+```
+PS2_MOUSE_ENABLE = yes
+PS2_USE_BUSYWAIT = yes
+```
+
+In your keyboard config.h:
+
+```
+#ifdef PS2_USE_BUSYWAIT
+#   define PS2_CLOCK_PORT  PORTD
+#   define PS2_CLOCK_PIN   PIND
+#   define PS2_CLOCK_DDR   DDRD
+#   define PS2_CLOCK_BIT   1
+#   define PS2_DATA_PORT   PORTD
+#   define PS2_DATA_PIN    PIND
+#   define PS2_DATA_DDR    DDRD
+#   define PS2_DATA_BIT    2
+#endif
+```
+
+### Interrupt version
+
+The following example uses D2 for clock and D5 for data. You can use any INT or PCINT pin for clock, and any pin for data.
+
+In rules.mk:
+
+```
+PS2_MOUSE_ENABLE = yes
+PS2_USE_INT = yes
+```
+
+In your keyboard config.h:
+
+```
+#ifdef PS2_USE_INT
+#define PS2_CLOCK_PORT  PORTD
+#define PS2_CLOCK_PIN   PIND
+#define PS2_CLOCK_DDR   DDRD
+#define PS2_CLOCK_BIT   2
+#define PS2_DATA_PORT   PORTD
+#define PS2_DATA_PIN    PIND
+#define PS2_DATA_DDR    DDRD
+#define PS2_DATA_BIT    5
+
+#define PS2_INT_INIT()  do {    \
+    EICRA |= ((1<<ISC21) |      \
+              (0<<ISC20));      \
+} while (0)
+#define PS2_INT_ON()  do {      \
+    EIMSK |= (1<<INT2);         \
+} while (0)
+#define PS2_INT_OFF() do {      \
+    EIMSK &= ~(1<<INT2);        \
+} while (0)
+#define PS2_INT_VECT   INT2_vect
+#endif
+```
+
+### USART version
+
+To use USART on the ATMega32u4, you have to use PD5 for clock and PD2 for data. If one of those are unavailable, you need to use interrupt version.
+
+In rules.mk:
+
+```
+PS2_MOUSE_ENABLE = yes
+PS2_USE_USART = yes
+```
+
+In your keyboard config.h:
+
+```
+#ifdef PS2_USE_USART
+#define PS2_CLOCK_PORT  PORTD
+#define PS2_CLOCK_PIN   PIND
+#define PS2_CLOCK_DDR   DDRD
+#define PS2_CLOCK_BIT   5
+#define PS2_DATA_PORT   PORTD
+#define PS2_DATA_PIN    PIND
+#define PS2_DATA_DDR    DDRD
+#define PS2_DATA_BIT    2
+
+/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
+/* set DDR of CLOCK as input to be slave */
+#define PS2_USART_INIT() do {   \
+    PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT);   \
+    PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT);     \
+    UCSR1C = ((1 << UMSEL10) |  \
+              (3 << UPM10)   |  \
+              (0 << USBS1)   |  \
+              (3 << UCSZ10)  |  \
+              (0 << UCPOL1));   \
+    UCSR1A = 0;                 \
+    UBRR1H = 0;                 \
+    UBRR1L = 0;                 \
+} while (0)
+#define PS2_USART_RX_INT_ON() do {  \
+    UCSR1B = ((1 << RXCIE1) |       \
+              (1 << RXEN1));        \
+} while (0)
+#define PS2_USART_RX_POLL_ON() do { \
+    UCSR1B = (1 << RXEN1);          \
+} while (0)
+#define PS2_USART_OFF() do {    \
+    UCSR1C = 0;                 \
+    UCSR1B &= ~((1 << RXEN1) |  \
+                (1 << TXEN1));  \
+} while (0)
+#define PS2_USART_RX_READY      (UCSR1A & (1<<RXC1))
+#define PS2_USART_RX_DATA       UDR1
+#define PS2_USART_ERROR         (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
+#define PS2_USART_RX_VECT       USART1_RX_vect
+#endif
+```
+
+### Additional Settings
+
+#### PS/2 mouse features
+
+These enable settings supported by the PS/2 mouse protocol: http://www.computer-engineering.org/ps2mouse/
+
+```
+/* Use remote mode instead of the default stream mode (see link) */
+#define PS2_MOUSE_USE_REMOTE_MODE  
+
+/* Enable the scrollwheel or scroll gesture on your mouse or touchpad */
+#define PS2_MOUSE_ENABLE_SCROLLING
+
+/* Some mice will need a scroll mask to be configured. The default is 0xFF. */
+#define PS2_MOUSE_SCROLL_MASK 0x0F
+
+/* Applies a transformation to the movement before sending to the host (see link) */
+#define PS2_MOUSE_USE_2_1_SCALING
+
+/* The time to wait after initializing the ps2 host */
+#define PS2_MOUSE_INIT_DELAY 1000 /* Default */
+```
+
+You can also call the following functions from ps2_mouse.h
+
+```
+void ps2_mouse_disable_data_reporting(void);
+
+void ps2_mouse_enable_data_reporting(void);
+
+void ps2_mouse_set_remote_mode(void);
+
+void ps2_mouse_set_stream_mode(void);
+
+void ps2_mouse_set_scaling_2_1(void);
+
+void ps2_mouse_set_scaling_1_1(void);
+
+void ps2_mouse_set_resolution(ps2_mouse_resolution_t resolution);
+
+void ps2_mouse_set_sample_rate(ps2_mouse_sample_rate_t sample_rate);
+```
+
+#### Fine control
+
+Use the following defines to change the sensitivity and speed of the mouse.
+Note: you can also use `ps2_mouse_set_resolution` for the same effect (not supported on most touchpads).
+
+```
+#define PS2_MOUSE_X_MULTIPLIER 3
+#define PS2_MOUSE_Y_MULTIPLIER 3
+#define PS2_MOUSE_V_MULTIPLIER 1
+```
+
+#### Scroll button
+
+If you're using a trackpoint, you will likely want to be able to use it for scrolling.
+Its possible to enable a "scroll button/s" that when pressed will cause the mouse to scroll instead of moving.
+To enable the feature, you must set a scroll button mask as follows:
+
+```
+#define PS2_MOUSE_SCROLL_BTN_MASK (1<<PS2_MOUSE_BUTTON_MIDDLE) /* Default */
+```
+
+To disable the scroll button feature:
+
+```
+#define PS2_MOUSE_SCROLL_BTN_MASK 0
+```
+
+The available buttons are:
+
+```
+#define PS2_MOUSE_BTN_LEFT      0
+#define PS2_MOUSE_BTN_RIGHT     1
+#define PS2_MOUSE_BTN_MIDDLE    2
+```
+
+You can also combine buttons in the mask by `|`ing them together.
+
+Once you've configured your scroll button mask, you must configure the scroll button send interval.
+This is the interval before which if the scroll buttons were released they would be sent to the host.
+After this interval, they will cause the mouse to scroll and will not be sent.
+
+```
+#define PS2_MOUSE_SCROLL_BTN_SEND 300 /* Default */
+```
+
+To disable sending the scroll buttons:
+```
+#define PS2_MOUSE_SCROLL_BTN_SEND 0
+```
+
+Fine control over the scrolling is supported with the following defines:
+
+```
+#define PS2_MOUSE_SCROLL_DIVISOR_H 2
+#define PS2_MOUSE_SCROLL_DIVISOR_V 2
+```
+
+#### Debug settings
+
+To debug the mouse, add `debug_mouse = true` or enable via bootmagic.
+
+```
+/* To debug the mouse reports */
+#define PS2_MOUSE_DEBUG_HID
+#define PS2_MOUSE_DEBUG_RAW
+```
+
+## Safety Considerations
+
+You probably don't want to "brick" your keyboard, making it impossible
+to rewrite firmware onto it.  Here are some of the parameters to show
+what things are (and likely aren't) too risky.
+
+- If your keyboard map does not include RESET, then, to get into DFU
+  mode, you will need to press the reset button on the PCB, which
+  requires unscrewing the bottom.
+- Messing with tmk_core / common files might make the keyboard
+  inoperable
+- Too large a .hex file is trouble; `make dfu` will erase the block,
+  test the size (oops, wrong order!), which errors out, failing to
+  flash the keyboard, leaving it in DFU mode.
+  - To this end, note that the maximum .hex file size on Planck is
+    7000h (28672 decimal)
+
+```
+Linking: .build/planck_rev4_cbbrowne.elf                                                            [OK]
+Creating load file for Flash: .build/planck_rev4_cbbrowne.hex                                       [OK]
+
+Size after:
+   text    data     bss     dec     hex filename
+      0   22396       0   22396    577c planck_rev4_cbbrowne.hex
+```
+
+  - The above file is of size 22396/577ch, which is less than
+    28672/7000h
+  - As long as you have a suitable alternative .hex file around, you
+    can retry, loading that one
+  - Some of the options you might specify in your keyboard's Makefile
+    consume extra memory; watch out for BOOTMAGIC_ENABLE,
+    MOUSEKEY_ENABLE, EXTRAKEY_ENABLE, CONSOLE_ENABLE, API_SYSEX_ENABLE
+- DFU tools do /not/ allow you to write into the bootloader (unless
+  you throw in extra fruitsalad of options), so there is little risk
+  there.
+- EEPROM has around a 100000 write cycle.  You shouldn't rewrite the
+  firmware repeatedly and continually; that'll burn the EEPROM
+  eventually.
+

+ 17 - 0
docs/Mouse-keys.md

@@ -0,0 +1,17 @@
+# Can I increase the speed of the mouse keys?
+
+**Q:** The default speed for controlling the mouse with the keyboard is slow. I've tried increasing the mouse's sensitivity at work using xset m and it worked, although sometimes it changes by itself for some reason. At home, on Arch Linux, this does not change ti. I've looked through the forums and resolved to use libinput using xinput but using that I only manage to change the speed of the mouse using the actual mouse. The speed of the mouse using the keyboard controls remained unchanged.
+Is there perhaps something I can input in the keymap.c to change the sensitivity? Or some other surefire way of increasing the speed?
+Thanks!
+
+**A:**  In your keymap's config.h:
+
+```
+#define MOUSEKEY_INTERVAL       20
+#define MOUSEKEY_DELAY          0
+#define MOUSEKEY_TIME_TO_MAX    60
+#define MOUSEKEY_MAX_SPEED      7
+#define MOUSEKEY_WHEEL_DELAY 0
+```
+
+Tweak away. A lower interval or higher max speed will effectively make the mouse move faster. Time-to-max controls acceleration. (See [this Reddit thread for the original discussion](https://www.reddit.com/r/ErgoDoxEZ/comments/61fwr2/a_reliable_way_to_increase_the_speed_of_the_mouse/)).

+ 62 - 0
docs/Other-Projects.md

@@ -0,0 +1,62 @@
+Keyboard Firmware Projects other than TMK
+================================
+## PJRC USB Keyboard/Mouse Example[USB][PJRC][Teensy][AVR]
+- <http://www.pjrc.com/teensy/usb_keyboard.html>
+- <http://www.pjrc.com/teensy/usb_mouse.html>
+ 
+## kbupgrade[USB][V-USB][AVR]
+- <http://github.com/rhomann/kbupgrade>
+- <http://geekhack.org/showwiki.php?title=Island:8406>
+ 
+## c64key[USB][V-USB][AVR]
+- <http://symlink.dk/projects/c64key/>
+ 
+## rump[USB][V-USB][AVR]
+- <http://mg8.org/rump/>
+- <http://github.com/clee/rump>
+ 
+## dulcimer[USB][V-USB][AVR]
+- <http://www.schatenseite.de/dulcimer.html>
+ 
+## humblehacker-keyboard[USB][LUFA][AVR][Ergo]
+- <http://github.com/humblehacker>
+- <http://www.humblehacker.com/keyboard/>
+- <http://geekhack.org/showwiki.php?title=Island:6292>
+ 
+## ps2avr[PS/2][AVR]
+- <http://sourceforge.net/projects/ps2avr/>
+ 
+## ErgoDox[Ergo][Split][USB][AVR]
+- <http://geekhack.org/index.php?topic=22780.0>
+- <https://github.com/benblazak/ergodox-firmware>
+- <https://github.com/cub-uanic/tmk_keyboard>
+ 
+## Suka's keyboard collection[Ergo][Split][3DPrinting][USB][AVR]
+- <http://deskthority.net/workshop-f7/my-diy-keyboard-collection-or-how-i-became-a-kb-geek-t2534.html>
+- <https://github.com/frobiac/adnw>
+ 
+## bpiphany's AVR-Keyboard[PJRC][AVR][USB]
+- <https://github.com/BathroomEpiphanies/AVR-Keyboard>
+- <http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions>
+- <http://deskthority.net/wiki/Phantom>
+ 
+## USB-USB keyboard remapper[converter][USB-USB][AVR][Arduino]
+- <http://forum.colemak.com/viewtopic.php?pid=10837>
+- <https://github.com/darkytoothpaste/keymapper>
+ 
+## USB-USB converter threads[converter][USB-USB]
+- <http://deskthority.net/workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841-30.html>
+- <http://geekhack.org/index.php?topic=19458.0>
+ 
+## kbdbabel.org[converter][vintage][protocol][8051]
+Great resource of vintage keyboard protocol information and code
+
+- <http://www.kbdbabel.org/>
+ 
+## Haata's kiibohd Controller[converter][vintage][protocol][AVR][PJRC][Cortex]
+A lots of vintage keyboard protocol supports
+ 
+- <https://github.com/kiibohd/controller>
+ 
+## Kinesis ergonomic keyboard firmware replacement[V-USB][LUFA][Ergo]
+- <https://github.com/chrisandreae/kinesis-firmware>

doc/PCB_GUIDE.md → docs/PCB_GUIDE.md


doc/POWER.txt → docs/POWER.txt


+ 70 - 0
docs/Porting-Your-Keyboard-to-QMK-(ARM-and-other-ChibiOS-CPUs).md

@@ -0,0 +1,70 @@
+Setting up your ARM based PCB is a little more involved than an Atmel MCU, but is easy enough. Start by using `util/new_project.sh <keyboard>` to create a new project:
+
+```
+$ util/new_project.sh simontester
+######################################################
+# /keyboards/simontester project created. To start
+# working on things, cd into keyboards/simontester
+######################################################
+```
+
+
+
+# END OF NEW ARM DOC, OLD ATMEL DOC FOLLOWS
+
+## `/keyboards/<keyboard>/config.h`
+
+The `USB Device descriptor parameter` block contains parameters are used to uniquely identify your keyboard, but they don't really matter to the machine.
+
+Your `MATRIX_ROWS` and `MATRIX_COLS` are the numbers of rows and cols in your keyboard matrix - this may be different than the number of actual rows and columns on your keyboard. There are some tricks you can pull to increase the number of keys in a given matrix, but most keyboards are pretty straight-forward.
+
+The `MATRIX_ROW_PINS` and `MATRIX_COL_PINS` are the pins your MCU uses on each row/column. Your schematic (if you have one) will have this information on it, and the values will vary depending on your setup. This is one of the most important things to double-check in getting your keyboard setup correctly.
+
+For the `DIODE_DIRECTION`, most hand-wiring guides will instruct you to wire the diodes in the `COL2ROW` position, but it's possible that they are in the other - people coming from EasyAVR often use `ROW2COL`. Nothing will function if this is incorrect.
+
+`BACKLIGHT_PIN` is the pin that your PWM-controlled backlight (if one exists) is hooked-up to. Currently only B5, B6, and B7 are supported.
+
+`BACKLIGHT_BREATHING` is a fancier backlight feature that adds breathing/pulsing/fading effects to the backlight. It uses the same timer as the normal backlight. These breathing effects must be called by code in your keymap.
+
+`BACKLIGHT_LEVELS` is how many levels exist for your backlight - max is 15, and they are computed automatically from this number.
+
+## `/keyboards/<keyboard>/Makefile`
+
+The values at the top likely won't need to be changed, since most boards use the `atmega32u4` chip. The `BOOTLOADER_SIZE` will need to be adjusted based on your MCU type. It's defaulted to the Teensy, since that's the most common controller. Below is quoted from the `Makefile`.
+
+```
+# Boot Section Size in *bytes*
+#   Teensy halfKay   512
+#   Teensy++ halfKay 1024
+#   Atmel DFU loader 4096
+#   LUFA bootloader  4096
+#   USBaspLoader     2048
+OPT_DEFS += -DBOOTLOADER_SIZE=512
+```
+
+At the bottom of the file, you'll find lots of features to turn on and off - all of these options should be set with `?=` to allow for the keymap overrides. `?=` only assigns if the variable was previously undefined. For the full documenation of these features, see the [Makefile options](#makefile-options).
+
+## `/keyboards/<keyboard>/readme.md`
+
+This is where you'll describe your keyboard - please write as much as you can about it! Talking about default functionality/features is useful here. Feel free to link to external pages/sites if necessary. Images can be included here as well. This file will be rendered into a webpage at qmk.fm/keyboards/<keyboard>/.
+
+## `/keyboards/<keyboard>/<keyboard>.c`
+
+This is where all of the custom logic for your keyboard goes - you may not need to put anything in this file, since a lot of things are configured automatically. All of the `*_kb()` functions are defined here. If you modify them, remember to keep the calls to `*_user()`, or things in the keymaps might not work. You can read more about the functions [here](#custom-quantum-functions-for-keyboards-and-keymaps)
+
+## `/keyboards/<keyboard>/<keyboard>.h`
+
+Here is where you can (optionally) define your `KEYMAP` function to remap your matrix into a more readable format. With ortholinear boards, this isn't always necessary, but it can help to accomodate the dead spots on your matrix, where there are keys that take up more than one space (2u, staggering, 6.25u, etc). The example shows the difference between the physical keys, and the matrix design:
+
+```
+#define KEYMAP( \
+    k00, k01, k02, \
+      k10,  k11   \
+) \
+{ \
+    { k00, k01,   k02 }, \
+    { k10, KC_NO, k11 }, \
+}
+```
+
+Each of the `kxx` variables needs to be unique, and usually follows the format `k<row><col>`. You can place `KC_NO` where your dead keys are in your matrix.

+ 59 - 0
docs/Porting-your-keyboard-to-QMK.md

@@ -0,0 +1,59 @@
+If your keyboard is running an Atmega chip (atmega32u4 and others), it's pretty easy to get things setup for compiling your own firmware to flash onto your board. There is a `/util/new_project.sh <keyboard>` script to help get you started - you can simply pass your keyboard's name into the script, and all of the necessary files will be created. The components of each are described below.
+
+## `/keyboards/<keyboard>/config.h`
+
+The `USB Device descriptor parameter` block contains parameters are used to uniquely identify your keyboard, but they don't really matter to the machine.
+
+Your `MATRIX_ROWS` and `MATRIX_COLS` are the numbers of rows and cols in your keyboard matrix - this may be different than the number of actual rows and columns on your keyboard. There are some tricks you can pull to increase the number of keys in a given matrix, but most keyboards are pretty straight-forward.
+
+The `MATRIX_ROW_PINS` and `MATRIX_COL_PINS` are the pins your MCU uses on each row/column. Your schematic (if you have one) will have this information on it, and the values will vary depending on your setup. This is one of the most important things to double-check in getting your keyboard setup correctly.
+
+For the `DIODE_DIRECTION`, most hand-wiring guides will instruct you to wire the diodes in the `COL2ROW` position, but it's possible that they are in the other - people coming from EasyAVR often use `ROW2COL`. Nothing will function if this is incorrect.
+
+`BACKLIGHT_PIN` is the pin that your PWM-controlled backlight (if one exists) is hooked-up to. Currently only B5, B6, and B7 are supported.
+
+`BACKLIGHT_BREATHING` is a fancier backlight feature that adds breathing/pulsing/fading effects to the backlight. It uses the same timer as the normal backlight. These breathing effects must be called by code in your keymap.
+
+`BACKLIGHT_LEVELS` is how many levels exist for your backlight - max is 15, and they are computed automatically from this number.
+
+## `/keyboards/<keyboard>/Makefile`
+
+The values at the top likely won't need to be changed, since most boards use the `atmega32u4` chip. The `BOOTLOADER_SIZE` will need to be adjusted based on your MCU type. It's defaulted to the Teensy, since that's the most common controller. Below is quoted from the `Makefile`.
+
+```
+# Boot Section Size in *bytes*
+#   Teensy halfKay   512
+#   Teensy++ halfKay 1024
+#   Atmel DFU loader 4096
+#   LUFA bootloader  4096
+#   USBaspLoader     2048
+OPT_DEFS += -DBOOTLOADER_SIZE=512
+```
+
+At the bottom of the file, you'll find lots of features to turn on and off - all of these options should be set with `?=` to allow for the keymap overrides. `?=` only assigns if the variable was previously undefined. For the full documenation of these features, see the [Makefile options](#makefile-options).
+
+## `/keyboards/<keyboard>/readme.md`
+
+This is where you'll describe your keyboard - please write as much as you can about it! Talking about default functionality/features is useful here. Feel free to link to external pages/sites if necessary. Images can be included here as well. This file will be rendered into a webpage at qmk.fm/keyboards/<keyboard>/.
+
+## `/keyboards/<keyboard>/<keyboard>.c`
+
+This is where all of the custom logic for your keyboard goes - you may not need to put anything in this file, since a lot of things are configured automatically. All of the `*_kb()` functions are defined here. If you modify them, remember to keep the calls to `*_user()`, or things in the keymaps might not work. You can read more about the functions [here](#custom-quantum-functions-for-keyboards-and-keymaps)
+
+## `/keyboards/<keyboard>/<keyboard>.h`
+
+Here is where you can (optionally) define your `KEYMAP` function to remap your matrix into a more readable format. With ortholinear boards, this isn't always necessary, but it can help to accomodate the dead spots on your matrix, where there are keys that take up more than one space (2u, staggering, 6.25u, etc). The example shows the difference between the physical keys, and the matrix design:
+
+```
+#define KEYMAP( \
+    k00, k01, k02, \
+      k10,  k11   \
+) \
+{ \
+    { k00, k01,   k02 }, \
+    { k10, KC_NO, k11 }, \
+}
+```
+
+Each of the `kxx` variables needs to be unique, and usually follows the format `k<row><col>`. You can place `KC_NO` where your dead keys are in your matrix.
+

+ 14 - 0
docs/Previously-Asked-Questions.asciidoc

@@ -0,0 +1,14 @@
+= Previously Asked Questions
+:toc:
+:toc-placement: preamble
+
+toc::[]
+
+= Question thread
+http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177-270.html
+
+= Questions
+== Columns beyond 16(uint16_t) cannot be read
+* https://github.com/tmk/tmk_keyboard/wiki/FAQ#cant-read-comlumn-of-matrix-beyond-16
+* http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177-270.html#p247051
+* http://deskthority.net/workshop-f7/rebuilding-and-redesigning-a-classic-thinkpad-keyboard-t6181-60.html#p146279

+ 75 - 0
docs/QMK-Overview.md

@@ -0,0 +1,75 @@
+# QMK Overview
+
+This page attempts to explain the basic information you need to know to work with the QMK project. It assumes that you are familiar with navigating a UNIX shell, but does not assume you are familiar with C or with compiling using make.
+
+# Basic QMK structure
+
+QMK is a fork of @tmk's [tmk_keyboard](https://github.com/tmk/tmk_keyboard) project. The original TMK code, with modifications, can be found in the `tmk` folder. The QMK additions to the project may be found in the `quantum` folder. Keyboard projects may be found in the `handwired` and `keyboard` folders.
+
+## Keyboard project structure
+
+Within the `handwired` and `keyboard` folders is a directory for each keyboard project, for example `qmk_firmware/keyboards/clueboard`. Within you'll find the following structure:
+
+* `keymaps/`: Different keymaps that can be built
+* `rules.mk`: The file that sets the default "make" options. Do not edit this file directly, instead use a keymap specific `Makefile`.
+* `config.h`: The file that sets the default compile time options. Do not edit this file directly, instead use a keymap specific `config.h`.
+
+### Keymap structure
+
+In every keymap folder, the following files may be found. Only `keymap.c` is required, if the rest of the files are not found the default options will be chosen.
+
+* `config.h`: the options to configure your keymap
+* `keymap.c`: all of your keymap code, required
+* `Makefile`: the features of QMK that are enabled, required to run `make` in your keymap folder
+* `readme.md`: a description of your keymap, how others might use it, and explanations of features
+* Other files: Some people choose to include an image depicting the layout, and other files that help people to use or understand a particular keymap.
+
+# The `make` command
+
+The `make` command is how you compile the firmware into a .hex file, which can be loaded by a dfu programmer (like dfu-progammer via `make dfu`) or the [Teensy loader](https://www.pjrc.com/teensy/loader.html) (only used with Teensys). It it recommended that you always run make from within the `root` folder.
+
+**NOTE:** To abort a make command press `Ctrl-c`
+
+For more details on the QMK build process see [Make Instructions](/Make-Instructions.md).
+
+### Simple instructions for building and uploading a keyboard
+
+**Most keyboards have more specific instructions in the keyboard specific readme.md file, so please check that first**
+
+1. Enter the `root` folder
+2. Run `make <keyboard>-<subproject>-<keymap>-<programmer>`
+
+In the above commands, replace:
+
+* `<keyboard>` with the name of your keyboard
+* `<keymap>` with the name of your keymap
+* `<subproject>` with the name of the subproject (revision or sub-model of your keyboard). For example, for Ergodox it can be `ez` or `infinity`, and for Planck `rev3` or `rev4`.
+  * If the keyboard doesn't have a subproject, or if you are happy with the default (defined in `rules.mk` file of the `keyboard` folder), you can leave it out. But remember to also remove the dash (`-`) from the command.
+* `<programmer>` The programmer to use. Most keyboards use `dfu`, but some use `teensy`. Infinity keyboards use `dfu-util`. Check the readme file in the keyboard folder to find out which programmer to use.
+  * If you  don't add `-<programmer` to the command line, the firmware will be still be compiled into a hex file, but the upload will be skipped.
+
+**NOTE:** Some operating systems will refuse to program unless you run the make command as root for example `sudo make clueboard-default-dfu`
+
+## Make Examples
+
+* Build all Clueboard keymaps: `make clueboard`
+* Build the default Planck keymap: `make planck-rev4-default`
+* Build and flash your ergodox-ez: `make ergodox-ez-default-teensy`
+
+# The `config.h` file
+
+There are 2 `config.h` locations:
+
+* keyboard (`/keyboards/<keyboard>/`)
+* keymap (`/keyboards/<keyboard>/keymaps/<keymap>/`)
+
+The keyboard `config.h` is included only if the keymap one doesn't exist. The format to use for your custom one [is here](https://github.com/qmk/qmk_firmware/blob/master/doc/keymap_config_h_example.h). If you want to override a setting from the parent `config.h` file, you need to do this:
+
+```c
+#undef MY_SETTING
+#define MY_SETTING 4
+```
+
+For a value of `4` for this imaginary setting. So we `undef` it first, then `define` it.
+
+You can then override any settings, rather than having to copy and paste the whole thing.

+ 1 - 0
docs/Report-Descriptor.md

@@ -0,0 +1 @@
+# Get Report Descriptor with lsusb

+ 26 - 0
docs/SUMMARY.md

@@ -0,0 +1,26 @@
+
+### Getting started 
+* [Introduction](/Home.md)
+* [QMK Overview](/QMK-Overview.md)
+* [Build Environment Setup](/Build-Environment-Setup.md)
+
+### Making a keymap
+* [Keymap overview](/Keymap.md)
+* [Keycodes](/Keycodes.md)
+* [Layer switching](/Key-Functions.md)
+* [Leader Key](/Leader-Key.md)
+* [Macros](/Macros.md)
+* [Space Cadet](/Space-Cadet-Shift.md)
+* [Tap Dance](/Tap-Dance.md)
+* [Mouse keys](/Mouse-keys.md)
+* [FAQ: Creating a Keymap](/FAQ-Keymap.md)
+* [FAQ: Compiling QMK](/FAQ-Build.md)
+  
+### For hardware makers and modders
+* [Modding your keyboard](/Modding-your-keyboard.md)
+* [Porting your keyboard to QMK](/Porting-your-keyboard-to-QMK.md)
+* [Adding features to QMK](/Adding-features-to-QMK.md)
+  
+### Other topics
+* [General FAQ](/FAQ.md)
+* [Differences from TMK](/Differences-from-TMK.md)

+ 24 - 0
docs/Space-Cadet-Shift.md

@@ -0,0 +1,24 @@
+## Space Cadet Shift: The future, built in
+
+Steve Losh [described](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) the Space Cadet Shift quite well. Essentially, you hit the left Shift on its own, and you get an opening parenthesis; hit the right Shift on its own, and you get the closing one. When hit with other keys, the Shift key keeps working as it always does. Yes, it's as cool as it sounds.
+
+To use it, use `KC_LSPO` (Left Shift, Parens Open) for your left Shift on your keymap, and `KC_RSPC` (Right Shift, Parens Close) for your right Shift.
+
+It's defaulted to work on US keyboards, but if your layout uses different keys for parenthesis, you can define those in your `config.h` like this:
+
+    #define LSPO_KEY KC_9
+    #define RSPC_KEY KC_0
+
+You can also choose between different rollover behaviors of the shift keys by defining:
+
+    #define DISABLE_SPACE_CADET_ROLLOVER
+
+in your `config.h`. Disabling rollover allows you to use the opposite shift key to cancel the space cadet state in the event of an erroneous press instead of emitting a pair of parentheses when the keys are released.
+
+The only other thing you're going to want to do is create a `Makefile` in your keymap directory and set the following:
+
+```
+COMMAND_ENABLE   = no  # Commands for debug and configuration
+```
+
+This is just to keep the keyboard from going into command mode when you hold both Shift keys at the same time.

+ 34 - 0
docs/TMK-Based-Projects.md

@@ -0,0 +1,34 @@
+## TMK based projects
+Add your project here!
+See https://github.com/tmk/tmk_keyboard/issues/173
+
+### keyboards
+**S60-X**: [DIY 60% keyboard](https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open) designed by [VinnyCordeiro](https://github.com/VinnyCordeiro) for Sentraq:
+- https://github.com/VinnyCordeiro/tmk_keyboard
+
+**Octagon V1**: Korean custom keyboard designed by Duck.
+- https://github.com/xauser/tmk_keyboard/tree/xauser
+
+**Compact L3**: Custom keyboard designed by LifeZone and LeeKu.
+- https://github.com/xauser/tmk_keyboard/tree/xauser
+
+**KMAC, 1,2 and Happy**: Custom keyboard designed by kbdmania.
+- https://github.com/ageaenes/tmk_keyboard
+
+**P60**: [DIY wired 60% keyboard](https://imgur.com/a/zwsDN) by [p3lim](https://github.com/p3lim).
+- https://github.com/p3lim/keyboard_firmware
+
+**Nerd, Kitten Paw, Lightsaber, Phantom, Lightpad, Ergodox** on [xauser](https://github.com/xauser)'s repository
+- https://github.com/xauser/tmk_keyboard/tree/xauser
+
+**ErgoDox** on [cub-unanic](https://github.com/cub-uanic)'s repository
+- https://github.com/cub-uanic/tmk_keyboard/tree/master/keyboard/ergodox
+
+**Atreus** by [technomancy](https://atreus.technomancy.us)
+- https://github.com/technomancy/tmk_keyboard/tree/atreus/keyboard/atreus
+
+**[mcdox](https://github.com/DavidMcEwan/mcdox)**
+- https://github.com/DavidMcEwan/tmk_keyboard/tree/master/keyboard/mcdox
+
+
+### converters

+ 69 - 0
docs/TMK-Own-Projects.md

@@ -0,0 +1,69 @@
+## TMK own projects by hasu
+Located in [tmk_keyboard](https://github.com/tmk/tmk_keyboard/tree/master/) repository.
+
+### converter                                                                                                                                                                                          
+* [ps2_usb]         - [PS/2 keyboard to USB][GH_ps2]
+* [adb_usb]         - [ADB keyboard to USB][GH_adb]
+* [m0110_usb]       - [Macintosh 128K/512K/Plus keyboard to USB][GH_m0110]
+* [terminal_usb]    - [IBM Model M terminal keyboard(PS/2 scancode set3) to USB][GH_terminal]
+* [news_usb]        - [Sony NEWS keyboard to USB][GH_news]
+* [x68k_usb]        - [Sharp X68000 keyboard to USB][GH_x68k]
+* [sun_usb]         - [Sun] to USB(type4, 5 and 3?)
+* [pc98_usb]        - [PC98] to USB
+* [usb_usb]         - USB to USB(experimental)
+* [ascii_usb]       - ASCII(Serial console terminal) to USB
+* [ibm4704_usb]     - [IBM 4704 keyboard Converter][GH_ibm4704]
+                   
+### keyboard 
+* [hhkb]            - [Happy Hacking Keyboard pro][GH_hhkb]
+* [gh60]            - [GH60][GH60_diy] DIY 60% keyboard [prototype][GH60_proto]
+* [hbkb]            - [Happy Buckling spring keyboard][GH_hbkb](IBM Model M 60% mod)
+* [hid_liber]       - [HID liberation][HID_liber] controller (by alaricljs)
+* [phantom]         - [Phantom] keyboard (by Tranquilite)
+* [IIgs_Standard]   - Apple [IIGS] keyboard mod(by JeffreySung)
+* [macway]          - [Compact keyboard mod][GH_macway] [retired]
+* [KMAC]            - Korean custom keyboard
+* [Lightsaber]      - Korean custom keyboard
+             
+[ps2_usb]:              https://github.com/tmk/tmk_keyboard/tree/master/converter/ps2_usb/
+[adb_usb]:              https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb/
+[m0110_usb]:            https://github.com/tmk/tmk_keyboard/tree/master/converter/m0110_usb
+[terminal_usb]:         https://github.com/tmk/tmk_keyboard/tree/master/converter/terminal_usb/
+[news_usb]:             https://github.com/tmk/tmk_keyboard/tree/master/converter/news_usb/
+[x68k_usb]:             https://github.com/tmk/tmk_keyboard/tree/master/converter/x68k_usb/
+[sun_usb]:              https://github.com/tmk/tmk_keyboard/tree/master/converter/sun_usb/
+[pc98_usb]:             https://github.com/tmk/tmk_keyboard/tree/master/converter/pc98_usb/
+[usb_usb]:              https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb/
+[ascii_usb]:            https://github.com/tmk/tmk_keyboard/tree/master/converter/ascii_usb/
+[ibm4704_usb]:          https://github.com/tmk/tmk_keyboard/tree/master/converter/ibm4704_usb
+[hhkb]:                 https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hhkb/
+[gh60]:                 https://github.com/tmk/tmk_keyboard/tree/master/keyboard/gh60/
+[hbkb]:                 https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hbkb/
+[hid_liber]:            https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hid_liber/
+[phantom]:              https://github.com/tmk/tmk_keyboard/tree/master/keyboard/phantom/
+[IIgs_Standard]:        https://github.com/tmk/tmk_keyboard/tree/master/keyboard/IIgs/
+[macway]:               https://github.com/tmk/tmk_keyboard/tree/master/keyboard/macway/
+[KMAC]:                 https://github.com/tmk/tmk_keyboard/tree/master/keyboard/kmac/
+[Lightsaber]:           https://github.com/tmk/tmk_keyboard/tree/master/keyboard/lightsaber/
+             
+[GH_macway]:    http://geekhack.org/showwiki.php?title=Island:11930
+[GH_hhkb]:      http://geekhack.org/showwiki.php?title=Island:12047
+[GH_ps2]:       http://geekhack.org/showwiki.php?title=Island:14618
+[GH_adb]:       http://geekhack.org/showwiki.php?title=Island:14290
+[GH_hhkb_bt]:   http://geekhack.org/showwiki.php?title=Island:20851
+[GH_m0110]:     http://geekhack.org/showwiki.php?title=Island:24965
+[GH_news]:      http://geekhack.org/showwiki.php?title=Island:25759
+[GH_terminal]:  http://geekhack.org/showwiki.php?title=Island:27272
+[GH_x68k]:      http://geekhack.org/showwiki.php?title=Island:29060
+[GH_hbkb]:      http://geekhack.org/showwiki.php?title=Island:29483
+[GH_ibm4704]:   http://geekhack.org/index.php?topic=54706.0
+[HID_liber]:    http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions
+[Phantom]:      http://geekhack.org/index.php?topic=26742
+[GH60_diy]:     http://geekhack.org/index.php?topic=34959
+[GH60_proto]:   http://geekhack.org/index.php?topic=37570.0
+[PC98]:         http://en.wikipedia.org/wiki/NEC_PC-9801
+[Sun]:          http://en.wikipedia.org/wiki/Sun-3
+[IIGS]:         http://en.wikipedia.org/wiki/Apple_IIGS
+
+
+See other [[TMK Based Projects]]

doc/TMK_README.md → docs/TMK_README.md


Разница между файлами не показана из-за своего большого размера
+ 144 - 0
docs/Tap-Dance.md


+ 17 - 0
docs/Test-for-ASCIIDOC.asciidoc

@@ -0,0 +1,17 @@
+
+
+
+.Makefile
+[source,Makefile]
+----
+# Build Options
+#   comment out to disable the options.
+#
+BOOTMAGIC_ENABLE = yes  # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes   # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes   # Audio control and System control(+450)
+CONSOLE_ENABLE = yes    # Console for debug(+400)
+COMMAND_ENABLE = yes    # Commands for debug and configuration
+#SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
+NKRO_ENABLE = yes       # USB Nkey Rollover - not yet supported in LUFA
+----

+ 11 - 0
docs/USB-HID.md

@@ -0,0 +1,11 @@
+# Getting Report Descriptor
+```
+  $ cd /sys/bus/usb/drivers/usbhid
+  $ ls
+  1-1.3.4:1.0  1-1.3.4:1.2  bind    new_id     uevent
+  1-1.3.4:1.1  1-1.3.4:1.3  module  remove_id  unbind
+  $ echo -n 1-1.4\:1.0 | sudo tee unbind
+  $ sudo lsusb -vvv -d 046d:c01d
+  $ echo -n 1-1.4\:1.0 | sudo tee bind
+```
+

doc/USB_NKRO.txt → docs/USB_NKRO.txt


+ 54 - 0
docs/Unicode-and-additional-language-support.md

@@ -0,0 +1,54 @@
+## Unicode support
+
+There are three Unicode keymap definition method available in QMK:
+
+### UNICODE_ENABLE
+
+Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in
+keymap file, where *n* is a 4 digit hexadecimal.
+
+### UNICODEMAP_ENABLE
+
+Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping
+table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file.
+The keycode function is `X(n)` where *n* is the array index of the mapping
+table.
+
+### UCIS_ENABLE
+
+TBD
+
+Unicode input in QMK works by inputing a sequence of characters to the OS,
+sort of like macro. Unfortunately, each OS has different ideas on how Unicode is inputted.
+
+This is the current list of Unicode input method in QMK:
+
+* UC_OSX: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex.
+* UC_LNX: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else.
+* UC_WIN: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead.
+* UC_WINC: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows.
+
+## Additional language support
+
+In `quantum/keymap_extras/`, you'll see various language files - these work the same way as the alternative layout ones do. Most are defined by their two letter country/language code followed by an underscore and a 4-letter abbreviation of its name. `FR_UGRV` which will result in a `ù` when using a software-implemented AZERTY layout. It's currently difficult to send such characters in just the firmware.
+
+## International Characters on Windows
+
+[AutoHotkey](https://autohotkey.com) allows Windows users to create custom hotkeys among others.
+
+The method does not require Unicode support in the keyboard itself but depends instead of AutoHotkey running in the background.
+
+First you need to select a modifier combination that is not in use by any of your programs.
+CtrlAltWin is not used very widely and should therefore be perfect for this.
+There is a macro defined for a mod-tab combo `LCAG_T`.
+Add this mod-tab combo to a key on your keyboard, e.g.: `LCAG_T(KC_TAB)`.
+This makes the key behave like a tab key if pressed and released immediately but changes it to the modifier if used with another key.
+
+In the default script of AutoHotkey you can define custom hotkeys.
+
+    <^<!<#a::Send, ä
+    <^<!<#<+a::Send, Ä
+
+The hotkeys above are for the combination CtrlAltGui and CtrlAltGuiShift plus the letter a.
+AutoHotkey inserts the Text right of `Send, ` when this combination is pressed.
+

Разница между файлами не показана из-за своего большого размера
+ 68 - 0
docs/Unit-testing.md


doc/VAGRANT_GUIDE.md → docs/VAGRANT_GUIDE.md


+ 21 - 0
docs/_Sidebar.md

@@ -0,0 +1,21 @@
+* [Wiki Home](/qmk/qmk_firmware/wiki)
+* Getting started
+  * [QMK Overview](QMK-Overview)
+  * [Build Environment Setup](Build-Environment-Setup)
+* [Overview for keymap creators](Keymap)
+ * [Keycodes](Keycodes)
+ * [Layer switching](Key-Functions)
+ * [Leader Key](Leader-Key)
+ * [Macros](Macros)
+ * [Space Cadet](Space-Cadet-Shift)
+ * [Tap Dance](Tap-Dance)
+ * [Mouse keys](Mouse-keys)
+ * [FAQ: Creating a Keymap](FAQ-Keymap)
+ * [FAQ: Compiling QMK](FAQ-Build)
+* For hardware makers and modders
+  * [Modding your keyboard](Modding-your-keyboard)
+  * [Porting your keyboard to QMK](Porting-your-keyboard-to-QMK)
+  * [Adding features to QMK](Adding-features-to-QMK)
+* [General FAQ](FAQ)
+
+

doc/basic_how_keyboards_work.md → docs/basic_how_keyboards_work.md


doc/build_old.md → docs/build_old.md


BIN
docs/gitbook/images/favicon.ico


BIN
docs/gitbook/images/favicon.png


doc/keycode.txt → docs/keycode.txt


doc/keymap_config_h_example.h → docs/keymap_config_h_example.h


doc/keymap_makefile_example.mk → docs/keymap_makefile_example.mk


doc/keymap.md → docs/keymap_old.md


Разница между файлами не показана из-за своего большого размера
+ 36 - 0
docs/mbed-cortex-porting.md


doc/other_projects.md → docs/other_projects.md


+ 15 - 0
keyboards/amj60/amj60.h

@@ -147,6 +147,21 @@
     {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d}  \
 }
 
+#define KEYMAP_MAX( \
+    k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k49,\
+    k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
+    k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b,      k2d, \
+    k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \
+    k40, k41, k42,           k45,                     k4a, k4b, k4c, k4d  \
+) \
+{ \
+    {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \
+    {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \
+    {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \
+    {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \
+    {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d}  \
+}
+
 void matrix_init_user(void);
 void matrix_scan_user(void);
 

+ 61 - 0
keyboards/amj60/keymaps/maximized/keymap.c

@@ -0,0 +1,61 @@
+// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
+// this is the style you want to emulate.
+
+#include "amj60.h"
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _DEF 0
+#define _SPC 1
+
+// dual-role shortcuts
+#define SPACEDUAL LT(_SPC, KC_SPACE)
+
+
+// increase readability 
+#define _______ KC_TRNS
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    /* Keymap _DEF: Default Layer
+     * ,-----------------------------------------------------------.
+     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =| \ | ~ |
+     * |-----------------------------------------------------------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| bspc|
+     * |-----------------------------------------------------------|
+     * |Caps   | A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '| Return |
+     * |-----------------------------------------------------------|
+     * |Sft | Fn0|  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /| Sft |Fn2|
+     * |-----------------------------------------------------------|
+     * |Ctrl|Win |Alt |      Space/Fn0         |Alt |Win |Menu|RCtl|
+     * `-----------------------------------------------------------'
+     */
+    [_DEF] = KEYMAP_MAX(
+        KC_ESC,   KC_1,    KC_2,    KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9,    KC_0,    KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \
+        KC_TAB,   KC_Q,    KC_W,    KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O,    KC_P,    KC_LBRC, KC_RBRC,    KC_BSPC,  \
+        KC_CAPS,  KC_A,    KC_S,    KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,    KC_SCLN, KC_QUOT, KC_ENT,   \
+        KC_LSFT,  F(0),    KC_Z,    KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT,    F(1),     \
+        KC_LCTL,  KC_LALT, KC_LGUI,             SPACEDUAL,                       KC_RGUI, KC_RALT, KC_RCTL,    F(2)),
+
+    /* Keymap 1: F-and-vim Layer, modified with Space (by holding space)
+     * ,-----------------------------------------------------------.
+     * |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|   |  |
+     * |-----------------------------------------------------------|
+     * |    |Paus| Up| [ | ] |   |   |   | ( | ) |   |   |   | Del |
+     * |-----------------------------------------------------------|
+     * |      |Lft|Dwn|Rgt|   |   |Left|Down|Right|Up|  |   | PLAY |
+     * |-----------------------------------------------------------|
+     * |    |   |   |   | < | > |   |M0 |   |   |   |   | Vol+ |   |
+     * |-----------------------------------------------------------|
+     * |    |    |    |                        |Alt |Prev|Vol-|Next|
+     * `-----------------------------------------------------------'
+     */
+    [_SPC] = KEYMAP_MAX(
+        KC_PSCR, KC_F1,   KC_F2,   KC_F3,    KC_F4,   KC_F5,   KC_F6,    KC_F7,     KC_F8,     KC_F9,   KC_F10,  KC_F11,  KC_F12,  _______, _______,  \
+        _______, KC_PAUS, KC_UP,   _______,  _______, _______, _______,  _______, _______, _______, _______, _______, _______, KC_DEL, \
+        _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT,  KC_DOWN,   KC_UP,     KC_RGHT, _______, _______, KC_MPLY, \
+        _______, _______, _______, _______,  _______, _______, KC_SPACE, M(0),      _______,   _______, _______, _______, KC_VOLU, _______, \
+        _______, _______, _______,                                  _______,                                 _______, KC_MPRV, KC_VOLD, KC_MNXT),
+
+};

+ 16 - 1
keyboards/amjpad/amjpad.h

@@ -39,7 +39,22 @@
 	{k40, k41, k42, k43}, \
 	{k50, XXX, k52, XXX} \
 }
-
+#define MAXKEYMAP( \
+    k00, k01, k02, k03, \
+	k10, k11, k12, k13, \
+	k20, k21, k22, k23, \
+	k30, k31, k32, k33, \
+	k40, k41, k42, k43, \
+	k50, k51, k52, k53\
+) \
+{ \
+	{k00, k01, k02, k03}, \
+	{k10, k11, k12, k13}, \
+	{k20, k21, k22, k23}, \
+	{k30, k31, k32, k33}, \
+	{k40, k41, k42, k43}, \
+	{k50, k51, k52, k53} \
+}
 void matrix_init_user(void);
 void matrix_scan_user(void);
 

+ 102 - 0
keyboards/amjpad/keymaps/max/keymap.c

@@ -0,0 +1,102 @@
+#include "amjpad.h"
+
+#ifdef RGBLIGHT_ENABLE
+#include "rgblight.h"
+#endif
+
+// Used for SHIFT_ESC
+#define MODS_CTRL_MASK  (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _BL 0
+#define _FL 1
+
+#define _______ KC_TRNS
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+  /* Keymap _BL: (Base Layer) Default Layer
+   * ,-------------------.
+   * |Esc |Setp| -  | =  |
+   * |----|----|----|----|
+   * | F1 | F2 | F3 | F4 |
+   * |----|----|----|----|
+   * | 7  | 8  | 9  |  - |
+   * |----|----|----|----|
+   * | 4  | 5  | 6  | LF |
+   * |----|----|----|----|
+   * | 1  | 2  | 3  | \  |
+   * |----|----|----|----|
+   * |Left|Down| Up |Rght|
+   * `-------------------'
+   */
+
+[_BL] = MAXKEYMAP(
+
+  KC_ESC,  KC_TAB,  KC_MINS,KC_EQL,  \
+  KC_F1,   KC_F2,   KC_F3,  KC_F4,   \
+  KC_P7,   KC_P8,   KC_P9,  KC_PMNS, \
+  KC_P4,   KC_P5,   KC_P6,  KC_PENT, \
+  KC_P1,   KC_P2,   KC_P3,  KC_BSLS, \
+  KC_LEFT, KC_DOWN, KC_UP,  KC_RIGHT),
+
+  /* Keymap _FL: Function Layer
+   * ,-------------------.
+   * |Esc |TAB |BS  | =  |
+   * |----|----|----|----|
+   * | NL | /  | *  | -  |
+   * |----|----|----|----|
+   * | 7  | 8  | 9  |    |
+   * |----|----|----|RST |
+   * | 4  | 5  | 6  |    |
+   * |----|----|----|----|
+   * | 1  | 2  | 3  |    |
+   * |----|----|----| En |
+   * |   0     |./FN|    |
+   * `-------------------'
+   */
+[_FL] = MAXKEYMAP(
+
+  KC_ESC,KC_TAB,KC_BSPC,KC_PEQL, \
+  KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
+  KC_P7, KC_P8, KC_P9, RESET,  \
+  KC_P4, KC_P5, KC_P6, KC_PENT, \
+  KC_P1, KC_P2, KC_P3, KC_PENT, \
+  KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT),
+};
+
+enum function_id {
+    SHIFT_ESC,
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+  [0]  = ACTION_FUNCTION(SHIFT_ESC),
+};
+
+void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
+  static uint8_t shift_esc_shift_mask;
+  switch (id) {
+    case SHIFT_ESC:
+      shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
+      if (record->event.pressed) {
+        if (shift_esc_shift_mask) {
+          add_key(KC_GRV);
+          send_keyboard_report();
+        } else {
+          add_key(KC_ESC);
+          send_keyboard_report();
+        }
+      } else {
+        if (shift_esc_shift_mask) {
+          del_key(KC_GRV);
+          send_keyboard_report();
+        } else {
+          del_key(KC_ESC);
+          send_keyboard_report();
+        }
+      }
+      break;
+  }
+}

+ 65 - 0
keyboards/amjpad/keymaps/ortho_left/keymap.c

@@ -0,0 +1,65 @@
+#include "amjpad.h"
+
+#ifdef RGBLIGHT_ENABLE
+#include "rgblight.h"
+#endif
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _BL 0
+#define _FL 1
+
+#define _______ KC_TRNS
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+  /* Keymap _BL: (Base Layer) Default Layer
+   * ,-------------------.
+   * | T  | G  | B  |Spac|
+   * |----|----|----|----|
+   * | R  | F  | V  | Fn |
+   * |----|----|----|----|
+   * | E  | D  | C  | OS |
+   * |----|----|----|----|
+   * | W  | S  | X  | Alt|
+   * |----|----|----|----|
+   * | Q  | A  | Z  | Ctl|
+   * |----|----|----|----|
+   * | Esc| Tab|Shft| Fn2|
+   * `-------------------'
+   */
+
+[_BL] = MAXKEYMAP(
+
+  KC_T,   KC_G,   KC_B,      KC_SPACE,\
+  KC_R,   KC_F,   KC_V,      MO(1),    \
+  KC_E,   KC_D,   KC_C,      KC_LGUI, \
+  KC_W,   KC_S,   KC_X,      KC_LALT, \
+  KC_Q,   KC_A,   KC_Z,      KC_LCTL, \
+  KC_TAB, KC_ESC, KC_LSHIFT, MO(1)),
+
+  /* Keymap _FL: Function Layer
+   * ,-------------------.
+   * | 5  | F5 | F11|Spac|
+   * |----|----|----|----|
+   * | 4  | F4 | F10|    |
+   * |----|----|----|----|
+   * | 3  | F3 | F9 | OS |
+   * |----|----|----|----|
+   * | 2  | F2 | F8 | Alt|
+   * |----|----|----|----|
+   * | 1  | F1 | F7 | Ctl|
+   * |----|----|----|----|
+   * | `  | Del|Shft|    |
+   * `-------------------'
+   */
+[_FL] = MAXKEYMAP(
+
+  KC_5,  KC_F5,  KC_F11,  _______, \
+  KC_4,  KC_F4,  KC_F10,  _______, \
+  KC_3,  KC_F3,  KC_F9,   _______, \
+  KC_2,  KC_F2,  KC_F8,   _______, \
+  KC_1,  KC_F1,  KC_F7,   _______, \
+  KC_GRV,KC_DEL, _______, _______),
+};

+ 65 - 0
keyboards/amjpad/keymaps/ortho_right/keymap.c

@@ -0,0 +1,65 @@
+#include "amjpad.h"
+
+#ifdef RGBLIGHT_ENABLE
+#include "rgblight.h"
+#endif
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _BL 0
+#define _FL 1
+
+#define _______ KC_TRNS
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+  /* Keymap _BL: (Base Layer) Default Layer
+   * ,-------------------.
+   * |Spac| N  | H  | Y  |
+   * |----|----|----|----|
+   * | Fn | M  | J  | U  |
+   * |----|----|----|----|
+   * |Left| ,  | K  | I  |
+   * |----|----|----|----|
+   * |Down| .  | L  | O  |
+   * |----|----|----|----|
+   * | Up | /  | ;  | P  |
+   * |----|----|----|----|
+   * |Rght| Ret| "  |Bspc|
+   * `-------------------'
+   */
+
+[_BL] = MAXKEYMAP(
+
+  KC_SPACE, KC_N,     KC_H,      KC_Y, \
+  MO(1),    KC_M,     KC_J,      KC_U, \
+  KC_LEFT,  KC_COMM,  KC_K,      KC_I, \
+  KC_DOWN,  KC_DOT,   KC_L,      KC_O, \
+  KC_UP,    KC_SLASH, KC_SCLN,   KC_P, \
+  KC_RIGHT, KC_ENT,   KC_QUOT,   KC_BSPC),
+
+  /* Keymap _FL: Function Layer
+   * ,-------------------.
+   * |Esc | F12| F6 | 6  |
+   * |----|----|----|----|
+   * | NL | M  | -  | 7  |
+   * |----|----|----|----|
+   * |Left| ,  | =  | 8  |
+   * |----|----|----|----|
+   * |Down| .  | [  | 9  |
+   * |----|----|----|----|
+   * | Up | /  | ]  | 0  |
+   * |----|----|----|----|
+   * |Rght| Ret| \  | Del|
+   * `-------------------'
+   */
+[_FL] = MAXKEYMAP(
+
+  _______, KC_F12,  KC_F6,   KC_6, \
+  _______, _______, KC_MINS, KC_7, \
+  _______, _______, KC_EQL,  KC_8, \
+  _______, _______, KC_LBRC, KC_9, \
+  _______, _______, KC_RBRC, KC_0, \
+  _______, _______, KC_BSLS, KC_DEL),
+};

+ 2 - 2
keyboards/atomic/keymaps/pvc/keymap.c

@@ -255,7 +255,7 @@ float tone_scroll_off[][2] = SONG(SCROLL_LOCK_OFF_SOUND);
 
 #endif /* AUDIO_ENABLE */
 
-void persistant_default_layer_set(uint16_t default_layer)
+void persistent_default_layer_set(uint16_t default_layer)
 {
     eeconfig_update_default_layer(default_layer);
     default_layer_set(default_layer);
@@ -366,7 +366,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
         case MACRO_QWERTY:
             if (record->event.pressed)
             {
-                persistant_default_layer_set(1UL<<LAYER_QWERTY);
+                persistent_default_layer_set(1UL<<LAYER_QWERTY);
             }
             break;
 

+ 5 - 5
keyboards/atreus/keymaps/xyverz/keymap.c

@@ -168,7 +168,7 @@ const uint16_t PROGMEM fn_actions[] = {
 
 };
 
-void persistant_default_layer_set(uint16_t default_layer) {
+void persistent_default_layer_set(uint16_t default_layer) {
   eeconfig_update_default_layer(default_layer);
   default_layer_set(default_layer);
 }
@@ -177,25 +177,25 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
   switch (keycode) {
         case QWERTY:
           if (record->event.pressed) {
-            persistant_default_layer_set(1UL<<_QWERTY);
+            persistent_default_layer_set(1UL<<_QWERTY);
           }
           return false;
           break;
         case COLEMAK:
           if (record->event.pressed) {
-            persistant_default_layer_set(1UL<<_COLEMAK);
+            persistent_default_layer_set(1UL<<_COLEMAK);
           }
           return false;
           break;
         case DVORAK:
           if (record->event.pressed) {
-            persistant_default_layer_set(1UL<<_DVORAK);
+            persistent_default_layer_set(1UL<<_DVORAK);
           }
           return false;
           break;
         case DVORMAC:
           if (record->event.pressed) {
-            persistant_default_layer_set(1UL<<_DVORMAC);
+            persistent_default_layer_set(1UL<<_DVORMAC);
           }
           return false;
           break;

+ 5 - 5
keyboards/atreus62/keymaps/xyverz/keymap.c

@@ -119,7 +119,7 @@ const uint16_t PROGMEM fn_actions[] = {
 
 };
 
-void persistant_default_layer_set(uint16_t default_layer) {
+void persistent_default_layer_set(uint16_t default_layer) {
   eeconfig_update_default_layer(default_layer);
   default_layer_set(default_layer);
 }
@@ -128,25 +128,25 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
   switch (keycode) {
         case QWERTY:
           if (record->event.pressed) {
-            persistant_default_layer_set(1UL<<_QWERTY);
+            persistent_default_layer_set(1UL<<_QWERTY);
           }
           return false;
           break;
         case COLEMAK:
           if (record->event.pressed) {
-            persistant_default_layer_set(1UL<<_COLEMAK);
+            persistent_default_layer_set(1UL<<_COLEMAK);
           }
           return false;
           break;
         case DVORAK:
           if (record->event.pressed) {
-            persistant_default_layer_set(1UL<<_DVORAK);
+            persistent_default_layer_set(1UL<<_DVORAK);
           }
           return false;
           break;
         case WOW:
           if (record->event.pressed) {
-            persistant_default_layer_set(1UL<<_WOW);
+            persistent_default_layer_set(1UL<<_WOW);
           }
           return false;
           break;

+ 86 - 0
keyboards/clueboard/keymaps/jokrik/keymap.c

@@ -0,0 +1,86 @@
+#include "clueboard.h"
+
+// Helpful defines
+#define GRAVE_MODS  (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
+#define _______ KC_TRNS
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _BL 0
+#define _FL 1
+#define _CL 2
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+  /* Keymap _BL: Base Layer (Default Layer)
+   */
+[_BL] = KEYMAP(
+  KC_ESC,  KC_1,    KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,    KC_0,     KC_MINS,  KC_EQL,   KC_BSLS,  KC_GRV,          KC_PSCR, \
+  KC_TAB,  KC_Q,    KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,    KC_P,     KC_LBRC,  KC_RBRC,  KC_BSPC,                   KC_PAUS, \
+  KC_LCTL, KC_A,    KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,    KC_SCLN,  KC_QUOT,  KC_NUHS,  KC_ENT,                             \
+  KC_LSFT, KC_NUBS, KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM, KC_DOT,   KC_SLSH,  KC_RO,    KC_RSFT,          KC_UP,            \
+  KC_LCTL, KC_LGUI, KC_LALT, KC_SPC,           KC_SPC,KC_SPC,                        KC_SPC,   KC_RALT,  MO(_FL),  KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
+
+  /* Keymap _FL: Function Layer
+   */
+[_FL] = KEYMAP(
+  KC_GRV,  KC_F1,   KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9,   KC_F10,   KC_F11,   KC_F12,   KC_INS,  KC_DEL,           BL_STEP, \
+  _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS,  _______,  _______,  _______,                   _______, \
+  _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,                           \
+  _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,          KC_PGUP,         \
+  _______, _______, _______, _______,        _______,_______,                        _______,  _______,  MO(_FL),  _______, KC_HOME, KC_PGDN, KC_END),
+
+  /* Keymap _CL: Control layer
+   */
+[_CL] = KEYMAP(
+  _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______, RGB_TOG,             RGB_VAI, \
+  _______, _______, _______,_______,RESET,  _______,_______,_______,_______,_______, _______,  _______,  _______,  _______,                   RGB_VAD, \
+  _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,                         \
+  MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,          RGB_SAI,          \
+  _______, _______, _______,_______,        RGB_MOD,   RGB_MOD,                      _______,  _______,  MO(_FL),  _______, RGB_HUD,    RGB_SAD,    RGB_HUI),
+};
+
+/* This is a list of user defined functions. F(N) corresponds to item N
+   of this list.
+ */
+const uint16_t PROGMEM fn_actions[] = {
+  [0] = ACTION_FUNCTION(0),  // Calls action_function()
+};
+
+void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
+  static uint8_t mods_pressed;
+  static bool mod_flag;
+
+  switch (id) {
+    case 0:
+      /* Handle the combined Grave/Esc key
+       */
+      mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
+
+      if (record->event.pressed) {
+        /* The key is being pressed.
+         */
+        if (mods_pressed) {
+          mod_flag = true;
+          add_key(KC_GRV);
+          send_keyboard_report();
+        } else {
+          add_key(KC_ESC);
+          send_keyboard_report();
+        }
+      } else {
+        /* The key is being released.
+         */
+        if (mod_flag) {
+          mod_flag = false;
+          del_key(KC_GRV);
+          send_keyboard_report();
+        } else {
+          del_key(KC_ESC);
+          send_keyboard_report();
+        }
+      }
+      break;
+  }
+}

+ 11 - 0
keyboards/clueboard/keymaps/jokrik/readme.md

@@ -0,0 +1,11 @@
+```
+ ___     _____ _            _                         _     __    __ _   __
+|__ \   / ____| |          | |                       | |   / /   / /(_) / /
+ ||) | | |    | |_   _  ___| |__   ___   __ _ _ __ __| |  / /_  / /_   / /
+ |/ /  | |    | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
+ |_|   | |____| | |_| |  __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
+ (_)    \_____|_|\__,_|\___|_.__/ \___/ \__,_|_|  \__,_|  \___/ \___/_/ (_)
+```
+
+# Jokrik's Clueboard Layout
+

+ 7 - 14
keyboards/clueboard/keymaps/mac_optimized/keymap.c

@@ -50,35 +50,28 @@ const uint16_t PROGMEM fn_actions[] = {
 
 void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
   static uint8_t mods_pressed;
-  static bool mod_flag;
 
   switch (id) {
     case 0:
       /* Handle the combined Grave/Esc key
        */
-      mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
-
       if (record->event.pressed) {
         /* The key is being pressed.
          */
+        mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
         if (mods_pressed) {
-          mod_flag = true;
-          add_key(KC_GRV);
-          send_keyboard_report();
+          register_code(KC_GRV);
         } else {
-          add_key(KC_ESC);
-          send_keyboard_report();
+          register_code(KC_ESC);
         }
       } else {
         /* The key is being released.
          */
-        if (mod_flag) {
-          mod_flag = false;
-          del_key(KC_GRV);
-          send_keyboard_report();
+        if (mods_pressed) {
+          mods_pressed = false;
+          unregister_code(KC_GRV);
         } else {
-          del_key(KC_ESC);
-          send_keyboard_report();
+          unregister_code(KC_ESC);
         }
       }
       break;

+ 4 - 0
keyboards/clueboard/keymaps/serubin/Makefile

@@ -0,0 +1,4 @@
+
+MOUSEKEY_ENABLE = yes
+EXTRAKEY_ENABLE = yes
+

+ 103 - 0
keyboards/clueboard/keymaps/serubin/keymap.c

@@ -0,0 +1,103 @@
+#include "clueboard.h"
+
+// Helpful defines
+#define GRAVE_MODS  (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
+#define _______ KC_TRNS
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _BL 0
+#define _FL 1
+#define _ME 2
+#define _CL 3
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+  /* Keymap _BL: Base Layer (Default Layer)
+   */
+[_BL] = KEYMAP(
+  KC_GRV,    KC_1,    KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,    KC_0,     KC_MINS,  KC_EQL,   KC_GRV,  KC_BSPC,          KC_PGUP, \
+  KC_TAB,  KC_Q,    KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,    KC_P,     KC_LBRC,  KC_RBRC,  KC_BSLS,                   KC_PGDN, \
+  F(1), KC_A,    KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,    KC_SCLN,  KC_QUOT,  KC_NUHS,  KC_ENT,                             \
+  KC_LSFT, KC_NUBS, KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM, KC_DOT,   KC_SLSH,  KC_RO,    KC_RSFT,          KC_UP,            \
+  KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN,          KC_SPC,KC_SPC,                        KC_HENK,  KC_RGUI,  MO(_FL),  MO(_ME), KC_LEFT, KC_DOWN, KC_RGHT),
+
+  /* Keymap _FL: Function Layer
+   */
+[_FL] = KEYMAP(
+  KC_ESC,     KC_F1,   KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9,   KC_F10,   KC_F11,   KC_F12,  _______, KC_DEL,           KC_HOME, \
+  _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS,  _______,  _______,  KC_PSCR,                KC_END,  \
+  _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,                           \
+  _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,          KC_PGUP,         \
+  _______, _______, _______, _______,        _______,_______,                        _______,  _______,  MO(_FL),  MO(_ME), KC_HOME, KC_PGDN, KC_END),
+
+/* Keymap _FL: Function Layer
+   */
+[_ME] = KEYMAP(
+  _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______, _______,  _______,  KC_MUTE,          KC_VOLU, \
+  _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS,  _______,  _______,  _______,                   KC_VOLD, \
+  _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,                           \
+  _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______, _______ ,  _______,          _______,         \
+  _______, _______, _______, _______,        _______,_______,                        _______,  _______,  MO(_FL),  MO(_ME), KC_MPRV, KC_MPLY, KC_MNXT),
+
+
+  /* Keymap _CL: Control layer
+   */
+[_CL] = KEYMAP(
+  _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______, RGB_TOG,             RGB_VAI, \
+  _______, _______, _______,_______,RESET,  _______,_______,_______,_______,_______, _______,  _______,  _______,  _______,                   RGB_VAD, \
+  _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,                         \
+  MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______,  MO(_FL),  _______,          RGB_SAI,          \
+  _______, _______, _______,_______,        RGB_MOD,   RGB_MOD,                            _______,  _______,  _______,  _______, RGB_HUD,    RGB_SAD,    RGB_HUI),
+};
+
+/* This is a list of user defined functions. F(N) corresponds to item N
+   of this list.
+ */
+const uint16_t PROGMEM fn_actions[] = {
+  [0] = ACTION_FUNCTION(0),  // Calls action_function()
+  [1] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC),
+};
+
+void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
+  static uint8_t mods_pressed;
+  static bool mod_flag;
+
+  switch (id) {
+    case 0:
+      /* Handle the combined Grave/Esc key
+       */
+      mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
+
+      if (record->event.pressed) {
+        /* The key is being pressed.
+         */
+        if (mods_pressed) {
+          mod_flag = true;
+          add_key(KC_GRV);
+          send_keyboard_report();
+        } else {
+          add_key(KC_ESC);
+          send_keyboard_report();
+        }
+      } else {
+        /* The key is being released.
+         */
+        if (mod_flag) {
+          mod_flag = false;
+          del_key(KC_GRV);
+          send_keyboard_report();
+        } else {
+          del_key(KC_ESC);
+          send_keyboard_report();
+        }
+      }
+      break;
+    case 1:
+      if(record->event.pressed) {
+        del_key(KC_ESC);
+      }
+    break;
+  }
+}

BIN
keyboards/clueboard/keymaps/serubin/layout-base.png


BIN
keyboards/clueboard/keymaps/serubin/layout-fn.png


BIN
keyboards/clueboard/keymaps/serubin/layout-media.png


+ 23 - 0
keyboards/clueboard/keymaps/serubin/readme.md

@@ -0,0 +1,23 @@
+```
+ ___     _____ _            _                         _     __    __ _   __
+|__ \   / ____| |          | |                       | |   / /   / /(_) / /
+ ||) | | |    | |_   _  ___| |__   ___   __ _ _ __ __| |  / /_  / /_   / /
+ |/ /  | |    | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
+ |_|   | |____| | |_| |  __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
+ (_)    \_____|_|\__,_|\___|_.__/ \___/ \__,_|_|  \__,_|  \___/ \___/_/ (_)
+```
+
+# Serubin's Clueboard Layout
+
+This is the layout based on the clueboard default, modified for development on Mac, PC, and Windows. This layout also handles media and volume keys on all the previously listed platforms. Most importantly, Capslock has been replaced by a dual function Esc/Ctrl key. This is particularly handy for use in Vim. 
+
+#### Base Layer
+![Base Layout Image](layout-base.png)
+
+#### Fn Layer
+![Fn Layout Image](layout-fn.png)
+
+#### Media Layer
+![Media Layer Image](layout-media.png)
+
+

+ 4 - 4
keyboards/clueboard/keymaps/shift_fn/keymap.c

@@ -19,17 +19,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
   F(0),    KC_1,    KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,    KC_0,     KC_MINS,  KC_EQL,   KC_GRV,  KC_BSPC,          KC_PGUP, \
   KC_TAB,  KC_Q,    KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,    KC_P,     KC_LBRC,  KC_RBRC,  KC_BSLS,                   KC_PGDN, \
   KC_CAPS, KC_A,    KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,    KC_SCLN,  KC_QUOT,  KC_NUHS,  KC_ENT,                             \
-  KC_LSFT, KC_NUBS, KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM, KC_DOT,   KC_SLSH,  KC_RO,    KC_RSFT,          KC_UP,            \
-  KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN,          KC_SPC,KC_SPC,                        KC_HENK,  KC_RALT,  KC_RCTL,  MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
+  MO(_FL), KC_NUBS, KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM, KC_DOT,   KC_SLSH,  KC_RO,    KC_RSFT,          KC_UP,            \
+  KC_LCTL, KC_LGUI, KC_LALT,KC_MHEN,          KC_SPC, KC_SPC,                        KC_HENK,  KC_RALT,  KC_RGUI,  KC_RCTL,  KC_LEFT, KC_DOWN, KC_RGHT),
 
   /* Keymap _FL: Function Layer
    */
 [_FL] = KEYMAP(
-  S(KC_GRV), KC_F1,     KC_F2,  KC_F3,  KC_F4,  KC_F5,    KC_F6,    KC_F7,  KC_F8,  KC_F9,     KC_F10,    KC_F11,    KC_F12,    S(KC_GRV), KC_DEL,           BL_STEP,    \
+  KC_GRV, KC_F1,     KC_F2,  KC_F3,  KC_F4,  KC_F5,    KC_F6,    KC_F7,  KC_F8,  KC_F9,     KC_F10,    KC_F11,    KC_F12,    S(KC_GRV), KC_DEL,           BL_STEP,    \
   S(KC_TAB), S(KC_Q),   S(KC_W),S(KC_E),S(KC_R),S(KC_T),  S(KC_Y),  S(KC_U),S(KC_I),S(KC_O),   S(KC_P),   S(KC_LBRC),S(KC_RBRC),S(KC_BSLS),                  S(KC_PGDN), \
   S(KC_LCTL),S(KC_A),   MO(_CL),S(KC_D),S(KC_F),S(KC_G),  S(KC_H),  S(KC_J),S(KC_K),S(KC_L),   S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT),                               \
   MO(_FL),   S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V),  S(KC_B),  S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO),  KC_RSFT,           KC_PGUP,             \
-  KC_LCTL,   KC_LALT,   KC_LGUI,MO(_FL),        S(KC_SPC),S(KC_SPC),                           MO(_FL),   KC_RGUI,   KC_RALT,   KC_RCTL,   KC_HOME, KC_PGDN, KC_END),
+  KC_LCTL,   KC_LALT,   KC_LGUI,KC_MHEN,        S(KC_SPC),S(KC_SPC),                           KC_HENK,   KC_RGUI,   KC_RALT,   KC_RCTL,   KC_HOME, KC_PGDN, KC_END),
 
   /* Keymap _CL: Control layer
    */

+ 19 - 16
keyboards/clueboard/keymaps/skully/keymap.c

@@ -16,33 +16,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
   /* Keymap _BL: Base Layer (Default Layer)
    */
 [_BL] = KEYMAP(
-  F(0),   KC_1,   KC_2,   KC_3,   KC_4,  KC_5,   KC_6,   KC_7,   KC_8,   KC_9,    KC_0,     KC_MINS,  KC_EQL,   KC_GRV,  KC_BSPC,          KC_PGUP, \
-  KC_TAB, KC_Q,   KC_W,   KC_E,   KC_R,  KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,    KC_P,     KC_LBRC,  KC_RBRC,  KC_BSLS,                   KC_PGDN, \
-  KC_LCTL,KC_A,   KC_S,   KC_D,   KC_F,  KC_G,   KC_H,   KC_J,   KC_K,   KC_L,    KC_SCLN,  KC_QUOT,  KC_NUHS,  KC_ENT,                             \
-  KC_LSFT,KC_NUBS,KC_Z,   KC_X,   KC_C,  KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM, KC_DOT,   KC_SLSH,  KC_RO,    KC_RSFT,          KC_UP,            \
-  KC_LCTL,KC_LALT,KC_LGUI,MO(_FL),       KC_SPC, KC_SPC,                          MO(_FL),  KC_RGUI,  KC_RCTL,  MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
+  F(0),    KC_1,    KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,    KC_0,     KC_MINS,  KC_EQL,   KC_GRV,  KC_BSPC,          KC_PGUP, \
+  KC_TAB,  KC_Q,    KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,    KC_P,     KC_LBRC,  KC_RBRC,  KC_BSLS,                   KC_PGDN, \
+  KC_LCTL, KC_A,    KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,    KC_SCLN,  KC_QUOT,  KC_NUHS,  KC_ENT,                             \
+  MO(_FL), KC_NUBS, KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM, KC_DOT,   KC_SLSH,  KC_RO,    KC_RSFT,          KC_UP,            \
+  KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN,          KC_SPC, KC_SPC,                        KC_HENK,  KC_RGUI,  KC_RALT,  KC_RCTL,  KC_LEFT, KC_DOWN, KC_RGHT),
 
   /* Keymap _FL: Function Layer
    */
 [_FL] = KEYMAP(
-  KC_GRV, KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9,  KC_F10, KC_F11, KC_F12, _______,KC_DEL,         BL_STEP, \
-  _______,_______,_______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS,_______,_______,_______,                _______, \
-  _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,                         \
-  _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,        KC_PGUP,         \
-  _______,_______,_______,MO(_FL),        _______,_______,                        MO(_FL),_______,_______,MO(_FL),KC_HOME,KC_PGDN,KC_END),
+  KC_GRV, KC_F1,     KC_F2,  KC_F3,  KC_F4,  KC_F5,    KC_F6,    KC_F7,  KC_F8,  KC_F9,     KC_F10,    KC_F11,    KC_F12,    S(KC_GRV), KC_DEL,           BL_STEP,    \
+  S(KC_TAB), S(KC_Q),   S(KC_W),S(KC_E),S(KC_R),S(KC_T),  S(KC_Y),  S(KC_U),S(KC_I),S(KC_O),   S(KC_P),   S(KC_LBRC),S(KC_RBRC),S(KC_BSLS),                  S(KC_PGDN), \
+  S(KC_LCTL),S(KC_A),   MO(_CL),S(KC_D),S(KC_F),S(KC_G),  S(KC_H),  S(KC_J),S(KC_K),S(KC_L),   S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT),                               \
+  MO(_FL),   S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V),  S(KC_B),  S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO),  KC_RSFT,           KC_PGUP,             \
+  KC_LCTL,   KC_LALT,   KC_LGUI,KC_MHEN,        S(KC_SPC),S(KC_SPC),                           KC_HENK,   KC_RGUI,   KC_RALT,   KC_RCTL,   KC_HOME, KC_PGDN, KC_END),
 
   /* Keymap _CL: Control layer
    */
 [_CL] = KEYMAP(
-  _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,          _______, \
-  _______,_______,_______,_______,RESET,  _______,_______,_______,_______,_______,_______,_______,_______,_______,                  _______, \
-  _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,                           \
-  _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,         _______,          \
-  _______,_______,_______,_______,        _______,_______,                        _______,_______,_______,MO(_FL),_______, _______, _______),
+  _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______, RGB_TOG,              RGB_VAI, \
+  _______, _______, _______,_______,RESET,  _______,_______,_______,_______,_______, _______,  _______,  _______,  _______,                       RGB_VAD, \
+  _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,                                \
+  MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  MO(_FL),               RGB_SAI,         \
+  _______, _______, _______,_______,        RGB_MOD,RGB_MOD,                            _______,  _______,  _______,  _______, RGB_HUD,RGB_SAD,RGB_HUI),
 };
 
+/* This is a list of user defined functions. F(N) corresponds to item N
+   of this list.
+ */
 const uint16_t PROGMEM fn_actions[] = {
-  [0]  = ACTION_FUNCTION(0),
+  [0] = ACTION_FUNCTION(0),  // Calls action_function()
 };
 
 void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {

+ 181 - 0
keyboards/clueboard/keymaps/smt/keymap.c

@@ -0,0 +1,181 @@
+#include "clueboard.h"
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _QWERTY 0
+#define _COLEMAK 1
+#define _DVORAK 2
+#define _FL 3
+#define _CL 4
+
+enum planck_keycodes {
+  QWERTY = SAFE_RANGE,
+  COLEMAK,
+  DVORAK
+};
+
+// Helpful defines
+#define _______ KC_TRNS
+#define XXXXXXX KC_NO
+#define GRAVE_MODS  (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
+
+// Custom macros
+#define CTL_ESC     CTL_T(KC_ESC)               // Tap for Esc, hold for Ctrl
+#define HPR_TAB     ALL_T(KC_TAB)               // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt)
+#define SFT_ENT     SFT_T(KC_ENT)               // Tap for Enter, hold for Shift
+
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+  /* Keymap _QWERTY: Base Layer (Default Layer)
+   * ,-----------------------------------------------------------.  ,---.
+   * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|  `|  |PgU|
+   * |-----------------------------------------------------------|  |---|
+   * |HpTab|  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|   BS|  |PgD|
+   * |-----------------------------------------------------------|  `---'
+   * |CtlEsc|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|   | Ent|
+   * |--------------------------------------------------------------.
+   * |Shift|  |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift| Fn| Up|
+   * |------------------------------------------------------------------.
+   * |Ctrl|Gui|Alt |    | Space| Space|    |Alt |Gui |Ctrl|Left|Down|Rgt|
+   * `------------------------------------------------------------------'
+   */
+[_QWERTY] = KEYMAP(
+  F(0),    KC_1,    KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,    KC_0,     KC_MINS,  KC_EQL,   KC_BSLS, KC_GRV,           KC_PGUP, \
+  HPR_TAB, KC_Q,    KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,    KC_P,     KC_LBRC,  KC_RBRC,  KC_BSPC,                   KC_PGDN, \
+  CTL_ESC, KC_A,    KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,    KC_SCLN,  KC_QUOT,  XXXXXXX,  KC_ENT,                             \
+  KC_LSFT, XXXXXXX, KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM, KC_DOT,   KC_SLSH,  SFT_ENT,  MO(_FL),          KC_UP,            \
+  KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX,          KC_SPC,KC_SPC,                        XXXXXXX,  KC_RALT,  KC_RGUI,  KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
+
+  /* Keymap _COLEMAK: Base Layer
+   * ,-----------------------------------------------------------.  ,---.
+   * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|  `|  |PgU|
+   * |-----------------------------------------------------------|  |---|
+   * |HpTab|  Q|  W|  F|  P|  G|  J|  L|  U|  Y|  ;|  [|  ]|   BS|  |PgD|
+   * |-----------------------------------------------------------|  `---'
+   * |CtlEsc|  A|  R|  S|  T|  D|  H|  N|  E|  I|  O|  '|   | Ent|
+   * |--------------------------------------------------------------.
+   * |Shift|  |  Z|  X|  C|  V|  B|  K|  M|  ,|  .|  /|Shift| Fn| Up|
+   * |------------------------------------------------------------------.
+   * |Ctrl|Gui|Alt |    | Space| Space|    |Alt |Gui |Ctrl|Left|Down|Rgt|
+   * `------------------------------------------------------------------'
+   */
+[_COLEMAK] = KEYMAP(
+  F(0),    KC_1,    KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,    KC_0,     KC_MINS,  KC_EQL,   KC_BSLS, KC_GRV,           KC_PGUP, \
+  HPR_TAB, KC_Q,    KC_W,   KC_F,   KC_P,   KC_G,   KC_J,   KC_L,   KC_U,   KC_Y,    KC_SCLN,  KC_LBRC,  KC_RBRC,  KC_BSPC,                   KC_PGDN, \
+  CTL_ESC, KC_A,    KC_R,   KC_S,   KC_T,   KC_D,   KC_H,   KC_N,   KC_E,   KC_I,    KC_O,     KC_QUOT,  XXXXXXX,  KC_ENT,                             \
+  KC_LSFT, XXXXXXX, KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_K,   KC_M,   KC_COMM, KC_DOT,   KC_SLSH,  SFT_ENT,  MO(_FL),          KC_UP,            \
+  KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX,          KC_SPC,KC_SPC,                        XXXXXXX,  KC_RALT,  KC_RGUI,  KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
+
+  /* Keymap _DVORAK: Base Layer
+   * ,-----------------------------------------------------------.  ,---.
+   * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  [|  ]|  \|  `|  |PgU|
+   * |-----------------------------------------------------------|  |---|
+   * |HpTab|  '|  ,|  .|  P|  Y|  F|  G|  C|  R|  L|  /|  =|   BS|  |PgD|
+   * |-----------------------------------------------------------|  `---'
+   * |CtlEsc|  A|  O|  E|  U|  I|  D|  H|  T|  N|  S|  -|   | Ent|
+   * |--------------------------------------------------------------.
+   * |Shift|  |  ;|  Q|  J|  K|  X|  B|  M|  W|  V|  Z|Shift| Fn| Up|
+   * |------------------------------------------------------------------.
+   * |Ctrl|Gui|Alt |    | Space| Space|    |Alt |Gui |Ctrl|Left|Down|Rgt|
+   * `------------------------------------------------------------------'
+   */
+[_DVORAK] = KEYMAP(
+  F(0),    KC_1,    KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,    KC_0,     KC_LBRC,  KC_RBRC,  KC_BSLS, KC_GRV,           KC_PGUP, \
+  HPR_TAB, KC_QUOT, KC_COMM,KC_DOT, KC_P,   KC_Y,   KC_F,   KC_G,   KC_C,   KC_R,    KC_L,     KC_SLSH,  KC_EQL,   KC_BSPC,                   KC_PGDN, \
+  CTL_ESC, KC_A,    KC_O,   KC_E,   KC_U,   KC_I,   KC_D,   KC_H,   KC_T,   KC_N,    KC_S,     KC_MINS,  XXXXXXX,  KC_ENT,                             \
+  KC_LSFT, XXXXXXX, KC_SCLN,KC_Q,   KC_J,   KC_K,   KC_X,   KC_B,   KC_M,   KC_W,    KC_V,     KC_Z,     SFT_ENT,  MO(_FL),          KC_UP,            \
+  KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX,          KC_SPC,KC_SPC,                        XXXXXXX,  KC_RALT,  KC_RGUI,  KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
+
+  /* Keymap _FL: Function Layer
+   */
+[_FL] = KEYMAP(
+  KC_GRV,  KC_F1,   KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9,   KC_F10,   KC_F11,   KC_F12,   _______, _______,          BL_STEP, \
+  _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS,  _______,  _______,  KC_DEL,                    _______, \
+  _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,                            \
+  _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  MO(_FL),          KC_PGUP,          \
+  _______, _______, _______, _______,        _______,_______,                        _______,  _______,  _______,  _______, KC_HOME, KC_PGDN, KC_END),
+
+  /* Keymap _CL: Control layer
+   */
+[_CL] = KEYMAP(
+  _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______, RGB_TOG,          RGB_VAI, \
+  _______, _______, _______,_______,RESET,  _______,_______,QWERTY, COLEMAK,DVORAK,  _______,  _______,  _______,  _______,                   RGB_VAD, \
+  _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  _______,                            \
+  MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______,  _______,  _______,  MO(_FL),          RGB_SAI,          \
+  _______, _______, _______,_______,         RGB_MOD,RGB_MOD,                        _______,  _______,  _______,  _______, RGB_HUD, RGB_SAD, RGB_HUI),
+};
+
+/* This is a list of user defined functions. F(N) corresponds to item N
+   of this list.
+ */
+const uint16_t PROGMEM fn_actions[] = {
+  [0] = ACTION_FUNCTION(0),  // Calls action_function()
+};
+
+void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
+  static uint8_t mods_pressed;
+  static bool mod_flag;
+
+  switch (id) {
+    case 0:
+      /* Handle the combined Grave/Esc key
+       */
+      mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
+
+      if (record->event.pressed) {
+        /* The key is being pressed.
+         */
+        if (mods_pressed) {
+          mod_flag = true;
+          add_key(KC_GRV);
+          send_keyboard_report();
+        } else {
+          add_key(KC_ESC);
+          send_keyboard_report();
+        }
+      } else {
+        /* The key is being released.
+         */
+        if (mod_flag) {
+          mod_flag = false;
+          del_key(KC_GRV);
+          send_keyboard_report();
+        } else {
+          del_key(KC_ESC);
+          send_keyboard_report();
+        }
+      }
+      break;
+  }
+}
+
+void persistent_default_layer_set(uint16_t default_layer) {
+  eeconfig_update_default_layer(default_layer);
+  default_layer_set(default_layer);
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+  switch (keycode) {
+    case QWERTY:
+      if (record->event.pressed) {
+        persistent_default_layer_set(1UL<<_QWERTY);
+      }
+      return false;
+      break;
+    case COLEMAK:
+      if (record->event.pressed) {
+        persistent_default_layer_set(1UL<<_COLEMAK);
+      }
+      return false;
+      break;
+    case DVORAK:
+      if (record->event.pressed) {
+        persistent_default_layer_set(1UL<<_DVORAK);
+      }
+      return false;
+      break;
+  }
+  return true;
+}

BIN
keyboards/clueboard/keymaps/smt/layout.png


+ 30 - 0
keyboards/clueboard/keymaps/smt/readme.md

@@ -0,0 +1,30 @@
+```
+ ___     _____ _            _                         _     __    __ _   __
+|__ \   / ____| |          | |                       | |   / /   / /(_) / /
+ ||) | | |    | |_   _  ___| |__   ___   __ _ _ __ __| |  / /_  / /_   / /
+ |/ /  | |    | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
+ |_|   | |____| | |_| |  __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
+ (_)    \_____|_|\__,_|\___|_.__/ \___/ \__,_|_|  \__,_|  \___/ \___/_/ (_)
+```
+
+# smt Clueboard Layout (HHKB variant)
+
+![Clueboard Layout Image](layout.png)
+
+This is smt's HHKB variant layout, based on the default layout that comes
+flashed on every Clueboard. The primary differences from the default are:
+
+- The Backspace key is moved down into the traditional `\` position
+- `\` and `` ` `` are assigned to the "split-backspace" positions
+- The right Shift is split to allow for a Fn key to its right
+- The modifiers on the right side now mirror the left side (`Alt`/`Super`/`Ctrl`)
+
+For the most part, it's a straightforward and easy to follow layout. There
+are a few special keys:
+
+- The Esc key sends `Esc` when tapped, `` ` `` when `Alt`/`Super`/`Ctrl`/`Fn` is held, or `~` when `Shift` is held
+- The Tab key sends `Tab` when tapped, or `Super+Ctrl+Alt+Shift` (a.k.a. [Hyper]) when held
+- The key traditionally in the Caps-Lock position has been re-mapped to send `Esc` when tapped, or `Ctrl` when held
+- The left Shift key sends `Enter` when tapped, or `Shift` when held
+
+[Hyper]: http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/

+ 5 - 5
keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c

@@ -256,7 +256,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     */
 };
 
-void persistant_default_layer_set(uint16_t default_layer) {
+void persistent_default_layer_set(uint16_t default_layer) {
   eeconfig_update_default_layer(default_layer);
   default_layer_set(default_layer);
 }
@@ -266,25 +266,25 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
     /* layout switcher */
     case LAY_QWE:
       if (record->event.pressed) {
-        persistant_default_layer_set(1UL<<QWE);
+        persistent_default_layer_set(1UL<<QWE);
       }
       return false;
       break;
     case LAY_COL:
       if (record->event.pressed) {
-        persistant_default_layer_set(1UL<<COL);
+        persistent_default_layer_set(1UL<<COL);
       }
       return false;
       break;
     case LAY_WOR:
       if (record->event.pressed) {
-        persistant_default_layer_set(1UL<<WOR);
+        persistent_default_layer_set(1UL<<WOR);
       }
       return false;
       break;
     case LAY_DVO:
       if (record->event.pressed) {
-        persistant_default_layer_set(1UL<<DVO);
+        persistent_default_layer_set(1UL<<DVO);
       }
       return false;
       break;

keyboards/s60-x/Makefile → keyboards/dk60/Makefile


+ 55 - 0
keyboards/dk60/config.h

@@ -0,0 +1,55 @@
+/*
+Copyright 2017 Damien Broqua <contact@darkou.fr>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CONFIG_H
+    #define CONFIG_H
+
+    #include "config_common.h"
+
+    /* USB Device descriptor parameter */
+    #define VENDOR_ID       0xFEED
+    #define PRODUCT_ID      0x6060
+    #define DEVICE_VER      0x0003
+    #define MANUFACTURER    DARKOU
+    #define PRODUCT         DK60
+    #define DESCRIPTION     QMK keyboard firmware for DK60 support
+
+    /* key matrix size */
+    #define MATRIX_ROWS 5
+    #define MATRIX_COLS 13
+
+    // ROWS: Top to bottom, COLS: Left to right
+    #define MATRIX_ROW_PINS { B6, B4, D7, D6, D4 }
+    #define MATRIX_COL_PINS { B0, B3, B2, B1, D3, D5, B5, B7, C6, C7, D0, D1, D2 }
+    #define UNUSED_PINS
+
+    /* COL2ROW or ROW2COL */
+    #define DIODE_DIRECTION COL2ROW
+
+    /* Set 0 if debouncing isn't needed */
+    #define DEBOUNCING_DELAY 5
+
+    /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+    #define LOCKING_SUPPORT_ENABLE
+    /* Locking resynchronize hack */
+    #define LOCKING_RESYNC_ENABLE
+
+    /* key combination for command */
+    #define IS_COMMAND() ( \
+        keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+    )
+#endif

+ 34 - 0
keyboards/dk60/dk60.c

@@ -0,0 +1,34 @@
+#include "dk60.h"
+
+void dk60_blink_all_leds(void)
+{
+    dk60_led_all_off();
+    dk60_led_all_on();
+    _delay_ms(500);
+    dk60_led_all_off();
+}
+
+void matrix_init_kb(void) {
+    led_init_ports();
+    dk60_blink_all_leds();
+
+    matrix_init_user();
+}
+
+void led_init_ports(void) {
+    // * Set our LED pins as output
+    DDRE |= (1<<6);
+    DDRF |= (1<<0);
+}
+
+void led_set_kb(uint8_t usb_led) {
+	if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+		// Turn capslock on
+		dk60_caps_led_on();
+	} else {
+		// Turn capslock off
+		dk60_caps_led_off();
+	}
+
+	led_set_user(usb_led);
+}

+ 41 - 0
keyboards/dk60/dk60.h

@@ -0,0 +1,41 @@
+#ifndef DK60_H
+    #define DK60_H
+
+    #include "quantum.h"
+    #include <util/delay.h>
+
+    inline void dk60_caps_led_on(void)      {  PORTE |= (1<<6); }
+    inline void dk60_esc_led_on(void)    	{  PORTF |= (1<<0); }
+
+    inline void dk60_caps_led_off(void)     { PORTE &= ~(1<<6); }
+    inline void dk60_esc_led_off(void)   	{ PORTF &= ~(1<<0); }
+
+    inline void dk60_led_all_on(void)
+    {
+        dk60_caps_led_on();
+        dk60_esc_led_on();
+    }
+
+    inline void dk60_led_all_off(void)
+    {
+        dk60_caps_led_off();
+        dk60_esc_led_off();
+    }
+
+    #define ___ KC_NO
+
+    #define KEYMAP( \
+        K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K4B, K4A, \
+        K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K4C, \
+        K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
+        K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \
+             K41, K42,           K45,           K48, K49  \
+    ) { \
+        { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \
+        { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \
+        { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \
+        { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C }, \
+        { ___, K41, K42, ___, ___, K45, ___, ___, K48, K49, K4A, K4B, K4C }  \
+    }
+
+#endif

+ 80 - 0
keyboards/dk60/keymaps/default/keymap.c

@@ -0,0 +1,80 @@
+#include "dk60.h"
+#include "action_layer.h"
+
+enum planck_layers {
+  _QWERTY,
+  _FN,
+  _DVORAK,
+  _LOWER,
+  _RAISE,
+  _PLOVER,
+  _ADJUST
+};
+
+enum planck_keycodes {
+  QWERTY = SAFE_RANGE,
+  FN
+};
+
+// Fillers to make layering more clear
+#define ______ KC_TRNS
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+/* Qwerty gui/alt/space/alt/gui
+ * ,-----------------------------------------------------------------------------------------.
+ * | Esc |  1  |  2  |  3  |  4  |  5  |  6  |  7  |  8  |  9  |  0  |  -  |  =  |  \  |  `  |
+ * |-----------------------------------------------------------------------------------------+
+ * | Tab    |  Q  |  W  |  E  |  R  |  T  |  Y  |  U  |  I  |  O  |  P  |  [  |  ]  |  Bksp  |
+ * |-----------------------------------------------------------------------------------------+
+ * | Ctrl    |  A  |  S  |  D  |  F  |  G  |  H  |  J  |  K  |  L  |  ;  |  '  |    Enter    |
+ * |-----------------------------------------------------------------------------------------+
+ * | Shift     |  Z  |  X  |  C  |  V  |  B  |  N  |  M  |  ,  |  .  |  /  | RShift    | FN  |
+ * |-----------------------------------------------------------------------------------------+
+ *         |LGUI | LAlt  |               Space                | RAlt   |RGUI |
+ *         `-----------------------------------------------------------------'
+ */
+  [_QWERTY] = KEYMAP( /* Basic QWERTY */
+      KC_ESC,   KC_1,   KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,    KC_9,   KC_0,       KC_MINS,    KC_EQL, KC_BSLS,    KC_GRV, \
+      KC_TAB,   KC_Q,   KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,    KC_O,   KC_P,       KC_LBRC,    KC_RBRC,KC_BSPC,  \
+      KC_LCTL,  KC_A,   KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,    KC_L,   KC_SCLN,    KC_QUOT,    KC_ENT,   \
+      KC_LSFT,  KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM, KC_DOT, KC_SLSH,    KC_RSFT,    FN, \
+                KC_LGUI,KC_LALT,                KC_SPC,                          KC_RALT,KC_RGUI \
+      ),
+
+/* FN Layer
+ * ,-----------------------------------------------------------------------------------------.
+ * |     | F1  | F2  | F3  | F4  | F5  | F6  | F7  | F8  | F9  | F10 | F11 | F12 | Ins | Del |
+ * |-----------------------------------------------------------------------------------------+
+ * |  CAPS  |     |     |     |     |     |     |     | Psc | Slck| Paus| Up  |     |        |
+ * |-----------------------------------------------------------------------------------------+
+ * |         | Vol-| Vol+| Mute|     |     | *   | /   | Home| PgUp| Left|Right|             |
+ * |-----------------------------------------------------------------------------------------+
+ * |           | Prev| Play| Next|     |     | +   | -   | End  |PgDn| Down|           |     |
+ * |-----------------------------------------------------------------------------------------+
+ *         |       |       |                                 | Stop  |       |
+ *         `-----------------------------------------------------------------'
+ */
+  [_FN] = KEYMAP( /* Layer 1 */
+      ______, KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12, KC_INS,  KC_DEL, \
+      KC_CAPS,  ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP,   ______, ______,  \
+      ______,   KC_VOLD,KC_VOLU,KC_MUTE,______, ______, KC_PAST,KC_PSLS,KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, ______,   \
+      ______,   KC_MPRV,KC_MPLY,KC_MNXT,______, ______, KC_PPLS,KC_PMNS,KC_END,  KC_PGDN, KC_DOWN, ______,  ______,  \
+                ______, ______,                 ______,                 KC_MSTP, ______ \
+      )
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+  switch (keycode) {
+    case FN:
+      if (record->event.pressed) {
+        layer_on(_FN);
+        dk60_esc_led_on();
+      } else {
+        layer_off(_FN);
+        dk60_esc_led_off();
+      }
+      return false;
+      break;
+  }
+  return true;
+}

+ 8 - 0
keyboards/dk60/readme.md

@@ -0,0 +1,8 @@
+DK60 keyboard firmware
+======================
+
+Another 60% keyboard with different HHKB layout
+
+More information here: https://github.com/Dbroqua/DK60
+
+Open Hardware project!

+ 21 - 0
keyboards/dk60/rules.mk

@@ -0,0 +1,21 @@
+MCU = atmega32u4
+F_CPU = 16000000
+ARCH = AVR8
+F_USB = $(F_CPU)
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+OPT_DEFS += -DBOOTLOADER_SIZE=4096
+
+BOOTMAGIC_ENABLE ?= yes	# Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= no	# Mouse keys(+4700)
+EXTRAKEY_ENABLE ?= yes	# Audio control and System control(+450)
+# CONSOLE_ENABLE ?= yes	# Console for debug(+400)
+# COMMAND_ENABLE ?= yes    # Commands for debug and configuration
+KEYBOARD_LOCK_ENABLE ?= yes	# Allow locking of keyboard via magic key
+NKRO_ENABLE ?= yes		# USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+RGBLIGHT_ENABLE ?= no   # Enable keyboard underlight functionality (+4870)
+BACKLIGHT_ENABLE ?= no  # Enable keyboard backlight functionality (+1150)
+MIDI_ENABLE ?= no 		# MIDI controls
+AUDIO_ENABLE ?= no
+UNICODE_ENABLE ?= yes 		# Unicode
+BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
+SLEEP_LED_ENABLE ?= yes

+ 2 - 2
keyboards/ergodox/config.h

@@ -3,8 +3,8 @@
 
 #define MOUSEKEY_INTERVAL       20
 #define MOUSEKEY_DELAY          0
-#define MOUSEKEY_TIME_TO_MAX    5
-#define MOUSEKEY_MAX_SPEED      2
+#define MOUSEKEY_TIME_TO_MAX    60
+#define MOUSEKEY_MAX_SPEED      7
 #define MOUSEKEY_WHEEL_DELAY 0
 
 #define TAPPING_TOGGLE  1

+ 3 - 1
keyboards/ergodox/ez/config.h

@@ -58,7 +58,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define RGBW 1
 
 /* Set 0 if debouncing isn't needed */
-#define DEBOUNCE    5
+#define DEBOUNCE    15
+
+#define PREVENT_STUCK_MODIFIERS
 
 #define USB_MAX_POWER_CONSUMPTION 500
 

+ 37 - 25
keyboards/ergodox/ez/matrix.c

@@ -53,11 +53,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef DEBOUNCE
 #   define DEBOUNCE	5
 #endif
-static uint8_t debouncing = DEBOUNCE;
 
 /* matrix state(1:on, 0:off) */
 static matrix_row_t matrix[MATRIX_ROWS];
-static matrix_row_t matrix_debouncing[MATRIX_ROWS];
+
+// Debouncing: store for each key the number of scans until it's eligible to
+// change.  When scanning the matrix, ignore any changes in keys that have
+// already changed in the last DEBOUNCE scans.
+static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS];
 
 static matrix_row_t read_cols(uint8_t row);
 static void init_cols(void);
@@ -113,7 +116,9 @@ void matrix_init(void)
     // initialize matrix state: all keys off
     for (uint8_t i=0; i < MATRIX_ROWS; i++) {
         matrix[i] = 0;
-        matrix_debouncing[i] = 0;
+        for (uint8_t j=0; j < MATRIX_COLS; ++j) {
+            debounce_matrix[i * MATRIX_COLS + j] = 0;
+        }
     }
 
 #ifdef DEBUG_MATRIX_SCAN_RATE
@@ -134,14 +139,36 @@ void matrix_power_up(void) {
     // initialize matrix state: all keys off
     for (uint8_t i=0; i < MATRIX_ROWS; i++) {
         matrix[i] = 0;
-        matrix_debouncing[i] = 0;
     }
 
 #ifdef DEBUG_MATRIX_SCAN_RATE
     matrix_timer = timer_read32();
     matrix_scan_count = 0;
 #endif
+}
+
+// Returns a matrix_row_t whose bits are set if the corresponding key should be
+// eligible to change in this scan.
+matrix_row_t debounce_mask(uint8_t row) {
+  matrix_row_t result = 0;
+  for (uint8_t j=0; j < MATRIX_COLS; ++j) {
+    if (debounce_matrix[row * MATRIX_COLS + j]) {
+      --debounce_matrix[row * MATRIX_COLS + j];
+    } else {
+      result |= (1 << j);
+    }
+  }
+  return result;
+}
 
+// Report changed keys in the given row.  Resets the debounce countdowns
+// corresponding to each set bit in 'change' to DEBOUNCE.
+void debounce_report(matrix_row_t change, uint8_t row) {
+  for (uint8_t i = 0; i < MATRIX_COLS; ++i) {
+    if (change & (1 << i)) {
+      debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE;
+    }
+  }
 }
 
 uint8_t matrix_scan(void)
@@ -178,26 +205,12 @@ uint8_t matrix_scan(void)
     for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
         select_row(i);
         wait_us(30);  // without this wait read unstable value.
-        matrix_row_t cols = read_cols(i);
-        if (matrix_debouncing[i] != cols) {
-            matrix_debouncing[i] = cols;
-            if (debouncing) {
-                debug("bounce!: "); debug_hex(debouncing); debug("\n");
-            }
-            debouncing = DEBOUNCE;
-        }
-        unselect_rows();
-    }
+        matrix_row_t mask = debounce_mask(i);
+        matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask);
+        debounce_report(cols ^ matrix[i], i);
+        matrix[i] = cols;
 
-    if (debouncing) {
-        if (--debouncing) {
-            wait_us(1);
-            // this should be wait_ms(1) but has been left as-is at EZ's request
-        } else {
-            for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-                matrix[i] = matrix_debouncing[i];
-            }
-        }
+        unselect_rows();
     }
 
     matrix_scan_quantum();
@@ -205,9 +218,8 @@ uint8_t matrix_scan(void)
     return 1;
 }
 
-bool matrix_is_modified(void)
+bool matrix_is_modified(void) // deprecated and evidently not called.
 {
-    if (debouncing) return false;
     return true;
 }
 

+ 0 - 0
keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h


Некоторые файлы не были показаны из-за большого количества измененных файлов