On Aug 6, 4:27 am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
You really should leave the function of the secondary button as it is.
I disagree on this point. I do acknowledge that it's bad design to,
say, disable the secondary button across your entire site, as that
would change the behavior of the page from the user's expected
behavior, but from within a designated and controlled area, using the
events as specified by the W3C should be completely allowed. That is
to say, the function of the secondary (and tertiary!) button may
change with respect to the page's intended use of the mouse as the
main interaction device.
For example, say I'm making a Minesweeper clone in DHTML. The right-
click button is by far the most intuitive interface for performing
'safety' actions on the grid, and right-click+left-click is the
accepted, familiar way to "clear" a surrounding group of squares on
the grid. However, in the W3C model, there is no native way of
detecting multiple mouse buttons used in a mouse event, and without
reliable preventDefault behavior, I'm likely to trigger any one of
several gestures in Opera or Firefox. (And that's after I force my
Opera-driven users to upgrade to 8.5+ and turn on "Allow script to
receive right-clicks" in a menu buried in Preferences.)
Or say I'm creating an interactive tab bar for a client's intranet
application, and they'd like to leave browser choice for their users
open for choice. Shouldn't I be able to duplicate the tab behavior of
any other tabbed browser, where middle-click closes the tab? Well,
there's no way (I've found) for preventing the default 'turn on the
scroll anchor' on mousedown. (Assuming I could get Firefox to
recognize the middle-click in the first place.)
These seem like simple implementations of a pretty clearly-defined
standard, that browser manufacturers have decided to straight-up deny
in what I assume to be the name of "protecting their users from
malicious [read: annoying] web authors". The days of preventing a
dozen popup windows from Geocities are long since over; these simple
features should be given back to Web authors. If they choose to abuse
them, there's no real harm that can be done to the page or the user's
client due to other Javascript security measures, and if they affect
the user's experience adversely enough, the users will leave and those
practices will die with the author's business.
All I'm saying is, I'd really wish browsers would respond to the event
handlers I'm setting on them, and when I say preventDefault, I mean
prevent the damn default.