Dichotemy: Refactor and Configurator update (#3133)

* Refactor KEYMAP to LAYOUT

* Configurator support
This commit is contained in:
noroadsleft 2018-06-06 09:47:56 -07:00 committed by Drashna Jaelre
parent 97d5b6aba0
commit 99e849ac89
3 changed files with 55 additions and 43 deletions

View file

@ -49,7 +49,7 @@
// This a shortcut to help you visually see your layout. // This a shortcut to help you visually see your layout.
// The first section contains all of the arguements // The first section contains all of the arguements
// The second converts the arguments into a two-dimensional array // The second converts the arguments into a two-dimensional array
#define KEYMAP( \ #define LAYOUT( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, \

View file

@ -0,0 +1,12 @@
{
"keyboard_name": "Dichotemy",
"url": "",
"maintainer": "qmk",
"width": 13,
"height": 6,
"layouts": {
"LAYOUT": {
"layout": [{"label":"k00", "x":0, "y":0.5}, {"label":"k01", "x":1, "y":0.5}, {"label":"k02", "x":2, "y":0.25}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0.5}, {"label":"k05", "x":5, "y":0.5}, {"label":"k06", "x":7, "y":0.5}, {"label":"k07", "x":8, "y":0.5}, {"label":"k08", "x":9, "y":0}, {"label":"k09", "x":10, "y":0.25}, {"label":"k0A", "x":11, "y":0.5}, {"label":"k0B", "x":12, "y":0.5}, {"label":"k10", "x":0, "y":1.5}, {"label":"k11", "x":1, "y":1.5}, {"label":"k12", "x":2, "y":1.25}, {"label":"k13", "x":3, "y":1}, {"label":"k14", "x":4, "y":1.5}, {"label":"k15", "x":5, "y":1.5}, {"label":"k16", "x":7, "y":1.5}, {"label":"k17", "x":8, "y":1.5}, {"label":"k18", "x":9, "y":1}, {"label":"k19", "x":10, "y":1.25}, {"label":"k1A", "x":11, "y":1.5}, {"label":"k1B", "x":12, "y":1.5}, {"label":"k20", "x":0, "y":2.5}, {"label":"k21", "x":1, "y":2.5}, {"label":"k22", "x":2, "y":2.25}, {"label":"k23", "x":3, "y":2}, {"label":"k24", "x":4, "y":2.5}, {"label":"k25", "x":5, "y":2.5}, {"label":"k26", "x":7, "y":2.5}, {"label":"k27", "x":8, "y":2.5}, {"label":"k28", "x":9, "y":2}, {"label":"k29", "x":10, "y":2.25}, {"label":"k2A", "x":11, "y":2.5}, {"label":"k2B", "x":12, "y":2.5}, {"label":"k33", "x":3, "y":4}, {"label":"k34", "x":4, "y":4}, {"label":"k35", "x":5, "y":4}, {"label":"k36", "x":7, "y":4}, {"label":"k37", "x":8, "y":4}, {"label":"k38", "x":9, "y":4}, {"label":"k43", "x":3, "y":5}, {"label":"k44", "x":4, "y":5}, {"label":"k45", "x":5, "y":5}, {"label":"k46", "x":7, "y":5}, {"label":"k47", "x":8, "y":5}, {"label":"k48", "x":9, "y":5}]
}
}
}

View file

