summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2014-01-28 10:55:51 +0900
committertmk <nobody@nowhere>2014-01-28 10:55:51 +0900
commitcb3a547ebff8e09401c7d635ed24585a7521bb19 (patch)
tree9f90ef44921666b88858c76abce87a5dd783c42b /common
parenta86c1e2b713e8adace45cd3c1cae397a908b261e (diff)
Make modifiers 'weak' in macro
Diffstat (limited to 'common')
-rw-r--r--common/action_macro.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/common/action_macro.c b/common/action_macro.c
index cc7ac18a09..d85aee3796 100644
--- a/common/action_macro.c
+++ b/common/action_macro.c
@@ -16,6 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <util/delay.h>
#include "action.h"
+#include "action_util.h"
#include "action_macro.h"
#ifdef DEBUG_ACTION
@@ -39,12 +40,20 @@ void action_macro_play(const macro_t *macro_p)
case KEY_DOWN:
MACRO_READ();
dprintf("KEY_DOWN(%02X)\n", macro);
- register_code(macro);
+ if (IS_MOD(macro)) {
+ add_weak_mods(MOD_BIT(macro));
+ } else {
+ register_code(macro);
+ }
break;
case KEY_UP:
MACRO_READ();
dprintf("KEY_UP(%02X)\n", macro);
- unregister_code(macro);
+ if (IS_MOD(macro)) {
+ del_weak_mods(MOD_BIT(macro));
+ } else {
+ unregister_code(macro);
+ }
break;
case WAIT:
MACRO_READ();