Requesting Keyboard Shortcut Key Screenshots

NEW
Unassigned

Status

()

Firefox
Keyboard Navigation
11 months ago
7 months ago

People

(Reporter: jgruen, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

11 months ago
We would like to implement a keyboard shortcut in the Screenshots feature shipping in Firefox 55. The shortcut does not block release of Screenshots in 55.

A few questions:

1. Can we implement the shortcut in our system add-on or would it need to be implemented in Firefox itself outside of the add-on? Asking b/c it seems some add-ons let users modify keybindings and it seems like we'd want to expose ourselves to that, which might not be possible from inside the add-on. (cf https://addons.mozilla.org/en-US/firefox/addon/s3menu-wizard/)

2. Is there a specific key combination we should use? CMND+OPT+S is taken by dev tools, so maybe CMND+SHIFT+S would work.

3. How would we have to modify this combination for MacOS, Linux, Windows.
(Reporter)

Comment 1

11 months ago
Gijs, It was suggested that you might help us answer these questions. Feel free to remove the NI if that's not the case.
Flags: needinfo?(gijskruitbosch+bugs)

Comment 2

11 months ago
(In reply to [:jgruen] from comment #0)
> We would like to implement a keyboard shortcut in the Screenshots feature
> shipping in Firefox 55. The shortcut does not block release of Screenshots
> in 55.
> 
> A few questions:
> 
> 1. Can we implement the shortcut in our system add-on or would it need to be
> implemented in Firefox itself outside of the add-on? Asking b/c it seems
> some add-ons let users modify keybindings and it seems like we'd want to
> expose ourselves to that, which might not be possible from inside the
> add-on. (cf https://addons.mozilla.org/en-US/firefox/addon/s3menu-wizard/)

I don't know how the add-on works and if how you add the shortcut would make a difference, but I would be somewhat surprised if it did. Either way, this will break in 57 anyway, so I'm not sure that you should worry about this just for the 56 release.

I don't know about shortcut keys in webextensions. Kris can answer whether you can add one and what, if any, restrictions there are. In bootstrapped add-ons, it shouldn't be a problem to add the shortcut as part of the add-on.

> 2. Is there a specific key combination we should use? CMND+OPT+S is taken by
> dev tools, so maybe CMND+SHIFT+S would work.
> 3. How would we have to modify this combination for MacOS, Linux, Windows.

This is the really hard part, and I don't have cycles to do the work of finding a key that is genuinely not taken, and the various platform versions.

I will say that ctrl+shift+s is taken on Windows/Linux for the same thing cmd-opt-s is taken on OS X (debugger).

Given the relative size of the Windows population and the ease of taking screenshots on OS X with platform support (though that's coming to Windows, too) I would focus on coming up with a Windows (and potentially Linux) shortcut first, and worry about OS X later. I don't think you should replace ctrl+s for 'save', but you could argue it out with the devtools folks about who is more important for ctrl-shift-s. I don't think adding ctrl-alt-s shortcuts is 'the done thing', so the next best thing would be an F-key shortcut (potentially with 'shift'), and those aren't very natural, nor do I know if we have any left that don't already have a binding. Have you checked what any other browsers/apps do and/or if there's some convention?
Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(kmaglione+bmo)

Updated

11 months ago
Component: Keyboard: Navigation → Keyboard Navigation
Product: Core → Firefox
(In reply to :Gijs from comment #2)
> I don't know about shortcut keys in webextensions. Kris can answer whether
> you can add one and what, if any, restrictions there are. In bootstrapped
> add-ons, it shouldn't be a problem to add the shortcut as part of the add-on.

Yes, it should be possible via the commands API:

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/commands

(In reply to :Gijs from comment #2)
> (In reply to [:jgruen] from comment #0)
> > 1. Can we implement the shortcut in our system add-on or would it need to be
> > implemented in Firefox itself outside of the add-on? Asking b/c it seems
> > some add-ons let users modify keybindings and it seems like we'd want to
> > expose ourselves to that, which might not be possible from inside the
> > add-on. (cf https://addons.mozilla.org/en-US/firefox/addon/s3menu-wizard/)
>
> I don't know how the add-on works and if how you add the shortcut would make
> a difference, but I would be somewhat surprised if it did. Either way, this
> will break in 57 anyway, so I'm not sure that you should worry about this
> just for the 56 release.

Black magic. It mostly just mangles any <command> and <key> elements that are
present in the window. It should work with WebExtension keyboard shortcuts,
though. In theory, anyway.

See also bug 1303384, which is about adding built-in support for reassigning
extension key bindings.

> > 2. Is there a specific key combination we should use? CMND+OPT+S is taken by
> > dev tools, so maybe CMND+SHIFT+S would work.
> > 3. How would we have to modify this combination for MacOS, Linux, Windows.
>
> This is the really hard part, and I don't have cycles to do the work of
> finding a key that is genuinely not taken, and the various platform versions.
>
> I will say that ctrl+shift+s is taken on Windows/Linux for the same thing
> cmd-opt-s is taken on OS X (debugger).

Given that devtools is being migrated to a not-installed-by-default system
add-on, there might be an for giving precedence to screenshots, here...
Flags: needinfo?(kmaglione+bmo)
You need to log in before you can comment on or make changes to this bug.