O'Reilly logo

Learning Carbon by Apple Computer Inc

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

Appendix B. Carbon Event Classesand Kinds

In order to handle events, you need to tell the Carbon Event Manager what kinds of events you want to be notified about. You do so by specifying the class and kind of each event you want to handle. Table 2.1 through Table 2.9 list the most common event classes and kinds. After you’ve identified the event class (keyboard, mouse, and so forth) and the event kind (mouse up, mouse down, and so on) appropriate to your application’s needs, you pass these to the Carbon Event Manager when installing your event handler. See Chapter 6 for more information.

Table B-1. Event Kinds in the Application Event Class (kEventClassApplication)

Event KindMeans
kEventAppActivated This application brought to foreground
kEventAppDeactivated This application sent to background
kEventAppFrontSwitched Frontmost (active) application changed
kEventAppLaunched Another application started up
kEventAppTerminated Another application terminated
kEventAppQuit This application about to be terminated

Table B-2. Event Kinds in the Command Event Class (kEventClassCommand)

Event KindMeans
kEventCommandProcess Menu item chosen or a control with a command that has been pressed
kEventCommandUpdateStatus Determine enabled or disabled status of command

Table B-3. Event Kinds in the Control Event Class (kEventClassControl)

Event KindMeans
kEventControlDefInitialize Control created
kEventControlDefDispose Control to be destroyed
kEventControlHit Mouse button pressed in control
kEventControlSimulateHit ...

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