x/input/input_actions/>Recipe: Input Actions</a>. However, you may find yourself needing to add one or more actions directly in a script. The <a href=https://docs.godotengine.org/en/latest/classes/class_inputmap.html target=_blank>InputMap singleton</a> has methods to help you do this.</p><p>Here&rsquo;s an example that would add a new action called &ldquo;attack&rdquo; using the space key:</p><div class=highlight><pre tabindex=0 style=color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab