Polish and cleanup

- Redid the tap hold to simplify maintenance
- moved the ploopy nano stuff into tap hold
- removed all mention of function layer
- added double taps for programming macros
This commit is contained in:
Victor 2024-04-21 10:32:13 -05:00
parent 7c665ff65a
commit 082926a4e1
Failed to generate hash of commit
9 changed files with 217 additions and 232 deletions

View file

@ -1,39 +1,44 @@
#pragma once
#include "t4corun.h"
void insert_brackets(uint16_t left, uint16_t right);
void double_tap(uint16_t keycode, uint32_t ms);
void single_tap(uint16_t key, uint16_t altkey, bool isHold);
void double_tap(uint16_t key, uint16_t altkey, uint32_t ms);
void insert_brackets(uint16_t left, uint16_t right, uint32_t ms);
bool process_tap_hold_key(keyrecord_t* record, uint16_t keycode);
/* the first element is the key
* the second is altkey
* for the most part it will be tap for key, hold for alt key
/* the first element is the alt key (tap action)
* the second is altkey (hold action usually)
*
* I was doing a switch statement to assign these each time, but this is faster
* and easier to maintain
*/
/*
//Brackets: open and close brackets and put the cursor inside
static const uint16_t TR_LCBR_taphold[] = { KC_LCBR, KC_RCBR };
static const uint16_t TR_LABK_taphold[] = { KC_LABK, KC_RABK };
static const uint16_t TR_LBRC_taphold[] = { KC_LBRC, KC_RBRC };
static const uint16_t TR_SQUO_taphold[] = { KC_QUOT, KC_QUOT };
static const uint16_t TR_DQUO_taphold[] = { KC_DQUO, KC_DQUO };
#define TH_LCBR KC_LCBR, KC_RCBR
#define TH_LABK KC_LABK, KC_RABK
#define TH_LBRC KC_LBRC, KC_RBRC
#define TH_SQUO KC_QUOT, KC_QUOT
#define TH_DQUO KC_DQUO, KC_DQUO
#define TH_LPRN KC_LPRN, KC_RPRN
//double tap
static const uint16_t TR_EQL_taphold[] = { KC_EQL, KC_EQL };
static const uint16_t TR_PLUS_taphold[] = { KC_PLUS, KC_PLUS };
static const uint16_t TR_PIPE_taphold[] = { KC_PIPE, KC_PIPE };
#define TH_EQL KC_EQL, KC_EQL
#define TH_PLUS KC_PLUS, KC_PLUS
#define TH_PIPE KC_PIPE, KC_PIPE
#define TH_NUM KC_NUM, KC_NUM //For ploopy nano
#define TH_CAPS KC_CAPS, KC_CAPS
//Custom: things like overriding default shifted key
static const uint16_t TR_LPRN_taphold[] = { KC_LPRN, KC_LPRN };
static const uint16_t TR_COMM_taphold[] = { KC_COMM, KC_LPRN };
static const uint16_t TR_DOT_taphold[] = { KC_DOT, KC_RPRN };
static const uint16_t TR_PERC_taphold[] = { KC_PERC, KC_CIRC };
#define TH_COMM KC_COMM, KC_LPRN
#define TH_DOT KC_DOT, KC_RPRN
#define TH_PERC KC_PERC, KC_CIRC
#define TH_EXLM KC_EXLM, KC_EXLM
#define TH_NEQL KC_EXLM, KC_EQL
//auto shift
#define TH_MINS KC_MINS, KC_UNDS
#define TH_GRV KC_GRV, KC_TILD
#define TH_SCLN KC_SCLN, KC_COLN
#define TH_QUOT KC_QUOT, KC_DQUO
//Faux auto shift
static const uint16_t TR_MINS_taphold[] = { KC_MINS, KC_UNDS };
static const uint16_t TR_GRV_taphold[] = { KC_GRV, KC_TILDE };
static const uint16_t TR_SCLN_taphold[] = { KC_SCLN, KC_COLN };
static const uint16_t TR_QUOT_taphold[] = { KC_QUOT, KC_DQUO };
*/