mirror of
https://github.com/qmk/qmk_userspace.git
synced 2025-04-29 12:17:18 -04:00
Add tap dance for symbol layer
This commit is contained in:
parent
066e3e7c72
commit
fc0422415b
9 changed files with 628 additions and 52 deletions
27
flashMyKeyboard.sh
Executable file
27
flashMyKeyboard.sh
Executable file
|
@ -0,0 +1,27 @@
|
|||
#! /bin/bash
|
||||
|
||||
KEYBOARD=splitkb/kyria/rev1
|
||||
KEYMAP=struckmb_wip
|
||||
SIDE=left
|
||||
|
||||
while getopts 'k:m:s:' opt; do
|
||||
case "$opt" in
|
||||
k)
|
||||
KEYBOARD=${OPTARG}
|
||||
;;
|
||||
m)
|
||||
KEYMAP=${OPTARG}
|
||||
;;
|
||||
s)
|
||||
SIDE=${OPTARG}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "keyboard: ${KEYBOARD}, keymap: ${KEYMAP}, side: ${SIDE}"
|
||||
|
||||
if [ "$KEYBOARD" = "cantor" ]; then
|
||||
qmk flash -kb $KEYBOARD -km ${KEYMAP} -bl "dfu-util-split-${SIDE}"
|
||||
else
|
||||
qmk flash -kb $KEYBOARD -km ${KEYMAP}
|
||||
fi
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
#define QWERTY_ENABLE
|
||||
// #define BONE_ENABLE
|
||||
// #define COLEMAK_DH_ENABLE
|
||||
#define BONE_ENABLE
|
||||
#define COLEMAK_DH_ENABLE
|
||||
|
|
|
@ -1,15 +1,28 @@
|
|||
// Copyright 2022 Diego Palacios (@diepala)
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "struckmb.h"
|
||||
#include "bs_tap_dance.c"
|
||||
|
||||
#define LAYOUT_split_3x6_3_wrapper(...) LAYOUT_split_3x6_3(__VA_ARGS__)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //
|
||||
[LAYER_QWERTY] = //
|
||||
LAYOUT_split_3x6_3_wrapper(_QWERTY_3x6_, _THUMBS_3_3_),
|
||||
[LAYER_SYMBOL] = LAYOUT_split_3x6_3_wrapper(_SYMBOLS_3x6_, _SL4_3_, _SR4_3_),
|
||||
[LAYER_LOWER] = LAYOUT_split_3x6_3_wrapper(_LOWER_3x6_, _LL4_3_, _LR4_3_),
|
||||
[LAYER_RAISE] = LAYOUT_split_3x6_3_wrapper(_RAISE_3x6_, _RL4_3_, _RR4_3_),
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
#ifdef QWERTY_ENABLE
|
||||
[LAYER_QWERTY] = LAYOUT_split_3x6_3_wrapper(_QWERTY_3x6_, _THUMBS_3_3_),
|
||||
#endif /* ifdef QWERTY_ENABLE */
|
||||
|
||||
#ifdef BONE_ENABLE
|
||||
[LAYER_BONE] = LAYOUT_split_3x6_3_wrapper(_BONE_3x6_, _THUMBS_3_3_),
|
||||
#endif /* ifdef BONE_ENABLE */
|
||||
|
||||
[LAYER_SYMBOL] = LAYOUT_split_3x6_3_wrapper(_SYMBOLS_3x6_, _SL4_3_, _SR4_3_),
|
||||
|
||||
[LAYER_LOWER] = LAYOUT_split_3x6_3_wrapper(_LOWER_3x6_, _LL4_3_, _LR4_3_),
|
||||
|
||||
[LAYER_RAISE] = LAYOUT_split_3x6_3_wrapper(_RAISE_3x6_, _RL4_3_, _RR4_3_),
|
||||
|
||||
[LAYER_POINTER] = LAYOUT_split_3x6_3_wrapper(_POINTER_3x6_, _PL4_3_, _PR4_3_),
|
||||
[LAYER_ATTIC] = LAYOUT_split_3x6_3_wrapper(_ATTIC_3x6_, _AL4_3_, _AR4_3_)};
|
||||
|
||||
[LAYER_ATTIC] = LAYOUT_split_3x6_3_wrapper(_ATTIC_3x6_, _AL4_3_, _AR4_3_),
|
||||
};
|
||||
|
|
1
keyboards/cantor/keymaps/struckmb/rules.mk
Normal file
1
keyboards/cantor/keymaps/struckmb/rules.mk
Normal file
|
@ -0,0 +1 @@
|
|||
TAP_DANCE_ENABLE = yes
|
165
users/struckmb/bs_tap_dance.c
Normal file
165
users/struckmb/bs_tap_dance.c
Normal file
|
@ -0,0 +1,165 @@
|
|||
#ifdef TAP_DANCE_ENABLE
|
||||
// Create a global instance of the tapdance state type
|
||||
static td_state_t td_state;
|
||||
|
||||
// Determine the tapdance state to return
|
||||
td_state_t cur_dance(tap_dance_state_t *state) {
|
||||
if (state->count == 1) {
|
||||
if (state->interrupted || !state->pressed)
|
||||
return TD_SINGLE_TAP;
|
||||
else
|
||||
return TD_SINGLE_HOLD;
|
||||
}
|
||||
|
||||
if (state->count == 2)
|
||||
return TD_DOUBLE_SINGLE_TAP;
|
||||
else
|
||||
return TD_UNKNOWN; // Any number higher than the maximum state value you return above
|
||||
}
|
||||
|
||||
// Handle the possible states for each tapdance keycode you define:
|
||||
|
||||
void symL_finished(tap_dance_state_t *state, void *user_data) {
|
||||
td_state = cur_dance(state);
|
||||
if (td_state == TD_SINGLE_HOLD) {
|
||||
layer_on(LAYER_SYMBOL);
|
||||
return;
|
||||
}
|
||||
uint8_t current_layer = get_highest_layer(default_layer_state);
|
||||
switch (td_state) {
|
||||
case TD_SINGLE_TAP:
|
||||
# ifdef QWERTY_ENABLE
|
||||
if (LAYER_QWERTY == current_layer) register_code(DE_A);
|
||||
# endif // QWERTY_ENABLE
|
||||
# ifdef BONE_ENABLE
|
||||
if (LAYER_BONE == current_layer) register_code(DE_C);
|
||||
# endif // BONE_ENABLE
|
||||
# ifdef COLEMAK_DH_ENABLE
|
||||
if (LAYER_COLEMAK_DH == current_layer) register_code(DE_A);
|
||||
# endif // COLEMAK_DH_ENABLE
|
||||
break;
|
||||
case TD_DOUBLE_SINGLE_TAP: // Allow nesting of 2 parens `((` within tapping term
|
||||
# ifdef QWERTY_ENABLE
|
||||
if (LAYER_QWERTY == current_layer) {
|
||||
tap_code(DE_A);
|
||||
register_code(DE_A);
|
||||
}
|
||||
# endif // QWERTY_ENABLE
|
||||
# ifdef BONE_ENABLE
|
||||
if (LAYER_BONE == current_layer) {
|
||||
tap_code(DE_C);
|
||||
register_code(DE_C);
|
||||
}
|
||||
# endif // BONE_ENABLE
|
||||
# ifdef COLEMAK_DH_ENABLE
|
||||
if (LAYER_COLEMAK_DH == current_layer) {
|
||||
tap_code(DE_A);
|
||||
register_code(DE_A);
|
||||
}
|
||||
# endif // COLEMAK_DH_ENABLE
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void symL_reset(tap_dance_state_t *state, void *user_data) {
|
||||
if (td_state == TD_SINGLE_HOLD) {
|
||||
layer_off(LAYER_SYMBOL);
|
||||
return;
|
||||
}
|
||||
uint8_t current_layer = get_highest_layer(default_layer_state);
|
||||
switch (td_state) {
|
||||
case TD_SINGLE_TAP:
|
||||
case TD_DOUBLE_SINGLE_TAP:
|
||||
# ifdef QWERTY_ENABLE
|
||||
if (LAYER_QWERTY == current_layer) unregister_code(DE_A);
|
||||
# endif // QWERTY_ENABLE
|
||||
# ifdef BONE_ENABLE
|
||||
if (LAYER_BONE == current_layer) unregister_code(DE_C);
|
||||
# endif // BONE_ENABLE
|
||||
# ifdef COLEMAK_DH_ENABLE
|
||||
if (LAYER_COLEMAK_DH == current_layer) unregister_code(DE_A);
|
||||
# endif // COLEMAK_DH_ENABLE
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void symR_finished(tap_dance_state_t *state, void *user_data) {
|
||||
td_state = cur_dance(state);
|
||||
if (td_state == TD_SINGLE_HOLD) {
|
||||
layer_on(LAYER_SYMBOL);
|
||||
return;
|
||||
}
|
||||
uint8_t current_layer = get_highest_layer(default_layer_state);
|
||||
switch (td_state) {
|
||||
case TD_SINGLE_TAP:
|
||||
# ifdef QWERTY_ENABLE
|
||||
if (LAYER_QWERTY == current_layer) register_code(DE_ODIA);
|
||||
# endif // QWERTY_ENABLE
|
||||
# ifdef BONE_ENABLE
|
||||
if (LAYER_BONE == current_layer) register_code(DE_G);
|
||||
# endif // BONE_ENABLE
|
||||
# ifdef COLEMAK_DH_ENABLE
|
||||
if (LAYER_COLEMAK_DH == current_layer) register_code(DE_O);
|
||||
# endif // COLEMAK_DH_ENABLE
|
||||
break;
|
||||
case TD_DOUBLE_SINGLE_TAP: // Allow nesting of 2 key presses within tapping term
|
||||
# ifdef QWERTY_ENABLE
|
||||
if (LAYER_QWERTY == current_layer) {
|
||||
tap_code(DE_ODIA);
|
||||
register_code(DE_ODIA);
|
||||
}
|
||||
# endif // QWERTY_ENABLE
|
||||
# ifdef BONE_ENABLE
|
||||
if (LAYER_BONE == current_layer) {
|
||||
tap_code(DE_G);
|
||||
register_code(DE_G);
|
||||
}
|
||||
# endif // BONE_ENABLE
|
||||
# ifdef COLEMAK_DH_ENABLE
|
||||
if (LAYER_COLEMAK_DH == current_layer) {
|
||||
tap_code(DE_O);
|
||||
register_code(DE_O);
|
||||
}
|
||||
# endif // COLEMAK_DH_ENABLE
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void symR_reset(tap_dance_state_t *state, void *user_data) {
|
||||
if (td_state == TD_SINGLE_HOLD) {
|
||||
layer_off(LAYER_SYMBOL);
|
||||
return;
|
||||
}
|
||||
uint8_t current_layer = get_highest_layer(default_layer_state);
|
||||
switch (td_state) {
|
||||
case TD_SINGLE_TAP:
|
||||
case TD_DOUBLE_SINGLE_TAP:
|
||||
# ifdef QWERTY_ENABLE
|
||||
if (LAYER_QWERTY == current_layer) unregister_code(DE_A);
|
||||
# endif // QWERTY_ENABLE
|
||||
# ifdef BONE_ENABLE
|
||||
if (LAYER_BONE == current_layer) unregister_code(DE_C);
|
||||
# endif // BONE_ENABLE
|
||||
# ifdef COLEMAK_DH_ENABLE
|
||||
if (LAYER_COLEMAK_DH == current_layer) unregister_code(DE_A);
|
||||
# endif // COLEMAK_DH_ENABLE
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Define `ACTION_TAP_DANCE_FN_ADVANCED()` for each tapdance keycode, passing in `finished` and `reset` functions
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
//
|
||||
[SYM_L] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, symL_finished, symL_reset),
|
||||
[SYM_R] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, symR_finished, symR_reset),
|
||||
};
|
||||
|
||||
#endif // TAP_DANCE_ENABLE
|
11
users/struckmb/config.h
Normal file
11
users/struckmb/config.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#define EE_HANDS
|
||||
|
||||
// // select at least on of these base layers
|
||||
// #define QWERTY_ENABLE
|
||||
// #define BONE_ENABLE
|
||||
// #define COLEMAK_DH_ENABLE
|
||||
|
||||
// // some additionl layers can be added
|
||||
// #define GAME_ENABLE (left hand qwerty + right hand arrows and numbers)
|
||||
// #define ASETNIOP_ENABLE (corded writing)
|
||||
// #define ARTSENIO_ENABLE (one handed writing)
|
4
users/struckmb/rules.mk
Normal file
4
users/struckmb/rules.mk
Normal file
|
@ -0,0 +1,4 @@
|
|||
OS_DETECTION_ENABLE = yes
|
||||
|
||||
# Userspace code
|
||||
SRC += struckmb.c
|
333
users/struckmb/struckmb.c
Normal file
333
users/struckmb/struckmb.c
Normal file
|
@ -0,0 +1,333 @@
|
|||
#include "struckmb.h"
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
// Return after running through all individual hooks
|
||||
if (keycode <= NO_MODS && record->event.pressed) {
|
||||
switch (keycode) {
|
||||
case NO_MODS:
|
||||
clear_oneshot_mods();
|
||||
return false;
|
||||
#ifdef QWERTY_ENABLE
|
||||
case DL_QWER:
|
||||
set_single_persistent_default_layer(LAYER_QWERTY);
|
||||
return false;
|
||||
#endif /* ifdef QWERTY_ENABLE */
|
||||
#ifdef BONE_ENABLE
|
||||
case DL_BONE:
|
||||
set_single_persistent_default_layer(LAYER_BONE);
|
||||
return false;
|
||||
#endif /* ifdef BONE_ENABLE */
|
||||
#ifdef COLEMAK_DH_ENABLE
|
||||
case DL_CODH:
|
||||
set_single_persistent_default_layer(LAYER_COLEMAK_DH);
|
||||
return false;
|
||||
#endif /* ifdef COLEMAK_DH_ENABLE */
|
||||
case DL_PREV:
|
||||
if (get_highest_layer(default_layer_state) > 0) {
|
||||
set_single_persistent_default_layer(get_highest_layer(default_layer_state) - 1);
|
||||
} else {
|
||||
set_single_persistent_default_layer(LAYER_SYMBOL - 1);
|
||||
}
|
||||
return false;
|
||||
case DL_NEXT:
|
||||
// uint8_t next_default_layer = get_highest_layer(default_layer_state) + 1;
|
||||
if (get_highest_layer(default_layer_state) + 1 < LAYER_SYMBOL) {
|
||||
set_single_persistent_default_layer(get_highest_layer(default_layer_state) + 1);
|
||||
} else {
|
||||
set_single_persistent_default_layer(0);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef OS_DETECTION_ENABLE
|
||||
switch (detected_host_os()) {
|
||||
case OS_MACOS:
|
||||
switch (keycode) {
|
||||
case DE_RSQU: // '
|
||||
if (record->event.pressed) {
|
||||
register_code16(DE_QUOT);
|
||||
} else {
|
||||
unregister_code16(DE_QUOT);
|
||||
}
|
||||
return false;
|
||||
case KC_CUT:
|
||||
if (record->event.pressed) {
|
||||
register_code16(G(KC_X));
|
||||
} else {
|
||||
unregister_code16(G(KC_X));
|
||||
}
|
||||
return false;
|
||||
case KC_COPY:
|
||||
if (record->event.pressed) {
|
||||
register_code16(G(KC_C));
|
||||
} else {
|
||||
unregister_code16(G(KC_C));
|
||||
}
|
||||
return false;
|
||||
case KC_PSTE:
|
||||
if (record->event.pressed) {
|
||||
register_code16(G(KC_V));
|
||||
} else {
|
||||
unregister_code16(G(KC_V));
|
||||
}
|
||||
return false;
|
||||
case KC_BRIU:
|
||||
if (record->event.pressed) {
|
||||
register_code16(KC_BRMU);
|
||||
} else {
|
||||
unregister_code16(KC_BRMU);
|
||||
}
|
||||
return false;
|
||||
case KC_BRID:
|
||||
if (record->event.pressed) {
|
||||
register_code16(KC_BRMD);
|
||||
} else {
|
||||
unregister_code16(KC_BRMD);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case OS_LINUX:
|
||||
switch (keycode) {
|
||||
case DE_AT: // @
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_Q));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_Q));
|
||||
}
|
||||
return false;
|
||||
case DE_ELLP: // …
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(KC_DOT));
|
||||
} else {
|
||||
unregister_code16(ALGR(KC_DOT));
|
||||
}
|
||||
return false;
|
||||
case DE_LBRC: // [
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_8));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_8));
|
||||
}
|
||||
return false;
|
||||
case DE_RBRC: // ]
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_9));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_9));
|
||||
}
|
||||
return false;
|
||||
case DE_BSLS: // "\"
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_SS));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_SS));
|
||||
}
|
||||
return false;
|
||||
case DE_LCBR: // {
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_7));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_7));
|
||||
}
|
||||
return false;
|
||||
case DE_RCBR: // }
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_0));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_0));
|
||||
}
|
||||
return false;
|
||||
case DE_PIPE: // |
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(KC_NUBS));
|
||||
} else {
|
||||
unregister_code16(ALGR(KC_NUBS));
|
||||
}
|
||||
return false;
|
||||
case DE_TILD: // ~
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_PLUS));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_PLUS));
|
||||
}
|
||||
return false;
|
||||
case DE_LDAQ: // «
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_X));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_X));
|
||||
}
|
||||
return false;
|
||||
case DE_RDAQ: // »
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_Y));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_Y));
|
||||
}
|
||||
return false;
|
||||
case DE_LSAQ: // ‹
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(ALGR(DE_X)));
|
||||
} else {
|
||||
unregister_code16(S(ALGR(DE_X)));
|
||||
}
|
||||
return false;
|
||||
case DE_RSAQ: // ›
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(ALGR(DE_Y)));
|
||||
} else {
|
||||
unregister_code16(S(ALGR(DE_Y)));
|
||||
}
|
||||
return false;
|
||||
case DE_PND: // £
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(ALGR(DE_3)));
|
||||
} else {
|
||||
unregister_code16(S(ALGR(DE_3)));
|
||||
}
|
||||
return false;
|
||||
case DE_CENT: // ¢
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_C));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_C));
|
||||
}
|
||||
return false;
|
||||
case DE_EURO: // €
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_E));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_E));
|
||||
}
|
||||
return false;
|
||||
case DE_IEXL: // ¡
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(ALGR(DE_1)));
|
||||
} else {
|
||||
unregister_code16(S(ALGR(DE_1)));
|
||||
}
|
||||
return false;
|
||||
case DE_SLQU: // ‚
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(ALGR(DE_V)));
|
||||
} else {
|
||||
unregister_code16(S(ALGR(DE_V)));
|
||||
}
|
||||
return false;
|
||||
case DE_NDSH: // –
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_MINS));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_MINS));
|
||||
}
|
||||
return false;
|
||||
case DE_MDSH: // —
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(ALGR(DE_MINS)));
|
||||
} else {
|
||||
unregister_code16(S(ALGR(DE_MINS)));
|
||||
}
|
||||
return false;
|
||||
case DE_LSQU: // ‘
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(ALGR(DE_B)));
|
||||
} else {
|
||||
unregister_code16(S(ALGR(DE_B)));
|
||||
}
|
||||
return false;
|
||||
case DE_RSQU: // ’
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(ALGR(DE_N)));
|
||||
} else {
|
||||
unregister_code16(S(ALGR(DE_N)));
|
||||
}
|
||||
return false;
|
||||
case DE_IQUE: // ¿
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(ALGR(DE_SS)));
|
||||
} else {
|
||||
unregister_code16(S(ALGR(DE_SS)));
|
||||
}
|
||||
return false;
|
||||
case DE_MDDT: // •
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_COMM));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_COMM));
|
||||
}
|
||||
return false;
|
||||
case DE_DIV: // ÷
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(ALGR(DE_DOT)));
|
||||
} else {
|
||||
unregister_code16(S(ALGR(DE_DOT)));
|
||||
}
|
||||
return false;
|
||||
case DE_PLMN: // ±
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(ALGR(DE_9)));
|
||||
} else {
|
||||
unregister_code16(S(ALGR(DE_9)));
|
||||
}
|
||||
return false;
|
||||
case DE_DLQU: // „
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_V));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_V));
|
||||
}
|
||||
return false;
|
||||
case DE_LDQU: // “
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_B));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_B));
|
||||
}
|
||||
return false;
|
||||
case DE_RDQU: // ”
|
||||
if (record->event.pressed) {
|
||||
register_code16(ALGR(DE_N));
|
||||
} else {
|
||||
unregister_code16(ALGR(DE_N));
|
||||
}
|
||||
return false;
|
||||
case KC_CUT:
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(KC_DEL));
|
||||
} else {
|
||||
unregister_code16(S(KC_DEL));
|
||||
}
|
||||
return false;
|
||||
case KC_COPY:
|
||||
if (record->event.pressed) {
|
||||
register_code16(C(KC_INS));
|
||||
} else {
|
||||
unregister_code16(C(KC_INS));
|
||||
}
|
||||
return false;
|
||||
case KC_PSTE:
|
||||
if (record->event.pressed) {
|
||||
register_code16(S(KC_INS));
|
||||
} else {
|
||||
unregister_code16(S(KC_INS));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// ???
|
||||
break;
|
||||
}
|
||||
|
||||
#endif /* ifdef OS_DETECTION_ENABLE */
|
||||
return
|
||||
// process_record_keymap(keycode, record) &&
|
||||
// #ifdef ENCODER_ENABLE
|
||||
// process_record_encoder(keycode, record) &&
|
||||
// #endif // ENCODER_ENABLE
|
||||
true;
|
||||
}
|
|
@ -22,7 +22,13 @@
|
|||
#define LOW_TAB LT(LAYER_LOWER, KC_TAB)
|
||||
#define RSE_BSP LT(LAYER_RAISE, KC_BSPC)
|
||||
#define ATT(kc) LT(LAYER_ATTIC, kc)
|
||||
#define SY(kc) LT(LAYER_SYMBOL, kc)
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
# define SY_L(kc) TD(SYM_L)
|
||||
# define SY_R(kc) TD(SYM_R)
|
||||
#else
|
||||
# define SY_L(kc) LT(LAYER_SYMBOL, kc)
|
||||
# define SY_R(kc) LT(LAYER_SYMBOL, kc)
|
||||
#endif // TAP_DANCE_ENABLE
|
||||
#ifdef MOUSEKEY_ENABLE
|
||||
# define MS(kc) LT(LAYER_POINTER, kc)
|
||||
#else
|
||||
|
@ -76,15 +82,6 @@ enum userspace_layers {
|
|||
enum userspace_custom_keycodes {
|
||||
// Safe stuff
|
||||
BS_SAFE = SAFE_RANGE,
|
||||
#ifdef QWERTY_ENABLE
|
||||
DL_QWER,
|
||||
#endif // ifdef QWERTY_ENABLE
|
||||
#ifdef BONE_ENABLE
|
||||
DL_BONE,
|
||||
#endif // ifdef BONE_ENABLE
|
||||
#ifdef COLEMAK_DH_ENABLE
|
||||
DL_CODH,
|
||||
#endif // ifdef COLEMAK_DH_ENABLE
|
||||
DL_PREV,
|
||||
DL_NEXT,
|
||||
NO_MODS,
|
||||
|
@ -99,8 +96,8 @@ enum userspace_custom_keycodes {
|
|||
/* AS_START, AS_END, // Dummy key codes for combo definitions */
|
||||
#endif // ASETNIOP_ENABLE
|
||||
DE_RSQU,
|
||||
// Encoder button
|
||||
#ifdef ENCODER_ENABLE
|
||||
// Encoder button(s)
|
||||
BS_ENC0,
|
||||
BS_ENC1,
|
||||
#endif // ENCODER_ENABLE
|
||||
|
@ -110,36 +107,61 @@ enum userspace_custom_keycodes {
|
|||
|
||||
// Fallbacks to first base layer
|
||||
#ifndef QWERTY_ENABLE
|
||||
# define DL_QWER DF(0)
|
||||
# define LAYER_QWERTY 0
|
||||
#endif // ifndef QWERTY_ENABLE
|
||||
#ifndef BONE_ENABLE
|
||||
# define DL_BONE DF(0)
|
||||
# define LAYER_BONE 0
|
||||
#endif // ifndef BONE_ENABLE
|
||||
#ifndef COLEMAK_DH_ENABLE
|
||||
# define DL_CODH DF(0)
|
||||
# define LAYER_COLEMAK_DH 0
|
||||
#endif // ifndef COLEMAK_DH_ENABLE
|
||||
// non-sticky layers (return after reset):
|
||||
#ifdef GAME_ENABLE
|
||||
# define DL_GAME DF(LAYER_GAME)
|
||||
#else
|
||||
# define DL_GAME DF(0)
|
||||
#ifndef GAME_ENABLE
|
||||
# define LAYER_GAME 0
|
||||
#endif /* ifndef GAME_ENABLE */
|
||||
#ifdef ARTSENIO_ENABLE
|
||||
# define DL_ARTS DF(LAYER_ARTSENIO)
|
||||
#ifndef ARTSENIO_ENABLE
|
||||
# define LAYER_ARTSENIO 0
|
||||
#else // artsenio specific layer keys
|
||||
# define AR_A LT(L_ARTS_PAR, DE_A)
|
||||
# define AR_E LT(L_ARTS_SYM, DE_E)
|
||||
# define AR_S LT(L_ARTS_NUM, DE_S)
|
||||
# define AR_O DE_O
|
||||
#else
|
||||
# define DL_ARTS DF(0)
|
||||
#endif /* ifndef ARTSENIO_ENABLE */
|
||||
#ifdef ASETNIOP_ENABLE
|
||||
# define DL_ASET DF(LAYER_ASETNIOP)
|
||||
#else
|
||||
# define DL_ASET DF(0)
|
||||
#ifndef ASETNIOP_ENABLE
|
||||
# define LAYER_ASETNIOP 0
|
||||
#endif /* ifndef ASETNIOP_ENABLE */
|
||||
// sticky layers (withstands reset):
|
||||
#define DL_QWER PDF(LAYER_QWERTY)
|
||||
#define DL_BONE PDF(LAYER_BONE)
|
||||
#define DL_CODH PDF(LAYER_COLEMAK_DH)
|
||||
// non-sticky layers (return to saved after reset):
|
||||
#define DL_GAME DF(LAYER_GAME)
|
||||
#define DL_ARTS DF(LAYER_ARTSENIO)
|
||||
#define DL_ASET DF(LAYER_ASETNIOP)
|
||||
|
||||
// KEYMAS
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
// Tap Dance keycodes
|
||||
enum td_keycodes {
|
||||
// Toggle symbol layer if held, key based on current base layer, else
|
||||
SYM_L,
|
||||
SYM_R
|
||||
};
|
||||
|
||||
// Define a type containing as many tapdance states as you need
|
||||
typedef enum { TD_NONE, TD_UNKNOWN, TD_SINGLE_TAP, TD_SINGLE_HOLD, TD_DOUBLE_SINGLE_TAP } td_state_t;
|
||||
|
||||
// Declare your tapdance functions:
|
||||
|
||||
// Function to determine the current tapdance state
|
||||
td_state_t cur_dance(tap_dance_state_t *state);
|
||||
|
||||
// `finished` and `reset` functions for each tapdance keycode
|
||||
void symL_finished(tap_dance_state_t *state, void *user_data);
|
||||
void symL_reset(tap_dance_state_t *state, void *user_data);
|
||||
void symR_finished(tap_dance_state_t *state, void *user_data);
|
||||
void symR_reset(tap_dance_state_t *state, void *user_data);
|
||||
#endif // TAP_DANCE_ENABLE
|
||||
|
||||
// /// // /* KEYMAPS */ // /// //
|
||||
// first and last column keys for base layer
|
||||
#define _0L1_1_ ALT_BSP
|
||||
#define _0L2_1_ CTL_ESC
|
||||
|
@ -172,10 +194,10 @@ enum userspace_custom_keycodes {
|
|||
* y │ x │ c │ v │ b n │ m │ , │ . │ ß │(Ent)
|
||||
*/
|
||||
# define _QL1_5_ DE_Q, DE_W, DE_E, DE_R, DE_T
|
||||
# define _QL2_5_ SY(DE_A), DE_S, DE_D, DE_F, DE_G
|
||||
# define _QL2_5_ SY_L(DE_A), DE_S, DE_D, DE_F, DE_G
|
||||
# define _QL3_5_ MS(DE_Y), DE_X, DE_C, DE_V, DE_B
|
||||
# define _QR1_5_ DE_Z, DE_U, DE_I, DE_O, DE_P
|
||||
# define _QR2_5_ DE_H, DE_J, DE_K, DE_L, SY(DE_ODIA)
|
||||
# define _QR2_5_ DE_H, DE_J, DE_K, DE_L, SY_R(DE_ODIA)
|
||||
# define _QR3_5_ DE_N, DE_M, DE_COMM, DE_DOT, MS(DE_SS)
|
||||
//
|
||||
# define _QL1_6_ _0L1_1_, _QL1_5_
|
||||
|
@ -198,10 +220,10 @@ enum userspace_custom_keycodes {
|
|||
* f │ v │ ü │ ä │ ö y │ z │ , │ . │ k │(Ent)
|
||||
*/
|
||||
# define _BL1_5_ DE_J, DE_D, DE_U, DE_A, DE_X
|
||||
# define _BL2_5_ SY(DE_C), DE_T, DE_I, DE_E, DE_O
|
||||
# define _BL2_5_ SY_L(DE_C), DE_T, DE_I, DE_E, DE_O
|
||||
# define _BL3_5_ MS(DE_F), DE_V, DE_UDIA, DE_ADIA, DE_ODIA
|
||||
# define _BR1_5_ DE_P, DE_H, DE_L, DE_M, DE_W
|
||||
# define _BR2_5_ DE_B, DE_N, DE_R, DE_S, SY(DE_G)
|
||||
# define _BR2_5_ DE_B, DE_N, DE_R, DE_S, SY_R(DE_G)
|
||||
# define _BR3_5_ DE_Y, DE_Z, DE_COMM, DE_DOT, MS(DE_K)
|
||||
//
|
||||
# define _BL1_6_ _0L1_1_, _BL1_5_
|
||||
|
@ -224,10 +246,10 @@ enum userspace_custom_keycodes {
|
|||
* z │ x │ c │ d │ v k │ h │ , │ . │ ß │(Ent)
|
||||
*/
|
||||
# define _CL1_5_ DE_Q, DE_W, DE_F, DE_P, DE_B
|
||||
# define _CL2_5_ SY(DE_A), DE_R, DE_S, DE_T, DE_G
|
||||
# define _CL2_5_ SY_L(DE_A), DE_R, DE_S, DE_T, DE_G
|
||||
# define _CL3_5_ MS(DE_Z), DE_X, DE_C, DE_D, DE_V
|
||||
# define _CR1_5_ DE_J, DE_L, DE_U, DE_Y, DE_ODIA
|
||||
# define _CR2_5_ DE_M, DE_N, DE_E, DE_I, SY(DE_O)
|
||||
# define _CR2_5_ DE_M, DE_N, DE_E, DE_I, SY_R(DE_O)
|
||||
# define _CR3_5_ DE_K, DE_H, DE_COMM, DE_DOT, MS(DE_SS)
|
||||
//
|
||||
# define _CL1_6_ _0L1_1_, _CL1_5_
|
||||
|
@ -357,9 +379,9 @@ enum userspace_custom_keycodes {
|
|||
#define _RR2_5_ OSM_MEH, OSM_SFT, OSM_CTL, OSM_ALT, OSM_GUI
|
||||
#define _RR3_5_ KC_PSCR, CW_TOGG, KC_PAUS, OSM_AGR, KC_SCRL
|
||||
//
|
||||
#define _RL1_6_ KC_LALT, _LR1_5_
|
||||
#define _RL2_6_ KC_LCTL, _LR2_5_
|
||||
#define _RL3_6_ KC_LGUI, _LR3_5_
|
||||
#define _RL1_6_ KC_LALT, _RL1_5_
|
||||
#define _RL2_6_ KC_LCTL, _RL2_5_
|
||||
#define _RL3_6_ KC_LGUI, _RL3_5_
|
||||
#define _RR1_6_ _RR1_5_, KC_LALT
|
||||
#define _RR2_6_ _RR2_5_, KC_RCTL
|
||||
#define _RR3_6_ _RR3_5_, KC_RGUI
|
||||
|
@ -410,9 +432,9 @@ enum userspace_custom_keycodes {
|
|||
#endif
|
||||
|
||||
/* Attic: Adjustments and missing stuff
|
||||
* QBt│ECl│LAs│LAr│ • ¡ │ ‹ │ « │ » │ ›
|
||||
* QBt│ECl│LAs│LAr│ ¡ │ ‹ │ « │ » │ ›
|
||||
* ───┼───┼───┼───┼─── ───┼───┼───┼───┼───
|
||||
* LyG│Ly←│Ly→│BsL│MDX ¿ │ … │ ‚ │ ‘ │ ’
|
||||
* LyG│Ly←│Ly→│BsL│MDX ¿ │ • │ ‚ │ ‘ │ ’ │(…)
|
||||
* ───┼───┼───┼───┼─── ───┼───┼───┼───┼───
|
||||
* R_T│R_M│R_M│R_M│R_M n-–│m-—│ „ │ “ │ ”
|
||||
* ┌───┬───┬───┐ ┌───┬───┬───┐
|
||||
|
@ -420,18 +442,18 @@ enum userspace_custom_keycodes {
|
|||
* └───┴───┴───┘ └───┴───┴───┘
|
||||
* * *
|
||||
*/
|
||||
#define _AL1_5_ QK_BOOT, EE_CLR, DL_ASET, DL_ARTS, DE_MDDT
|
||||
#define _AL1_5_ QK_BOOT, EE_CLR, DL_ASET, DL_ARTS, KC_NO
|
||||
#define _AL2_5_ DL_GAME, DL_PREV, DL_NEXT, DL_QWER, NO_MODS
|
||||
#define _AL3_5_ RGB_TOG, RGB_SAI, RGB_HUI, RGB_VAI, RGB_MOD
|
||||
#define _AR1_5_ DE_IEXL, DE_LSAQ, DE_LDAQ, DE_RDAQ, DE_RSAQ
|
||||
#define _AR2_5_ DE_IQUE, DE_ELLP, DE_SLQU, DE_LSQU, DE_RSQU
|
||||
#define _AR2_5_ DE_IQUE, DE_MDDT, DE_SLQU, DE_LSQU, DE_RSQU
|
||||
#define _AR3_5_ DE_NDSH, DE_MDSH, DE_DLQU, DE_LDQU, DE_RDQU
|
||||
//
|
||||
#define _AL1_6_ KC_NO, _AL1_5_
|
||||
#define _AL2_6_ KC_NO, _AL2_5_
|
||||
#define _AL3_6_ KC_NO, _AL3_5_
|
||||
#define _AR1_6_ _AR1_5_, KC_NO
|
||||
#define _AR2_6_ _AR2_5_, KC_NO
|
||||
#define _AR2_6_ _AR2_5_, DE_ELLP
|
||||
#define _AR3_6_ _AR3_5_, KC_NO
|
||||
//
|
||||
#define _AL4_2_ KC_BRID, KC_TRNS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue