From 6dab239fbb985cf8b1835b380bb80afc8010d6de Mon Sep 17 00:00:00 2001 From: Canino Developments Date: Sat, 7 Sep 2019 11:42:23 -0400 Subject: [PATCH 01/11] map programmer qwerty --- .../plaid/keymaps/thehalfdeafchef/config.h | 19 ++ .../plaid/keymaps/thehalfdeafchef/keymap.c | 237 ++++++++++++++++++ .../plaid/keymaps/thehalfdeafchef/readme.md | 40 +++ 3 files changed, 296 insertions(+) create mode 100644 keyboards/plaid/keymaps/thehalfdeafchef/config.h create mode 100644 keyboards/plaid/keymaps/thehalfdeafchef/keymap.c create mode 100644 keyboards/plaid/keymaps/thehalfdeafchef/readme.md diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/config.h b/keyboards/plaid/keymaps/thehalfdeafchef/config.h new file mode 100644 index 000000000000..5733b9e4b046 --- /dev/null +++ b/keyboards/plaid/keymaps/thehalfdeafchef/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Takuya Urakawa (dm9records.com) + * + * 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 . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c new file mode 100644 index 000000000000..57fc0217f65d --- /dev/null +++ b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c @@ -0,0 +1,237 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum plaid_layers { + _QWERTY, + _DVORAK, + _COLEMAK, + _LOWER, + _RAISE, + _FUNCTION, +}; + +enum plaid_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LED +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +#define LED_ON 1 +#define LED_OFF 0 + +const uint16_t PROGMEM +keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | LS/( | Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | LGUI | Alt | [ |Lower | Space |Raise | ] | RGUI | \ | RS/) | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = +LAYOUT_planck_mit( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_LBRC, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |RAISE | LT3(']}') | RGUI | \| | RShift(')') | + * `-----------------------------------------------------------------------------------' + */ + +[_COLEMAK] = +LAYOUT_planck_mit( + KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Esc | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + +[_DVORAK] = +LAYOUT_planck_mit( + KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_LGUI, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC +), + +/* LOWER + * ,----------------------------------------------------------------------------. + * | | | MPRV | MPLY | MNXT | | | | PGUP| UP | PGDN|PSCR | + * |------+------+------+------+------+-----+-----+-----+-----+-----------+-----+ + * | | | MUTE | VOLD | VOLU | | | | LEFT| DOWN|RIGHT| | + * |------+------+------+------+------+-----+-----+-----+-----+-----+-----+-----+ + * | | | MAIL | WBAK | WFWD | | | | HOME| | END | | + * |------+------+------+------+------+-----+-----+-----+-----+-----------+-----+ + * | | | | | | DEL | | | | | | + * `----------------------------------------------------------------------------' + */ + +[_LOWER] = +LAYOUT_planck_mit( + KC_NO, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, + KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, + KC_NO, KC_NO, KC_MAIL, KC_WBAK, KC_WFWD, KC_NO, KC_NO, KC_NO, KC_HOME, KC_NO, KC_END, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO +), + +/* RAISE + * ,--------------------------------------------------------------------------------. + * | NLCK | 1 | 2 | 3 | - | | | | ! | # | $ | + | + * |------+------+------+------+------+-----+-----+-----+------+------+------+------+ + * | | 4 | 5 | 6 | + | | | | % | ! | ! | = | + * |------+------+------+------+------+-----+-----+-----+------+------+------+------+ + * | | 7 | 8 | 9 | * | | | | _ | - | @ | ~ | + * |------+------+------+------+------+-----+-----+-----+------+------+------+------+ + * | | 0 | . | Ent | = | | | | | | ` | + * `--------------------------------------------------------------------------------' + */ + +[_RAISE] = +LAYOUT_planck_mit( + KC_NLCK, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_NO, KC_NO, KC_NO, KC_EXLM, KC_HASH, KC_DLR, KC_PLUS, + KC_PSLS, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_NO, KC_NO, KC_NO, KC_PERC, KC_ASTR, KC_AMPR, KC_EQL, + KC_PAST, KC_P7, KC_P8, KC_P9, KC_PCMM, KC_NO, KC_NO, KC_NO, KC_UNDS, KC_MINS, KC_AT, KC_TILDE, + KC_NO, KC_P0, KC_PDOT, KC_PENT, KC_PEQL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_GRV +), + +/* Function (Lower + Raise) + * ,-----------------------------------------------------------------------------------------------------------------------. + * | RESET| LCA_T(F1) | LCA_T(F2) | LCA_T(F3) | LCA_T(F4) | LCA_T(F5) | LCA_T(F6) | LCA_T(F7) | | | | | + * |------+------------+-----------+-----------+-----------+-----------+-----------+-----------+------+------+------+------+ + * | | | | | | QWERTY | DVORAK | COLEMAK | | | | | + * |------+------------+-----------+-----------+-----------+-----------+-----------+-----------+------+------+------+------+ + * | | | | | | | | | | | | | + * |------+------------+-----------+-----------+-----------+-----------+-----------+-----------+------+------+------+------+ + * | | | | | | LED | | | | | | + * `-----------------------------------------------------------------------------------------------------------------------' + */ + +[_FUNCTION] = +LAYOUT_planck_mit( + RESET, LCA_T(KC_F1), LCA_T(KC_F2), LCA_T(KC_F3), LCA_T(KC_F4), LCA_T(KC_F5), LCA_T(KC_F6), LCA_T( + KC_F7), KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, QWERTY, DVORAK, COLEMAK, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LED, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO +) +}; + +// constants to toggle LED behavior +#define LED_ON 1 +#define LED_OFF 0 + + +//Setup config struct for LED +typedef union { + uint32_t raw; + struct { + uint8_t red_mode :8; + uint8_t green_mode :8; + }; +} led_config_t; +led_config_t led_config; + +void keyboard_post_init_user(void) { + led_config.raw = eeconfig_read_user(); +} + +void eeconfig_init_user(void) { // EEPROM is getting reset! + led_config.raw = 0; + led_config.red_mode = LED_ON; + led_config.green_mode = LED_ON; + eeconfig_update_user(led_config.raw); + eeconfig_update_user(led_config.raw); +} + +// When LOWER and RAISE are held together, go to the FUNCTION layer +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _FUNCTION); +} + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + switch (layer) { + case _LOWER: + writePinHigh(LED_RED); + break; + case _RAISE: + writePinHigh(LED_GREEN); + break; + default: + writePinLow(LED_GREEN); + writePinLow(LED_RED); + + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LED: + if (record->event.pressed) { + if (led_config.red_mode == LED_ON && led_config.green_mode == LED_ON) { + led_config.red_mode = LED_OFF; + led_config.green_mode = LED_OFF; + } else if (led_config.red_mode == LED_OFF && led_config.green_mode == LED_OFF) { + led_config.red_mode = LED_ON; + led_config.green_mode = LED_ON; + } + } + eeconfig_update_user(led_config.raw); + return false; + break; + } + return true; +} diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/readme.md b/keyboards/plaid/keymaps/thehalfdeafchef/readme.md new file mode 100644 index 000000000000..7908c2e10844 --- /dev/null +++ b/keyboards/plaid/keymaps/thehalfdeafchef/readme.md @@ -0,0 +1,40 @@ +

Plaid Keymap for Programmers 👋

+

(MIT Layout)

+

+

+ +> An opinionated keymap with QWERTY, DVORAK, and COLEMAN layouts intended for programmers. The Left and Right Shift tap as parenthesis and the bracket keys are to either side of the layer keys (LOWER, RAISE). An additional layer is provided to swith to virtual console on Linux based systems running xorg. + +### 🏠 [Homepage](https://github.com/CaninoDev/qmk_firmware) + +## Install + +```sh +make plaid:thehalfdeafchef:program +``` + +## KeyMap +![QWERTY](./assets/QWERTY_layer.png) +
+![COLEMAK](./assets/COLEMAK_layer.png) +
+![DVORAK](./assets/DVORAK_layer.png) +
+![LOWER](./assets/LOWER_layer.png) +
+![RAISE](./assets/RAISE_layer.png) +
+![FUNCTION](./assets/FUNCTION_layer.png) + +## Author + +👤 **The Half Deaf Chef** + +* Github: [@CaninoDev](https://github.com/CaninoDev) + +## Show your support + +Give a ⭐️ if this project helped you! + +*** +_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_ From d53f686006907d8eff40227a3a5f27995ca31d50 Mon Sep 17 00:00:00 2001 From: Canino Developments Date: Sat, 7 Sep 2019 11:47:17 -0400 Subject: [PATCH 02/11] clarify and fix typo --- keyboards/plaid/keymaps/thehalfdeafchef/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/readme.md b/keyboards/plaid/keymaps/thehalfdeafchef/readme.md index 7908c2e10844..be0a54b5e82e 100644 --- a/keyboards/plaid/keymaps/thehalfdeafchef/readme.md +++ b/keyboards/plaid/keymaps/thehalfdeafchef/readme.md @@ -3,7 +3,7 @@

-> An opinionated keymap with QWERTY, DVORAK, and COLEMAN layouts intended for programmers. The Left and Right Shift tap as parenthesis and the bracket keys are to either side of the layer keys (LOWER, RAISE). An additional layer is provided to swith to virtual console on Linux based systems running xorg. +> An opinionated QWERTY keymap optimized for programmers. The Left and Right Shift tap as parenthesis and the bracket keys are to either side of the layer keys (LOWER, RAISE). A 'right-side' up numberpad in a layer with a complementary 'symbol' pad on the opposite side. An additional layer is provided to switch to virtual console on Linux based systems running xorg. ### 🏠 [Homepage](https://github.com/CaninoDev/qmk_firmware) From 3240290817e717bf82e619ca24666c2121e2c505 Mon Sep 17 00:00:00 2001 From: Canino Developments Date: Sun, 8 Sep 2019 14:57:05 -0400 Subject: [PATCH 03/11] finishing touches --- keyboards/plaid/keymaps/thehalfdeafchef/keymap.c | 12 ++++++------ keyboards/plaid/keymaps/thehalfdeafchef/readme.md | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c index 57fc0217f65d..1782dbffb3b8 100644 --- a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c +++ b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c @@ -52,9 +52,9 @@ LAYOUT_planck_mit( * |------+------+------+------+------+-------------+------+------+------+------+------| * | Tab | A | R | S | T | D | H | N | E | I | O | " | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * | LS/( | Z | X | C | V | B | K | M | , | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | RAlt | Alt | GUI |Lower | Space |RAISE | LT3(']}') | RGUI | \| | RShift(')') | + * | Ctrl | LGUI | Alt | [ |Lower | Space |Raise | ] | RGUI | \ | RS/) | * `-----------------------------------------------------------------------------------' */ @@ -62,7 +62,7 @@ LAYOUT_planck_mit( LAYOUT_planck_mit( KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC ), @@ -74,7 +74,7 @@ LAYOUT_planck_mit( * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Ctrl | LGUI | Alt | [ |Lower | Space |Raise | ] | RGUI | \ | RS/) | * `-----------------------------------------------------------------------------------' */ @@ -82,8 +82,8 @@ LAYOUT_planck_mit( LAYOUT_planck_mit( KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, - KC_LCTL, KC_LALT, KC_LGUI, KC_LGUI, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC + KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, + KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC ), /* LOWER diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/readme.md b/keyboards/plaid/keymaps/thehalfdeafchef/readme.md index be0a54b5e82e..825139fad367 100644 --- a/keyboards/plaid/keymaps/thehalfdeafchef/readme.md +++ b/keyboards/plaid/keymaps/thehalfdeafchef/readme.md @@ -3,8 +3,7 @@

