mirror of
https://github.com/qmk/qmk_firmware
synced 2024-11-18 09:55:48 +00:00
Remove userspace info from Quad-Function Tap Dance example (#4631)
This commit is contained in:
parent
60f9abca12
commit
641bbeb41a
1 changed files with 7 additions and 29 deletions
|
@ -185,29 +185,11 @@ Below is a specific example:
|
|||
|
||||
## 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.
|
||||
You will need a few things that can be used for 'Quad Function Tap-Dance'.
|
||||
|
||||
### In `/qmk_firmware/users/<your_name>/rules.mk`
|
||||
|
||||
Put the following:
|
||||
```c
|
||||
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>/<your_name>.h`
|
||||
|
||||
You will need a few things in this file:
|
||||
You'll need to add these to the top of your `keymap.c` file, before your keymap.
|
||||
|
||||
```c
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
#include "process_keycode/process_tap_dance.h"
|
||||
|
||||
typedef struct {
|
||||
bool is_press_action;
|
||||
int state;
|
||||
|
@ -234,18 +216,12 @@ 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
|
||||
void x_finished (qk_tap_dance_state_t *state, void *user_data);
|
||||
void x_reset (qk_tap_dance_state_t *state, void *user_data);
|
||||
|
||||
```
|
||||
|
||||
### In `/qmk_firmware/users/<your_name>/<your_name>.c`
|
||||
|
||||
And then in your user's `.c` file you implement the functions above:
|
||||
Now, at the bottom of your `keymap.c` file, you'll need to add the following:
|
||||
|
||||
```c
|
||||
#include "<your_name>.h"
|
||||
#include "quantum.h"
|
||||
#include "action.h"
|
||||
#include "process_keycode/process_tap_dance.h"
|
||||
|
||||
/* Return an integer that corresponds to what kind of tap dance should be executed.
|
||||
*
|
||||
* How to figure out tap dance state: interrupted and pressed.
|
||||
|
@ -335,4 +311,6 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
|||
};
|
||||
```
|
||||
|
||||
And then simply use `TD(X_CTL)` anywhere in your keymap after including `<your_name>.h`.
|
||||
And then simply use `TD(X_CTL)` anywhere in your keymap.
|
||||
|
||||
If you want to implement this in your userspace, then you may want to check out how [DanielGGordon](https://github.com/qmk/qmk_firmware/tree/master/users/gordon) has implemented this in their userspace.
|
||||
|
|
Loading…
Reference in a new issue