pull/5340/head
Eric Peterson 6 years ago
commit 620341a47a

@ -129,6 +129,20 @@ Documentation is one of the easiest ways to get started contributing to QMK. Fin
You'll find all our documentation in the `qmk_firmware/docs` directory, or if you'd rather use a web based workflow you can click "Suggest An Edit" at the top of each page on http://docs.qmk.fm/. You'll find all our documentation in the `qmk_firmware/docs` directory, or if you'd rather use a web based workflow you can click "Suggest An Edit" at the top of each page on http://docs.qmk.fm/.
When providing code examples in your documentation, try to observe naming conventions used elsewhere in the docs. For example, standardizing enums as `my_layers` or `my_keycodes` for consistency:
```c
enum my_layers {
_FIRST_LAYER,
_SECOND_LAYER
};
enum my_keycodes {
FIRST_LAYER = SAFE_RANGE,
SECOND_LAYER
};
```
## Keymaps ## Keymaps
Most first-time QMK contributors start with their personal keymaps. We try to keep keymap standards pretty casual (keymaps, after all, reflect the personality of their creators) but we do ask that you follow these guidelines to make it easier for others to discover and learn from your keymap. Most first-time QMK contributors start with their personal keymaps. We try to keep keymap standards pretty casual (keymaps, after all, reflect the personality of their creators) but we do ask that you follow these guidelines to make it easier for others to discover and learn from your keymap.

