# Respond to keyboard events in config screen

**URL:** <https://discourse.nodered.org/t/respond-to-keyboard-events-in-config-screen/53284>\
**Category:** Developing Nodes\
**Created:** [6 November 2021 06:27 UTC](https://discourse.nodered.org/t/respond-to-keyboard-events-in-config-screen/53284 "2021-11-06T06:27:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [6 November 2021 06:27 UTC](https://discourse.nodered.org/t/respond-to-keyboard-events-in-config-screen/53284/1 "2021-11-06T06:27:16Z")

</div>

Hi folks,

I have an SVG in the config screen of a new node, and when spending my time in that SVG I need to be able to respond to keyboard events.

1. Since an SVG element is no input-type, I need to add an ` tabindex="0"` attribute to my SVG element (see [Stackoverflow](https://stackoverflow.com/a/68885356)). However I never arrive in my event handler...

2. So I tried listening to all keyboard events on my window, but I also never arrive in my event.

3. Finally listening to all keyboard events on my document works:

From this I 'assume' that the event propagation towards my config screen window is somewhere stopped by Node-RED?

I am now wondering if option 3 is an acceptable approach? Have not digged into it further, but I assume I have to start taking into account that my handler should always be removed correctly, to avoid duplicate processings.

Thanks !!!  
Bart

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [6 November 2021 08:46 UTC](https://discourse.nodered.org/t/respond-to-keyboard-events-in-config-screen/53284/2 "2021-11-06T08:46:00Z")

</div>

Node-RED only blocks events if they match an assigned keyboard shortcut. Otherwise you wouldn't be able to type text into any thing.

So there must be some other reason for why your event listener isn't being triggered.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 January 2022 08:46 UTC](https://discourse.nodered.org/t/respond-to-keyboard-events-in-config-screen/53284/3 "2022-01-05T08:46:16Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
