@ -179,42 +179,124 @@ Below is a specific example:
* Double Tap = Send `Escape`
* Double Tap and Hold = Send `Alt`
The following example can be easily expanded to more than 4 quite easily:
## Setup
You will need a few things that can be used for 'Quad Function Tap-Dance'. The suggested setup is to create a user directory for yourself. This directory will contain rules.mk `<your_name>.c` and `<your_name>.h`. This directory should be called `<your_name>`, and located in the top level `users` directory. There should already be a few examples to look at there.
### In `/qmk_firmware/users/<your_name>/rules.mk`
Put the following:
```c
//**************** Definitions needed for quad function to work *********************//
//Enums used to clearly convey the state of the tap dance
TAP_DANCE_ENABLE = yes
SRC += your_name.c
```
Pretty simple. It is a nice way to keep some rules common on all your keymaps.
### In `/qmk_firmware/users/<your_name>/<you_name>.h`
You will need a few things in this file:
```c
#ifndef YOUR_NAME
#define YOUR_NAME
#include "quantum.h"
#include "process_keycode/process_tap_dance.h"
typedef struct {
bool is_press_action;
int state;
} xtap;
enum {
SINGLE_TAP = 1,
SINGLE_HOLD = 2,
DOUBLE_TAP = 3,
DOUBLE_HOLD = 4,
DOUBLE_SINGLE_TAP = 5 //send SINGLE_TAP twice - NOT DOUBLE_TAP
// Add more enums here if you want for triple, quadruple, etc.
DOUBLE_SINGLE_TAP = 5, //send two single taps
TRIPLE_TAP = 6,
TRIPLE_HOLD = 7
};
typedef struct {
bool is_press_action;
int state;
} tap;
//Tap dance enums
enum {
CTL_X = 0,
SOME_OTHER_DANCE
}
int cur_dance (qk_tap_dance_state_t *state);
//for the x tap dance. Put it here so it can be used in any keymap