Closed
Bug 677785
Opened 14 years ago
Closed 14 years ago
Allow some hotkeys without a modifier
Categories
(Add-on SDK Graveyard :: General, defect, P2)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: markh, Assigned: irakli)
References
Details
Attachments
(1 file)
If you try and create a hotkey without a modifier, you hit the code in hotkeys.js:
"""
const INVALID_HOTKEY = "Hotkey must have at least one modifier.";
...
if (!hotkey.modifiers.length) {
throw new TypeError(INVALID_HOTKEY);
}
"""
I'd like to use the "F1" key for F1/Firefox Share, but this prevents me.
If the intent of the restriction is to prevent things like unmodified alpha keys being used, then I'd suggest a different strategy be used to detect such keys - currently a "shift-" modifier is allowed for these keys which is only slightly less evil than the unmodified version.
I could try and help with a patch if this is accepted and I can understand the intent of the restriction.
| Reporter | ||
Updated•14 years ago
|
OS: Windows Vista → All
Hardware: x86_64 → All
Comment 1•14 years ago
|
||
"F1" seems like a perfectly reasonable hotkey for the F1 addon, and we should support registering it via the Hotkeys API, whether we do so by enabling the registration of all unmodified keys or just certain ones (f.e. non-alphanumerics).
Comment 2•14 years ago
|
||
Also cc:ing Irakli, who's involved in that API's implementation, for his input.
Updated•14 years ago
|
Assignee: nobody → rFobic
Priority: -- → P2
Target Milestone: --- → 1.2
(Pushing all open bugs to the --- milestone for the new triage system)
Target Milestone: 1.2 → ---
| Assignee | ||
Comment 4•14 years ago
|
||
I think we should restrict that to non printables, cause otherwise your hotkey will be executed even if users type in search-box or address-bar
| Assignee | ||
Comment 5•14 years ago
|
||
Pointer to Github pull-request
| Assignee | ||
Updated•14 years ago
|
Attachment #564838 -
Flags: review?(poirot.alex)
Comment 6•14 years ago
|
||
Comment on attachment 564838 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/242
Seems good to take. I think we may have to allow other keys without modifiers,
but let's get this improvement now. It will be easy to allow extra keys by renaming this isFunctionKey().
Attachment #564838 -
Flags: review?(poirot.alex) → review+
| Assignee | ||
Comment 7•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Blocks: sdk/hotkeys
You need to log in
before you can comment on or make changes to this bug.
Description
•