Cocoa Event-Handling Guide
PDF
Introduction
Event Architecture
How an Event Enters a Cocoa Application
Event Dispatch
The Path of Mouse and Tablet Events
The Path of Key Events
Other Event Dispatching
Action Messages
Responders
First Responders
Next Responders
The Responder Chain
Responder Chain for Event Messages
Responder Chain for Action Messages
Other Uses
Event Objects and Types
NSEvent Objects
Attributes of an Event Object
NSEvent Class Methods
Event Objects in Methods of Other Classes
Event Types
Mouse Events
Events Related to Mouse Clicks and Movements
Mouse Tracking Events
Key Events
Tablet Events
Overview of Tablet Devices
Types of Tablet Events
Proximity Events
Pointer Events
Sequence of Tablet Events
Other Types of Events
Event Handling Basics
Preparing a Custom View for Receiving Events
Implementing Action Methods
Getting the Location of an Event
Testing for Event Type and Modifier Flags
Responder-Related Tasks
Determining First-Responder Status
Setting the First Responder
Handling Mouse Events
Overview of Mouse Events
Handling Mouse Clicks
Handling Mouse Dragging Operations
The Three-Method Approach
The Mouse-Tracking Loop Approach
Filtering Out Key Events During Mouse-Tracking Operations
Handling Key Events
Overview of Key Events
Overriding the keyDown: Method
Handling Keyboard Actions and Inserting Text
Specially Interpreting Keystrokes
Handling Key Equivalents
Keyboard Interface Control
Using Tracking-Area Objects
Creating an NSTrackingArea Object
Managing a Tracking-Area Object
Responding to Mouse-Tracking Events
Managing Cursor-Update Events
Compatibility Issues
Handling Tablet Events
Packaging of Tablet Events
Tablet Events and the Responder Chain
Text System Defaults and Key Bindings
Key Bindings
Key Bindings in Xcode
Standard Action Methods for Selecting and Editing
Selection Direction
Selection and insertion point
Marks
The kill buffer
Text System Defaults
NSMnemonicsWorkInText
NSRepeatCountBinding
NSQuotedKeystrokeBinding
NSTextShowsInvisibleCharacters)
NSTextShowsControlCharacters
NSTextSelectionColor
NSMarkedTextAttribute and NSMarkedTextColor)
NSTextKillRingSize
Appendix A: Mouse-Tracking and Cursor-Update Events
Handling Mouse-Tracking Events
Managing Cursor-Update Events
Revision History
Related Reference
Objective-C
NSApplication
NSEvent
NSResponder
NSView
NSWindow
Related Sample Code
Cropped Image
Color Sampler
Cocoa OpenGL
DragItemAround
BoingX
People
Sketch-112
FunkyOverlayWindow
CIAnnotation
Related Documents
Cocoa Fundamentals Guide
View Programming Guide for Cocoa
Text Editing Programming Guide for Cocoa