# Is it necessary to check the keyState under macroAction()?

**URL:** <https://community.keyboard.io/t/is-it-necessary-to-check-the-keystate-under-macroaction/1855>\
**Category:** Programming\
**Created:** [July 29, 2018, 2:45am UTC](https://community.keyboard.io/t/is-it-necessary-to-check-the-keystate-under-macroaction/1855 "2018-07-29T02:45:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamadagni](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jamadagni/32/2030_2.png) [@jamadagni](https://community.keyboard.io/u/jamadagni)\
**Post date:** [July 29, 2018, 2:45am UTC](https://community.keyboard.io/t/is-it-necessary-to-check-the-keystate-under-macroaction/1855/1 "2018-07-29T02:45:44Z")

</div>

Continuing the discussion from [MouseKeys Plugin - separate keys for press and release?](https://community.keyboard.io/t/mousekeys-plugin-separate-keys-for-press-and-release/877/8):

> [@MouseKeys Plugin - separate keys for press and release?](https://community.keyboard.io/t/mousekeys-plugin-separate-keys-for-press-and-release/877/8):
>
> > Hello. Can you explain why this is so? I mean in my mind a macro is something that gets executed when you _do_ something, not even when you _don’t_ do something?
> 
> It’s not like that anymore. =)

Re the above mention, I’d like to know whether: `if (keyToggledOn(keyState))` is necessary any longer in the `macroAction` function.

---

<div class="post-metadata">

**Author:** ![jamadagni](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jamadagni/32/2030_2.png) [@jamadagni](https://community.keyboard.io/u/jamadagni)\
**Post date:** [July 29, 2018, 2:49am UTC](https://community.keyboard.io/t/is-it-necessary-to-check-the-keystate-under-macroaction/1855/2 "2018-07-29T02:49:07Z")

</div>

Um sorry about that. This sort of has a reply at [Two questions re macros](https://community.keyboard.io/t/two-questions-re-macros/1626/4?u=jamadagni) but I searched for that and didn’t get a result first…
