qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

tap_dances.h (1546B)


      1 /* Copyright 2024 Vaarai
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 2 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 General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     15  */
     16 
     17 #pragma once
     18 
     19 #include QMK_KEYBOARD_H
     20 
     21 /* Tap dances definitions */
     22 enum tap_dances {
     23   TD_SFT_CAPSW,
     24   TD_NAV_ACCENT,
     25   TD_NUM_ACCENT,
     26   TAP_DANCE_ACTIONS_COUNT /* Utility to get TD_xxx count */
     27 };
     28 
     29 /* Accented letters */
     30 typedef enum {
     31   ACCENT_NONE,
     32   ACCENT_LEFT,
     33   ACCENT_RIGHT
     34 } accent_state_t;
     35 
     36 extern accent_state_t accent_state;
     37 
     38 extern tap_dance_action_t tap_dance_actions[TAP_DANCE_ACTIONS_COUNT];
     39 
     40 void dance_shift_capsword_finished (tap_dance_state_t *state, void *user_data);
     41 void dance_shift_capsword_reset (tap_dance_state_t *state, void *user_data);
     42 
     43 void dance_nav_accent_finished (tap_dance_state_t *state, void *user_data);
     44 void dance_nav_accent_reset (tap_dance_state_t *state, void *user_data);
     45 
     46 void dance_num_accent_finished (tap_dance_state_t *state, void *user_data);
     47 void dance_num_accent_reset (tap_dance_state_t *state, void *user_data);