Google Docs, Google Chrome - Focus Moves to Settings Button After Hotkey Pressed

Report problems with documented functionality
trekracer
Posts: 1
Joined: 25 Mar 2017, 10:56

Google Docs, Google Chrome - Focus Moves to Settings Button After Hotkey Pressed

25 Mar 2017, 12:40

In Google Docs, keyboard shortcut Ctrl+Alt+1 styles the line at the cursor as <h1>, Ctrl+Alt+2 as <h2>, Ctrl+Alt+3 as <h3> and so on. I use a script to simplify adding these styles to Google Docs:

F9::SendInput ^!1
F10::SendInput ^!2
F11::SendInput ^!3
F12::SendInput ^!4

This allows me to type a line of text, hit the hotkey to apply the style, and quickly keep typing. This works great in Firefox and has for years. It also works in Microsoft Edge.

However, pressing the hotkeys in Google Chrome not only changes the style, but it then sets focus on the Settings button in the toolbar instead of leaving the focus where I'm typing. Interestingly, pressing Ctrl+Alt+1, 2, 3, etc. on the keyboard leaves the focus on the cursor as I would expect. It's only when using the hotkeys that the focus moves away from the document and into the toolbar.

Any thoughts?

Thank you!

- AutoHotkey 1.1.25.01 (the same result was also present in an older version, 1.0.40.x. I don't have the exact version number any more.)
- Windows 10
- Chrome 57.0.2987.110 (64-bit)
- Firefox 52.0.1 (32-bit)
- Microsoft Edge 38.14393.0.0
Guest

Re: Google Docs, Google Chrome - Focus Moves to Settings Button After Hotkey Pressed

25 Mar 2017, 16:21

It is probably because of the the ! (Alt) key, try sending an additional Alt to reset the focus back to the text input (you can make it conditional by using #If or #IfWinActive of IfWinActive depending on how you code it. So send another alt after the numbers.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 49 guests