Open Bug 1173291 Opened 10 years ago Updated 2 years ago

Add a shared utility to handle keyboard shortcut labels

Categories

(DevTools :: Framework, defect)

defect

Tracking

(Not tracked)

People

(Reporter: pbro, Unassigned)

References

Details

Attachments

(1 file)

Bug 1077339 just added a tone of labels for keyboard shortcuts within toolbox tooltips. See https://hg.mozilla.org/integration/fx-team/diff/fa429d0aec1a/browser/devtools/definitions.js They are very useful for users to learn how to access various tools from the keyboard. I'm also about to add one more in bug 1172500. See https://reviewboard.mozilla.org/r/10607/ It feels like this could be handled better in a shared module.
Attached image tab-tooltip.png
I notice that the tab tooltips is displaying shortcuts on osx as Cmd+AltK. The shared one should (I think) show it as Cmd+Opt+K which is how we show things in our documentation: https://developer.mozilla.org/en-US/docs/Tools/Keyboard_shortcuts
Blocks: 1077339
There is a little helper function that we use in a couple tests that we might be able to modify to generate this from a <key> element: function synthesizeKeyElement(el) { let key = el.getAttribute("key") || el.getAttribute("keycode"); let mod = {}; el.getAttribute("modifiers").split(" ").forEach((m) => mod[m+"Key"] = true); info(`Synthesizing: key=${key}, mod=${JSON.stringify(mod)}`); EventUtils.synthesizeKey(key, mod, el.ownerDocument.defaultView); }
(In reply to Brian Grinstead [:bgrins] from comment #1) > Created attachment 8617965 [details] > tab-tooltip.png > > I notice that the tab tooltips is displaying shortcuts on osx as Cmd+AltK. > The shared one should (I think) show it as Cmd+Opt+K which is how we show > things in our documentation: > https://developer.mozilla.org/en-US/docs/Tools/Keyboard_shortcuts Went ahead and filed a separate bug for this issue to make sure it gets fixed separately - Bug 1173373
No longer blocks: 1077339
Depends on: 1077339
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: