O'Reilly logo

SproutCore Web Application Development by Tyler Keating

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Responding to user events in custom views

One of the most difficult tasks in any software is responding to user events properly. On the surface it may seem trivial, but we quickly find that there are many context-specific variables that need to be considered.

First, there is the matter of efficiently listening to events within a complex and dynamic UI. In SproutCore, we do this via the root responder object, SC.RootResponder, which acts as the sole listener for all the user events. Having a single listener is much easier and faster than manually adding the many mouse, touch, keyboard, and other event listeners directly to each element. If we did try to manage the events per view, we would have to write a lot of extra code and in turn, would lose ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required