@ -15,7 +15,7 @@ This will allow you to use `FN_CAPS` and `ALT_TAB` in your keymap, keeping it mo
## Caveats ## Caveats
Currently, `LT()` and `MT()` are limited to the [Basic Keycode set](keycodes_basic.md), meaning you can't use keycodes like `LCTL()`, `KC_TILD`, or anything greater than `0xFF`. Modifiers specified as part of a Layer Tap or Mod Tap's keycode will be ignored. Currently, `LT()` and `MT()` are limited to the [Basic Keycode set](keycodes_basic.md), meaning you can't use keycodes like `LCTL()`, `KC_TILD`, or anything greater than `0xFF`. Modifiers specified as part of a Layer Tap or Mod Tap's keycode will be ignored. If you need to apply modifiers to your tapped keycode, [Tap Dance](https://github.com/qmk/qmk_firmware/blob/master/docs/feature_tap_dance.md#example-5-using-tap-dance-for-advanced-mod-tap-and-layer-tap-keys) can be used to accomplish this.
Additionally, if at least one right-handed modifier is specified in a Mod Tap or Layer Tap, it will cause all modifiers specified to become right-handed, so it is not possible to mix and match the two. Additionally, if at least one right-handed modifier is specified in a Mod Tap or Layer Tap, it will cause all modifiers specified to become right-handed, so it is not possible to mix and match the two.

@ -314,3 +314,86 @@ qk_tap_dance_action_t tap_dance_actions[] = {
And then simply use `TD(X_CTL)` anywhere in your keymap. And then simply use `TD(X_CTL)` anywhere in your keymap.
If you want to implement this in your userspace, then you may want to check out how [DanielGGordon](https://github.com/qmk/qmk_firmware/tree/master/users/gordon) has implemented this in their userspace. If you want to implement this in your userspace, then you may want to check out how [DanielGGordon](https://github.com/qmk/qmk_firmware/tree/master/users/gordon) has implemented this in their userspace.
### Example 5: Using tap dance for advanced mod-tap and layer-tap keys
Tap dance can be used to emulate `MT()` and `LT()` behavior when the tapped code is not a basic keycode. This is useful to send tapped keycodes that normally require `Shift`, such as parentheses or curly braces—or other modified keycodes, such as `Control + X`.
Below your layers and custom keycodes, add the following:
```c
// tapdance keycodes
enum td_keycodes {
ALT_LP // Our example key: `LALT` when held, `(` when tapped. Add additional keycodes for each tapdance.
};
// define a type containing as many tapdance states as you need
typedef enum {
SINGLE_TAP,
SINGLE_HOLD,
DOUBLE_SINGLE_TAP
} td_state_t;
// create a global instance of the tapdance state type
static td_state_t td_state;
// declare your tapdance functions:
// function to determine the current tapdance state
int cur_dance (qk_tap_dance_state_t *state);
// `finished` and `reset` functions for each tapdance keycode
void altlp_finished (qk_tap_dance_state_t *state, void *user_data);
void altlp_reset (qk_tap_dance_state_t *state, void *user_data);
```
Below your `LAYOUT`, define each of the tapdance functions:
```c
// determine the tapdance state to return
int cur_dance (qk_tap_dance_state_t *state) {
if (state->count == 1) {
if (state->interrupted || !state->pressed) { return SINGLE_TAP; }
else { return SINGLE_HOLD; }
}
if (state->count == 2) { return DOUBLE_SINGLE_TAP; }
else { return 3; } // any number higher than the maximum state value you return above
}
// handle the possible states for each tapdance keycode you define:
void altlp_finished (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance(state);
switch (td_state) {
case SINGLE_TAP:
register_code16(KC_LPRN);
break;
case SINGLE_HOLD:
register_mods(MOD_BIT(KC_LALT)); // for a layer-tap key, use `layer_on(_MY_LAYER)` here
break;
case DOUBLE_SINGLE_TAP: // allow nesting of 2 parens `((` within tapping term
tap_code16(KC_LPRN);
register_code16(KC_LPRN);
}
}
void altlp_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (td_state) {
case SINGLE_TAP:
unregister_code16(KC_LPRN);
break;
case SINGLE_HOLD:
unregister_mods(MOD_BIT(KC_LALT)); // for a layer-tap key, use `layer_off(_MY_LAYER)` here
break;
case DOUBLE_SINGLE_TAP:
unregister_code16(KC_LPRN);
}
}
// define `ACTION_TAP_DANCE_FN_ADVANCED()` for each tapdance keycode, passing in `finished` and `reset` functions
qk_tap_dance_action_t tap_dance_actions[] = {
[ALT_LP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altlp_finished, altlp_reset)
};
```
Wrap each tapdance keycode in `TD()` when including it in your keymap, e.g. `TD(ALT_LP)`.

@ -0,0 +1,3 @@
#pragma once
#define DRIVER_1_LED_TOTAL 63
#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL

@ -0,0 +1,181 @@
#include QMK_KEYBOARD_H
extern bool g_suspend_state;
#define _LAYER0 0
#define _LAYER1 1
#define _LAYER2 2
#define _LAYER3 3
#define _LAYER4 4
#define _LAYER5 5
#define _LAYER6 6
#define _LAYER7 7
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LAYER0] = LAYOUT( /* Base */
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, 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_LBRC, KC_RBRC, KC_BSLASH, \
CTL_T(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_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL), \
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(1) , KC_LEFT, KC_DOWN, KC_RIGHT),
[_LAYER1] = LAYOUT( /* FN */
TO(3), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL , \
KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET , \
KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDOWN, KC_VOLU, KC_MUTE, \
KC_TRNS, KC_TRNS, KC_TRNS, TO(4), KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT),
[_LAYER2] = LAYOUT( /* LIGHT */
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL , \
KC_TRNS, RGB_TOG, KC_TRNS, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, RESET , \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPI, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAYER3] = LAYOUT( /* NUMPAD */
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSLS, KC_PAST, KC_PMNS, KC_PPLS, KC_TRNS, \
KC_TRNS, KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, TO(0), \
KC_TRNS, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_PENT, \
KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_P0, KC_PDOT, KC_PENT, KC_P0, KC_PDOT, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAYER4] = LAYOUT( /* MAC */
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, 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_LBRC, KC_RBRC, KC_BSLASH, \
CTL_T(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_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL), \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(5) , KC_LEFT, KC_DOWN, KC_RIGHT),
[_LAYER5] = LAYOUT( /* FN */
TO(3), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL , \
KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET , \
KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDOWN, KC_VOLU, KC_MUTE, \
KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT),
}
;
void rgb_matrix_layer_helper(uint8_t red, uint8_t green, uint8_t blue, bool default_layer)
{
rgb_led led;
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
led = g_rgb_leds[i];
if (led.matrix_co.raw < 0xFF) {
if (led.modifier) {
rgb_matrix_set_color(i, red, green, blue);
}
}
}
}
void rgb_matrix_indicators_user(void)
{
uint8_t this_led = host_keyboard_leds();
if (!g_suspend_state) {
switch (biton32(layer_state)) {
case _LAYER1:
rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break;
case _LAYER2:
rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break;
case _LAYER4:
rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break;
}
}
if (this_led & (1 << USB_LED_CAPS_LOCK)) {
rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF);
}
switch (biton32(layer_state)) {
case _LAYER3:
if (this_led & (1 << USB_LED_NUM_LOCK)) {
rgb_matrix_set_color(13, 0xFF, 0x00, 0x00);
} else {
rgb_matrix_set_color(13, 0x00, 0x00, 0x00);
}
rgb_matrix_set_color(0, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(1, 0x00, 0x00, 0x00);
rgb_matrix_set_color(1, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(2, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(3, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(4, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(5, 0x00, 0x00, 0x00);
rgb_matrix_set_color(6, 0x00, 0x00, 0x00);
rgb_matrix_set_color(7, 0x00, 0x00, 0x00);
rgb_matrix_set_color(8, 0x00, 0x00, 0x00);
rgb_matrix_set_color(9, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(10, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(11, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(12, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(14, 0x00, 0x00, 0xFF);
rgb_matrix_set_color(15, 0x00, 0x00, 0x00);
rgb_matrix_set_color(16, 0x00, 0x00, 0x00);
rgb_matrix_set_color(17, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(18, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(19, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(20, 0x00, 0x00, 0x00);
rgb_matrix_set_color(21, 0x00, 0x00, 0x00);
rgb_matrix_set_color(22, 0x00, 0x00, 0x00);
rgb_matrix_set_color(23, 0x00, 0x00, 0x00);
rgb_matrix_set_color(24, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(25, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(26, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(27, 0x00, 0x00, 0x00);
rgb_matrix_set_color(28, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(29, 0x00, 0x00, 0x00);
rgb_matrix_set_color(30, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(31, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(32, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(33, 0x00, 0x00, 0x00);
rgb_matrix_set_color(34, 0x00, 0x00, 0x00);
rgb_matrix_set_color(35, 0x00, 0x00, 0x00);
rgb_matrix_set_color(36, 0x00, 0x00, 0x00);
rgb_matrix_set_color(37, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(38, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(39, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(40, 0x00, 0x00, 0x00);
rgb_matrix_set_color(41, 0x00, 0x00, 0x00);
rgb_matrix_set_color(42, 0x00, 0x00, 0x00);
rgb_matrix_set_color(43, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(44, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(45, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(46, 0x00, 0x00, 0x00);
rgb_matrix_set_color(47, 0x00, 0x00, 0x00);
rgb_matrix_set_color(48, 0x00, 0x00, 0x00);
rgb_matrix_set_color(49, 0x00, 0x00, 0x00);
rgb_matrix_set_color(50, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(51, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(52, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(53, 0x00, 0x00, 0x00);
rgb_matrix_set_color(54, 0x00, 0x00, 0x00);
rgb_matrix_set_color(55, 0x00, 0x00, 0x00);
rgb_matrix_set_color(56, 0x00, 0x00, 0x00);
rgb_matrix_set_color(57, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(58, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(59, 0xFF, 0x00, 0x00);
rgb_matrix_set_color(60, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(61, 0xFF, 0xFF, 0x00);
rgb_matrix_set_color(62, 0x00, 0x00, 0x00);
break;
}
}
void matrix_init_user(void)
{
//user initialization
}
void matrix_scan_user(void)
{
//user matrix
}
bool process_record_user(uint16_t keycode, keyrecord_t* record)
{
return true;
}

@ -0,0 +1,34 @@
# mekanist keymap instructions
## Dev Environment setup (macOS)
1. Install Homebrew by copy pasting the following into a terminal:
```
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
2. Refer to the [QMK macOS Instructions](https://github.com/qmk/qmk_firmware/blob/master/docs/getting_started_build_tools.md#macos) and install the list of tools using the `brew` command in terminal.
3. While in terminal, issue the following command within the directory you wish to clone qmk_firmware in.
```
git clone https://github.com/qmk/qmk_firmware.git
```
## Creating the mekanist dz60rgb firmware file
1. While in the `qmk_firmware` directory, issue the following command
```
make git-submodule
```
This will download the chibi-os submoduled needed to create firmware for ARM based boards such as the dz60rgb.
2. While in the `qmk_firmware` directory, issue the followng command
```
make dztech/dz60rgb:mekanist
```
This will result in a file called `dztech_dz60rgb_mekanist.bin` that you can flash onto your board using QMK Toolbox.

@ -0,0 +1,245 @@
/*
Copyright 2019 MechMerlin
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 0x0000
#define DEVICE_VER 0x0001
#define MANUFACTURER Mechkeys
#define PRODUCT mechkeys mk60
#define DESCRIPTION A custom 60% keyboard
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 15
/*
* Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 }
#define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 }
#define UNUSED_PINS
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW
/*
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
*/
#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
#define BACKLIGHT_PIN B6
#define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 6
#define RGB_DI_PIN E6
#ifdef RGB_DI_PIN
#define RGBLED_NUM 12
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
/*== all animations enable ==*/
#define RGBLIGHT_ANIMATIONS
/*== or choose animations ==*/
// #define RGBLIGHT_EFFECT_BREATHING
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
// #define RGBLIGHT_EFFECT_SNAKE
// #define RGBLIGHT_EFFECT_KNIGHT
// #define RGBLIGHT_EFFECT_CHRISTMAS
// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
// #define RGBLIGHT_EFFECT_RGB_TEST
// #define RGBLIGHT_EFFECT_ALTERNATING
#endif
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCING_DELAY 5
/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
/* 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
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
*/
// #define GRAVE_ESC_CTRL_OVERRIDE
/*
* Force NKRO
*
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
* makefile for this to work.)
*
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
* until the next keyboard reset.
*
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
* fully operational during normal computer usage.
*
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
* power-up.
*
*/
//#define FORCE_NKRO
/*
* Magic Key Options
*
* Magic keys are hotkey commands that allow control over firmware functions of
* the keyboard. They are best used in combination with the HID Listen program,
* found here: https://www.pjrc.com/teensy/hid_listen.html
*
* The options below allow the magic key functionality to be changed. This is
* useful if your keyboard/keypad is missing keys and you want magic key support.
*
*/
/* key combination for magic key command */
/* defined by default; to change, uncomment and set to the combination you want */
// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
/* control how magic key switches layers */
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
/* override magic key keymap */
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
//#define MAGIC_KEY_HELP H
//#define MAGIC_KEY_HELP_ALT SLASH
//#define MAGIC_KEY_DEBUG D
//#define MAGIC_KEY_DEBUG_MATRIX X
//#define MAGIC_KEY_DEBUG_KBD K
//#define MAGIC_KEY_DEBUG_MOUSE M
//#define MAGIC_KEY_VERSION V
//#define MAGIC_KEY_STATUS S
//#define MAGIC_KEY_CONSOLE C
//#define MAGIC_KEY_LAYER0 0
//#define MAGIC_KEY_LAYER0_ALT GRAVE
//#define MAGIC_KEY_LAYER1 1
//#define MAGIC_KEY_LAYER2 2
//#define MAGIC_KEY_LAYER3 3
//#define MAGIC_KEY_LAYER4 4
//#define MAGIC_KEY_LAYER5 5
//#define MAGIC_KEY_LAYER6 6
//#define MAGIC_KEY_LAYER7 7
//#define MAGIC_KEY_LAYER8 8
//#define MAGIC_KEY_LAYER9 9
//#define MAGIC_KEY_BOOTLOADER B
//#define MAGIC_KEY_BOOTLOADER_ALT ESC
//#define MAGIC_KEY_LOCK CAPS
//#define MAGIC_KEY_EEPROM E
//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
//#define MAGIC_KEY_NKRO N
//#define MAGIC_KEY_SLEEP_LED Z
/*
* 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 NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
/*
* MIDI options
*/
/* Prevent use of disabled MIDI features in the keymap */
//#define MIDI_ENABLE_STRICT 1
/* enable basic MIDI features:
- MIDI notes can be sent when in Music mode is on
*/
//#define MIDI_BASIC
/* enable advanced MIDI features:
- MIDI notes can be added to the keymap
- Octave shift and transpose
- Virtual sustain, portamento, and modulation wheel
- etc.
*/
//#define MIDI_ADVANCED
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 1
/*
* HD44780 LCD Display Configuration
*/
/*
#define LCD_LINES 2 //< number of visible lines of the display
#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
#if LCD_IO_MODE
#define LCD_PORT PORTB //< port for the LCD lines
#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
#define LCD_RS_PORT LCD_PORT //< port for RS line
#define LCD_RS_PIN 3 //< pin for RS line
#define LCD_RW_PORT LCD_PORT //< port for RW line
#define LCD_RW_PIN 2 //< pin for RW line
#define LCD_E_PORT LCD_PORT //< port for Enable line
#define LCD_E_PIN 1 //< pin for Enable line
#endif
*/
/* Bootmagic Lite key configuration */
// #define BOOTMAGIC_LITE_ROW 0
// #define BOOTMAGIC_LITE_COLUMN 0

@ -0,0 +1,83 @@
{
"keyboard_name": "MK60",
"url": "",
"maintainer": "qmk",
"width": 15,
"height": 5,
"layouts": {
"LAYOUT": {
"key_count": 68,
"layout": [
{"label":"K00", "x":0, "y":0},
{"label":"K01", "x":1, "y":0},
{"label":"K02", "x":2, "y":0},
{"label":"K03", "x":3, "y":0},
{"label":"K04", "x":4, "y":0},
{"label":"K05", "x":5, "y":0},
{"label":"K06", "x":6, "y":0},
{"label":"K07", "x":7, "y":0},
{"label":"K08", "x":8, "y":0},
{"label":"K09", "x":9, "y":0},
{"label":"K0A", "x":10, "y":0},
{"label":"K0B", "x":11, "y":0},
{"label":"K0C", "x":12, "y":0},
{"label":"K0D", "x":13, "y":0},
{"label":"K0E", "x":14, "y":0},
{"label":"K10", "x":0, "y":1, "w":1.5},
{"label":"K12", "x":1.5, "y":1},
{"label":"K13", "x":2.5, "y":1},
{"label":"K14", "x":3.5, "y":1},
{"label":"K15", "x":4.5, "y":1},
{"label":"K16", "x":5.5, "y":1},
{"label":"K17", "x":6.5, "y":1},
{"label":"K18", "x":7.5, "y":1},
{"label":"K19", "x":8.5, "y":1},
{"label":"K1A", "x":9.5, "y":1},
{"label":"K1B", "x":10.5, "y":1},
{"label":"K1C", "x":11.5, "y":1},
{"label":"K1D", "x":12.5, "y":1},
{"label":"K1E", "x":13.5, "y":1, "w":1.5},
{"label":"K20", "x":0, "y":2, "w":1.75},
{"label":"K22", "x":1.75, "y":2},
{"label":"K23", "x":2.75, "y":2},
{"label":"K24", "x":3.75, "y":2},
{"label":"K25", "x":4.75, "y":2},
{"label":"K26", "x":5.75, "y":2},
{"label":"K27", "x":6.75, "y":2},
{"label":"K28", "x":7.75, "y":2},
{"label":"K29", "x":8.75, "y":2},
{"label":"K2A", "x":9.75, "y":2},
{"label":"K2B", "x":10.75, "y":2},
{"label":"K2C", "x":11.75, "y":2},
{"label":"K2D", "x":12.75, "y":2, "w":2.25},
{"label":"K30", "x":0, "y":3},
{"label":"K31", "x":1, "y":3},
{"label":"K32", "x":2, "y":3},
{"label":"K33", "x":3, "y":3},
{"label":"K34", "x":4, "y":3},
{"label":"K35", "x":5, "y":3},
{"label":"K36", "x":6, "y":3},
{"label":"K37", "x":7, "y":3},
{"label":"K38", "x":8, "y":3},
{"label":"K39", "x":9, "y":3},
{"label":"K3A", "x":10, "y":3},
{"label":"K3B", "x":11, "y":3},
{"label":"K3C", "x":12, "y":3},
{"label":"K3D", "x":13, "y":3},
{"label":"K3E", "x":14, "y":3},
{"label":"K40", "x":0, "y":4, "w":1.75},
{"label":"K42", "x":1.75, "y":4, "w":1.25},
{"label":"K43", "x":3, "y":4, "w":1.25},
{"label":"K44", "x":4.25, "y":4, "w":1.25},
{"label":"K47", "x":5.5, "y":4, "w":3},
{"label":"K49", "x":8.5, "y":4, "w":1.5},
{"label":"K4A", "x":10, "y":4},
{"label":"K4B", "x":11, "y":4},
{"label":"K4C", "x":12, "y":4},
{"label":"K4D", "x":13, "y":4},
{"label":"K4E", "x":14, "y":4}
]
}
}
}

@ -0,0 +1,19 @@
/* Copyright 2019 MechMerlin
*
* 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
// place overrides here

@ -0,0 +1,74 @@
/* Copyright 2019 MechMerlin
*
* 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
// Defines the keycodes used by our macros in process_record_user
enum custom_keycodes {
QMKBEST = SAFE_RANGE,
QMKURL
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT( \
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, 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_ENT, KC_LSFT, KC_NO, KC_Z, \
KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_DEL, KC_LCTL, KC_LGUI, KC_LALT, \
MO(1), KC_SPC, KC_RALT, KC_PGUP, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT \
),
[1] = LAYOUT( \
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_TRNS, \
BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, \
RGB_MOD, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QMKBEST:
if (record->event.pressed) {
// when keycode QMKBEST is pressed
SEND_STRING("QMK is the best thing ever!");
} else {
// when keycode QMKBEST is released
}
break;
case QMKURL:
if (record->event.pressed) {
// when keycode QMKURL is pressed
SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
} else {
// when keycode QMKURL is released
}
break;
}
return true;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
}

@ -0,0 +1 @@
# The default keymap for mk60

@ -0,0 +1,50 @@
/* Copyright 2019 MechMerlin
*
* 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 "mk60.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
setPinOutput(B7);
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
if(IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)){
writePinLow(B7);
}else {
writePinHigh(B7);
}
led_set_user(usb_led);
}

@ -0,0 +1,41 @@
/* Copyright 2019 MechMerlin
*
* 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( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \
k10, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \
k40, k42, k43, k44, k47, k49, k4A, k4B, k4C, k4D, k4E \
) \
{ \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E}, \
{ k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E}, \
{ k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, KC_NO}, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E}, \
{ k40, KC_NO, k42, k43, k44, KC_NO, KC_NO, k47, KC_NO, k49, k4A, k4B, k4C, k4D, k4E}, \
}

@ -0,0 +1,13 @@
# mechkeys mk60
60% keyboard with RGB underglow and backlights
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
Hardware Supported: MK60
Hardware Availability: The MK60 was discontinued by [mechkeys.ca](https://mechkeys.ca/)
Make example for this keyboard (after setting up your build environment):
make mk60:default
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).

@ -0,0 +1,81 @@
# MCU name
#MCU = at90usb1286
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# atmega32a bootloadHID
BOOTLOADER = atmel-dfu
# If you don't know the bootloader type, then you can specify the
# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)

@ -26,10 +26,10 @@ enum my_keycodes {
}; };
enum td_keycodes { enum td_keycodes {
ALT_OP, ALT_LP,
CTL_CCB, CTL_RCB,
GUI_CP, GUI_RP,
SFT_OCB, SFT_LCB,
SFT_PLS SFT_PLS
}; };
@ -41,14 +41,14 @@ typedef enum {
static td_state_t td_state; static td_state_t td_state;
int cur_dance (qk_tap_dance_state_t *state); int cur_dance (qk_tap_dance_state_t *state);
void altop_finished (qk_tap_dance_state_t *state, void *user_data); void altlp_finished (qk_tap_dance_state_t *state, void *user_data);
void altop_reset (qk_tap_dance_state_t *state, void *user_data); void altlp_reset (qk_tap_dance_state_t *state, void *user_data);
void ctlccb_finished (qk_tap_dance_state_t *state, void *user_data); void ctlrcb_finished (qk_tap_dance_state_t *state, void *user_data);
void ctlccb_reset (qk_tap_dance_state_t *state, void *user_data); void ctlrcb_reset (qk_tap_dance_state_t *state, void *user_data);
void guicp_finished (qk_tap_dance_state_t *state, void *user_data); void guirp_finished (qk_tap_dance_state_t *state, void *user_data);
void guicp_reset (qk_tap_dance_state_t *state, void *user_data); void guirp_reset (qk_tap_dance_state_t *state, void *user_data);
void sftocb_finished (qk_tap_dance_state_t *state, void *user_data); void sftlcb_finished (qk_tap_dance_state_t *state, void *user_data);
void sftocb_reset (qk_tap_dance_state_t *state, void *user_data); void sftlcb_reset (qk_tap_dance_state_t *state, void *user_data);
void sftpls_finished (qk_tap_dance_state_t *state, void *user_data); void sftpls_finished (qk_tap_dance_state_t *state, void *user_data);
void sftpls_reset (qk_tap_dance_state_t *state, void *user_data); void sftpls_reset (qk_tap_dance_state_t *state, void *user_data);
@ -58,7 +58,7 @@ void sftpls_reset (qk_tap_dance_state_t *state, void *user_data);
#define ALT_D LALT_T(KC_D) #define ALT_D LALT_T(KC_D)
#define ALT_E LALT_T(KC_E) #define ALT_E LALT_T(KC_E)
#define ALT_K LALT_T(KC_K) #define ALT_K LALT_T(KC_K)
#define ALT_OB LALT_T(KC_LBRC) #define ALT_LB LALT_T(KC_LBRC)
#define ALT_S LALT_T(KC_S) #define ALT_S LALT_T(KC_S)
#define CTRL_2 LCTL_T(KC_2) #define CTRL_2 LCTL_T(KC_2)
#define CTRL_4 LCTL_T(KC_4) #define CTRL_4 LCTL_T(KC_4)
@ -73,7 +73,7 @@ void sftpls_reset (qk_tap_dance_state_t *state, void *user_data);
#define GUI_1 LGUI_T(KC_1) #define GUI_1 LGUI_T(KC_1)
#define GUI_4 LGUI_T(KC_4) #define GUI_4 LGUI_T(KC_4)
#define GUI_7 LGUI_T(KC_7) #define GUI_7 LGUI_T(KC_7)
#define GUI_CB LGUI_T(KC_RBRC) #define GUI_RB LGUI_T(KC_RBRC)
#define GUI_F LGUI_T(KC_F) #define GUI_F LGUI_T(KC_F)
#define GUI_J LGUI_T(KC_J) #define GUI_J LGUI_T(KC_J)
#define GUI_N LGUI_T(KC_N) #define GUI_N LGUI_T(KC_N)
@ -252,7 +252,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/ */
[_SYM] = LAYOUT( \ [_SYM] = LAYOUT( \
KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_QUES, KC_QUOT, \ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_QUES, KC_QUOT, \
TD(SFT_PLS), CTRL_EQ, TD(ALT_OP), TD(GUI_CP), KC_DQT, KC_COLN, GUI_CB, ALT_OB, TD(CTL_CCB), TD(SFT_OCB), \ TD(SFT_PLS), CTRL_EQ, TD(ALT_LP), TD(GUI_RP), KC_DQT, KC_COLN, GUI_RB, ALT_LB, TD(CTL_RCB), TD(SFT_LCB), \
KC_LT, KC_PIPE, KC_MINS, KC_GT, KC_BSLS, KC_GRV, KC_UNDS, KC_SLSH, KC_TILD, KC_SCLN, \ KC_LT, KC_PIPE, KC_MINS, KC_GT, KC_BSLS, KC_GRV, KC_UNDS, KC_SLSH, KC_TILD, KC_SCLN, \
_______, MAC_EN, _______, _______, MAC_EM, _______ \ _______, MAC_EN, _______, _______, MAC_EM, _______ \
) )
@ -285,131 +285,115 @@ int cur_dance (qk_tap_dance_state_t *state) {
else return 3; else return 3;
} }
void altop_finished (qk_tap_dance_state_t *state, void *user_data) { void altlp_finished (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance(state); td_state = cur_dance(state);
switch (td_state) { switch (td_state) {
case SINGLE_TAP: case SINGLE_TAP:
register_mods(MOD_BIT(KC_LSFT)); register_code16(KC_LPRN);
register_code(KC_9);
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
register_mods(MOD_BIT(KC_LALT)); register_mods(MOD_BIT(KC_LALT));
break; break;
case DOUBLE_SINGLE_TAP: case DOUBLE_SINGLE_TAP:
register_mods(MOD_BIT(KC_LSFT)); tap_code16(KC_LPRN);
tap_code(KC_9); register_code16(KC_LPRN);
register_code(KC_9);
} }
} }
void altop_reset (qk_tap_dance_state_t *state, void *user_data) { void altlp_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (td_state) { switch (td_state) {
case SINGLE_TAP: case SINGLE_TAP:
unregister_code(KC_9); unregister_code16(KC_LPRN);
unregister_mods(MOD_BIT(KC_LSFT));
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
unregister_mods(MOD_BIT(KC_LALT)); unregister_mods(MOD_BIT(KC_LALT));
break; break;
case DOUBLE_SINGLE_TAP: case DOUBLE_SINGLE_TAP:
unregister_code(KC_9); unregister_code16(KC_LPRN);
unregister_mods(MOD_BIT(KC_LSFT));
} }
} }
void ctlccb_finished (qk_tap_dance_state_t *state, void *user_data) { void ctlrcb_finished (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance(state); td_state = cur_dance(state);
switch (td_state) { switch (td_state) {
case SINGLE_TAP: case SINGLE_TAP:
register_mods(MOD_BIT(KC_LSFT)); register_code16(KC_RCBR);
register_code(KC_RBRC);
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
register_mods(MOD_BIT(KC_LCTL)); register_mods(MOD_BIT(KC_LCTL));
break; break;
case DOUBLE_SINGLE_TAP: case DOUBLE_SINGLE_TAP:
register_mods(MOD_BIT(KC_LSFT)); tap_code16(KC_RCBR);
tap_code(KC_RBRC); register_code16(KC_RCBR);
register_code(KC_RBRC);
} }
} }
void ctlccb_reset (qk_tap_dance_state_t *state, void *user_data) { void ctlrcb_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (td_state) { switch (td_state) {
case SINGLE_TAP: case SINGLE_TAP:
unregister_code(KC_RBRC); unregister_code16(KC_RCBR);
unregister_mods(MOD_BIT(KC_LSFT));
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
unregister_mods(MOD_BIT(KC_LCTL)); unregister_mods(MOD_BIT(KC_LCTL));
break; break;
case DOUBLE_SINGLE_TAP: case DOUBLE_SINGLE_TAP:
unregister_code(KC_RBRC); unregister_code16(KC_RCBR);
unregister_mods(MOD_BIT(KC_LSFT));
} }
} }
void guicp_finished (qk_tap_dance_state_t *state, void *user_data) { void guirp_finished (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance(state); td_state = cur_dance(state);
switch (td_state) { switch (td_state) {
case SINGLE_TAP: case SINGLE_TAP:
register_mods(MOD_BIT(KC_LSFT)); register_code16(KC_RPRN);
register_code(KC_0);
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
register_mods(MOD_BIT(KC_LGUI)); register_mods(MOD_BIT(KC_LGUI));
break; break;
case DOUBLE_SINGLE_TAP: case DOUBLE_SINGLE_TAP:
register_mods(MOD_BIT(KC_LSFT)); tap_code16(KC_RPRN);
tap_code(KC_0); register_code16(KC_RPRN);
register_code(KC_0);
} }
} }
void guicp_reset (qk_tap_dance_state_t *state, void *user_data) { void guirp_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (td_state) { switch (td_state) {
case SINGLE_TAP: case SINGLE_TAP:
unregister_code(KC_0); unregister_code16(KC_RPRN);
unregister_mods(MOD_BIT(KC_LSFT));
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
unregister_mods(MOD_BIT(KC_LGUI)); unregister_mods(MOD_BIT(KC_LGUI));
break; break;
case DOUBLE_SINGLE_TAP: case DOUBLE_SINGLE_TAP:
unregister_code(KC_0); unregister_code16(KC_RPRN);
unregister_mods(MOD_BIT(KC_LSFT));
} }
} }
void sftocb_finished (qk_tap_dance_state_t *state, void *user_data) { void sftlcb_finished (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance(state); td_state = cur_dance(state);
switch (td_state) { switch (td_state) {
case SINGLE_TAP: case SINGLE_TAP:
register_mods(MOD_BIT(KC_LSFT)); register_code16(KC_LCBR);
register_code(KC_LBRC);
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
register_mods(MOD_BIT(KC_LSFT)); register_mods(MOD_BIT(KC_LSFT));
break; break;
case DOUBLE_SINGLE_TAP: case DOUBLE_SINGLE_TAP:
register_mods(MOD_BIT(KC_LSFT)); tap_code16(KC_LCBR);
tap_code(KC_LBRC); register_code16(KC_LCBR);
register_code(KC_LBRC);
} }
} }
void sftocb_reset (qk_tap_dance_state_t *state, void *user_data) { void sftlcb_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (td_state) { switch (td_state) {
case SINGLE_TAP: case SINGLE_TAP:
unregister_code(KC_LBRC); unregister_code16(KC_LCBR);
unregister_mods(MOD_BIT(KC_LSFT));
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
unregister_mods(MOD_BIT(KC_LSFT)); unregister_mods(MOD_BIT(KC_LSFT));
break; break;
case DOUBLE_SINGLE_TAP: case DOUBLE_SINGLE_TAP:
unregister_code(KC_LBRC); unregister_code16(KC_LCBR);
unregister_mods(MOD_BIT(KC_LSFT));
} }
} }
@ -417,38 +401,34 @@ void sftpls_finished (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance(state); td_state = cur_dance(state);
switch (td_state) { switch (td_state) {
case SINGLE_TAP: case SINGLE_TAP:
register_mods(MOD_BIT(KC_LSFT)); register_code16(KC_PLUS);
register_code(KC_EQL);
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
register_mods(MOD_BIT(KC_LSFT)); register_mods(MOD_BIT(KC_LSFT));
break; break;
case DOUBLE_SINGLE_TAP: case DOUBLE_SINGLE_TAP:
register_mods(MOD_BIT(KC_LSFT)); tap_code16(KC_PLUS);
tap_code(KC_EQL); register_code16(KC_PLUS);
register_code(KC_EQL);
} }
} }
void sftpls_reset (qk_tap_dance_state_t *state, void *user_data) { void sftpls_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (td_state) { switch (td_state) {
case SINGLE_TAP: case SINGLE_TAP:
unregister_code(KC_EQL); unregister_code16(KC_PLUS);
unregister_mods(MOD_BIT(KC_LSFT));
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
unregister_mods(MOD_BIT(KC_LSFT)); unregister_mods(MOD_BIT(KC_LSFT));
break; break;
case DOUBLE_SINGLE_TAP: case DOUBLE_SINGLE_TAP:
unregister_code(KC_EQL); unregister_code16(KC_PLUS);
unregister_mods(MOD_BIT(KC_LSFT));
} }
} }
qk_tap_dance_action_t tap_dance_actions[] = { qk_tap_dance_action_t tap_dance_actions[] = {
[ALT_OP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altop_finished, altop_reset), [ALT_LP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altlp_finished, altlp_reset),
[CTL_CCB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctlccb_finished, ctlccb_reset), [CTL_RCB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctlrcb_finished, ctlrcb_reset),
[GUI_CP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, guicp_finished, guicp_reset), [GUI_RP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, guirp_finished, guirp_reset),
[SFT_OCB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, sftocb_finished, sftocb_reset), [SFT_LCB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, sftlcb_finished, sftlcb_reset),
[SFT_PLS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, sftpls_finished, sftpls_reset) [SFT_PLS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, sftpls_finished, sftpls_reset)
}; };

@ -9,30 +9,28 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case KC_MAKE: case KC_MAKE:
if (!record->event.pressed) { if (!record->event.pressed) {
uint8_t temp_mod = get_mods(); uint8_t mods = get_mods();
uint8_t temp_osm = get_oneshot_mods();
clear_mods(); clear_mods();
clear_oneshot_mods();
send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10);
if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK ) { if (mods & MOD_MASK_SHIFT) {
//RESET board for flashing if SHIFT held or tapped with KC_MAKE //RESET board for flashing if SHIFT held or tapped with KC_MAKE
#if defined(__arm__) #if defined(__arm__)
send_string_with_delay_P(PSTR(":dfu-util"), 10); send_string_with_delay_P(PSTR(":dfu-util"), 10);
wait_ms(100);
reset_keyboard();
#elif defined(BOOTLOADER_DFU) #elif defined(BOOTLOADER_DFU)
send_string_with_delay_P(PSTR(":dfu"), 10); send_string_with_delay_P(PSTR(":dfu"), 10);
#elif defined(BOOTLOADER_HALFKAY) #elif defined(BOOTLOADER_HALFKAY)
send_string_with_delay_P(PSTR(":teensy"), 10); send_string_with_delay_P(PSTR(":teensy"), 10);
#elif defined(BOOTLOADER_CATERINA) #elif defined(BOOTLOADER_CATERINA)
send_string_with_delay_P(PSTR(":avrdude"), 10); send_string_with_delay_P(PSTR(":avrdude"), 10);
#else
reset_keyboard();
#endif // bootloader options #endif // bootloader options
send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10);
reset_keyboard();
}
if (mods & MOD_MASK_CTRL) {
send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10);
} }
if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); }
send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10);
set_mods(temp_mod); set_mods(mods);
} }
return false; return false;
break; break;

@ -13,9 +13,6 @@ enum custom_keycodes {
NEW_SAFE_RANGE //use "NEW_SAFE_RANGE" for keymap specific codes NEW_SAFE_RANGE //use "NEW_SAFE_RANGE" for keymap specific codes
}; };
#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
//Aliases for longer keycodes //Aliases for longer keycodes
#define KC_CAD LALT(LCTL(KC_DEL)) #define KC_CAD LALT(LCTL(KC_DEL))
#define KC_LOCK LGUI(KC_L) #define KC_LOCK LGUI(KC_L)

Loading…
Cancel
Save