Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>pull/19131/head
@ -0,0 +1,25 @@ | |||||
// Copyright 2022 bwprobably | |||||
// SPDX-License-Identifier: GPL-2.0-or-later | |||||
#pragma once | |||||
/* | |||||
* Feature disable options | |||||
* These options are also useful to firmware size reduction. | |||||
*/ | |||||
/* disable debug print */ | |||||
//#define NO_DEBUG | |||||
/* disable print */ | |||||
//#define NO_PRINT | |||||
/* disable action features */ | |||||
//#define NO_ACTION_LAYER | |||||
//#define NO_ACTION_TAPPING | |||||
//#define NO_ACTION_ONESHOT | |||||
#define ENCODERS_PAD_A { D1 } | |||||
#define ENCODERS_PAD_B { D0 } | |||||
#define ENCODER_RESOLUTION 4 | |||||
#define TAP_CODE_DELAY 100 |
@ -0,0 +1,45 @@ | |||||
{ | |||||
"manufacturer": "bwprobably", | |||||
"keyboard_name": "DactylMacropad", | |||||
"maintainer": "bwprobably", | |||||
"bootloader": "atmel-dfu", | |||||
"diode_direction": "COL2ROW", | |||||
"features": { | |||||
"bootmagic": true, | |||||
"command": false, | |||||
"console": false, | |||||
"extrakey": true, | |||||
"mousekey": true, | |||||
"nkro": true, | |||||
"encoder":true | |||||
}, | |||||
"matrix_pins": { | |||||
"cols": ["F7", "B1", "B3", "B2", "B6"], | |||||
"rows": ["F6", "B4", "B5"] | |||||
}, | |||||
"processor": "atmega32u4", | |||||
"usb": { | |||||
"device_version": "1.0.0", | |||||
"pid": "0x0000", | |||||
"vid": "0xFEED" | |||||
}, | |||||
"layouts": { | |||||
"LAYOUT": { | |||||
"layout": [ | |||||
{ "matrix": [0, 0], "x": 0, "y": 0 }, | |||||
{ "matrix": [0, 1], "x": 1, "y": 0 }, | |||||
{ "matrix": [0, 2], "x": 2, "y": 0 }, | |||||
{ "matrix": [0, 3], "x": 3, "y": 0 }, | |||||
{ "matrix": [1, 0], "x": 0, "y": 1 }, | |||||
{ "matrix": [1, 1], "x": 1, "y": 1 }, | |||||
{ "matrix": [1, 2], "x": 2, "y": 1 }, | |||||
{ "matrix": [1, 3], "x": 3, "y": 1 }, | |||||
{ "matrix": [2, 0], "x": 0, "y": 2 }, | |||||
{ "matrix": [2, 1], "x": 1, "y": 2 }, | |||||
{ "matrix": [2, 2], "x": 2, "y": 2 }, | |||||
{ "matrix": [2, 3], "x": 3, "y": 2 }, | |||||
{ "matrix": [2, 4], "x": 4, "y": 2 } | |||||
] | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,123 @@ | |||||
// Copyright 2022 bwprobably | |||||
// SPDX-License-Identifier: GPL-2.0-or-later | |||||
#include QMK_KEYBOARD_H | |||||
bool is_alt_tab_active = false; | |||||
uint16_t alt_tab_timer = 0; | |||||
enum layer_names { | |||||
_BASE, | |||||
_MTG, | |||||
_MAC | |||||
}; | |||||
enum custom_keycodes { | |||||
pvt = SAFE_RANGE, | |||||
snap, | |||||
ALT_TAB | |||||
}; | |||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||||
/* | |||||
* ┌───┬───┬───┬───┐ | |||||
* │pvt│pst│ up│cpy│ | |||||
* ├───┼───┼───┤───│ | |||||
* │sft│ lf│ dn│rt │ | |||||
* ├───┼───┼───┼───┤───┤ | |||||
* │[1]│ctr│wtb│app│bt3│ | |||||
* ├───┴───┼───┤───│───│ | |||||
*/ | |||||
[_BASE] = LAYOUT | |||||
(pvt, LCTL(KC_V), KC_UP, LCTL(KC_C), | |||||
LSFT_T(KC_ESC), KC_LEFT, KC_DOWN, KC_RGHT, | |||||
TO(1), KC_LCTL, ALT_TAB, KC_APP, KC_BTN3), | |||||
/* | |||||
* ┌────┬────┬────┬────┐ | |||||
* │mte │ BI │ up │pgu │ | |||||
* ├────┼────┼────┤────│ | |||||
* │snp │ lf │ dn │ rt │ | |||||
* ├────┼────┼────┼────┤───┤ | |||||
* │[1] │mut │min │pgd │ply│ | |||||
* ├────┴────┼────┤────│───│ | |||||
*/ | |||||
[_MTG] = LAYOUT ( | |||||
LCTL(LSFT(KC_H)), LCTL(KC_F6), KC_TRNS, KC_PGUP, | |||||
snap, KC_TRNS, KC_TRNS, KC_TRNS, | |||||
TO(2), KC_MUTE, LGUI(KC_M), KC_PGDN, KC_MPLY), | |||||
/* | |||||
* ┌────┬────┬────┬────┐ | |||||
* │sdbr│past│ up │ cpy│ | |||||
* ├────┼────┼────┤────│ | |||||
* │snp │ lf │ dn │ rt │ | |||||
* ├────┼────┼────┤─────│────┤ | |||||
* │[1] |qkfl│ min│focus│ ply│ | |||||
* ├────┴────┼────┤─────│────│ | |||||
*/ | |||||
[_MAC] = LAYOUT ( | |||||
LSFT(LGUI(KC_L)), LGUI(KC_V), KC_TRNS, LGUI(KC_C), | |||||
LGUI(LCTL(LSFT(KC_4))), KC_TRNS, KC_TRNS, KC_TRNS, | |||||
TO(0), LSFT(LGUI(KC_O)), LCTL(LALT(KC_F3)), LCTL(LSFT(KC_1)), KC_TRNS) | |||||
}; | |||||
bool encoder_update_user(uint8_t index, bool clockwise) { | |||||
if (IS_LAYER_ON(_MTG)) { | |||||
if (clockwise) { | |||||
tap_code(KC_VOLU); | |||||
} else { | |||||
tap_code16(S(KC_VOLD)); | |||||
} | |||||
} else { | |||||
if (clockwise) { | |||||
tap_code(KC_WH_D); | |||||
} else { | |||||
tap_code(KC_WH_U); | |||||
} | |||||
} | |||||
return false; | |||||
} | |||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||||
switch (keycode) { | |||||
case pvt: | |||||
if (record->event.pressed) { | |||||
// creates pivot table in excel | |||||
SEND_STRING(SS_LALT("nvt")); | |||||
} else { | |||||
// when keycode QMKBEST is released | |||||
} | |||||
break; | |||||
case snap: | |||||
if (record->event.pressed) { | |||||
SEND_STRING(SS_TAP(X_LGUI)SS_DELAY(500)"snip"SS_DELAY(500)SS_TAP(X_ENTER)SS_LALT("n")); // opens snipping and creates new snip | |||||
} | |||||
break; | |||||
case ALT_TAB: | |||||
if (record->event.pressed) { | |||||
if (!is_alt_tab_active) { | |||||
is_alt_tab_active = true; | |||||
register_code(KC_LALT); | |||||
} | |||||
alt_tab_timer = timer_read(); | |||||
register_code(KC_TAB); | |||||
} else { | |||||
unregister_code(KC_TAB); | |||||
} | |||||
break; | |||||
} | |||||
return true; | |||||
} | |||||
void housekeeping_task_user(void) { | |||||
if (is_alt_tab_active) { | |||||
if (timer_elapsed(alt_tab_timer) > 1000) { | |||||
unregister_code(KC_LALT); | |||||
is_alt_tab_active = false; | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,26 @@ | |||||
# DactylMacropad | |||||
[Glamour shot](https://i.imgur.com/ONvbIbmh.jpg) | |||||
* Keyboard Maintainer: [bwprobably](https://github.com/bwprobably) | |||||
* Hardware Supported: ProMicro (Atmega32U4), EC11 Rotary Encoder | |||||
* Hardware Availability: [Example Encoder](https://www.amazon.com/dp/B07D3DF8TK/) | |||||
[ProMicro](https://www.sparkfun.com/products/12640) | |||||
Make example for this keyboard (after setting up your build environment): | |||||
make default:default | |||||
Flashing example for this keyboard: | |||||
make default:default:flash | |||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). | |||||
## Bootloader | |||||
Enter the bootloader in 3 ways: | |||||
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard | |||||
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead | |||||
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available |
@ -0,0 +1 @@ | |||||
# This file intentionally left blank |
@ -0,0 +1,30 @@ | |||||
/* | |||||
Copyright 2017 Danny Nguyen <danny@hexwire.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 | |||||
#define USE_I2C | |||||
/* Select hand configuration */ | |||||
#define MASTER_RIGHT | |||||
// #define EE_HANDS | |||||
#undef RGBLED_NUM | |||||
#define RGBLED_NUM 12 | |||||
#define RGBLIGHT_HUE_STEP 8 | |||||
#define RGBLIGHT_SAT_STEP 8 | |||||
#define RGBLIGHT_VAL_STEP 8 |
@ -0,0 +1,31 @@ | |||||
// Copyright 2022 bwprobably | |||||
// SPDX-License-Identifier: GPL-2.0-or-later | |||||
#include QMK_KEYBOARD_H | |||||
enum custom_layer { | |||||
_LAYER0, | |||||
_LAYER1, | |||||
_LAYER2, | |||||
_LAYER3, | |||||
}; | |||||
enum custom_keycodes { | |||||
LAYER0 = SAFE_RANGE, | |||||
LAYER1, | |||||
LAYER2, | |||||
LAYER3, | |||||
}; | |||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||||
[_LAYER0] = LAYOUT(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, LT(3,KC_CAPS), 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_ENT, KC_LCTL, KC_LALT, KC_LGUI, KC_DEL, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), | |||||
[_LAYER1] = LAYOUT(KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TAB, KC_Q, KC_UP, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_CALC, KC_HOME, KC_ESC, KC_LEFT, KC_DOWN, KC_RGHT, KC_T, KC_D, KC_H, KC_N, KC_TRNS, KC_I, KC_MUTE, KC_PGUP, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_MNXT, KC_MPLY, KC_VOLU, KC_PGDN, MO(3), KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_SPC, KC_SPC, KC_TRNS, KC_MPRV, KC_MSTP, KC_VOLD, KC_END), | |||||
[_LAYER2] = LAYOUT(KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_TRNS, KC_RCBR, KC_PIPE, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, LSFT(KC_NUHS), LSFT(KC_BSLS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), | |||||
[_LAYER3] = LAYOUT(KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NO, KC_NO, KC_PSLS, KC_PAST, KC_PMNS, KC_NO, KC_TRNS, RESET, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, KC_NO, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_DEL, KC_TRNS, KC_TRNS, BL_TOGG, BL_DEC, BL_INC, AG_NORM, KC_NO, KC_P4, KC_P5, KC_P6, KC_PCMM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_P1, KC_P2, KC_P3, KC_PEQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P0, KC_PDOT, KC_PENT, KC_TRNS) | |||||
}; |
@ -0,0 +1 @@ | |||||
RGBLIGHT_ENABLE = yes |