# Combine Enter key and button is pressed in the When clause of triggers

**URL:** <https://community.tulip.co/t/combine-enter-key-and-button-is-pressed-in-the-when-clause-of-triggers/8794>\
**Category:** Product Suggestions\
**Created:** [July 11, 2023, 6:27am UTC](https://community.tulip.co/t/combine-enter-key-and-button-is-pressed-in-the-when-clause-of-triggers/8794 "2023-07-11T06:27:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas.riehl](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/thomas.riehl/32/7170_2.png) [@thomas.riehl](https://community.tulip.co/u/thomas.riehl)\
**Post date:** [July 11, 2023, 6:27am UTC](https://community.tulip.co/t/combine-enter-key-and-button-is-pressed-in-the-when-clause-of-triggers/8794/1 "2023-07-11T06:27:26Z")

</div>

Hi,

I face a situation where I need to submit a step (and execute button trigger) but I want to associate the enter key to the same list of trigger.

I have found the post [Key-Mapping on Steps](https://community.tulip.co/t/key-mapping-on-steps/2912), but it doesn’t answer my issue.

Only workaround I havec found is to duplicate the triggers:

- 1 trigger on input field associated to “when enter key is pressed”
- same trigger a button associated to “when button is pressed”

My expectation is to have in the same When clause : when button is pressed and on enter key is pressed.  
So I can associate both action to same trigger and reduce code duplication.

thank you

---

<div class="post-metadata">

**Author:** ![thorsten.langner](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@thorsten.langner](https://community.tulip.co/u/thorsten.langner)\
**Post date:** [July 11, 2023, 1:33pm UTC](https://community.tulip.co/t/combine-enter-key-and-button-is-pressed-in-the-when-clause-of-triggers/8794/2 "2023-07-11T13:33:57Z")

</div>

Hi @thomas.riehl,

I’m with you on that one. Thats one reason why I built an input widget as custom widget by myself.

As possible workaround:

- Make a custom widget, that detects a change of a boolean variable.

- Put your trigger logik on this widget

- toggle this starting vaiable by enter in the input field and by the button

→ both will start your widget and you can also start it with other trigger logic, simply by changing the variable.

btw.: It could be reasonable to check for a specific state (true) of this bool and reset it on step enter and in the widget logic itself (before fireing the event).
