Most browser accelerators shouldn't repeat when keys are held |
|||||
Issue descriptionash currently prevents certain window management accelerators from repeating when the user holds keys down (see issue 626014 for the current and proposed lists). As far as I can tell, there isn't currently a mechanism for doing something similar with browser accelerators that are handled by Chrome. As a result, it's easy (depending on your key autorepeat delay) to e.g. inadvertently accidentally close extra tabs when hitting Ctrl-W. I think there are very few browser commands that should actually be repeatable, maybe just the following (and even some of these seem debatable): IDC_SELECT_NEXT_TAB IDC_SELECT_PREVIOUS_TAB IDC_RESTORE_TAB IDC_MOVE_TAB_NEXT IDC_MOVE_TAB_PREVIOUS IDC_FIND_NEXT IDC_FIND_PREVIOUS IDC_FOCUS_NEXT_PANE IDC_FOCUS_PREVIOUS_PANE If others agree, I can think of several ways of making the other commands (technically, their corresponding accelerators) not be repeatable: a) Maintain a list of the few commands that should actually be repeatable. This means that we don't have fine-grained control of the behavior for commands with multiple accelerators, but maybe we don't need/want that. b) Add a bool field to AcceleratorMapping in chrome/browser/ui/views/accelerator_table.h describing whether the accelerator should be repeatable. This gives us control over individual accelerators, but the value will be false for most of the entries (so I *think* we could just make the member be last and omit it in most cases to get default initialization to false, right?). I haven't looked into the additional plumbing that would be needed yet.
,
Jul 8 2016
Alex, can you chime in with your thoughts about this? There's relevant discussion in the comments on https://codereview.chromium.org/2128243003/, but basically: - Chrome OS currently prevents most window management accelerators from repeating. - GTK/GNOME (Linux) and OS X (and maybe also Windows?) seem to let all accelerators repeat. - I think that it's undesirable for almost all accelerators (both WM and browser) to repeat.
,
Jul 8 2016
I think Scott's and my thought is that WM and browser should match, and they should match the OS default if possible.
,
Jul 18 2016
I talked to Alex in-person today and he asked me to summarize his viewpoint here. He actually went a bit farther than me, arguing that it probably doesn't make sense for any accelerators (apart from e.g. volume up/down and brightness up/down) to repeat (and those are more like special keys than accelerators; they just happen to be implemented using the accelerator code). He said he thinks we should disable autorepeat for most accelerators on all platforms. Albert, michaelpg@ mentioned that I should cc you to make sure that this lines up with some of the accelerator-related work that you've been doing.
,
Jul 18 2016
I certainly can't agree that things like ctrl-w shouldn't repeat, just based on personal usage. (Since one already remembers ctrl-w as a close tab shortcut, it's easier to remember to simply hold it down to close all the tabs instead of remembering a distinct shortcut for that, which would be used less commonly.) And I can't agree based on OS- or browser-compatibility reasons either; Edge, for example, allows ctrl-t and ctrl-w to repeat. We can defy the conventions of the OS and other browsers, but we should have an exceptionally good reason for doing so. In this case, I don't think we have such a reason, and in fact there are plausible reasons not to do this.
,
Jul 18 2016
+afakhry@ and +tbuckley as well. I don't have strong opinions on key repeat. I have a general desire to have things be consistent barring good reasons otherwise.
,
Aug 20 2016
Trying to figure out how to reach a resolution here. It seems like "don't let anything repeat anywhere" is Alex' take, "do what the OS naturally does (don't put special code in Chrome)" is my and maybe Scott's take; I don't know how "be consistent" from comment 6 would be practically applied here. I don't care enough about this to fight against a determined UI team. If they really really think we should make most things not repeat, I can live with that. I'm going to pull myself off review for the CL and let derat figure out what he wants to do.
,
Sep 7 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/42d287c9658c6bfa1202275597f28399409e8603 commit 42d287c9658c6bfa1202275597f28399409e8603 Author: derat <derat@chromium.org> Date: Wed Sep 07 18:04:04 2016 Make most browser accelerators not repeat. Prevent browser accelerators from repeating unless they're associated with the following commands: IDC_FIND_NEXT IDC_FIND_PREVIOUS IDC_FOCUS_NEXT_PANE IDC_FOCUS_PREVIOUS_PANE IDC_MOVE_TAB_NEXT IDC_MOVE_TAB_PREVIOUS IDC_SELECT_NEXT_TAB IDC_SELECT_PREVIOUS_TAB BUG= 626154 TEST=Ctrl-Tab still repeats but Ctrl-t doesn't Review-Url: https://codereview.chromium.org/2128243003 Cr-Commit-Position: refs/heads/master@{#416995} [modify] https://crrev.com/42d287c9658c6bfa1202275597f28399409e8603/chrome/browser/ui/views/accelerator_table.cc [modify] https://crrev.com/42d287c9658c6bfa1202275597f28399409e8603/chrome/browser/ui/views/accelerator_table.h [modify] https://crrev.com/42d287c9658c6bfa1202275597f28399409e8603/chrome/browser/ui/views/frame/browser_view.cc [modify] https://crrev.com/42d287c9658c6bfa1202275597f28399409e8603/chrome/browser/ui/views/frame/browser_view.h [modify] https://crrev.com/42d287c9658c6bfa1202275597f28399409e8603/chrome/browser/ui/views/frame/browser_view_unittest.cc [modify] https://crrev.com/42d287c9658c6bfa1202275597f28399409e8603/ui/base/accelerators/accelerator_manager.cc
,
Sep 7 2016
,
Mar 18 2017
So one should be able to hold down the key to zoom the volume, but not character size ( issue 702106 )?
,
Mar 19 2017
#10: Issue 702106 was about Linux, right? Chrome doesn't handle volume keys there; they're generally handled by the desktop environment. On Chrome OS, yes, the volume and brightness keys are intended to repeat when held but the zoom accelerators are not. If disabling autorepeat for zoom accelerators breaks a use case, I'd like to hear more about it, though. Do you frequently need to switch between large and small zoom levels? I would've figured that the accelerators repeat so quickly on most systems that it's very difficult to get to the actual level you want instead of over- or under-shooting it when holding the keys.
,
Sep 8 2017
,
Sep 9 2017
You might go the whole hog and make the arrow keys not repeat. That way it would take 14 presses to go from the back to the front of a 14 letter word... users would revolt! I'm here on Linux, and now CTRL+++++++ has become a lot more work, ugh! Why is zooming an image different than zooming sound volume? Yes I do agree CTRL+W is dangerous to auto-repeat. If they wanted to close all their windows they should hit CTRL+Q. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by derat@chromium.org
, Jul 7 2016