diff options
author | TripTrap <adamnaldal@gmail.com> | 2020-08-08 20:24:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-08 11:24:10 -0700 |
commit | b506c498a789563511f59c8c902e9d9f6a1daaa4 (patch) | |
tree | 5cc733161d725f3867bcaa2f231e695db706c619 /keyboards | |
parent | a536e1bd8f29f82eb5cd4a7db6a4874bd469a076 (diff) |
[Keyboard] Dumbo (#9656)
* added dumbo keyboard
* added my personal keymap
* changed picture in readme
* removed rev1 folder to reduce clutter and confusion
* missed a few changes in last commit, everything should be added now
* Apply suggestions from code review
Committed all of the suggested changes except for removing the bootloader reference comments in rules.mk as i think it is handy.
* Update keyboards/dumbo/rules.mk
Removed the bootloader reference as suggested
* Apply clean up of info.json
* Apply suggestions from noroadsleft to support community layout LAYOUT_SPLIT_3x6_4 in the future_4
Diffstat (limited to 'keyboards')
-rw-r--r-- | keyboards/dumbo/config.h | 58 | ||||
-rw-r--r-- | keyboards/dumbo/dumbo.c | 16 | ||||
-rw-r--r-- | keyboards/dumbo/dumbo.h | 44 | ||||
-rw-r--r-- | keyboards/dumbo/info.json | 64 | ||||
-rw-r--r-- | keyboards/dumbo/keymaps/default/config.h | 21 | ||||
-rw-r--r-- | keyboards/dumbo/keymaps/default/keymap.c | 230 | ||||
-rw-r--r-- | keyboards/dumbo/keymaps/default/rules.mk | 2 | ||||
-rw-r--r-- | keyboards/dumbo/keymaps/trip-trap/config.h | 27 | ||||
-rw-r--r-- | keyboards/dumbo/keymaps/trip-trap/keymap.c | 428 | ||||
-rw-r--r-- | keyboards/dumbo/keymaps/trip-trap/rules.mk | 3 | ||||
-rw-r--r-- | keyboards/dumbo/readme.md | 17 | ||||
-rw-r--r-- | keyboards/dumbo/rules.mk | 23 |
12 files changed, 933 insertions, 0 deletions
diff --git a/keyboards/dumbo/config.h b/keyboards/dumbo/config.h new file mode 100644 index 0000000000..07b67d06d3 --- /dev/null +++ b/keyboards/dumbo/config.h @@ -0,0 +1,58 @@ +/* +Copyright 2020 Adam Naldal <adamnaldal@gmail.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 <http://www.gnu.org/licenses/>. +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x25E3 +#define DEVICE_VER 0x0001 +#define MANUFACTURER trip_trap +#define PRODUCT Dumbo + +/* key matrix size */ +/* Rows are doubled up */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +// wiring +#define MATRIX_ROW_PINS { D4, D7, E6, B4 } +#define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6} +#define UNUSED_PINS + +#define ENCODERS_PAD_A { F4, C6 } +#define ENCODERS_PAD_B { F5, B5 } +#define ENCODERS_PAD_A_RIGHT { F5, B5 } +#define ENCODERS_PAD_B_RIGHT { F4, C6 } + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D2 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/dumbo/dumbo.c b/keyboards/dumbo/dumbo.c new file mode 100644 index 0000000000..a8c34c1c9e --- /dev/null +++ b/keyboards/dumbo/dumbo.c @@ -0,0 +1,16 @@ +/* Copyright 2020 Adam Naldal <adamnaldal@gmail.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 <http://www.gnu.org/licenses/>. + */ +#include "dumbo.h" diff --git a/keyboards/dumbo/dumbo.h b/keyboards/dumbo/dumbo.h new file mode 100644 index 0000000000..bd1d02f8ec --- /dev/null +++ b/keyboards/dumbo/dumbo.h @@ -0,0 +1,44 @@ +/* Copyright 2020 Adam Naldal <adamnaldal@gmail.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 <http://www.gnu.org/licenses/>. + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#define LAYOUT_split_3x6_4( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, R30, R31, R32, R33 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { KC_NO, KC_NO, L30, L31, L32, L33 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { KC_NO, KC_NO, R33, R32, R31, R30 } \ + } diff --git a/keyboards/dumbo/info.json b/keyboards/dumbo/info.json new file mode 100644 index 0000000000..900b5bb5ac --- /dev/null +++ b/keyboards/dumbo/info.json @@ -0,0 +1,64 @@ +{ + "keyboard_name": "Dumbo", + "url": "", + "maintainer": "adamnaldal", + "width": 15.5, + "height": 5.25, + "layouts": { + "LAYOUT_split_3x6_4": { + "layout": [ + {"x":0, "y":1.25}, + {"x":1, "y":1}, + {"x":2, "y":0.25}, + {"x":3, "y":0}, + {"x":4, "y":0.5}, + {"x":5, "y":0.75}, + + {"x":9.5, "y":0.75}, + {"x":10.5, "y":0.5}, + {"x":11.5, "y":0}, + {"x":12.5, "y":0.25}, + {"x":13.5, "y":1}, + {"x":14.5, "y":1.25}, + + {"x":0, "y":2.25}, + {"x":1, "y":2}, + {"x":2, "y":1.25}, + {"x":3, "y":1}, + {"x":4, "y":1.5}, + {"x":5, "y":1.75}, + + {"x":9.5, "y":1.75}, + {"x":10.5, "y":1.5}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1.25}, + {"x":13.5, "y":2}, + {"x":14.5, "y":2.25}, + + {"x":0, "y":3.25}, + {"x":1, "y":3}, + {"x":2, "y":2.25}, + {"x":3, "y":2}, + {"x":4, "y":2.5}, + {"x":5, "y":2.75}, + + {"x":9.5, "y":2.75}, + {"x":10.5, "y":2.5}, + {"x":11.5, "y":2}, + {"x":12.5, "y":2.25}, + {"x":13.5, "y":3}, + {"x":14.5, "y":3.25}, + + {"x":3.25, "y":3.75}, + {"x":4.25, "y":3.75, "h":1.5}, + {"x":5.25, "y":3.75, "h":1.5}, + {"x":6.25, "y":4.25}, + + {"x":8.25, "y":4.25}, + {"x":9.25, "y":3.75, "h":1.5}, + {"x":10.25, "y":3.75, "h":1.5}, + {"x":11.25, "y":3.75} + ] + } + } +} diff --git a/keyboards/dumbo/keymaps/default/config.h b/keyboards/dumbo/keymaps/default/config.h new file mode 100644 index 0000000000..3b330ce546 --- /dev/null +++ b/keyboards/dumbo/keymaps/default/config.h @@ -0,0 +1,21 @@ +/* Copyright 2020 Adam Naldal <adamnaldal@gmail.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 <http://www.gnu.org/licenses/>. + */ + +#pragma once + +// If you are using an Elite C rev3 on the slave side, uncomment the lines below: +// #define SPLIT_USB_DETECT +// #define NO_USB_STARTUP_CHECK diff --git a/keyboards/dumbo/keymaps/default/keymap.c b/keyboards/dumbo/keymaps/default/keymap.c new file mode 100644 index 0000000000..dfa6a52b91 --- /dev/null +++ b/keyboards/dumbo/keymaps/default/keymap.c @@ -0,0 +1,230 @@ +/* Copyright 2020 Adam Naldal <adamnaldal@gmail.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 <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H + +enum layers { + _QWERTY = 0, + _NN, + _MS, + _SP +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* + * Base Layer: QWERTY + * + * ,-------------------------------------------. ,-------------------------------------------. + * | TAB | Q | W | E | R | T | | Y | U | I | O | P | ESC | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | CTRL | A | S | D | F | G | | H | J | K | L | ; : | ' " | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | N | M | , < | . > | / ? | SHIFT | + * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' + * | GUI | Caps | Space| Nav +| |Media+| Bksp | Enter| AltGr| + * | | | |Number| |symbol| | | | + * `---------------------------' `---------------------------' + */ + [_QWERTY] = LAYOUT_split_3x6_4( + //,-----------------------------------------------------. ,-----------------------------------------------------. + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ESC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| + KC_LGUI, KC_CAPS, KC_SPC, MO(_NN), MO(_MS), KC_BSPC, KC_ENT, KC_RALT + //`------------------------------------' '------------------------------------' + ), + /* + * Navigation and Numbers: _NN + * + * ,-------------------------------------------. ,-------------------------------------------. + * | TAB | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ESC | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | CTRL | F1 | F2 | F3 | F4 | F5 | | left | down | up | right| | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | LShift | F6 | F7 | F8 | F9 | F10 | | home | pgdn | pgup | end | | SHIFT | + * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' + * | GUI | Del | Space| Nav +| |Media+|Back- | Enter| AltGr| + * | | | |Number| |symbol|space | | | + * `---------------------------' `---------------------------' + */ + [_NN] = LAYOUT_split_3x6_4( + //,-----------------------------------------------------. ,-----------------------------------------------------. + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, KC_RSFT, + //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| + KC_LGUI, KC_DEL, KC_SPC, _______, _______, KC_BSPC, KC_ENT, KC_RALT + //`------------------------------------' '------------------------------------' + ), + /* + * Media and Symbols: _MS + * + * ,-------------------------------------------. ,-------------------------------------------. + * | TAB | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ESC | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | CTRL | | prev | play | next | vol+ | | - | = | { | } | | | ´ | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | LShift | |brght-|brght+| mute | vol- | | _ | + | [ | ] | \ | ~ | + * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' + * | GUI | Del | Space| Nav +| |Media+| Bksp | Enter| AltGr| + * | | | |Number| |symbol| | | | + * `---------------------------' `---------------------------' + */ + [_MS] = LAYOUT_split_3x6_4( + //,-----------------------------------------------------. ,-----------------------------------------------------. + KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_ESC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTL, XXXXXXX, KC_MRWD, KC_MPLY, KC_MFFD, KC_VOLU, KC_MINS, KC_EQL, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, XXXXXXX, KC_BRID, KC_BRIU, KC_MUTE, KC_VOLD, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_BSLS, KC_TILD, + //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| + KC_LGUI, KC_DEL, KC_SPC, _______, _______, KC_BSPC, KC_ENT, KC_RALT + //`------------------------------------' '------------------------------------' + ), +/* + * Special functions: _SP + * + * ,-------------------------------------------. ,-------------------------------------------. + * | TAB | | | | RESET| | | | | | | | ESC | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | CTRL | | | DEBUG| | | | | | | | | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | LShift | | | | | | | | | | | | SHIFT | + * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' + * | GUI | Del | Space| Nav +| |Media+| Bksp | Enter| AltGr| + * | | | |Number| |symbol| | | | + * `---------------------------' `---------------------------' + */ + [_SP] = LAYOUT_split_3x6_4( + //,-----------------------------------------------------. ,-----------------------------------------------------. + KC_TAB, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTL, XXXXXXX, XXXXXXX, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSFT, + //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| + KC_LGUI, KC_DEL, KC_SPC, _______, _______, KC_BSPC, KC_ENT, KC_RALT + //`------------------------------------' '------------------------------------' + ), + +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _NN, _MS, _SP); +} + +#ifdef OLED_DRIVER_ENABLE + +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, + 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, + 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00 + }; + + oled_write_P(qmk_logo, false); +} + +static void print_status_narrow(void) { + // Print current mode + oled_write_P(PSTR("\n"), false); + oled_write_ln_P(PSTR("MODE"), false); + oled_write_ln_P(PSTR(""), false); + + oled_write_P(PSTR("\n\n"), false); + // Print current layer + oled_write_ln_P(PSTR("LAYER"), false); + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_P(PSTR("Base\n"), false); + break; + case _NN: + oled_write_P(PSTR("Nums\n"), false); + break; + case _MS: + oled_write_P(PSTR("Sym\n"), false); + break; + case _SP: + oled_write_P(PSTR("Spec\n"), false); + break; + default: + oled_write_ln_P(PSTR("Undef\n"), false); + } + oled_write_P(PSTR("\n\n"), false); + led_t led_usb_state = host_keyboard_led_state(); + oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock); +} + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (is_keyboard_master()) { + return OLED_ROTATION_270; + } + return rotation; +} + +void oled_task_user(void) { + if (is_keyboard_master()) { + print_status_narrow(); + } else { + render_logo(); + } +} +#endif + +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + // master side thumb encoder + // Volume control + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + else if (index == 1) { + // master side pinky encoder + // Page down / Page up + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + else if (index == 2) { + // minion side thumb encoder + // Next track / Previous track + if (clockwise) { + tap_code(KC_MFFD); + } else { + tap_code(KC_MRWD); + } + } + else if (index == 3) { + // minion side pinky encoder + // Page end / Page home + if (clockwise) { + tap_code(KC_END); + } else { + tap_code(KC_HOME); + } + } +} +#endif diff --git a/keyboards/dumbo/keymaps/default/rules.mk b/keyboards/dumbo/keymaps/default/rules.mk new file mode 100644 index 0000000000..16913b421c --- /dev/null +++ b/keyboards/dumbo/keymaps/default/rules.mk @@ -0,0 +1,2 @@ +OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays +ENCODER_ENABLE = yes # Enables the use of one or more encoders diff --git a/keyboards/dumbo/keymaps/trip-trap/config.h b/keyboards/dumbo/keymaps/trip-trap/config.h new file mode 100644 index 0000000000..7f713e4a3d --- /dev/null +++ b/keyboards/dumbo/keymaps/trip-trap/config.h @@ -0,0 +1,27 @@ +/* Copyright 2020 Adam Naldal <adamnaldal@gmail.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 <http://www.gnu.org/licenses/>. + */ + +#pragma once + +// Tapping term is ever so slightly lowered from the 200ms default to make layer and mod usage more snappy. +#define TAPPING_TERM 200 + +// Prevent normal rollover on alphas from accidentally triggering mods. +#define IGNORE_MOD_TAP_INTERRUPT + +// If you are using an Elite C rev3 on the slave side, uncomment the lines below: +// #define SPLIT_USB_DETECT +// #define NO_USB_STARTUP_CHECK diff --git a/keyboards/dumbo/keymaps/trip-trap/keymap.c b/keyboards/dumbo/keymaps/trip-trap/keymap.c new file mode 100644 index 0000000000..4e73fdaa0e --- /dev/null +++ b/keyboards/dumbo/keymaps/trip-trap/keymap.c @@ -0,0 +1,428 @@ +/* Copyright 2020 Adam Naldal <adamnaldal@gmail.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 <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H +#include "keymap_danish.h" +#include <stdio.h> + +enum layers { + _QWERTY = 0, + _COLEMAK, + _NN, + _MS, + _SP +}; + +// Default layer switching +#define QWERT DF(_QWERTY) +#define COLEM DF(_COLEMAK) + +// Layer tap codes +#define LT_SPC LT(_NN, KC_SPC) +#define LT_TAB LT(_MS, KC_TAB) +#define LT_ENT LT(_MS, KC_ENT) +#define LT_BSPC LT(_NN, KC_BSPC) + +// Qwerty homerow mods +#define A_CTL LCTL_T(KC_A) +#define S_ALT LALT_T(KC_S) +#define D_GUI LGUI_T(KC_D) +#define F_SFT LSFT_T(KC_F) +#define J_SFT RSFT_T(KC_J) +#define K_GUI RGUI_T(KC_K) +#define L_ALT RALT_T(KC_L) +#define AE_CTL RCTL_T(DK_AE) + +// Colemak homerow mods +#define R_ALT LALT_T(KC_R) +#define S_GUI LGUI_T(KC_S) +#define T_SFT LSFT_T(KC_T) +#define N_SFT RSFT_T(KC_N) +#define E_GUI RGUI_T(KC_E) +#define I_ALT RALT_T(KC_I) +#define O_CTL RCTL_T(KC_O) + +// Navigation and numbers homerow mods +#define RGHT_SFT LSFT_T(KC_RGHT) +#define DOWN_GUI LGUI_T(KC_DOWN) +#define LEFT_ALT LALT_T(KC_LEFT) +#define N4_SFT RSFT_T(KC_4) +#define N5_GUI RGUI_T(KC_5) +#define N6_ALT RALT_T(KC_6) +#define OE_CTL RCTL_T(DK_OSTR) + +// Undefined or wrong symbols (homebrew) +#define HB_LCBR S(A(KC_8)) // { +#define HB_RCBR S(A(KC_9)) // } +#define HB_LABR KC_GRV // < +#define HB_RABR S(KC_GRV) // > +#define HB_USD KC_NUBS // $ +#define HB_PRGF S(KC_NUBS) // § +#define HB_AT A(KC_NUHS) // @ +#define HB_EUR S(KC_4) // € + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* + * Base Layer: QWERTY + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | Q | W | E | R | T | | Y | U | I | O | P | Å | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | A | S | D | F | G | | H | J | K | L | Æ | Ø | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | Z | X | C | V | B | | N | M | , ; | . : | - _ | | + * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' + * | MUTE | Esc | Space| Tab | | Enter| Bksp | Caps| PLAY| + * |(enc) | | _NN | _MS | | _MS | _NN | |(enc)| + * `---------------------------' `---------------------------' + */ + [_QWERTY] = LAYOUT_split_3x6_4( + //,-----------------------------------------------------. ,-----------------------------------------------------. + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, DK_ARNG, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, A_CTL, S_ALT, D_GUI, F_SFT, KC_G, KC_H, J_SFT, K_GUI, L_ALT, AE_CTL, DK_OSTR, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, DK_MINS, XXXXXXX, + //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| + KC_MUTE, KC_ESC, LT_SPC, LT_TAB, LT_ENT, LT_BSPC, KC_CAPS, KC_MPLY + //`------------------------------------' '------------------------------------' + ), +/* + * Base Layer: COLEMAK + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | Q | W | F | P | B | | J | L | U | Y | Å | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | A | R | S | T | G | | M | N | E | I | O | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | Z | X | C | D | V | | K | H | , ; | . : | Æ | | + * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' + * | MUTE | Esc | Space| Tab | | Enter| Bksp | Caps | PLAY| + * |(enc) | | _NN | _MS | | _MS | _NN | | (enc)| + * `---------------------------' `---------------------------' + */ + [_COLEMAK] = LAYOUT_split_3x6_4( + //,-----------------------------------------------------. ,-----------------------------------------------------. + XXXXXXX, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, DK_ARNG, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, A_CTL, R_ALT, S_GUI, T_SFT, KC_G, KC_M, N_SFT, E_GUI, I_ALT, O_CTL, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, DK_AE, XXXXXXX, + //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| + KC_MUTE, KC_ESC, LT_SPC, LT_TAB, LT_ENT, LT_BSPC, KC_CAPS, KC_MPLY + //`------------------------------------' '------------------------------------' + ), + /* + * Navigation and Numbers: _NN + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | | Home | Up | End | pgUp | | * | 7 | 8 | 9 | + | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | | Left | Down | Right| pgDwn| | / | 4 | 5 | 6 | Ø | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | | Cut | Copy | | Paste| | = | 1 | 2 | 3 | - | | + * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' + * | MUTE | Del | Space| Tab | | Enter| Bksp | 0 | PLAY | + * |(enc) | | _NN | _MS | | _MS | _NN | |(enc) | + * `---------------------------' `---------------------------' + */ + [_NN] = LAYOUT_split_3x6_4( + //,-----------------------------------------------------. ,-----------------------------------------------------. + XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, DK_ASTR, KC_7, KC_8, KC_9, DK_PLUS, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, KC_LCTL,LEFT_ALT,DOWN_GUI,RGHT_SFT, KC_PGDN, DK_SLSH, N4_SFT, N5_GUI, N6_ALT, OE_CTL, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, XXXXXXX, G(KC_X), G(KC_C), XXXXXXX, G(KC_V), DK_EQL, KC_1, KC_2, KC_3, DK_MINS, XXXXXXX, + //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| + KC_MUTE, KC_DEL, _______, _______, _______, _______, KC_0, KC_MPLY + //`------------------------------------' '------------------------------------' + ), + /* + * Media and Symbols: _MS + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | | | [ | ] | F1 | | $ | / | ( | ) | ? | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | |brght-|brght+| { | } | F2 | | @ | € | % | & | ' | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | | | < | > | F3 | | § | ! | " | # | _ | | + * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' + * | MUTE | Esc | Space| Tab | | Enter| Bksp | Caps | PLAY| + * |(enc) | | _NN | _MS | | _MS | _NN | | (enc)| + * `---------------------------' `---------------------------' + */ + [_MS] = LAYOUT_split_3x6_4( + //,-----------------------------------------------------. ,-----------------------------------------------------. + XXXXXXX, XXXXXXX, XXXXXXX, DK_LBRC, DK_RBRC, KC_F1, HB_USD, DK_SLSH, DK_LPRN, DK_RPRN, DK_QUES, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, KC_BRID, KC_BRIU, HB_LCBR, HB_RCBR, KC_F2, HB_AT, HB_EUR, DK_PERC, DK_AMPR, DK_QUOT, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + XXXXXXX, XXXXXXX, XXXXXXX, HB_LABR, HB_RABR, KC_F3, HB_PRGF, DK_EXLM, DK_DQUO, DK_HASH, DK_UNDS, XXXXXXX, + //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| + KC_MUTE, KC_ESC, _______, _______, _______, _______, KC_CAPS, KC_MPLY + //`------------------------------------' '------------------------------------' + ), +/* + * Special functions: _SP + * + * ,-------------------------------------------. ,-------------------------------------------. + * | |QWERTY| | | RESET| | | | | | | | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | | | DEBUG| | | | | | | | | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | | |COLEMK| | | | | | | | | | + * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' + * | GUI | Del | Space| Nav +| |Media+| Bksp | Enter| AltGr| + * | | | |Number| |symbol| | | | + * `---------------------------' `---------------------------' + */ |