Ticket #11997 (closed feature: plugin)
Feature enhancement: Add hasModifiers() to jQuery.Event
| Reported by: | michael@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I'd propose a method for events which would be true if any of shiftKey, metaKey, etc are true.
This is an important use case for PJAX/HTML5-history apps following the practice of graceful degradation. You create a normal link and hijack it to open the page via Ajax using event.preventDefault(). However, this behaviour breaks user expectations when a modifier is in effect - users will expect the link to act as a normal link and open in a new tab/window or open the popup menu. So a convenience method would be useful in many modern web apps.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

This seems better as a plugin, or simply as app-specific code. It wouldn't get used at all within touch-based apps, for example.