From cb53c4fd41885ba60192cbd0b5fd23d6a687ab17 Mon Sep 17 00:00:00 2001 From: hvp <32483282+hvpkod@users.noreply.github.com> Date: Thu, 2 Sep 2021 05:44:36 +0200 Subject: [Keymap] hvp keymap for Cornelius, updated ut47.2 and userspace (#14187) --- users/hvp/config.h | 18 ++++++++++++++++++ users/hvp/hvp.h | 38 ++++++++++++++++++++++++++++++++++---- users/hvp/per_key.c | 43 +++++++++++++++++++++++++++++++++++++++++++ users/hvp/rules.mk | 7 ++++++- users/hvp/tap_dances.h | 21 +++++++++++++++++++-- 5 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 users/hvp/config.h create mode 100644 users/hvp/per_key.c (limited to 'users/hvp') diff --git a/users/hvp/config.h b/users/hvp/config.h new file mode 100644 index 0000000000..68dd8b4828 --- /dev/null +++ b/users/hvp/config.h @@ -0,0 +1,18 @@ + /* Copyright 2021 hvp + * + * 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 . + */ +#pragma once + +#define LONG_TAPPING_TERM 1000 \ No newline at end of file diff --git a/users/hvp/hvp.h b/users/hvp/hvp.h index b016da9e25..275838a49a 100644 --- a/users/hvp/hvp.h +++ b/users/hvp/hvp.h @@ -1,13 +1,43 @@ + /* Copyright 2021 hvp + * + * 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 . + */ + + #pragma once +#include "quantum.h" +#undef TAPPING_TERM +#define TAPPING_TERM 150 #ifdef TAP_DANCE_ENABLE # include "tap_dances.h" #endif -#include "quantum.h" -#undef TAPPING_TERM -#define TAPPING_TERM 150 +#ifdef TAPPING_TERM_PER_KEY +# include "per_key.h" +#endif -// Keys #define D_NAVI MT(MOD_LCTL | MOD_LSFT, KC_D) + +/* Home-row mods */ +#define LG_A MT(MOD_LGUI, KC_A) +#define LA_S MT(MOD_LALT, KC_S) +#define LS_D MT(MOD_LSFT, KC_D) +#define LC_F MT(MOD_LCTL, KC_F) + +#define RC_H MT(MOD_RCTL, KC_H) +#define RS_J MT(MOD_RSFT, KC_J) +#define RA_K MT(MOD_RALT, KC_K) +#define RG_L MT(MOD_RGUI, KC_L) \ No newline at end of file diff --git a/users/hvp/per_key.c b/users/hvp/per_key.c new file mode 100644 index 0000000000..571fdcc915 --- /dev/null +++ b/users/hvp/per_key.c @@ -0,0 +1,43 @@ + /* Copyright 2021 hvp + * + * 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 . + */ + + +// #include per_key.h + +uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MT(MOD_LGUI, KC_A): + return TAPPING_TERM + LONG_TAPPING_TERM; + case MT(MOD_LALT, KC_S): + return TAPPING_TERM + LONG_TAPPING_TERM; + case MT(MOD_LSFT, KC_D): + return TAPPING_TERM + LONG_TAPPING_TERM; + case MT(MOD_LCTL, KC_F): + return TAPPING_TERM + LONG_TAPPING_TERM; + case MT(MOD_RCTL, KC_H): + return TAPPING_TERM + LONG_TAPPING_TERM; + case MT(MOD_RSFT, KC_J): + return TAPPING_TERM + LONG_TAPPING_TERM; + case MT(MOD_RALT, KC_K): + return TAPPING_TERM + LONG_TAPPING_TERM; + case MT(MOD_RGUI, KC_L): + return TAPPING_TERM + LONG_TAPPING_TERM; + case KC_LCPO: + return TAPPING_TERM 75; + default: + return TAPPING_TERM; + } +} \ No newline at end of file diff --git a/users/hvp/rules.mk b/users/hvp/rules.mk index 0a7e679631..549483b67b 100644 --- a/users/hvp/rules.mk +++ b/users/hvp/rules.mk @@ -1,4 +1,9 @@ + SRC += hvp.c ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dances.c + SRC += tap_dances.c +endif + +ifeq ($(strip $(TAPPING_TERM_PER_KEY)), yes) + SRC += per_key.c endif \ No newline at end of file diff --git a/users/hvp/tap_dances.h b/users/hvp/tap_dances.h index cad9bd90ec..a00caf0929 100644 --- a/users/hvp/tap_dances.h +++ b/users/hvp/tap_dances.h @@ -1,5 +1,22 @@ + /* Copyright 2021 hvp + * + * 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 . + */ + + #pragma once -#include "hvp.h" +#include "quantum.h" // Tap Dance Declarations enum tapdance_id @@ -9,4 +26,4 @@ enum tapdance_id TD3, TD4, TD5 -}; +}; \ No newline at end of file -- cgit v1.2.1