Papageno
An Advanced Pattern Matching Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
ppg_tap_dance.h
Go to the documentation of this file.
1 /* Copyright 2017 noseglasses <shinynoseglasses@gmail.com>
2  *
3  * This program is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU Lesser General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef PPG_TAP_DANCE_H
18 #define PPG_TAP_DANCE_H
19 
22 #include "ppg_action.h"
23 #include "ppg_token.h"
24 #include "ppg_input.h"
25 #include "ppg_layer.h"
26 
31 typedef struct {
33  PPG_Count tap_count;
35 
40 #define PPG_TAP_DEFINITIONS(...) \
41  sizeof((PPG_Tap_Definition[]){ __VA_ARGS__ })/sizeof(PPG_Tap_Definition), \
42  (PPG_Tap_Definition[]){ __VA_ARGS__ }
43 
49 #define PPG_TAP(TAP_COUNT, ACTION) \
50  (PPG_Tap_Definition) { .action = ACTION, .tap_count = TAP_COUNT }
51 
69  PPG_Layer layer,
70  PPG_Input_Id input,
71  PPG_Count n_tap_definitions,
72  PPG_Tap_Definition tap_definitions[]);
73 
74 #endif
Action information.
Definition: ppg_action.h:55
uint8_t PPG_Input_Id
The type used as input identifier.
Definition: ppg_input.h:29
PPG_Token ppg_tap_dance(PPG_Layer layer, PPG_Input_Id input, PPG_Count n_tap_definitions, PPG_Tap_Definition tap_definitions[])
Defines a tap dance.
PPG_Count tap_count
The number of taps necessary to trigger the action.
Definition: ppg_tap_dance.h:33
PPG_Action action
The action associated with the given number of taps.
Definition: ppg_tap_dance.h:32
void * PPG_Token
The token type.
Definition: ppg_token.h:38
A tap specification.
Definition: ppg_tap_dance.h:31