Surfingkeys icon indicating copy to clipboard operation
Surfingkeys copied to clipboard

how to exit input mode without pressing esc since esc closes some windows

Open kirilligum opened this issue 2 years ago • 4 comments

sometimes when a window within the webpage appears with inputs, I make an input and then want to exit the input, press 'F' and click a button but when I press esc, the window within the webpage closes. I need a way to exit the input without esc.

to reproduce: open gmail press "compose" enter something in "to" input field press esc to exit "to" input field the compose window closes

the current workaround is to keep pressing "tab" until no input element is selected

is there a key combination to exit the input mode? if not, it would be a good feature

Best, --Kirill

kirilligum avatar Jun 16 '22 15:06 kirilligum

Esc is now propagated to next event handler due to #248.

brookhong avatar Jun 18 '22 08:06 brookhong

Is there any workaround for this? I work with certain webapps that will close a window when pressing Esc. However, using Tab only adds a tab into the text field input rather than switching elements, so the tab workaround does not always work. Is there at least a workaround for unfocusing from an input without esc or tab? Otherwise, I am stuck having to use a mouse to submit certain things.... Especially if I am on a textfield that does not switch focus with tab.

I tried making a shortcut <Alt+u> for unfocusing using document.activeElement.blur(); but shortcuts don't seem to work if you are on typing mode, not even Alt or Ctrl shortcuts

BraianPita avatar Feb 29 '24 17:02 BraianPita

This works for me, did you try imapkey?

imapkey('<Ctrl-u>', '', function() {
    document.activeElement.blur();
});

brookhong avatar Mar 01 '24 02:03 brookhong

Thank you, @brookhong! I was trying to use api.mapkey and did not know about api.imapkey. This works perfectly!

BraianPita avatar Mar 01 '24 02:03 BraianPita