Mouse wheel support in Silverlight
Silverlight currently doesn't include support for mouse wheel events, but a couple of projects I've done recently required it. Since Silverlight has pretty decent browser integration I was able to just hook into the browser's mouse wheel events and leverage that. The code is primarily based off of Adomas's work which can be found at adomas.org/javascript-mouse-wheel but had to make a couple of modifications for OS X support.
A simple example of it working:
The source code for this can be found here.
The more complex example of it is my Virtual Earth map.
The source contains code for both Silverlight 1.0 and Silverlight 1.1 integration. Originally I had the 1.1 support all nicely packaged into a single C# code file which was nice, but I ran into some limitations of the browser interop that turned out prevented me from supporting Safari fully. I've been told the interop blockers have been removed which is great, but hopefully mouse wheel support gets into the runtime before I move to the next bits :)
Silverlight currently doesn't include support for mouse wheel events, but a couple of projects I've done recently required it. Since Silverlight has pretty decent browser integration I was able to just hook into the browser's mouse wheel events and leverage that. The code is primarily based off of Adomas's work which can be found at adomas.org/javascript-mouse-wheel but had to make a couple of modifications for OS X support.
A simple example of it working:
The source code for this can be found here.
The more complex example of it is my Virtual Earth map.
The source contains code for both Silverlight 1.0 and Silverlight 1.1 integration. Originally I had the 1.1 support all nicely packaged into a single C# code file which was nice, but I ran into some limitations of the browser interop that turned out prevented me from supporting Safari fully. I've been told the interop blockers have been removed which is great, but hopefully mouse wheel support gets into the runtime before I move to the next bits :)
Labels: javascript, Silverlight