]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
SixKeyBoard refactor (#3193)
authornoroadsleft <18669334+noroadsleft@users.noreply.github.com>
Sat, 16 Jun 2018 15:02:11 +0000 (08:02 -0700)
committerDrashna Jaelre <drashna@live.com>
Sat, 16 Jun 2018 15:02:11 +0000 (08:02 -0700)
* Refactor: create matrix macro

* Readme changes

* Configurator support

keyboards/sixkeyboard/info.json [new file with mode: 0644]
keyboards/sixkeyboard/keymaps/default/keymap.c
keyboards/sixkeyboard/readme.md
keyboards/sixkeyboard/sixkeyboard.h

diff --git a/keyboards/sixkeyboard/info.json b/keyboards/sixkeyboard/info.json
new file mode 100644 (file)
index 0000000..55239fc
--- /dev/null
@@ -0,0 +1,12 @@
+{
+  "keyboard_name": "Techkeys SixKeyBoard",
+  "url": "",
+  "maintainer": "qmk",
+  "width": 3,
+  "height": 2,
+  "layouts": {
+    "LAYOUT": {
+      "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k10", "x":0, "y":1}, {"label":"k11", "x":1, "y":1}, {"label":"k12", "x":2, "y":1}]
+    }
+  }
+}
index f5b10bb48889ac56860899e0d427f956bae0a07d..78b55478b6ae00387d167b1039ebc745f8e05cea 100644 (file)
@@ -1,12 +1,12 @@
 
-#include "sixkeyboard.h"
+#include QMK_KEYBOARD_H
 #include "matrix.h"
 
 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-[0] = {
-       {KC_A, KC_B, KC_C},
-  {KC_D, KC_E, KC_F}
-  }
+  [0] = LAYOUT(
+    KC_A, KC_B, KC_C, \
+    KC_D, KC_E, KC_F  \
+  )
 };
 
 const uint16_t PROGMEM fn_actions[] = {
index c0d87bc2c5975924cf9ac01151527b43c6db1197..512b9a6af2735c5c6b7f067b4bda9e430e34a058 100644 (file)
@@ -1,9 +1,9 @@
 Techkeys SixKeyBoard
 ===
 
-Keyboard Maintainer: QMK Community
-Hardware Supported: Techkeys SixKeyBoard PCB
-Hardware Availability: http://techkeys.us/collections/accessories/products/sixkeyboard
+Keyboard Maintainer: QMK Community  
+Hardware Supported: Techkeys SixKeyBoard PCB  
+Hardware Availability: [Techkeys](http://techkeys.us/collections/accessories/products/sixkeyboard)
 
 Make example for this keyboard (after setting up your build environment):
 
index 66f53bf7e12a9a08c74ecfdaecccd1f5aa51be81..e0eb896ce4dc4f90f22acc02049af04108f88580 100644 (file)
@@ -3,16 +3,32 @@
 
 #include "quantum.h"
 
-// This macro is an example of using a non-standard row-column matrix. The 
-// keyboard in question had 11 rows and 8 columns, but the rows were not all 
-// horizontal, and the columns were not all vertical. For example, row 2 
+// This macro is an example of using a non-standard row-column matrix. The
+// keyboard in question had 11 rows and 8 columns, but the rows were not all
+// horizontal, and the columns were not all vertical. For example, row 2
 // contained "Print Screen", "N", "M", ",", ".", "/", "Right Shift", and
-// "Left Alt". Column 0 contained "F6", "7", "O", "'", "Q", "D", "B", 
+// "Left Alt". Column 0 contained "F6", "7", "O", "'", "Q", "D", "B",
 // "Left Alt", "Up Arrow", and "Down Arrow".
 //
 // The macro makes programming the keys easier and in a more straight-forward
-// manner because it realigns the keys into a 6x15 sensible keyboard layout 
+// manner because it realigns the keys into a 6x15 sensible keyboard layout
 // instead of the obtuse 11x8 matrix.
 
 
-#endif
\ No newline at end of file
+/*
+ * ┌───┬───┬───┐
+ * │ A │ B │ C │
+ * ├───┼───┼───┤
+ * │ D │ E │ F │
+ * └───┴───┴───┘
+ */
+#define LAYOUT( \
+    k00, k01, k02, \
+    k10, k11, k12  \
+  ) { \
+    { k00, k01, k02 }, \
+    { k10, k11, k12 }  \
+}
+
+
+#endif