# Multiple Keys Checked with containers Array and Set to a "Was Input Key Just pressed"?

**URL:** <https://forums.unrealengine.com/t/multiple-keys-checked-with-containers-array-and-set-to-a-was-input-key-just-pressed/450852>\
**Category:** Blueprint\
**Tags:** keys, unreal-engine, multiple-instance, Blueprint, question\
**Created:** [June 18, 2019, 1:46am UTC](https://forums.unrealengine.com/t/multiple-keys-checked-with-containers-array-and-set-to-a-was-input-key-just-pressed/450852 "2019-06-18T01:46:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ch0c0latemilk12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ch0c0latemilk12](https://forums.unrealengine.com/u/Ch0c0latemilk12)\
**Post date:** [June 18, 2019, 1:46am UTC](https://forums.unrealengine.com/t/multiple-keys-checked-with-containers-array-and-set-to-a-was-input-key-just-pressed/450852/1 "2019-06-18T01:46:07Z")

</div>

I want to Check multiple keys like WASD with any container types to check if any of those key inputs are pressed under the _“Was Input Key Just Pressed/Released”_. My issue is that node only allows for one input; when the only way is to use 4 _“Was Input Key Just Pressed/Released”_ nodes to check each key separately. But I’d like to check for those keys being pressed in one instead of four separate _Just Pressed_ nodes. Also, does the node _Just Pressed_ 4 or more times cause more processing each node I add?

![280102-arrayandset-keys.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/e/d4ea6c5e1c2d89deb0d68f77a14c823337be7b1a.jpeg)

 ![280103-get-key.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/1/5/615e27aba68f4475dc9c82b10964c2f4d7cccfa3.jpeg)

![280104-variables.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/c/cec389f88323962dbe6acd049fe0373bff4578ad.jpeg)

---

<div class="post-metadata">

**Author:** ![Unfathomable](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Unfathomable](https://forums.unrealengine.com/u/Unfathomable)\
**Post date:** [June 18, 2019, 9:10am UTC](https://forums.unrealengine.com/t/multiple-keys-checked-with-containers-array-and-set-to-a-was-input-key-just-pressed/450852/2 "2019-06-18T09:10:58Z")

</div>

You may want to make use of the “Any Key” input event.

Image example: [[Imgur: The magic of the Internet](https://imgur.com/a/xjxlvS8)]

The “Pressed Keys” array in this example can be used to check multi-key combos.

Definitely using pure nodes like this will result in vast amounts of function calls. If you find yourself needing result of a pure node like Get Player Controller and the and the value doesn’t change in your game, you have the option of saving the player controller reference as a variable.

(Couldn’t upload image directly for some reason).

---

<div class="post-metadata">

**Author:** ![Ch0c0latemilk12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ch0c0latemilk12](https://forums.unrealengine.com/u/Ch0c0latemilk12)\
**Post date:** [June 18, 2019, 1:28pm UTC](https://forums.unrealengine.com/t/multiple-keys-checked-with-containers-array-and-set-to-a-was-input-key-just-pressed/450852/3 "2019-06-18T13:28:43Z")

</div>

Awesome, Thank you. It was a lot easier of a fix than I thought. Never even thought to directly check from all keys which were being pressed.

 ![280120-set-start-stop-speed.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/d/98dbd2aca77dfbc25e04c0da54080ca133573200.jpeg)