@ -1,8 +1,7 @@
// this is the style you want to emulate. // this is the style you want to emulate.
// This is the canonical layout file for the Quantum project. If you want to add another keyboard, // This is the canonical layout file for the Quantum project. If you want to add another keyboard,
#include "dichotemy.h" #include QMK_KEYBOARD_H
#include "report.h"
#include "pointing_device.h" #include "pointing_device.h"
// Each layer gets a name for readability, which is then used in the keymap matrix below. // Each layer gets a name for readability, which is then used in the keymap matrix below.
@ -20,7 +19,7 @@ enum dichotemy_layers
#define LONGPRESS_COUNT 4 #define LONGPRESS_COUNT 4
enum dichotemy_keycodes enum dichotemy_keycodes
{ {
CK_1G = SAFE_RANGE, CK_1G = SAFE_RANGE,
CK_BSPE, CK_BSPE,
@ -53,45 +52,46 @@ enum dichotemy_macros
#define XXXXXXX KC_NO #define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BS] = { /* Base layout, nearly qwerty but with modifications because it's not a full keyboard. Obviously. */
{CK_TE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC },
{NUMKEY, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, CK_QE },
{SFTKEY, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MOUSE },
{XXXXXXX, XXXXXXX, XXXXXXX, KC_LCTL, KC_LALT, KC_LGUI, KC_RGUI, KC_RALT, KC_RCTL, XXXXXXX, XXXXXXX, XXXXXXX },
{XXXXXXX, XXXXXXX, XXXXXXX, KC_LBRC, KC_LPRN, KC_QUOT, KC_SPC, KC_RPRN, KC_RBRC, XXXXXXX, XXXXXXX, XXXXXXX }
},
[_SF] = { /* Shifted layout, small changes (because angle brackets have been moved to thumb cluster buttons) */ [_BS] = LAYOUT( /* Base layout, nearly qwerty but with modifications because it's not a full keyboard. Obviously. */
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, CK_TE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, NUMKEY, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, CK_QE,
{_______, _______, _______, _______, _______, _______, _______, _______, NS_HYPH, KC_UNDS, _______, _______ }, SFTKEY, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MOUSE,
{XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX }, KC_LCTL, KC_LALT, KC_LGUI, KC_RGUI, KC_RALT, KC_RCTL,
{XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_LABK, _______, _______, KC_RABK, _______, XXXXXXX, XXXXXXX, XXXXXXX } KC_LBRC, KC_LPRN, KC_QUOT, KC_SPC, KC_RPRN, KC_RBRC
}, ),
[_NM] = { /* Number layout, basically the main function layer */ [_SF] = LAYOUT( /* Shifted layout, small changes (because angle brackets have been moved to thumb cluster buttons) */
{_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______ }, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
{_______, CK_1G, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, CK_BSPE }, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
{_______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______ }, _______, _______, _______, _______, _______, _______, _______, _______, NS_HYPH, KC_UNDS, _______, _______,
{XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX }, _______, _______, _______, _______, _______, _______,
{XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX } _______, KC_LABK, _______, _______, KC_RABK, _______
}, ),
[_NS] = { /* Shifted number/function layout, for per-key control. Only active when shift is held, and number is toggled or held */ [_NM] = LAYOUT( /* Number layout, basically the main function layer */
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
{_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, NS_EQU, _______ }, _______, CK_1G, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, CK_BSPE,
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______,
{XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX }, _______, _______, _______, _______, _______, _______,
{XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX } _______, _______, _______, _______, _______, _______
}, ),
[_MS] = { /* Mouse layer, including buttons for clicking. */ [_NS] = LAYOUT( /* Shifted number/function layout, for per-key control. Only active when shift is held, and number is toggled or held */
{_______, _______, _______, _______, _______, _______, KC_VOLU, KC_HOME, KC_PGUP, _______, _______, _______ }, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
{_______, _______, _______, _______, _______, _______, _______, MS_BTN1, MS_BTN2, _______, _______, _______ }, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, NS_EQU, _______,
{_______, _______, _______, _______, _______, _______, KC_VOLD, KC_END, KC_PGDN, _______, _______, _______ }, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
{XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, KC_UP, _______, XXXXXXX, XXXXXXX, XXXXXXX }, _______, _______, _______, _______, _______, _______,
{XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX } _______, _______, _______, _______, _______, _______
} ),
[_MS] = LAYOUT( /* Mouse layer, including buttons for clicking. */
_______, _______, _______, _______, _______, _______, KC_VOLU, KC_HOME, KC_PGUP, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, MS_BTN1, MS_BTN2, _______, _______, _______,
_______, _______, _______, _______, _______, _______, KC_VOLD, KC_END, KC_PGDN, _______, _______, _______,
_______, _______, _______, _______, KC_UP, _______,
_______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT
)
}; };
@ -259,8 +259,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
special_timers[CK_TE-SAFE_RANGE] = 0xFFFF; special_timers[CK_TE-SAFE_RANGE] = 0xFFFF;
} }
break; break;
//No-shift keys, they unregister the KC_LSFT code so they can send //No-shift keys, they unregister the KC_LSFT code so they can send
//unshifted values - but they don't change the bool. if any other //unshifted values - but they don't change the bool. if any other
//key is pressed and the bool is set, KC_LSFT is registered again. //key is pressed and the bool is set, KC_LSFT is registered again.
case NS_HYPH: case NS_HYPH:
if (record->event.pressed) { if (record->event.pressed) {
@ -288,7 +288,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
} }
break; break;
//mouse buttons, for 1-3, to update the mouse report: //mouse buttons, for 1-3, to update the mouse report:
case MS_BTN1: case MS_BTN1:
currentReport = pointing_device_get_report(); currentReport = pointing_device_get_report();
@ -335,7 +335,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
pointing_device_set_report(currentReport); pointing_device_set_report(currentReport);
break;*/ break;*/
//If any other key was pressed during the layer mod hold period, //If any other key was pressed during the layer mod hold period,
//then the layer mod was used momentarily, and should block latching //then the layer mod was used momentarily, and should block latching
//Additionally, if NS_ keys are in use, then shift may be held (but is //Additionally, if NS_ keys are in use, then shift may be held (but is