From 99e849ac89bcd97c9bd5fcb2b368643bf4fb3812 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 6 Jun 2018 09:47:56 -0700 Subject: Dichotemy: Refactor and Configurator update (#3133) * Refactor KEYMAP to LAYOUT * Configurator support --- keyboards/dichotemy/keymaps/default/keymap.c | 84 ++++++++++++++-------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'keyboards/dichotemy/keymaps/default') diff --git a/keyboards/dichotemy/keymaps/default/keymap.c b/keyboards/dichotemy/keymaps/default/keymap.c index 2298ecb222..8742116f15 100644 --- a/keyboards/dichotemy/keymaps/default/keymap.c +++ b/keyboards/dichotemy/keymaps/default/keymap.c @@ -1,8 +1,7 @@ // 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, -#include "dichotemy.h" -#include "report.h" +#include QMK_KEYBOARD_H #include "pointing_device.h" // 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 -enum dichotemy_keycodes +enum dichotemy_keycodes { CK_1G = SAFE_RANGE, CK_BSPE, @@ -53,45 +52,46 @@ enum dichotemy_macros #define XXXXXXX KC_NO 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) */ - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, _______, NS_HYPH, KC_UNDS, _______, _______ }, - {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX }, - {XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_LABK, _______, _______, KC_RABK, _______, XXXXXXX, XXXXXXX, XXXXXXX } -}, + [_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, + SFTKEY, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MOUSE, + KC_LCTL, KC_LALT, KC_LGUI, KC_RGUI, KC_RALT, KC_RCTL, + KC_LBRC, KC_LPRN, KC_QUOT, KC_SPC, KC_RPRN, KC_RBRC + ), -[_NM] = { /* 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, _______ }, - {_______, 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 } -}, + [_SF] = LAYOUT( /* Shifted layout, small changes (because angle brackets have been moved to thumb cluster buttons) */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, NS_HYPH, KC_UNDS, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, 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 */ - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, NS_EQU, _______ }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX }, - {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX } -}, + [_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, _______, + _______, 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, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ + ), -[_MS] = { /* Mouse layer, including buttons for clicking. */ - {_______, _______, _______, _______, _______, _______, KC_VOLU, KC_HOME, KC_PGUP, _______, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, MS_BTN1, MS_BTN2, _______, _______, _______ }, - {_______, _______, _______, _______, _______, _______, 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 } -} + [_NS] = LAYOUT( /* Shifted number/function layout, for per-key control. Only active when shift is held, and number is toggled or held */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, NS_EQU, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ + ), + + [_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; } break; - //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 + //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 //key is pressed and the bool is set, KC_LSFT is registered again. case NS_HYPH: if (record->event.pressed) { @@ -288,7 +288,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } break; - + //mouse buttons, for 1-3, to update the mouse report: case MS_BTN1: currentReport = pointing_device_get_report(); @@ -335,7 +335,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } pointing_device_set_report(currentReport); break;*/ - + //If any other key was pressed during the layer mod hold period, //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 -- cgit v1.2.3