Escape key in location bar under MAC to give focus to the web contents.

190 views
Skip to first unread message

Brook Hong

unread,
Sep 27, 2017, 4:41:47 AM9/27/17
to Chromium-dev
Hi All,


    If the escape key was pressed and no revert happened and we're in fullscreen mode, give focus to the web contents.

Why in fullscreen mode? It helps a lot if it could give focus to the web contents only if the escape key was pressed and no revert happened.


Why it helps?

I'm using a vim-like extension(https://github.com/brookhong/Surfingkeys) to surf the web, shortcuts from the extension only work when page content got focus. All other vim-like extensions(such as vimium and cVim) work in same way. If `Cmd + L` then a `Escape` could precisely bring focus to page content under MAC, it will benefit many extensions.

I tried to comment below line in the file, then build, it works like a charm under MAC.

    if ([windowController isInAnyFullscreenMode]) {

Could you please let me know why fullscreen mode is a must?

@isherman

Thanks

PhistucK

unread,
Sep 27, 2017, 6:55:33 AM9/27/17
to hzgma...@gmail.com, Chromium-dev
Why not press Tab? It goes to the web content as well (albeit focusing on something, but, still)...


PhistucK

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/d31a70d5-d390-4614-b321-54fb69429e89%40chromium.org.

Brook Hong

unread,
Sep 27, 2017, 10:51:32 PM9/27/17
to Chromium-dev, hzgma...@gmail.com
It takes several times of Tab to go to web content, which depends on how many extensions are installed.

For me, I have above 10 extensions installed, plus other icons from Chromium itself, I need press 16 times of Tab to go to web content.


On Wednesday, September 27, 2017 at 6:55:33 PM UTC+8, PhistucK wrote:
Why not press Tab? It goes to the web content as well (albeit focusing on something, but, still)...


PhistucK

On Wed, Sep 27, 2017 at 11:41 AM, Brook Hong <hzgma...@gmail.com> wrote:
Hi All,


    If the escape key was pressed and no revert happened and we're in fullscreen mode, give focus to the web contents.

Why in fullscreen mode? It helps a lot if it could give focus to the web contents only if the escape key was pressed and no revert happened.


Why it helps?

I'm using a vim-like extension(https://github.com/brookhong/Surfingkeys) to surf the web, shortcuts from the extension only work when page content got focus. All other vim-like extensions(such as vimium and cVim) work in same way. If `Cmd + L` then a `Escape` could precisely bring focus to page content under MAC, it will benefit many extensions.

I tried to comment below line in the file, then build, it works like a charm under MAC.

    if ([windowController isInAnyFullscreenMode]) {

Could you please let me know why fullscreen mode is a must?

@isherman

Thanks

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

PhistucK

unread,
Sep 28, 2017, 1:37:38 AM9/28/17
to Brook Hong, Chromium-dev
That might be a bug (or an intentional difference of behavior, unclear).
On Windows, pressing Control + L and then pressing Tab goes straight to the (first focusable element of the) web content.
(I have many extensions as well)

Control + K activates some search mode, so pressing Tab iterates the suggestions instead of going to the web content.

The behavior you are describing almost* happens on Windows if you press F6 to go to the address bar. Perhaps that was accidentally hooked to Command + L?
Are Safari and Firefox behaving similarly (Command + L activates some accessibility mode)?

*With the following minor and major differences -
- Not only extensions are participating in the tab-iteration. The bookmark-this-page button also participates, for example.
- The web content is never focused.


PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/df2f9eba-e24f-4545-8e95-b9e4413204ab%40chromium.org.

Brook Hong

unread,
Sep 28, 2017, 11:00:24 PM9/28/17
to Chromium-dev, hzgma...@gmail.com
Sorry for not making it clear.

The issue here is on Mac OSX, the source file autocomplete_text_field_editor.mm under cocoa is also specifically for Mac as far as I know.

Actually there are already some discussions on the web,



PhistucK

Trent Apted

unread,
Sep 28, 2017, 11:45:24 PM9/28/17
to hzgma...@gmail.com, Chromium-dev
On 29 September 2017 at 13:00, Brook Hong <hzgma...@gmail.com> wrote:
Sorry for not making it clear.

The issue here is on Mac OSX, the source file autocomplete_text_field_editor.mm under cocoa is also specifically for Mac as far as I know.

Actually there are already some discussions on the web,


If macOS `System Preferences` -> `Keyboard` -> `Shortcuts` -> `Full Keyboard Access` is set to "Text boxes and lists only", then Tab from the omnibox should go to the web page.

 

Brook Hong

unread,
Sep 29, 2017, 4:15:31 AM9/29/17
to Chromium-dev, hzgma...@gmail.com
Great, this makes Tab really work for this case.

Thanks.
Reply all
Reply to author
Forward
0 new messages