Skip to content

Instantly share code, notes, and snippets.

@shriharip
Created February 12, 2021 18:55
Show Gist options
  • Save shriharip/36fbd9713ca96de2efc16bcbb6847ceb to your computer and use it in GitHub Desktop.
Save shriharip/36fbd9713ca96de2efc16bcbb6847ceb to your computer and use it in GitHub Desktop.
dactyl manuform keymap
#include QMK_KEYBOARD_H
#define _BASE 0
#define _RAISE 1
#define _LOWER 2
#define _SHORTC 3
// Fillers to make layering more clear
// #define ____ KC_TRNS
#define SFT_ESC SFT_T(KC_ESC)
#define CTL_BSPC CTL_T(KC_BSPC)
#define ALT_SPC ALT_T(KC_SPC)
#define SFT_ENT SFT_T(KC_ENT)
#define KC_ML KC_MS_LEFT
#define KC_MR KC_MS_RIGHT
#define KC_MU KC_MS_UP
#define KC_MD KC_MS_DOWN
#define KC_MB1 KC_MS_BTN1
#define KC_MB2 KC_MS_BTN1
#define RAISE MO(_RAISE)
#define LOWER MO(_LOWER)
#define SHRTC MO(_SHORTC)
// Tap Dance declarations
enum {
TD_ESC_CAPS,
TD_CMD_SPC,
TD_Q_1
};
const uint16_t PROGMEM test_combo[] = {KC_A, KC_S, COMBO_END};
combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)};
// Tap Dance definitions
qk_tap_dance_action_t tap_dance_actions[] = {
// Tap once for Escape, twice for Caps Lock
[TD_Q_1] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_1),
[TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPSLOCK),
[TD_CMD_SPC] = ACTION_TAP_DANCE_DOUBLE(KC_RGUI, KC_LGUI)
};
enum custom_keycodes {
GMAIL1 = SAFE_RANGE,
GMAIL2,
HOTMAIL,
CITY,
PHONE,
ADDRESS,
FNAME,
LNAME,
NEM
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case GMAIL1:
if (record->event.pressed) {
// when keycode QMKBEST is pressed
SEND_STRING("[email protected]");
} else {
// when keycode QMKBEST is released
}
break;
case GMAIL2:
if (record->event.pressed) {
// when keycode QMKURL is pressed
SEND_STRING("[email protected]");
} else {
// when keycode QMKURL is released
}
break;
case HOTMAIL:
if (record->event.pressed) {
// when keycode QMKURL is pressed
SEND_STRING("[email protected]");
} else {
// when keycode QMKURL is released
}
break;
case CITY:
if (record->event.pressed) {
// when keycode QMKURL is pressed
SEND_STRING("Sørg");
} else {
// when keycode QMKURL is released
}
break;
case NEM:
if (record->event.pressed) {
// when keycode QMKURL is pressed
SEND_STRING("131");
} else {
// when keycode QMKURL is released
}
break;
case PHONE:
if (record->event.pressed) {
// when keycode QMKURL is pressed
SEND_STRING("36");
} else {
// when keycode QMKURL is released
}
break;
// case MY_OTHER_MACRO:
// if (record->event.pressed) {
// SEND_STRING(SS_LCTL("ac")); // selects all and copies
// }
// break;
}
return true;
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Base (qwerty)
* +-----------------------------------------+ +-----------------------------------------+
* | ESC | q | w | e | r | t | | y | u | i | o | p | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | TAB | a | s | d | f | g | | h | j | k | l | ; | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | SHFT | z | x | c | v | b | | n | m | , | . | / | |
* +------+------+------+------+-------------+ +-------------+------+------+------+------+
* | [ | ] | | | |
* +-------------+-------------+ +-------------+-------------+
* | | | | | |
* |------+------| |------+------|
* | | | | | |
* +-------------+ +-------------+
* +-------------+ +-------------+
* | | | | | |
* |------+------| |------+------|
* | | | | | |
* +-------------+ +-------------+
*/
[_BASE] = LAYOUT(
TD(TD_ESC_CAPS), TD(TD_Q_1), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LALT_T(KC_GESC), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, OSM(MOD_MEH), RCTL_T(KC_GRV), KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_SPC, OSM(MOD_LSFT), TG(_LOWER), KC_SFTENT, KC_ESC, LOWER, OSM(MOD_RGUI), KC_BSPC, KC_EQL, TG(_SHORTC), TG(_RAISE), KC_LEAD),
[_LOWER] = LAYOUT(
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_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PLUS, KC_PMNS, KC_PAST, KC_PSLS, 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),
[_RAISE] = LAYOUT(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_WH_LEFT, KC_MS_WH_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_BTN1, KC_MS_BTN2, KC_MS_WH_UP, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_TRNS, KC__VOLUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_WH_DOWN, KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, KC_TRNS, KC_TRNS, KC__VOLDOWN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_D, KC_MS_U, KC_MS_L,
KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_SHORTC] = LAYOUT(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, GMAIL1, GMAIL2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, HOTMAIL, NEM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CITY, PHONE, 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),
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
LEADER_EXTERNS();
void matrix_scan_user(void) {
LEADER_DICTIONARY() {
leading = false;
leader_end();
SEQ_ONE_KEY(KC_G) {
// Anything you can do in a macro.
SEND_STRING("g;");
}
// SEQ_TWO_KEYS(KC_D, KC_D) {
// SEND_STRING(SS_LCTL("a") SS_LCTL("c"));
// }
// SEQ_THREE_KEYS(KC_D, KC_D, KC_S) {
// SEND_STRING("https://start.duckduckgo.com\n");
// }
// SEQ_TWO_KEYS(KC_A, KC_S) {
// register_code(KC_LGUI);
// register_code(KC_S);
// unregister_code(KC_S);
// unregister_code(KC_LGUI);
// }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment