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)

defect

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.
OS: Windows Vista → All
Hardware: x86_64 → All
"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).
Also cc:ing Irakli, who's involved in that API's implementation, for his input.
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 → ---
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
Attachment #564838 - Flags: review?(poirot.alex)
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+
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: