From 78fdd406227f55f8bb2a1891e7fdbcb4b3daf13b Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 18 Jun 2020 01:20:45 -0400 Subject: [Keymap] Dcompact for iris (#9406) Co-authored-by: Dan Herrera Co-authored-by: Ryan --- keyboards/keebio/iris/keymaps/dcompact/config.h | 21 +++ keyboards/keebio/iris/keymaps/dcompact/keymap.c | 231 +++++++++++++++++++++++ keyboards/keebio/iris/keymaps/dcompact/readme.md | 45 +++++ 3 files changed, 297 insertions(+) create mode 100644 keyboards/keebio/iris/keymaps/dcompact/config.h create mode 100644 keyboards/keebio/iris/keymaps/dcompact/keymap.c create mode 100644 keyboards/keebio/iris/keymaps/dcompact/readme.md diff --git a/keyboards/keebio/iris/keymaps/dcompact/config.h b/keyboards/keebio/iris/keymaps/dcompact/config.h new file mode 100644 index 0000000000..149a54be7f --- /dev/null +++ b/keyboards/keebio/iris/keymaps/dcompact/config.h @@ -0,0 +1,21 @@ +/* +Copyright 2017 Danny Nguyen + +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 + +// #define USE_I2C +#define EE_HANDS diff --git a/keyboards/keebio/iris/keymaps/dcompact/keymap.c b/keyboards/keebio/iris/keymaps/dcompact/keymap.c new file mode 100644 index 0000000000..ec1ffac8c1 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/dcompact/keymap.c @@ -0,0 +1,231 @@ +#include QMK_KEYBOARD_H + +// Custom Keycodes and Combinations Used +#define DEL_SHF SFT_T(KC_DEL) +#define QUAKE LCTL(KC_GRV) + +#define WKSP_L LALT(LCTL(KC_LEFT)) +#define WKSP_D LALT(LCTL(KC_DOWN)) +#define WKSP_U LALT(LCTL(KC_UP)) +#define WKSP_R LALT(LCTL(KC_RGHT)) + +enum custom_layers { + _BASE, + _LOWER, + _RAISE, + _FUNC, + _GAME, + _LNUM, + _LFUN, + _ADJUST +}; + + +enum custom_keycodes { + BASE = SAFE_RANGE, + LOWER, + RAISE, + FUNC, + GAME, + EXT_GM, + LNUM, + LFUN, + ADJUST +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + DEL_SHF, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL, GAME, KC_LGUI, KC_LALT, LOWER, KC_LSFT, _______, _______, KC_SPC, RAISE, KC_RALT, KC_RGUI, FUNC, KC_ENT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LALT, LOWER, KC_LSFT, KC_SPC, RAISE, KC_RALT + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX, KC_PSCR, KC_MENU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX, KC_CAPS, KC_LNUM, KC_INS, XXXXXXX, XXXXXXX, XXXXXXX, WKSP_L, WKSP_D, WKSP_U, WKSP_R, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, XXXXXXX, _______, XXXXXXX + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + QUAKE, KC_GRV, KC_TILD, KC_BSLS, KC_PIPE, KC_LPRN, KC_RPRN, KC_7, KC_8, KC_9, KC_SLSH, KC_EQL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_4, KC_5, KC_6, KC_ASTR, KC_PLUS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LBRC, KC_RBRC, KC_1, KC_2, KC_3, KC_MINS, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, XXXXXXX, _______, _______, _______, KC_LABK, XXXXXXX, XXXXXXX, KC_RABK, _______, KC_0, KC_DOT, KC_COMM, XXXXXXX, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, KC_LABK, KC_RABK, _______, KC_0 + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_FUNC] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX, KC_SLEP, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX, KC_WAKE, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX, KC_PWR, KC_MRWD, KC_MPLY, KC_MFFD, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_GAME] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_TAB, KC_Q, KC_W, KC_E, KC_H, KC_Z, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_A, KC_S, KC_D, KC_U, KC_X, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL, KC_F, KC_G, KC_R, KC_M, KC_C, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ESC, KC_TILD, KC_LALT, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, EXT_GM, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_SPC, LNUM, LFUN, XXXXXXX, XXXXXXX, XXXXXXX + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LNUM] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, KC_1, KC_2, KC_3, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_5, KC_6, KC_7, KC_8, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_9, KC_0, KC_COMM, KC_DOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LFUN] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, BL_STEP, RGB_TOG, RGB_HUI, RGB_SAI, RGB_SAI, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, BL_BRTG, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case FUNC: + if (record->event.pressed) { + layer_on(_FUNC); + } else { + layer_off(_FUNC); + } + return false; + case GAME: + if (!record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + rgblight_mode(RGBLIGHT_MODE_SNAKE); + layer_on(_GAME); + } + return false; + case EXT_GM: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + rgblight_mode(RGBLIGHT_MODE_RAINBOW_MOOD); + layer_off(_GAME); + } + return false; + case LNUM: + if (record->event.pressed) { + layer_on(_LNUM); + } else { + layer_off(_LNUM); + } + return false; + case LFUN: + if (record->event.pressed) { + layer_on(_LFUN); + } else { + layer_off(_LFUN); + } + return false; + } + return true; +} + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + else if (index == 1) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } +} diff --git a/keyboards/keebio/iris/keymaps/dcompact/readme.md b/keyboards/keebio/iris/keymaps/dcompact/readme.md new file mode 100644 index 0000000000..f3f3d8ca6e --- /dev/null +++ b/keyboards/keebio/iris/keymaps/dcompact/readme.md @@ -0,0 +1,45 @@ +# DCompact Layout + +**Dvorak, Layered, Mouse-Enabled, Compact -- now with Game Mode~** + +_See [the layout source](keymap.c) for the actual layout_ + +## Goals + +The following are the goals kept in mind when designing the DCompact +layout: + +- Provide minimal travel distance when typing English or coding +- Consistent muscle memory translation from standard QWERTY +- Stateless typing experience +- OS-agnostic features, macros, and key placement +- Minimize dependence on mouse usage + +These are generally all met or balanced within reason. This layout is +not intended at all to be a familiar layout for much of anyone (except +maybe those who already type in Dvorak) -- this is meant to amplify the +best parts of having limited, ortholinear keys with layering. + +## As Reference Material + +If you're reading this hoping to find reference material to implement +your own layout, then please feel free to copy over this layout and +make edits where you see fit. I removed a lot of the features I felt +extraneous to my usage and simplified style where I felt needed. This +would hopefully mean that my code should feel like a good base to +develop from for those new to QMK. + +_Remember that settings defined in the layout directory override and +merge with those in the keyboard folder_ + +## Relevant Links + +- [Online Dvorak Layout Trainer](https://learn.dvorak.nl/) +- [Dvorak Wikipedia Page](https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard) +- [QMK Docs](https://docs.qmk.fm/#/) +- [QMK KeyCode Reference](https://docs.qmk.fm/#/keycodes) + +## Contact + +Maintainer: [Dan](https://github.com/loksonarius) + -- cgit v1.2.1