I have a textarea.
When it’s focused, I would like all the key presses to go there,
when it’s not focused, I would like to respond to key presses and send messages.
An example would be the spacebar, when the textarea is focused, it should act as normal,
if the textarea is not focused, I would send a custom message.
Is there any library to do that, or what’s the best way to achieve that?
By default a focused Textarea will receive all the key commands, so you don’t need to do anything in that state. It is when the Textarea is not focused you will want to capture the keys. Correct?