Focus un focus text input object options

There is this post by Reborn

Where user PalnktonFun streamlined it a little bit
So you press enter to get into text input object focus and out of it by pressing enter again
(it generates new line but that could be solved by using sub string to remove new line)

function isFocused(inputElement) {
  return (document.activeElement === inputElement)
}

if (objects.length > 0) {
    const renderer = objects[0]._renderer;

    document.onkeypress = function(e) {
        e = e || window.event;
        const key = e.key;
        if (key === 'Enter') {
            if(isFocused(renderer._input)) {
                renderer._input.blur();
            } else {
                renderer._input.focus();
            }
        }        
    }
}

It needs to have trigger once and here you need name of your text input object

Where Jack here suggest to adding options for focusing
Which also would be cool idea for example login screens or enter a name for character or something

Could we get this implemented into text input object?