W3C home > Mailing lists > Public > public-webapi@w3.org > March 2006

Re: ISSUE-30: mousewheel event

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Thu, 02 Mar 2006 03:37:39 -0500
Message-ID: <4406AED3.3040008@earthlink.net>
To: Jim Ley <jim@jibbering.com>
CC: Web APIs WG <public-webapi@w3.org>

Jim Ley wrote:
> "Matthew Raymond" <mattraymond@earthlink.net>
>>   So if I have my mouse set up to switch applications when I move the
>> mouse wheel, the BROWSER should prevent me from doing so and instead
>> hand that input off to a Javascript function?!? Get real!
> 
> No, obviously not.
> 
> There are 2 issues here, they are completely unrelated, one is how to 
> identify mouse buttons or mousewheels in a web-api.
> 
> The other is about how you configure the permission to access these buttons 
> and wheels.

   I disagree. The only issue here is creating an event to handle
"scroll what's under the pointer" type functionality. DOM events should
generally avoid events that are input device dependent. It will only
result in web app programmers writing scripts that assume you're using
specific input hardware like a mouse with a wheel.

>>   I did a quick test with two <textarea> elements. Scrolling the
>> unfocused <textarea> using the mouse wheel in both IE and Mozilla did
>> not cause the element to take focus from the focused <textarea>.
> 
> Try it with a SELECT element ie give focus to a select area, then use the 
> scrollwheel when mousefocus is somewhere else, I'm pretty sure the focused 
> element will scroll.

   I tested this in IE, Opera and Firefox. IE behaves as I described
previously, unless the control is a <select> element. In that situation,
it only scrolls the focused <select>, regardless of whether it's a
drop-down list or a list box. Opera scrolls only the focused control in
all situations.

   Personally, I don't find the Opera behavior useful. You might as well
bind the mouse wheel to the "scroll" event. The only real useful feature
of a "mousewheel" event for Opera is that you can handle something
similar to a "scroll" event without a scroll bar. However, I don't think
Opera even supports the "mousewheel" event, so there's probably been
minimal effort to determine how the browser should handle mouse wheel
events.

   For Firefox, if you have a <select> that's rendered as a drop-down
list, scrolling a non-focused element removes the list, but leaves the
actual control still focused. For drop-down lists, I think the IE
behavior of having the mouse wheel scroll only the list is probably
best. For a list box, however, it would be better to stick with the
Firefox behavior.
Received on Thursday, 2 March 2006 08:37:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:53 GMT