-> An opinionated QWERTY keymap optimized for programmers. The Left and Right Shift tap as parenthesis and the bracket keys are to either side of the layer keys (LOWER, RAISE). A 'right-side' up numberpad in a layer with a complementary 'symbol' pad on the opposite side. An additional layer is provided to switch to virtual console on Linux based systems running xorg. - +> Opinionated keymaps optimized for programmers. The Left and Right Shift tap as parenthesis and the bracket keys are to either side of the layer keys (LOWER, RAISE). A 'right-side' up number pad in a layer with a complementary 'symbol' pad on the opposite side. An additional layer is provided to switch to virtual console on Linux based systems running xorg. These changes are propagated among all the layouts. ### 🏠 [Homepage](https://github.com/CaninoDev/qmk_firmware) ## Install From 95b23592824070f5fd67ce2622a89bb8da90628d Mon Sep 17 00:00:00 2001 From: Canino Developments Date: Sun, 8 Sep 2019 19:16:11 -0400 Subject: [PATCH 04/11] use qmk s templates for readme --- .../plaid/keymaps/thehalfdeafchef/readme.md | 40 ++----------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/readme.md b/keyboards/plaid/keymaps/thehalfdeafchef/readme.md index 825139fad367..bd09965b55e4 100644 --- a/keyboards/plaid/keymaps/thehalfdeafchef/readme.md +++ b/keyboards/plaid/keymaps/thehalfdeafchef/readme.md @@ -1,39 +1,5 @@ -

Plaid Keymap for Programmers 👋

-

(MIT Layout)

-

-

