Skip to content

Commit

Permalink
Remove old capsword and install new one
Browse files Browse the repository at this point in the history
- remove old capsword feature
- upgrade tapping term to new macro
- add new capword

References
- https://getreuer.info/posts/keyboards/caps-word/index.html
- qmk#16681 (comment)
- https://docs.qmk.fm/#/feature_caps_word
  • Loading branch information
evantravers committed Mar 16, 2024
1 parent 3c4b26e commit 8743bd0
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 291 deletions.
9 changes: 1 addition & 8 deletions users/evantravers/evantravers.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ along with this program. If not, see <http:https://www.gnu.org/licenses/>.
*/

#include "evantravers.h"
#include "features/caps_word.h"

uint32_t user_key_timer;
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record);

qk_tap_dance_action_t tap_dance_actions[] = {
[TD_CTRL_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_ESC),
Expand All @@ -37,8 +35,6 @@ float qwerty[][2] = SONG(UNICODE_LINUX);


bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!process_caps_word(keycode, record)) { return false; }

switch (keycode) {
case TO(_GAMING):
#ifdef AUDIO_ENABLE
Expand All @@ -50,16 +46,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
PLAY_SONG (qwerty);
#endif
return true; break;
case CAPS:
caps_word_set(true);
return false; break;
case ESC_F19:
if (record->event.pressed) {
user_key_timer = timer_read();
register_code(KC_F19);
} else {
unregister_code(KC_F19);
if (timer_elapsed(user_key_timer) < get_tapping_term(keycode, record)) {
if (timer_elapsed(user_key_timer) < TAPPING_TERM) {
tap_code(KC_ESC);
}
}
Expand Down
3 changes: 1 addition & 2 deletions users/evantravers/evantravers.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ enum userspace_tapdances {
};

enum userspace_custom_keycodes {
ESC_F19 = SAFE_RANGE,
CAPS
ESC_F19 = SAFE_RANGE
};

/* Define layer names */
Expand Down
151 changes: 0 additions & 151 deletions users/evantravers/features/caps_word.c

This file was deleted.

128 changes: 0 additions & 128 deletions users/evantravers/features/caps_word.h

This file was deleted.

2 changes: 1 addition & 1 deletion users/evantravers/rules.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
SRC += evantravers.c
SRC += features/caps_word.c

TAP_DANCE_ENABLE = yes

Expand All @@ -15,5 +14,6 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
MACROS_ENABLED = no
CAPS_WORD_ENABLE = yes

DEBOUNCE_TYPE = sym_eager_pk
2 changes: 1 addition & 1 deletion users/evantravers/wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#define _________________SYMBL_L2__________________ KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV
#define _________________SYMBL_L3__________________ KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD

#define _________________SYMBL_R1__________________ KC_CIRC, KC_UNDS, KC_PLUS, KC_SLSH, CAPS
#define _________________SYMBL_R1__________________ KC_CIRC, KC_UNDS, KC_PLUS, KC_SLSH, CAPS_WORD
#define _________________SYMBL_R2__________________ KC_SLSH, KC_MINS, KC_EQL, KC_ASTR, KC_COLN
#define _________________SYMBL_R3__________________ KC_AMPR, KC_QUES, KC_LT, KC_GT, KC_BSLS

Expand Down

0 comments on commit 8743bd0

Please sign in to comment.