2 Copyright 2013 Jun Wako <wakojun@gmail.com>
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.
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.
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/>.
17 #ifndef ACTION_MACRO_H
18 #define ACTION_MACRO_H
20 #include <avr/pgmspace.h>
24 #define MACRO(...) ({ static prog_macro_t _m[] PROGMEM = { __VA_ARGS__ }; _m; })
27 typedef uint8_t macro_t;
28 typedef macro_t prog_macro_t PROGMEM;
31 #ifndef NO_ACTION_MACRO
32 void action_macro_play(const prog_macro_t *macro);
34 #define action_macro_play(macro)
41 key(down): 0x04-7f/73(F24)
43 command: 0x00-03, 0x80-83(0x74-7f, 0xf4-ff)
54 extension mode command: NOT IMPLEMENTED
70 enum macro_command_id{
90 EXTENSION_MODE = 0xff,
95 #define DOWN(key) (key)
96 #define UP(key) ((key) | 0x80)
97 #define TYPE(key) (key), (key | 0x80)
98 #define MODS_DOWN(mods) MODS_DOWN, (mods)
99 #define MODS_UP(mods) MODS_UP, (mods)
100 #define WAIT(ms) WAIT, (ms)
101 #define INTERVAL(ms) INTERVAL, (ms)
103 #define D(key) DOWN(KC_##key)
104 #define U(key) UP(KC_##key)
105 #define T(key) TYPE(KC_##key)
106 #define MD(key) MODS_DOWN(MOD_BIT(KC_##key))
107 #define MU(key) MODS_UP(MOD_BIT(KC_##key))
108 #define W(ms) WAIT(ms)
109 #define I(ms) INTERVAL(ms)
115 #endif /* ACTION_MACRO_H */