123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #ifndef ACTION_MACRO_H
- #define ACTION_MACRO_H
- #include <stdint.h>
- #include "progmem.h"
- #define MACRO_NONE 0
- #define MACRO(...) ({ static const macro_t __m[] PROGMEM = { __VA_ARGS__ }; &__m[0]; })
- #define MACRO_GET(p) pgm_read_byte(p)
- typedef uint8_t macro_t;
- #ifndef NO_ACTION_MACRO
- void action_macro_play(const macro_t *macro_p);
- #else
- #define action_macro_play(macro)
- #endif
- enum macro_command_id{
-
- END = 0x00,
- KEY_DOWN,
- KEY_UP,
-
-
- WAIT = 0x74,
- INTERVAL,
-
-
- };
- #define DOWN(key) KEY_DOWN, (key)
- #define UP(key) KEY_UP, (key)
- #define TYPE(key) DOWN(key), UP(key)
- #define WAIT(ms) WAIT, (ms)
- #define INTERVAL(ms) INTERVAL, (ms)
- #define D(key) DOWN(KC_##key)
- #define U(key) UP(KC_##key)
- #define T(key) TYPE(KC_##key)
- #define W(ms) WAIT(ms)
- #define I(ms) INTERVAL(ms)
- #define MD(key) DOWN(KC_##key)
- #define MU(key) UP(KC_##key)
- #endif
|