+![Plaid Layout Image](https://i.imgur.com/WnVnwEG.png) -> Opinionated keymaps optimized for programmers. The Left and Right Shift tap as parenthesis and the bracket keys are to either side of the layer keys (LOWER, RAISE). A 'right-side' up number pad in a layer with a complementary 'symbol' pad on the opposite side. An additional layer is provided to switch to virtual console on Linux based systems running xorg. These changes are propagated among all the layouts. -### 🏠 [Homepage](https://github.com/CaninoDev/qmk_firmware) +# The Half Deaf Chef Plaid Layout -## Install - -```sh -make plaid:thehalfdeafchef:program -``` - -## KeyMap -![QWERTY](./assets/QWERTY_layer.png) -
-![COLEMAK](./assets/COLEMAK_layer.png) -
-![DVORAK](./assets/DVORAK_layer.png) -
-![LOWER](./assets/LOWER_layer.png) -
-![RAISE](./assets/RAISE_layer.png) -
-![FUNCTION](./assets/FUNCTION_layer.png) - -## Author - -👤 **The Half Deaf Chef** - -* Github: [@CaninoDev](https://github.com/CaninoDev) - -## Show your support - -Give a ⭐️ if this project helped you! - -*** -_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_ +Opinionated keymaps optimized for programmers. The Left and Right Shift tap as parenthesis and the bracket keys are to either side of the layer keys (LOWER, RAISE). A 'right-side' up number pad in a layer with a complementary 'symbol' pad on the opposite side. An additional layer is provided to switch to virtual console on Linux based systems running xorg. These changes are propagated among all the layouts. From 5871d2dbe59aa9dbedd89ed94d1fbb6b7a7444ec Mon Sep 17 00:00:00 2001 From: Canino Developments Date: Sun, 8 Sep 2019 19:18:44 -0400 Subject: [PATCH 05/11] update copyright notice --- keyboards/plaid/keymaps/thehalfdeafchef/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/config.h b/keyboards/plaid/keymaps/thehalfdeafchef/config.h index 5733b9e4b046..4bcbc6f673a7 100644 --- a/keyboards/plaid/keymaps/thehalfdeafchef/config.h +++ b/keyboards/plaid/keymaps/thehalfdeafchef/config.h @@ -1,4 +1,4 @@ -/* Copyright 2019 Takuya Urakawa (dm9records.com) +/* Copyright 2019 Ian Canino (ian@thecommittedbug.io) * * 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 From 2294fe23254e2a5d07662a79dce3dd4ee464d9f8 Mon Sep 17 00:00:00 2001 From: IanGC Date: Wed, 11 Sep 2019 10:04:45 -0400 Subject: [PATCH 06/11] remove unnecessary code Co-Authored-By: Drashna Jaelre --- keyboards/plaid/keymaps/thehalfdeafchef/keymap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c index 1782dbffb3b8..773cce305e6c 100644 --- a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c +++ b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c @@ -1,6 +1,5 @@ #include QMK_KEYBOARD_H -extern keymap_config_t keymap_config; enum plaid_layers { _QWERTY, From 576bd88107cf5b685342d1f667bc8db7c6d3f7d3 Mon Sep 17 00:00:00 2001 From: IanGC Date: Wed, 11 Sep 2019 10:05:47 -0400 Subject: [PATCH 07/11] remove unnecessary code Co-Authored-By: Drashna Jaelre --- keyboards/plaid/keymaps/thehalfdeafchef/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c index 773cce305e6c..1917cbf0d125 100644 --- a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c +++ b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c @@ -156,7 +156,7 @@ LAYOUT_planck_mit( typedef union { uint32_t raw; struct { - uint8_t red_mode :8; + bool red_mode :1; uint8_t green_mode :8; }; } led_config_t; From b58074966c47b9e6a0c5e6e9134791cdb5d85a72 Mon Sep 17 00:00:00 2001 From: IanGC Date: Wed, 11 Sep 2019 10:06:23 -0400 Subject: [PATCH 08/11] Update keyboards/plaid/keymaps/thehalfdeafchef/keymap.c Co-Authored-By: Drashna Jaelre --- keyboards/plaid/keymaps/thehalfdeafchef/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c index 1917cbf0d125..a7afc9b543fa 100644 --- a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c +++ b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c @@ -157,7 +157,7 @@ typedef union { uint32_t raw; struct { bool red_mode :1; - uint8_t green_mode :8; + bool green_mode :1; }; } led_config_t; led_config_t led_config; From 2d8aa8c2b0020e56dd308c233901d093bd9d32dc Mon Sep 17 00:00:00 2001 From: Canino Developments Date: Fri, 13 Sep 2019 20:42:57 -0400 Subject: [PATCH 09/11] fix documentation --- keyboards/plaid/keymaps/thehalfdeafchef/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c index a7afc9b543fa..d5e211dd8b93 100644 --- a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c +++ b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c @@ -109,9 +109,9 @@ LAYOUT_planck_mit( * ,--------------------------------------------------------------------------------. * | NLCK | 1 | 2 | 3 | - | | | | ! | # | $ | + | * |------+------+------+------+------+-----+-----+-----+------+------+------+------+ - * | | 4 | 5 | 6 | + | | | | % | ! | ! | = | + * | / | 4 | 5 | 6 | + | | | | % | ! | ! | = | * |------+------+------+------+------+-----+-----+-----+------+------+------+------+ - * | | 7 | 8 | 9 | * | | | | _ | - | @ | ~ | + * | * | 7 | 8 | 9 | , | | | | _ | - | @ | ~ | * |------+------+------+------+------+-----+-----+-----+------+------+------+------+ * | | 0 | . | Ent | = | | | | | | ` | * `--------------------------------------------------------------------------------' From 228895b269f269ff58f9b283b0dbee122468bfe5 Mon Sep 17 00:00:00 2001 From: Canino Developments Date: Fri, 13 Sep 2019 21:14:06 -0400 Subject: [PATCH 10/11] reformat code --- .../plaid/keymaps/thehalfdeafchef/keymap.c | 240 +++++++----------- 1 file changed, 94 insertions(+), 146 deletions(-) diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c index d5e211dd8b93..e92577ec7a80 100644 --- a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c +++ b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c @@ -1,6 +1,5 @@ #include QMK_KEYBOARD_H - enum plaid_layers { _QWERTY, _DVORAK, @@ -10,12 +9,7 @@ enum plaid_layers { _FUNCTION, }; -enum plaid_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LED -}; +enum plaid_keycodes { QWERTY = SAFE_RANGE, COLEMAK, DVORAK, LED }; #define LOWER MO(_LOWER) #define RAISE MO(_RAISE) @@ -23,165 +17,120 @@ enum plaid_keycodes { #define LED_ON 1 #define LED_OFF 0 -const uint16_t PROGMEM -keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Tab | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | LS/( | Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | LGUI | Alt | [ |Lower | Space |Raise | ] | RGUI | \ | RS/) | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = -LAYOUT_planck_mit( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_LBRC, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC -), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Esc | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Tab | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | LS/( | Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | LGUI | Alt | [ |Lower | Space |Raise | ] | RGUI | \ | RS/) | - * `-----------------------------------------------------------------------------------' - */ - -[_COLEMAK] = -LAYOUT_planck_mit( - KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, - KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, - KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC -), - -/* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Esc | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Tab | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | LGUI | Alt | [ |Lower | Space |Raise | ] | RGUI | \ | RS/) | - * `-----------------------------------------------------------------------------------' - */ - -[_DVORAK] = -LAYOUT_planck_mit( - KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, - KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, - KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, - KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC -), - -/* LOWER - * ,----------------------------------------------------------------------------. - * | | | MPRV | MPLY | MNXT | | | | PGUP| UP | PGDN|PSCR | - * |------+------+------+------+------+-----+-----+-----+-----+-----------+-----+ - * | | | MUTE | VOLD | VOLU | | | | LEFT| DOWN|RIGHT| | - * |------+------+------+------+------+-----+-----+-----+-----+-----+-----+-----+ - * | | | MAIL | WBAK | WFWD | | | | HOME| | END | | - * |------+------+------+------+------+-----+-----+-----+-----+-----------+-----+ - * | | | | | | DEL | | | | | | - * `----------------------------------------------------------------------------' - */ - -[_LOWER] = -LAYOUT_planck_mit( - KC_NO, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, - KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, - KC_NO, KC_NO, KC_MAIL, KC_WBAK, KC_WFWD, KC_NO, KC_NO, KC_NO, KC_HOME, KC_NO, KC_END, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO -), - -/* RAISE - * ,--------------------------------------------------------------------------------. - * | NLCK | 1 | 2 | 3 | - | | | | ! | # | $ | + | - * |------+------+------+------+------+-----+-----+-----+------+------+------+------+ - * | / | 4 | 5 | 6 | + | | | | % | ! | ! | = | - * |------+------+------+------+------+-----+-----+-----+------+------+------+------+ - * | * | 7 | 8 | 9 | , | | | | _ | - | @ | ~ | - * |------+------+------+------+------+-----+-----+-----+------+------+------+------+ - * | | 0 | . | Ent | = | | | | | | ` | - * `--------------------------------------------------------------------------------' - */ - -[_RAISE] = -LAYOUT_planck_mit( - KC_NLCK, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_NO, KC_NO, KC_NO, KC_EXLM, KC_HASH, KC_DLR, KC_PLUS, - KC_PSLS, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_NO, KC_NO, KC_NO, KC_PERC, KC_ASTR, KC_AMPR, KC_EQL, - KC_PAST, KC_P7, KC_P8, KC_P9, KC_PCMM, KC_NO, KC_NO, KC_NO, KC_UNDS, KC_MINS, KC_AT, KC_TILDE, - KC_NO, KC_P0, KC_PDOT, KC_PENT, KC_PEQL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_GRV -), - -/* Function (Lower + Raise) - * ,-----------------------------------------------------------------------------------------------------------------------. - * | RESET| LCA_T(F1) | LCA_T(F2) | LCA_T(F3) | LCA_T(F4) | LCA_T(F5) | LCA_T(F6) | LCA_T(F7) | | | | | - * |------+------------+-----------+-----------+-----------+-----------+-----------+-----------+------+------+------+------+ - * | | | | | | QWERTY | DVORAK | COLEMAK | | | | | - * |------+------------+-----------+-----------+-----------+-----------+-----------+-----------+------+------+------+------+ - * | | | | | | | | | | | | | - * |------+------------+-----------+-----------+-----------+-----------+-----------+-----------+------+------+------+------+ - * | | | | | | LED | | | | | | - * `-----------------------------------------------------------------------------------------------------------------------' - */ - -[_FUNCTION] = -LAYOUT_planck_mit( - RESET, LCA_T(KC_F1), LCA_T(KC_F2), LCA_T(KC_F3), LCA_T(KC_F4), LCA_T(KC_F5), LCA_T(KC_F6), LCA_T( - KC_F7), KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, QWERTY, DVORAK, COLEMAK, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LED, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO -) -}; +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | LS/( | Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | LGUI | Alt | [ |Lower | Space |Raise | ] | RGUI | \ | RS/) | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_planck_mit(KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_LCTL, KC_LGUI, KC_LALT, KC_LBRC, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC), + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | LS/( | Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | LGUI | Alt | [ |Lower | Space |Raise | ] | RGUI | \ | RS/) | + * `-----------------------------------------------------------------------------------' + */ + + [_COLEMAK] = LAYOUT_planck_mit(KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC), + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Esc | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | LGUI | Alt | [ |Lower | Space |Raise | ] | RGUI | \ | RS/) | + * `-----------------------------------------------------------------------------------' + */ + + [_DVORAK] = LAYOUT_planck_mit(KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC), + + /* LOWER + * ,----------------------------------------------------------------------------. + * | | | MPRV | MPLY | MNXT | | | | PGUP| UP | PGDN|PSCR | + * |------+------+------+------+------+-----+-----+-----+-----+-----------+-----+ + * | | | MUTE | VOLD | VOLU | | | | LEFT| DOWN|RIGHT| | + * |------+------+------+------+------+-----+-----+-----+-----+-----+-----+-----+ + * | | | MAIL | WBAK | WFWD | | | | HOME| | END | | + * |------+------+------+------+------+-----+-----+-----+-----+-----------+-----+ + * | | | | | | DEL | | | | | | + * `----------------------------------------------------------------------------' + */ + + [_LOWER] = LAYOUT_planck_mit(KC_NO, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_MAIL, KC_WBAK, KC_WFWD, KC_NO, KC_NO, KC_NO, KC_HOME, KC_NO, KC_END, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), + + /* RAISE + * ,--------------------------------------------------------------------------------. + * | NLCK | 1 | 2 | 3 | - | | | | ! | # | $ | + | + * |------+------+------+------+------+-----+-----+-----+------+------+------+------+ + * | / | 4 | 5 | 6 | + | | | | % | ! | ! | = | + * |------+------+------+------+------+-----+-----+-----+------+------+------+------+ + * | * | 7 | 8 | 9 | , | | | | _ | - | @ | ~ | + * |------+------+------+------+------+-----+-----+-----+------+------+------+------+ + * | | 0 | . | Ent | = | | | | | | ` | + * `--------------------------------------------------------------------------------' + */ + + [_RAISE] = LAYOUT_planck_mit(KC_NLCK, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_NO, KC_NO, KC_NO, KC_EXLM, KC_HASH, KC_DLR, KC_PLUS, KC_PSLS, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_NO, KC_NO, KC_NO, KC_PERC, KC_ASTR, KC_AMPR, KC_EQL, KC_PAST, KC_P7, KC_P8, KC_P9, KC_PCMM, KC_NO, KC_NO, KC_NO, KC_UNDS, KC_MINS, KC_AT, KC_TILDE, KC_NO, KC_P0, KC_PDOT, KC_PENT, KC_PEQL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_GRV), + + /* Function (Lower + Raise) + * ,-----------------------------------------------------------------------------------------------------------------------. + * | RESET| LCA_T(F1) | LCA_T(F2) | LCA_T(F3) | LCA_T(F4) | LCA_T(F5) | LCA_T(F6) | LCA_T(F7) | | | | | + * |------+------------+-----------+-----------+-----------+-----------+-----------+-----------+------+------+------+------+ + * | | | | | | QWERTY | DVORAK | COLEMAK | | | | | + * |------+------------+-----------+-----------+-----------+-----------+-----------+-----------+------+------+------+------+ + * | | | | | | | | | | | | | + * |------+------------+-----------+-----------+-----------+-----------+-----------+-----------+------+------+------+------+ + * | | | | | | LED | | | | | | + * `-----------------------------------------------------------------------------------------------------------------------' + */ + + [_FUNCTION] = LAYOUT_planck_mit(RESET, LCA_T(KC_F1), LCA_T(KC_F2), LCA_T(KC_F3), LCA_T(KC_F4), LCA_T(KC_F5), LCA_T(KC_F6), LCA_T(KC_F7), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, QWERTY, DVORAK, COLEMAK, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LED, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO)}; // constants to toggle LED behavior #define LED_ON 1 #define LED_OFF 0 - -//Setup config struct for LED +// Setup config struct for LED typedef union { uint32_t raw; struct { - bool red_mode :1; - bool green_mode :1; + bool red_mode : 1; + bool green_mode : 1; }; } led_config_t; led_config_t led_config; -void keyboard_post_init_user(void) { - led_config.raw = eeconfig_read_user(); -} +void keyboard_post_init_user(void) { led_config.raw = eeconfig_read_user(); } void eeconfig_init_user(void) { // EEPROM is getting reset! - led_config.raw = 0; - led_config.red_mode = LED_ON; + led_config.raw = 0; + led_config.red_mode = LED_ON; led_config.green_mode = LED_ON; eeconfig_update_user(led_config.raw); eeconfig_update_user(led_config.raw); } // When LOWER and RAISE are held together, go to the FUNCTION layer -uint32_t layer_state_set_user(uint32_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _FUNCTION); -} +uint32_t layer_state_set_user(uint32_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _FUNCTION); } // Runs constantly in the background, in a loop. void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); switch (layer) { @@ -194,7 +143,6 @@ void matrix_scan_user(void) { default: writePinLow(LED_GREEN); writePinLow(LED_RED); - } } @@ -221,10 +169,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case LED: if (record->event.pressed) { if (led_config.red_mode == LED_ON && led_config.green_mode == LED_ON) { - led_config.red_mode = LED_OFF; + led_config.red_mode = LED_OFF; led_config.green_mode = LED_OFF; } else if (led_config.red_mode == LED_OFF && led_config.green_mode == LED_OFF) { - led_config.red_mode = LED_ON; + led_config.red_mode = LED_ON; led_config.green_mode = LED_ON; } } From 89d17f7cfaf74e0553f57aa43239c3ee2695bb30 Mon Sep 17 00:00:00 2001 From: IanGC Date: Sun, 15 Sep 2019 12:36:54 -0400 Subject: [PATCH 11/11] Apply suggestions from code review Co-Authored-By: Drashna Jaelre --- keyboards/plaid/keymaps/thehalfdeafchef/keymap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c index e92577ec7a80..bdf6c54c316c 100644 --- a/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c +++ b/keyboards/plaid/keymaps/thehalfdeafchef/keymap.c @@ -103,8 +103,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_FUNCTION] = LAYOUT_planck_mit(RESET, LCA_T(KC_F1), LCA_T(KC_F2), LCA_T(KC_F3), LCA_T(KC_F4), LCA_T(KC_F5), LCA_T(KC_F6), LCA_T(KC_F7), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, QWERTY, DVORAK, COLEMAK, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LED, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO)}; // constants to toggle LED behavior -#define LED_ON 1 -#define LED_OFF 0 // Setup config struct for LED typedef union {