qmk_firmware

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

process_dynamic_macro.h (2149B)


      1 /* Copyright 2016 Jack Humbert
      2  * Copyright 2019 Drashna Jael're (@drashna, aka Christopher Courtney)
      3  *
      4  * This program is free software: you can redistribute it and/or modify
      5  * it under the terms of the GNU General Public License as published by
      6  * the Free Software Foundation, either version 2 of the License, or
      7  * (at your option) any later version.
      8  *
      9  * This program is distributed in the hope that it will be useful,
     10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     12  * GNU General Public License for more details.
     13  *
     14  * You should have received a copy of the GNU General Public License
     15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     16  */
     17 
     18 /* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */
     19 #pragma once
     20 
     21 #include <stdint.h>
     22 #include <stdbool.h>
     23 #include "action.h"
     24 
     25 /* May be overridden with a custom value. Be aware that the effective
     26  * macro length is half of this value: each keypress is recorded twice
     27  * because of the down-event and up-event. This is not a bug, it's the
     28  * intended behavior.
     29  *
     30  * Usually it should be fine to set the macro size to at least 256 but
     31  * there have been reports of it being too much in some users' cases,
     32  * so 128 is considered a safe default.
     33  */
     34 #ifndef DYNAMIC_MACRO_SIZE
     35 #    define DYNAMIC_MACRO_SIZE 128
     36 #endif
     37 
     38 void dynamic_macro_led_blink(void);
     39 bool process_dynamic_macro(uint16_t keycode, keyrecord_t *record);
     40 bool dynamic_macro_record_start_kb(int8_t direction);
     41 bool dynamic_macro_record_start_user(int8_t direction);
     42 bool dynamic_macro_play_kb(int8_t direction);
     43 bool dynamic_macro_play_user(int8_t direction);
     44 bool dynamic_macro_record_key_kb(int8_t direction, keyrecord_t *record);
     45 bool dynamic_macro_record_key_user(int8_t direction, keyrecord_t *record);
     46 bool dynamic_macro_record_end_kb(int8_t direction);
     47 bool dynamic_macro_record_end_user(int8_t direction);
     48 bool dynamic_macro_valid_key_kb(uint16_t keycode, keyrecord_t *record);
     49 bool dynamic_macro_valid_key_user(uint16_t keycode, keyrecord_t *record);
     50 void dynamic_macro_stop_recording(void);