NSEvent Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSEvent.h NSTouch.h |
Overview
An NSEvent object, or simply an event, contains information about an input action such as a mouse click or a key down. The Application Kit associates each such user action with a window, reporting the event to the application that created the window. The NSEvent object contains pertinent information about each event, such as where the cursor was located or which character was typed. As the application receives events, it temporarily places them in a buffer called the event queue. When the application is ready to process an event, it takes one from the queue.
Beginning with OS X version 10.4, NSEvent objects can represent tablet-pointing and tablet-proximity events. A tablet-proximity event is generated when a pointing device enters or leaves proximity of its tablet; such event objects have a type of NSTypeProximity or a mouse subtype of NSTabletProximityEventSubtype. A tablet-pointing event is generated when a pointing device changes state, such as location, pressure, or tilt; such event objects have a type of NSTypePoint or a mouse subtype of NSTabletPointEventSubtype. The Application Kit reports all pure tablet events to responder objects through the NSResponder methods tabletPoint: and tabletProximity:. Mouse events can also contain tablet data (as event subtypes), so you can handle these events by overriding the NSResponder methods mouseDown:, mouseDragged:, and mouseUp:.
Support for touch and gesture events masks have been added to NSEvent in OS X v10.6. Magnify (pinch), swipe, and rotate masks are supported, as are more generic gesture masks. Using touchesMatchingPhase:inView: method a view can get all of the touch events associated with a gesture without overriding the individual touch responder methods defined in NSResponder.
OS X v10.6 adds the ability to create application event monitors that call block object handlers for certain event types that are sent through the NSApplication sendEvent: method. You can create a local monitor that will be informed of the events in your application and allow you to modify or cancel them. You can also create a global event monitor that allows you to monitor events in other applications, although you are unable to alter those events. See “Monitoring Application Events” for more information.
Tasks
Creating Events
-
+ keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode: -
+ mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure: -
+ enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData: -
+ otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2: -
+ eventWithEventRef: -
+ eventWithCGEvent:
Getting General Event Information
-
– context -
– locationInWindow -
– modifierFlags -
– timestamp -
– type -
– window -
– windowNumber -
– eventRef -
– CGEvent
Getting Key Event Information
-
+ modifierFlags -
+ keyRepeatDelay -
+ keyRepeatInterval -
– characters -
– charactersIgnoringModifiers -
– isARepeat -
– keyCode
Getting Mouse Event Information
-
+ pressedMouseButtons -
+ doubleClickInterval -
+ mouseLocation -
– buttonNumber -
– clickCount -
– pressure -
+ setMouseCoalescingEnabled: -
+ isMouseCoalescingEnabled
Getting Mouse-Tracking Event Information
Getting Custom Event Information
Getting Scroll Wheel Event Information
Getting Tablet Proximity Information
-
– capabilityMask -
– deviceID -
– isEnteringProximity -
– pointingDeviceID -
– pointingDeviceSerialNumber -
– pointingDeviceType -
– systemTabletID -
– tabletID -
– uniqueID -
– vendorID -
– vendorPointingDeviceType
Getting Tablet Pointing Information
-
– absoluteX -
– absoluteY -
– absoluteZ -
– buttonMask -
– rotation -
– tangentialPressure -
– tilt -
– vendorDefined
Requesting and Stopping Periodic Events
Getting Touch and Gesture Information
Monitoring Application Events
-
+ addGlobalMonitorForEventsMatchingMask:handler: -
+ addLocalMonitorForEventsMatchingMask:handler: -
+ removeMonitor:
Scroll Wheel and Flick Events
Class Methods
addGlobalMonitorForEventsMatchingMask:handler:
Installs an event monitor that receives copies of events posted to other applications.
Parameters
- mask
An event mask specifying which events you wish to monitor. See “NSEventMaskFromType” for possible values.
- block
The event handler block object. It is passed the event to monitor. You are unable to change the event, merely observe it.
Return Value
An event handler object.
Discussion
Events are delivered asynchronously to your app and you can only observe the event; you cannot modify or otherwise prevent the event from being delivered to its original target application.
Key-related events may only be monitored if accessibility is enabled or if your application is trusted for accessibility access (see AXIsProcessTrusted).
Note that your handler will not be called for events that are sent to your own application.
Special Considerations
In OS X v 10.6, event monitors are only able to monitor the following event types:
Availability
- Available in OS X v10.6 and later.
Declared In
NSEvent.haddLocalMonitorForEventsMatchingMask:handler:
Installs an event monitor that receives copies of events posted to this application before they are dispatched.
Parameters
- mask
An event mask specifying which events you wish to monitor. See “NSEventMaskFromType” for possible values.
- block
The event handler block object. It is passed the event to monitor. You can return the event unmodified, create and return a new NSEvent object, or return nil to stop the dispatching of the event.
Return Value
An event handler object.
Discussion
Your handler will not be called for events that are consumed by nested event-tracking loops such as control tracking, menu tracking, or window dragging; only events that are dispatched through the applications sendEvent: method will be passed to your handler.
Special Considerations
In OS X v 10.6, event monitors are only able to monitor the following event types:
Availability
- Available in OS X v10.6 and later.
Declared In
NSEvent.hdoubleClickInterval
Returns the time, in seconds, in which a second mouse click must occur in order to be considered a double click.
Return Value
The double-click time interval, in seconds.
Discussion
This is a system setting, overriding this method will have no effect.
Availability
- Available in OS X v10.6 and later.
Declared In
NSEvent.henterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:
Returns a new NSEvent object describing a tracking-rectangle or cursor-update event.
Parameters
- type
One of the following event-type constants:
NSMouseEntered,NSMouseExited,NSCursorUpdate. If the specified constant is not one of these, anNSInternalInconsistencyExceptionis raised- location
The cursor location in the base coordinate system of the window specified by windowNum.
- flags
An integer bit field containing any of the modifier key masks described in “Constants,” combined using the C bitwise OR operator.
- time
The time the event occurred in seconds since system startup.
- windowNum
An integer that identifies the window device associated with the event, which is associated with the
NSWindowthat will receive the event.- context
The display graphics context of the event.
- eventNumber
An identifier for the new event. It’s normally taken from a counter for mouse events, which continually increases as the application runs.
- trackingNumber
A number that identifies the tracking rectangle. This identifier is the same as that returned by the
NSViewmethodaddTrackingRect:owner:userData:assumeInside:.- userData
Data arbitrarily associated with the tracking rectangle when it was set up using the
NSViewmethodaddTrackingRect:owner:userData:assumeInside:.
Return Value
The created NSEvent object or nil if the object could not be created.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.heventWithCGEvent:
Creates and returns an event object that is based on a Core Graphics type of event.
Parameters
- cgEvent
A
CGEventRefopaque type that represents an event.
Return Value
An autoreleased NSEvent object that is equivalent to cgEvent.
Discussion
The returned object retains the CGEventRef object (cgEvent) until it (the Objective-C object) is freed—it then releases the CGEventRef object. If no Cocoa event corresponds to the CGEventRef object, this method returns nil.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSEvent.heventWithEventRef:
Creates an event object that is based on a Carbon type of event.
Parameters
- eventRef
The
EventRefopaque type to be associated with the createdNSEventobject.
Return Value
An autoreleased NSEvent object corresponding to eventRef or nil if eventRef cannot be converted into an equivalent NSEvent object.
Discussion
This method is valid for all events. The created NSEvent object retains the EventRef object and is released when the NSEvent object is freed.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSEvent.hisMouseCoalescingEnabled
Indicates whether mouse-movement event coalescing is enabled.
Return Value
YES if mouse-movement event coalescing is enabled, NO if it is disabled.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSEvent.hisSwipeTrackingFromScrollEventsEnabled
Returns the user's preference about using gesture scrolls as a way to track fluid swipes.
Return Value
YES if swipe tracking for scroll events is enable; otherwise NO.
Discussion
This value is determined by the mouse and trackpad preferences for the current user.
Generally, an NSScrollView instance will check this for you. However, if your app is not using an NSScrollView object, or an NSResponder instance can receive NSScrollWheel messages without first being sent to a scroll view , then you should check this preference before invoking trackSwipeEventWithOptions:dampenAmountThresholdMin:max:usingHandler:.
Availability
- Available in OS X v10.7 and later.
Declared In
NSEvent.hkeyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:
Returns a new NSEvent object describing a key event.
Parameters
- type
One of the following event-type constants:
NSKeyDown,NSKeyUp,NSFlagsChanged. If anything else is specified, anNSInternalInconsistencyExceptionis raised.- location
The cursor location in the base coordinate system of the window specified by windowNum.
- flags
An integer bit field containing any of the modifier key masks described in “Constants,” combined using the C bitwise OR operator.
- time
The time the event occurred in seconds since system startup.
- windowNum
An integer that identifies the window device associated with the event, which is associated with the
NSWindowthat will receive the event.- context
The display graphics context of the event.
- characters
A string of characters associated with the key event. Though most key events contain only one character, it is possible for a single keypress to generate a series of characters.
- unmodCharacters
The string of characters generated by the key event as if no modifier key had been pressed (except for Shift). This argument is useful for getting the “basic” key value in a hardware-independent manner.
- repeatKey
YESif the key event is a repeat caused by the user holding the key down,NOif the key event is new.- code
A number that identifies the keyboard key associated with the key event. Its value is hardware-independent.
Return Value
The created NSEvent instance or nil if the instance could not be created.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hkeyRepeatDelay
Returns the length of time a key must be held down in order to generate the first key repeat event.
Return Value
The delay interval, in seconds.
Discussion
This is a system setting, overriding this method will have no effect.
Availability
- Available in OS X v10.6 and later.
Declared In
NSEvent.hkeyRepeatInterval
Returns the length between subsequent key repeat events being posted.
Return Value
The repeat interval, in seconds.
Discussion
This is a system setting, overriding this method will have no effect.
Availability
- Available in OS X v10.6 and later.
Declared In
NSEvent.hmodifierFlags
Returns the currently pressed modifier flags.
Return Value
A mask of the current modifiers using the values in “Modifier Flags.”
Discussion
This returns the state of devices combined with synthesized events at the moment, independent of which events have been delivered via the event stream.
Availability
- Available in OS X v10.6 and later.
Declared In
NSEvent.hmouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:
Returns a new NSEvent object describing a mouse-down, -up, -moved, or -dragged event.
Parameters
- type
One of the modifier key masks described in “NSEventType,” or an
NSInternalInconsistencyExceptionis raised.- location
The cursor location in the base coordinate system of the window specified by windowNum.
- flags
An integer bit field containing any of the modifier key masks described in “Constants,” combined using the C bitwise OR operator.
- time
The time the event occurred in seconds since system startup.
- windowNum
An integer that identifies the window device associated with the event, which is associated with the
NSWindowthat will receive the event.- context
The display graphics context of the event.
- eventNumber
An identifier for the new event. It’s normally taken from a counter for mouse events, which continually increases as the application runs.
- clickNumber
The number of mouse clicks associated with the mouse event.
- pressure
A value from 0.0 to 1.0 indicating the pressure applied to the input device on a mouse event, used for an appropriate device such as a graphics tablet. For devices that aren’t pressure-sensitive, the value should be either 0.0 or 1.0.
Return Value
The created NSEvent instance or nil if the instance could not be created.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.hmouseLocation
Reports the current mouse position in screen coordinates.
Return Value
The current mouse location in screen coordinates.
Discussion
This method is similar to the NSWindow method mouseLocationOutsideOfEventStream. It returns the location regardless of the current event or pending events. The difference between these methods is that mouseLocationOutsideOfEventStream returns a point in the receiving window’s coordinates and mouseLocation returns the same information in screen coordinates.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hotherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:
Returns a new NSEvent object describing a custom event.
Parameters
- type
One of the following event-type constants:
If type is anything else, an
NSInternalInconsistencyExceptionis raised. Your code should only create events of typeNSApplicationDefined.- location
The cursor location in the base coordinate system of the window specified by windowNum.
- flags
An integer bit field containing any of the modifier key masks described in “Constants,” combined using the C bitwise OR operator.
- time
The time the event occurred in seconds since system startup.
- windowNum
An integer that identifies the window device associated with the event, which is associated with the
NSWindowthat will receive the event.- context
The display graphics context of the event.
- subtype
A numeric identifier that further differentiates custom events of types
NSAppKitDefined,NSSystemDefined, andNSApplicationDefined.NSPeriodicevents don’t use this attribute.- data1
Additional data associated with the event.
NSPeriodicevents don’t use these attributes.- data2
Additional data associated with the event.
NSPeriodicevents don’t use these attributes.
Return Value
The created NSEvent object or nil if the object couldn't be created.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hpressedMouseButtons
Returns the indices of the currently depressed mouse buttons.
Return Value
The indices of the currently depressed mouse buttons.
Discussion
A return value of 1 << 0 corresponds to the left mouse button, 1 << 1 corresponds to the right mouse button, 1<< n, n >=2 correspond to other mouse buttons.
This returns the state of devices combined with synthesized events at the moment, independent of which events have been delivered via the event stream, so this method is not suitable for tracking.
Availability
- Available in OS X v10.6 and later.
Declared In
NSEvent.hremoveMonitor:
Remove the specified event monitor.
Parameters
- eventMonitor
The event handler object to remove.
Discussion
You must ensure that eventMonitor is removed only once. Removing the same eventMonitor instance multiple times results in an over-release condition, even in a Garbage Collected environment
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSEvent.hsetMouseCoalescingEnabled:
Controls whether mouse-movement event coalescing is enabled.
Parameters
- flag
YESto enable mouse-movement event coalescing,NOto disable it.
Discussion
This method affects mouse-moved, mouse-dragged, and tablet events. Mouse-movement event coalescing is enabled by default.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSEvent.hstartPeriodicEventsAfterDelay:withPeriod:
Begins generating periodic events for the current thread.
Parameters
- delaySeconds
The number of seconds that
NSEventshould wait before beginning to generate periodic events.- periodSeconds
The period in seconds between the generated events.
Discussion
Raises an NSInternalInconsistencyException if periodic events are already being generated for the current thread. This method is typically used in a modal loop while tracking mouse-dragged events.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.hstopPeriodicEvents
Stops generating periodic events for the current thread and discards any periodic events remaining in the queue.
Discussion
This message is ignored if periodic events aren’t currently being generated.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hInstance Methods
absoluteX
Reports the absolute x coordinate of a pointing device on its tablet at full tablet resolution.
Discussion
For the coordinate to be valid, the receiver should represent an event generated by a tablet pointing device (otherwise 0 is returned). This method is valid only for mouse events with a subtype of NSTabletPointEventSubtype and for events of type NSTabletPoint. Use this value if you want to scale from tablet location to screen location yourself; otherwise use the class method mouseLocation or the instance method locationInWindow.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.habsoluteY
Reports the absolute y coordinate of a pointing device on its tablet at full tablet resolution.
Discussion
For the coordinate to be valid, the receiver should represent an event generated by a tablet pointing device (otherwise 0 is returned). This method is valid only for mouse events with a subtype of NSTabletPointEventSubtype and for events of type NSTabletPoint. Use this value if you want to scale from tablet location to screen location yourself; otherwise use the class method mouseLocation or the instance method locationInWindow.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.habsoluteZ
Reports the absolute z coordinate of pointing device on its tablet at full tablet resolution.
Discussion
For the coordinate to be valid, the receiver should represent an event generated by a tablet pointing device (otherwise 0 is returned). The z coordinate does not represent pressure. It registers the depth coordinate returned by some tablet devices with wheels; if the device is something other than these, 0 is returned. This method is valid only for mouse events with a subtype of NSTabletPointEventSubtype and for events of type NSTabletPoint.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.hbuttonMask
Returns a bit mask identifying the buttons pressed when the tablet event represented by the receiver was generated.
Discussion
Use one or more of the button-mask constants described in “Constants” to determine which buttons of the pointing device are pressed. This method is valid only for mouse events with a subtype of NSTabletPointEventSubtype and for events of type NSTabletPoint.
Availability
- Available in OS X v10.4 and later.
Declared In
NSEvent.hbuttonNumber
Returns the button number for the mouse button that generated an NSOtherMouse... event.
Discussion
This method is intended for use with the NSOtherMouseDown, NSOtherMouseUp, and NSOtherMouseDragged events, but will return values for NSLeftMouse... and NSRightMouse... events also.
Availability
- Available in OS X v10.1 and later.
Declared In
NSEvent.hcapabilityMask
Returns a mask whose set bits indicate the capabilities of the tablet device that generated the event represented by the receiver.
Discussion
These bits are vendor-defined. This method is valid only for mouse events with a subtype of NSTabletProximityEventSubtype and for events of type NSTabletProximity.
Availability
- Available in OS X v10.4 and later.
Declared In
NSEvent.hCGEvent
Returns a Core Graphics event object corresponding to the receiver.
Discussion
The returned CGEventRef opaque type is autoreleased. If no CGEventRef object corresponding to the NSEvent object can be created, this method returns NULL.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSEvent.hcharacters
Returns the characters associated with the receiving key-up or key-down event.
Discussion
These characters are derived from a keyboard mapping that associates various key combinations with Unicode characters. Raises an NSInternalInconsistencyException if sent to any other kind of event object.
This method returns an empty string for dead keys, such as Option-e. However, for a key combination such as Option-Shift-e this method returns the standard accent ("´").
For a list of constants corresponding to commonly-used Unicode characters, see NSText Class Reference.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.hcharactersIgnoringModifiers
Returns the characters generated by the receiving key event as if no modifier key (except for Shift) applies.
Discussion
Raises an NSInternalInconsistencyException if sent to a non-key event.
This method returns the non-modifier key character pressed for dead keys, such as Option-e. For example, Option-e (no shift key) returns an “e" for this method, whereas the characters method returns an empty string.
This method is useful for determining “basic” key values in a hardware-independent manner, enabling such features as keyboard equivalents defined in terms of modifier keys plus character keys. For example, to determine if the user typed Alt-S, you don’t have to know whether Alt-S generates a German double ess, an integral sign, or a section symbol. You simply examine the string returned by this method along with the event’s modifier flags, checking for “s” and NSAlternateKeyMask.
For a list of constants corresponding to commonly-used Unicode characters, see NSText Class Reference.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.hclickCount
Returns the number of mouse clicks associated with the receiver, which represents a mouse-down or mouse-up event.
Discussion
Raises an NSInternalInconsistencyException if sent to a non-mouse event.
Returns 0 for a mouse-up event if a time threshold has passed since the corresponding mouse-down event. This is because if this time threshold passes before the mouse button is released, it is no longer considered a mouse click, but a mouse-down event followed by a mouse-up event.
The return value of this method is meaningless for events other than mouse-down or mouse-up events.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hcontext
Returns the display graphics context of the receiver.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hdata1
Returns additional data associated with the receiver.
Discussion
The value returned by this method is dependent on the event type, and is defined by the originator of the event. Raises an NSInternalInconsistencyException if sent to an event not of type NSAppKitDefined, NSSystemDefined, NSApplicationDefined, or NSPeriodic.
NSPeriodic events don’t use this attribute.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.hdata2
Returns additional data associated with the receiver.
Discussion
The value returned by this method is dependent on the event type, and is defined by the originator of the event. Raises an NSInternalInconsistencyException if sent to an event not of type NSAppKitDefined, NSSystemDefined, NSApplicationDefined, or NSPeriodic.
NSPeriodic events don’t use this attribute.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.hdeltaX
Returns the x-coordinate change for a scroll wheel, mouse-move, or mouse-drag event.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hdeltaY
Returns the y-coordinate change for a scroll wheel, mouse-move, or mouse-drag event.
Discussion
The behavior of this method may seem counter-intuitive: as the mouse moves up the screen, the value is negative; and as it moves down the screen, the value is positive. The reason for this behavior is that NSEvent computes this delta value in device space, which is flipped, but both the screen and the window’s base coordinate system are not flipped.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hdeltaZ
Returns the z-coordinate change for a scroll wheel, mouse-move, or mouse-drag event.
Discussion
This value is typically 0.0.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hdeviceID
Returns a special identifier that is used to match tablet-pointer events with the tablet-proximity event represented by the receiver.
Discussion
All tablet-pointer events generated in the period between the device entering and leaving tablet proximity have the same device ID. This message is valid only for mouse events with subtype NSTabletPointEventSubtype or NSTabletProximityEventSubtype, and for NSTabletPoint and NSTabletProximity events.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.heventNumber
Returns the counter value of the latest mouse or tracking-rectangle event object; every system-generated mouse and tracking-rectangle event increments this counter.
Discussion
Raises an NSInternalInconsistencyException if sent to any other type of event object.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.heventRef
Returns the Carbon type associated with the receiver for representing an event.
Return Value
Returns an EventRef opaque type corresponding to the receiver. User-input events typically are created with an associated EventRef. An NSEvent object created through other means creates an EventRef in this method if that is necessary and possible. If there is no equivalent NSEvent for the receiver, this method returns NULL.
Discussion
This method is valid for all types of events. The EventRef object is retained by the receiver, so it is valid as long as the NSEvent object is valid, and is released when the NSEvent object is freed. You can use RetainEvent to extend the lifetime of the EventRef object, with a corresponding ReleaseEvent when you are done with it.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSEvent.hhasPreciseScrollingDeltas
Returns whether there are precise scrolling deltas available.
Return Value
YES if precise scrolling deltas are available; NO otherwise.
Discussion
This method is valid for NSScrollWheel events. A generic scroll wheel issues rather coarse scroll deltas. Some mice and trackpads provide much more precise delta. This method determines how the values of the scrollingDeltaX and scrollingDeltaY should be interpreted.
Availability
- Available in OS X v10.7 and later.
Declared In
NSEvent.hisARepeat
Returns YES if the receiving key event is a repeat caused by the user holding the key down, NO if the key event is new.
Discussion
Raises an NSInternalInconsistencyException if sent to an NSFlagsChanged event or other non-key event.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hisDirectionInvertedFromDevice
Returns whether the user has changed the device inversion.
Return Value
Returns YES if the direction is inverted; NO otherwise.
Discussion
This method valid for NSEventScrollWheel and NSEventTypeSwipe events. The user may choose to change the scrolling behavior such that it feels like they are moving the content instead of the scroll bar.
To accomplish this, deltaX and deltaY and scrollingDeltaX and scrollingDeltaY values are automatically inverted for NSEventScrollWheel events according to the user's preferences.
The direction of fluid swipes matches the direction of scrolling and as such for NSEventTypeSwipe events gestureAmount is inverted. However, for some uses of NSEventScrollWheel and NSEventTypeSwipe events, the behavior should not respect the user preference. This method allows you to determine when the event has been inverted and compensate by multiplying -1 if needed.
Availability
- Available in OS X v10.7 and later.
Declared In
NSEvent.hisEnteringProximity
Returns YES to indicate that a pointing device is entering the proximity of its tablet and NO when it is leaving it.
Discussion
This method is valid for mouse events with subtype NSTabletProximityEventSubtype and for NSTabletProximity events.
Availability
- Available in OS X v10.4 and later.
Declared In
NSEvent.hkeyCode
Returns the virtual key code for the keyboard key associated with the receiving key event.
Return Value
The virtual key code. The returned value is hardware-independent. The value returned is the same as the value returned in the kEventParamKeyCode when using Carbon Events.
Discussion
Raises an NSInternalInconsistencyException if sent to a non-key event.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hlocationInWindow
Returns the receiver’s location in the base coordinate system of the associated window.
Discussion
For non-mouse events the return value of this method is undefined.
With NSMouseMoved and possibly other events, the receiver can have a nil window (that is, window returns nil). In this case, locationInWindow returns the event location in screen coordinates.
In a method of a custom view that handles mouse events, you commonly use the locationInWindow method in conjunction with the NSView method convertPoint:fromView:to get the mouse location in the view’s coordinate system. For example:
NSPoint event_location = [theEvent locationInWindow]; |
NSPoint local_point = [self convertPoint:event_location fromView:nil]; |
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.hmagnification
Returns the change in magnification.
Return Value
The change in magnification that should be added to the current scaling of an item to achieve the new scale factor.
Discussion
This message is valid for events of type NSEventTypeMagnify.
Availability
- Available in OS X v10.6 and later.
Declared In
NSEvent.hmodifierFlags
Returns an integer bit field indicating the modifier keys in effect for the receiver.
Discussion
You can examine individual flag settings using the C bitwise AND operator with the predefined key masks described in “Constants.” The lower 16 bits of the modifier flags are reserved for device-dependent bits.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hmomentumPhase
The momentum phase of a scroll or flick gesture.
Return Value
The current event phase. See “NSEventPhase” for possible values.
Discussion
This message is valid for NSScrollWheel events. With the Magic Mouse and some trackpads, the user can use a scroll wheel or flick gesture resulting in a stream of scroll events that dissipate over time.
The location of these scroll wheel events changes as the user moves the cursor. These events are attached to the view that is under the cursor when the flick occurs. A custom view can use this method to recognize these momentum scroll events and further route the event to the appropriate sub component.
Availability
- Available in OS X v10.7 and later.
Declared In
NSEvent.hphase
Returns the phase of a gesture event such as swipe or scroll.
Return Value
The current gesture even phase. See “NSEventPhase” for possible values.
Discussion
A gesture phrase are all the events that begin with a NSEventPhaseBegan and end with either a NSEventPhaseEnded or NSEventPhaseCancelled. All the gesture events are sent to the view under the cursor when the NSEventPhaseBegan occurred.
A swipe event with a phase of NSEventPhaseEnded indicates a successful swipe. A swipe event with a phase of NSEventPhaseCancelled indicates an unsuccessful swipe and any partial swipe animation should be undone.
A gesture scroll event starts with a NSEventPhaseBegan phase and ends with a NSPhaseEnded.
Legacy scroll wheel events (say from a Mighty Mouse) and momentum scroll wheel events have a phase of NSEventPhaseNone.
Availability
- Available in OS X v10.7 and later.
Declared In
NSEvent.hpointingDeviceID
Returns the index of the pointing device currently in proximity with the tablet.
Discussion
This index is significant for multimode (or Dual Tracking) tablets that support multiple concurrent pointing devices; the index is incremented for each pointing device that comes into proximity. Otherwise, zero is always returned. The receiver of this message should be a mouse event object with subtype NSTabletProximityEventSubtype or an event of type NSTabletProximity.
Availability
- Available in OS X v10.4 and later.
Declared In
NSEvent.hpointingDeviceSerialNumber
Returns the vendor-assigned serial number of a pointing device of a certain type.
Discussion
Devices of different types, such as a puck and a pen, may have the same serial number. The receiver of this message should be a mouse event object with subtype NSTabletProximityEventSubtype or an event of type NSTabletProximity.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.hpointingDeviceType
Returns a NSPointingDeviceType constant indicating the kind of pointing device associated with the receiver.
Discussion
For example, the device could be a pen, eraser, or cursor pointing device. This method is valid for mouse events with subtype NSTabletProximityEventSubtype and for NSTabletProximity events. See “Constants” for descriptions of valid NSPointingDeviceType constants.
Availability
- Available in OS X v10.4 and later.
Declared In
NSEvent.hpressure
Returns a value from 0.0 through 1.0 indicating the pressure applied to the input device (used for appropriate devices).
Discussion
For devices that aren’t pressure-sensitive, the value is either 0.0 or 1.0. Raises an NSInternalInconsistencyException if sent to a non-mouse event.
For tablet pointing devices that are in proximity, the pressure value is 0.0 if they are not actually touching the tablet. As the device is pressed into the tablet, the value is increased.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.hrotation
Returns the rotation in degrees of the tablet pointing device associated with the receiver.
Discussion
Many devices do not support rotation, in which case the returned value is 0.0. This method is valid only for mouse events with subtype NSTabletPointEventSubtype and for NSTabletPoint events.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.hscrollingDeltaX
Returns the scroll wheel horizontal delta.
Return Value
The horizontal scroll wheel delta in points.
Discussion
This is the preferred method for accessing NSScrollWheel delta values. When hasPreciseScrollingDeltas returns NO, your application may which to modify this value.
Availability
- Available in OS X v10.7 and later.
Declared In
NSEvent.hscrollingDeltaY
Returns the scroll wheel vertical delta.
Return Value
The vertical scroll wheel delta in points.
Discussion
This is the preferred method for accessing NSScrollWheel delta values. When hasPreciseScrollingDeltas returns NO, multiply the value returned by this method by the line or row height. Otherwise scroll by the returned amount.
Availability
- Available in OS X v10.7 and later.
Declared In
NSEvent.hsubtype
Returns the subtype of the receiving event object.
Discussion
Raises an NSInternalInconsistencyException if sent to an event not of type NSAppKitDefined, NSSystemDefined, NSApplicationDefined, or NSPeriodic.
NSPeriodic events don’t use this attribute.
This method is also valid for mouse events on OS X v10.4 and later. See “Constants” for the predefined mouse and tablet subtypes.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.hsystemTabletID
Returns the index of the tablet device connected to the system.
Discussion
If multiple tablets are connected to the system, the system-tablet ID is incremented for each subsequent one. If there is only one tablet device, its system-tablet ID is zero. The receiver of this message should be a mouse event object with subtype NSTabletProximityEventSubtype or an event of type NSTabletProximity.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.htabletID
Returns the USB model identifier of the tablet device associated with the receiver.
Discussion
This method is valid for mouse events with subtype NSTabletProximityEventSubtype and for NSTabletProximity events.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.htangentialPressure
Reports the tangential pressure on the device that generated the event represented by the receiver.
Discussion
The value returned can range from -1.0 to 1.0. Tangential pressure is also known as barrel pressure. Only some pointing devices support tangential pressure. This method is valid for mouse events with subtype NSTabletPointEventSubtype and for NSTabletPoint events.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.htilt
Reports the scaled tilt values of the pointing device that generated the event represented by the receiver.
Discussion
The value returned can range from -1.0 to 1.0 for both axes. An x-coordinate value that is negative indicates a tilt to the left and a positive value indicates a tilt to the right; a y-coordinate value that is negative indicates a tilt to the top and a positive value indicates a tilt to the bottom. If the device is perfectly perpendicular to the table surface, the values are 0.0 for both axes. This method is valid for mouse events with subtype NSTabletPointEventSubtype and for NSTabletPoint events.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.htimestamp
Returns the time the receiver occurred in seconds since system startup.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.htouchesMatchingPhase:inView:
Returns all the NSTouch objects associated with a specific phase.
Parameters
- phase
The touch phase for which you want touches. See “NSTouchPhase” for the possible values.
- view
The view for which touches are wanted. Touches that target this view, or any of the view’s descendants will be returned. Passing
nilas the view gets all touches regardless of their targeted view.
Return Value
A set of applicable NSTouch objects.
Discussion
This method is only valid for gesture events (gesture, magnify, swipe, rotate, etc.). Using this method a view can get all of the touches associated with a gesture without overriding the individual touch responder methods.
Availability
- Available in OS X v10.6 and later.
Declared In
NSEvent.htrackingArea
Returns the NSTrackingArea object that generated the event represented by the receiver.
Return Value
Returns the NSTrackingArea object that generated the event represented by the receiver. If the receiver is not a mouse-tracking event (that is, an event of type NSMouseEntered, NSMouseExited, or NSCursorUpdate), this method raises an NSInternalInconsistencyException. This method returns nil if the event was generated by a tracking rectangle (pre-OS X version 10.5) instead of a NSTrackingArea object.
Discussion
If no NSTrackingArea object is associated with the event because the event corresponds to a tracking rectangle installed with the NSView method addTrackingRect:owner:userData:assumeInside:, this method returns nil. Note that the trackingNumber method returns either an NSTrackingArea object or the NSTrackingRectTag constant depending on how the event was generated.
Availability
- Available in OS X v10.5 and later.
Declared In
NSEvent.htrackingNumber
Returns the identifier of a mouse-tracking event.
Discussion
This method returns either an NSTrackingArea object or a NSTrackingRectTag constant depending on whether the event was generated from an NSTrackingArea object or a call to addTrackingRect:owner:userData:assumeInside:. Valid mouse-tracking methods are of types NSMouseEntered, NSMouseExited, and NSCursorUpdate. This method raises an NSInternalInconsistencyException if sent to any other type of event.
The NSTrackingArea class is new with OS X version 10.5
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.htrackSwipeEventWithOptions:dampenAmountThresholdMin:max:usingHandler:
Allows tracking and user interface feedback of scroll wheel events.
Parameters
- options
The swipe tracking events. See
NSEventSwipeTrackingOptionsfor possible values.- minDampenThreshold
The minimum dampen threshold. This value is considered to encompass the “current view content area” and is referred to as a page. This is the number of pages with a negative position relative to the current page. The value must be less than or equal to zero.
- maxDampenThreshold
The maximum dampen threshold. This value is considered to encompass the “current view content area” and is referred to as a page. This is the number of pages with a positive position relative to the current page. The value must be greater than or equal to zero.
- trackingHandler
The Block used as the tracking handler.
The Block takes four arguments:
- gestureAmount
The amount of gesture that you should display in the user interface. This may be a fractional amount.
The direction of the gestureAmount matches the user's "scroll content" preference setting as set in
isDirectionInvertedFromDevice, which is based on a user preference.Upon completion, the gesture amount will animate to one of the following values: -1, 0, 1.
- phase
The phase of the physical gesture as performed by the user. See “NSEventPhase” for possible values. When the phase is either
NSEventPhaseEnded, orNSEventPhaseMayBegin, the user has physically ended the gesture successfully or un-successfully, respectively.Your handler will continue to be called with updated progress values to complete the fluid swipe animation with a phase of
NSEventPhaseNone.- isComplete
Signifies the swipe and animation are complete and you should release any temporary animation objects.
The trackingHandler is released and will not be called further.
- stop
A reference to a Boolean value. The Block can set the value to
YESto stop further processing of the array. The stop argument is an out-only argument. You should only ever set this Boolean toYESwithin the Block
Discussion
Scroll wheel swipes are tracked not only to the end of the physical gesture phase by the user, but also to the completion of any user interface animation that should be performed. Using this method allows your implementation to maintain a consistent fluid feel with other applications. Any gesture amount outside of the supplied minimum and maximum dampen amount is pre-dampened for you to provide an elastic feel.
The swipe gestureAmount that would fall outside of the range specified by the minDampenThreshold and maxDampenThreshold are automatically dampened. For example, the user’s physical swipe action results in a value of .50, however, there is no page in that direction to swipe to. The gestureAmount reported is adjusted by a damping factor resulting in something like .125. As a developer, you simply treat the gestureAmount like you normally do, and the result is an elastic feedback effect to let the user know that there is nothing to swipe to in that direction.
Availability
- Available in OS X v10.7 and later.
Declared In
NSEvent.htype
Returns the type of the receiving event.
Return Value
Returns the event type. The possible values are described in “NSEventType.”
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.huniqueID
Returns the unique identifier of the pointing device that generated the event represented by the receiver.
Discussion
Also known as tool ID, this is a unique number recorded in the chip inside every pointing device. The unique ID makes it possible to assign a specific pointing device to a specific tablet. You can also use it to “sign” documents or to restrict access to document layers to a specific pointing device. This method is valid for mouse events with subtype NSTabletProximityEventSubtype and for NSTabletProximity events.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.huserData
Returns data associated with a mouse-tracking event,
Discussion
The returned data was assigned to the mouse-tracking event when it was set up using the NSView method addTrackingRect:owner:userData:assumeInside:. It is only valid to send this message if the receiver represents an NSMouseEntered or NSMouseExited event. Raises an NSInternalInconsistencyException if sent to any other type of event object.
Availability
- Available in OS X v10.0 and later.
Declared In
NSEvent.hvendorDefined
Returns an array of three vendor-defined NSNumber objects associated with the pointing-type event represented by the receiver.
Discussion
The NSNumber objects encapsulate short values that vendors may return for various reasons; see the vendor documentation for details.This method is valid for mouse events with subtype NSTabletPointEventSubtype and for NSTabletPoint events.
Availability
- Available in OS X v10.4 and later.
Declared In
NSEvent.hvendorID
Returns the vendor identifier of the tablet associated with the receiver.
Discussion
The tablet is typically a USB device. This method is valid only for mouse events with subtype NSTabletProximityEventSubtype and for NSTabletProximity events.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.hvendorPointingDeviceType
Returns a coded bit field whose set bits indicate the type of pointing device (within a vendor selection) associated with the receiver.
Discussion
See the vendor documentation for an interpretation of significant bits. This method is valid only for mouse events with subtype NSTabletProximityEventSubtype and for NSTabletProximity events.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSEvent.hwindow
Returns the window object associated with the receiver.
Discussion
A periodic event, however, has no window; in this case the return value is undefined.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSEvent.hConstants
NSEventSwipeTrackingOptions
These constants specify they swipe tracking options.
enum {
NSEventSwipeTrackingLockDirection = 0x1 << 0,
NSEventSwipeTrackingClampGestureAmount = 0x1 << 1
};
typedef NSUInteger NSEventSwipeTrackingOptions;
Constants
NSEventSwipeTrackingLockDirectionClamp gestureAmount to 0 if the user starts to swipe in the opposite direction than they started.
Available in OS X v10.7 and later.
Declared in
NSEvent.h.NSEventSwipeTrackingClampGestureAmountDon't allow gestureAmount to go beyond +/-1.0
Available in OS X v10.7 and later.
Declared in
NSEvent.h.
Availability
- Available in OS X v10.7 and later.
Declared In
NSEvent.hNSEventGestureAxis
These constants specify the gesture tracking axis.
enum {
NSEventGestureAxisNone = 0,
NSEventGestureAxisHorizontal,
NSEventGestureAxisVertical };
typedef NSInteger NSEventGestureAxis;
Constants
NSEventGestureAxisNoneThere is no specific gesture axis.
Available in OS X v10.7 and later.
Declared in
NSEvent.h.NSEventGestureAxisHorizontalThe gesture axis is horizontal.
Available in OS X v10.7 and later.
Declared in
NSEvent.h.NSEventGestureAxisVerticalThe gesture axis is vertical.
Available in OS X v10.7 and later.
Declared in
NSEvent.h.
Availability
- Available in OS X v10.7 and later.
Declared In
NSEvent.hNSEventPhase
These constants represent the possible phases during an event phase.
enum {
NSEventPhaseNone = 0,
NSEventPhaseBegan = 0x1 << 0,
NSEventPhaseStationary = 0x1 << 1,
NSEventPhaseChanged = 0x1 << 2,
NSEventPhaseEnded = 0x1 << 3,
NSEventPhaseCancelled = 0x1 << 4,
NSEventPhaseMayBegin = 0x1 << 5
};
#endif
typedef NSUInteger NSEventPhase;
Constants
NSEventPhaseNoneThe event is not associated with a phase.
Available in OS X v10.7 and later.
Declared in
NSEvent.h.NSEventPhaseBeganAn event phase has begun.
Available in OS X v10.7 and later.
Declared in
NSEvent.h.NSEventPhaseStationaryAn event phase is in progresses but hasn't moved since the previous event.
Available in OS X v10.7 and later.
Declared in
NSEvent.h.NSEventPhaseChangedAn event phase has changed.
Available in OS X v10.7 and later.
Declared in
NSEvent.h.NSEventPhaseEndedThe event phase ended..
Available in OS X v10.7 and later.
Declared in
NSEvent.h.NSEventPhaseCancelledThe system cancelled the event phase.
Available in OS X v10.7 and later.
Declared in
NSEvent.h.NSEventPhaseMayBeginThe system even phase may begin.
Available in OS X v10.8 and later.
Declared in
NSEvent.h.
NSTouchPhase
These constants represent the possible phases during a touch gesture.
enum {
NSTouchPhaseBegan = 1 << 0,
NSTouchPhaseMoved = 1 << 1,
NSTouchPhaseStationary = 1 << 2,
NSTouchPhaseEnded = 1 << 3,
NSTouchPhaseCancelled = 1 << 4,
NSTouchPhaseTouching = NSTouchPhaseBegan | NSTouchPhaseMoved | NSTouchPhaseStationary,
NSTouchPhaseAny = NSUIntegerMax
};
typedef NSUInteger NSTouchPhase;
Constants
NSTouchPhaseBeganA finger for a given event touched the screen.
Available in OS X v10.6 and later.
Declared in
NSTouch.h.NSTouchPhaseMovedA finger for a given event moved on the screen.
Available in OS X v10.6 and later.
Declared in
NSTouch.h.NSTouchPhaseStationaryA finger is touching the surface but hasn't moved since the previous event.
Available in OS X v10.6 and later.
Declared in
NSTouch.h.NSTouchPhaseEndedA finger for a given event was lifted from the screen.
Available in OS X v10.6 and later.
Declared in
NSTouch.h.NSTouchPhaseCancelledThe system cancelled tracking for the touch.
Available in OS X v10.6 and later.
Declared in
NSTouch.h.NSTouchPhaseTouchingAn NSTouchPhaseBegan, or NSTouchPhaseMoved, or NSTouchPhaseStationary phase is in progress.
Available in OS X v10.6 and later.
Declared in
NSTouch.h.NSTouchPhaseAnyAny touch phase.
Available in OS X v10.6 and later.
Declared in
NSTouch.h.
NSEventType
These constants represent various kinds of events. They are returned by type and are used as the first argument to the methods enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:, keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:, mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:, and otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:.
enum {
NSLeftMouseDown = 1,
NSLeftMouseUp = 2,
NSRightMouseDown = 3,
NSRightMouseUp = 4,
NSMouseMoved = 5,
NSLeftMouseDragged = 6,
NSRightMouseDragged = 7,
NSMouseEntered = 8,
NSMouseExited = 9,
NSKeyDown = 10,
NSKeyUp = 11,
NSFlagsChanged = 12,
NSAppKitDefined = 13,
NSSystemDefined = 14,
NSApplicationDefined = 15,
NSPeriodic = 16,
NSCursorUpdate = 17,
NSScrollWheel = 22,
NSTabletPoint = 23,
NSTabletProximity = 24,
NSOtherMouseDown = 25,
NSOtherMouseUp = 26,
NSOtherMouseDragged = 27
NSEventTypeGesture = 29,
NSEventTypeMagnify = 30,
NSEventTypeSwipe = 31,
NSEventTypeRotate = 18,
NSEventTypeBeginGesture = 19,
NSEventTypeEndGesture = 20
NSEventTypeSmartMagnify = 32,
NSEventTypeQuickLook = 33
};
typedef NSUInteger NSEventType;
Constants
NSLeftMouseDownSee “Handling Mouse Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSLeftMouseUpSee “Handling Mouse Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSRightMouseDownSee “Handling Mouse Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSRightMouseUpSee “Handling Mouse Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSOtherMouseDownSee “Handling Mouse Events” in Cocoa Event Handling Guide.
Available in OS X v10.1 and later.
Declared in
NSEvent.h.NSOtherMouseUpSee “Handling Mouse Events” in Cocoa Event Handling Guide.
Available in OS X v10.1 and later.
Declared in
NSEvent.h.NSMouseMovedSee “Handling Mouse Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSLeftMouseDraggedSee “Handling Mouse Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSRightMouseDraggedSee “Handling Mouse Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSOtherMouseDraggedSee “Handling Mouse Events” in Cocoa Event Handling Guide.
Available in OS X v10.1 and later.
Declared in
NSEvent.h.NSMouseEnteredSee “Mouse-Tracking and Cursor-Update Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSMouseExitedSee “Mouse-Tracking and Cursor-Update Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSCursorUpdateSee “Mouse-Tracking and Cursor-Update Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSKeyDownSee “Handling Key Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSKeyUpSee “Handling Key Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSFlagsChangedSee “Handling Key Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSAppKitDefinedSee “Event Objects and Types” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSSystemDefinedSee “Event Objects and Types” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSApplicationDefinedSee “Event Objects and Types” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSPeriodicSee “Event Objects and Types” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSScrollWheelSee “Handling Mouse Events” in Cocoa Event Handling Guide.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSTabletPointAn event representing the current state of a tablet pointing device, including its location, pressure, and tilt.
Available in OS X v10.4 and later.
Declared in
NSEvent.h.NSTabletProximityAn event representing the proximity of a pointing device to its tablet.
Available in OS X v10.4 and later.
Declared in
NSEvent.h.NSEventTypeGestureAn event that represents some type of gesture such as
NSEventTypeMagnify,NSEventTypeSwipe,NSEventTypeRotate,NSEventTypeBeginGesture, orNSEventTypeEndGesture.Available in OS X v10.6 and later.
Declared in
NSEvent.h.NSEventTypeMagnifyAn event representing a pinch open or pinch close gesture.
Available in OS X v10.6 and later.
Declared in
NSEvent.h.NSEventTypeSwipeAn event representing a swipe gesture.
Available in OS X v10.6 and later.
Declared in
NSEvent.h.NSEventTypeRotateAn event representing a rotation gesture.
Available in OS X v10.6 and later.
Declared in
NSEvent.h.NSEventTypeBeginGestureAn event that represents a gesture beginning.
Available in OS X v10.6 and later.
Declared in
NSEvent.h.NSEventTypeEndGestureAn event that represents a gesture ending.
Available in OS X v10.6 and later.
Declared in
NSEvent.h.NSEventTypeSmartMagnifyNSEvent type for the smart zoom gesture (2-finger double tap on trackpads) along with a corresponding NSResponder method. In response to this event, you should intelligently magnify the content.
Available in OS X v10.8 and later.
Declared in
NSEvent.h.NSEventTypeQuickLookSupports the new event responder method that initiates a Quicklook.
Available in OS X v10.8 and later.
Declared in
NSEvent.h.
NSEventMaskFromType
These constants are masks for the events defined in “NSEventType.” Pass them to the NSCell method sendActionOn: to specify when an NSCell should send its action message.
enum {
NSLeftMouseDownMask = 1 << NSLeftMouseDown,
NSLeftMouseUpMask = 1 << NSLeftMouseUp,
NSRightMouseDownMask = 1 << NSRightMouseDown,
NSRightMouseUpMask = 1 << NSRightMouseUp,
NSMouseMovedMask = 1 << NSMouseMoved,
NSLeftMouseDraggedMask = 1 << NSLeftMouseDragged,
NSRightMouseDraggedMask = 1 << NSRightMouseDragged,
NSMouseEnteredMask = 1 << NSMouseEntered,
NSMouseExitedMask = 1 << NSMouseExited,
NSKeyDownMask = 1 << NSKeyDown,
NSKeyUpMask = 1 << NSKeyUp,
NSFlagsChangedMask = 1 << NSFlagsChanged,
NSAppKitDefinedMask = 1 << NSAppKitDefined,
NSSystemDefinedMask = 1 << NSSystemDefined,
NSApplicationDefinedMask = 1 << NSApplicationDefined,
NSPeriodicMask = 1 << NSPeriodic,
NSCursorUpdateMask = 1 << NSCursorUpdate,
NSScrollWheelMask = 1 << NSScrollWheel,
NSTabletPointMask = 1 << NSTabletPoint,
NSTabletProximityMask = 1 << NSTabletProximity,
NSOtherMouseDownMask = 1 << NSOtherMouseDown,
NSOtherMouseUpMask = 1 << NSOtherMouseUp,
NSOtherMouseDraggedMask = 1 << NSOtherMouseDragged,
NSEventMaskGesture = 1 << NSEventTypeGesture,
NSEventMaskMagnify = 1 << NSEventTypeMagnify,
NSEventMaskSwipe = 1U << NSEventTypeSwipe,
NSEventMaskRotate = 1 << NSEventTypeRotate,
NSEventMaskBeginGesture = 1 << NSEventTypeBeginGesture,
NSEventMaskEndGesture = 1 << NSEventTypeEndGesture,
NSEventMaskSmartMagnify = 1ULL << NSEventTypeSmartMagnify,
NSAnyEventMask = 0xffffffffU
};
typedef unsigned long long NSEventMask;
NSUInteger NSEventMaskFromType(NSEventType type) { return (1 << type); };
Constants
NSLeftMouseDownMaskCorresponds to
NSLeftMouseDown. See “Handling Mouse Events” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSLeftMouseUpMaskCorresponds to
NSLeftMouseUp. See “Handling Mouse Events” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSRightMouseDownMaskCorresponds to
NSRightMouseDown. See “Handling Mouse Events” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSRightMouseUpMaskCorresponds to
NSRightMouseUp. See “Handling Mouse Events” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSOtherMouseDownMaskCorresponds to
NSOtherMouseDown. See “Handling Mouse Events” in Cocoa Event Handling Guide.Available in OS X v10.1 and later.
Declared in
NSEvent.h.NSOtherMouseUpMaskCorresponds to
NSOtherMouseUp. See “Handling Mouse Events” in Cocoa Event Handling Guide.Available in OS X v10.1 and later.
Declared in
NSEvent.h.NSMouseMovedMaskCorresponds to
NSMouseMoved. See “Handling Mouse Events” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSLeftMouseDraggedMaskCorresponds to
NSLeftMouseDragged. See “Handling Mouse Events” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSRightMouseDraggedMaskCorresponds to
NSRightMouseDragged. See “Handling Mouse Events” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSOtherMouseDraggedMaskCorresponds to
NSOtherMouseDragged. See “Handling Mouse Events” in Cocoa Event Handling Guide.Available in OS X v10.1 and later.
Declared in
NSEvent.h.NSMouseEnteredMaskCorresponds to
NSMouseEntered. See See “Mouse-Tracking and Cursor-Update Events” in Cocoa Event Handling Guide..Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSMouseExitedMaskCorresponds to
NSMouseExited. See See “Mouse-Tracking and Cursor-Update Events” in Cocoa Event Handling Guide..Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSCursorUpdateMaskCorresponds to
NSCursorUpdate. See See “Mouse-Tracking and Cursor-Update Events” in Cocoa Event Handling Guide..Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSKeyDownMaskCorresponds to
NSKeyDown. See “Handling Key Events” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSKeyUpMaskCorresponds to
NSKeyUp. See “Handling Key Events” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSFlagsChangedMaskCorresponds to
NSFlagsChanged. See “Handling Key Events” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSAppKitDefinedMaskCorresponds to
NSAppKitDefined. See “Event Objects and Types” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSSystemDefinedMaskCorresponds to
NSSystemDefined. See “Event Objects and Types” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSApplicationDefinedMaskCorresponds to
NSApplicationDefined. See “Event Objects and Types” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSPeriodicMaskCorresponds to
NSPeriodic. See “Event Objects and Types” in Cocoa Event Handling Guide.Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSScrollWheelMaskCorresponds to
NSScrollWheel. See “Handling Mouse Events” in Cocoa Event Handling Guide..Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSTabletPointMaskCorresponds to
NSTabletPoint.Available in OS X v10.4 and later.
Declared in
NSEvent.h.NSTabletProximityMaskCorresponds to
NSTabletProximity.Available in OS X v10.4 and later.
Declared in
NSEvent.h.NSEventMaskGestureCorresponds to
NSEventTypeGesture.Available in OS X v10.6 and later.
Declared in
NSEvent.h.NSEventMaskMagnifyCorresponds to
NSEventTypeMagnify.Available in OS X v10.6 and later.
Declared in
NSEvent.h.NSEventMaskSwipeCorresponds to
NSEventTypeSwipe.Available in OS X v10.6 and later.
Declared in
NSEvent.h.NSEventMaskRotateCorresponds to
NSEventTypeRotate.Available in OS X v10.6 and later.
Declared in
NSEvent.h.NSEventMaskBeginGestureCorresponds to
NSEventTypeBeginGesture.Available in OS X v10.6 and later.
Declared in
NSEvent.h.NSEventMaskEndGestureCorresponds to
NSEventTypeEndGesture.Available in OS X v10.6 and later.
Declared in
NSEvent.h.NSEventMaskSmartMagnifyNSEvent type for the smart zoom gesture (2-finger double tap on trackpads) along with a corresponding NSResponder method. In response to this event, you should intelligently magnify the content.
Available in OS X v10.8 and later.
Declared in
NSEvent.h.
Modifier Flags
The following constants (except for NSDeviceIndependentModifierFlagsMask) represent device-independent bits found in event modifier flags:
enum {
NSAlphaShiftKeyMask = 1 << 16,
NSShiftKeyMask = 1 << 17,
NSControlKeyMask = 1 << 18,
NSAlternateKeyMask = 1 << 19,
NSCommandKeyMask = 1 << 20,
NSNumericPadKeyMask = 1 << 21,
NSHelpKeyMask = 1 << 22,
NSFunctionKeyMask = 1 << 23,
NSDeviceIndependentModifierFlagsMask = 0xffff0000U
};
Constants
NSAlphaShiftKeyMaskSet if Caps Lock key is pressed.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSShiftKeyMaskSet if Shift key is pressed.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSControlKeyMaskSet if Control key is pressed.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSAlternateKeyMaskSet if Option or Alternate key is pressed.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSCommandKeyMaskSet if Command key is pressed.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSNumericPadKeyMaskSet if any key in the numeric keypad is pressed. The numeric keypad is generally on the right side of the keyboard. This is also set if any of the arrow keys are pressed (
NSUpArrowFunctionKey,NSDownArrowFunctionKey,NSLeftArrowFunctionKey, andNSRightArrowFunctionKey).Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSHelpKeyMaskSet if the Help key is pressed.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSFunctionKeyMaskSet if any function key is pressed. The function keys include the F keys at the top of most keyboards (F1, F2, and so on) and the navigation keys in the center of most keyboards (Help, Forward Delete, Home, End, Page Up, Page Down, and the arrow keys).
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSDeviceIndependentModifierFlagsMaskUsed to retrieve only the device-independent modifier flags, allowing applications to mask off the device-dependent modifier flags, including event coalescing information.
Available in OS X v10.4 and later.
Declared in
NSEvent.h.
NSPointingDeviceType
The following constants represent pointing-device types for NSTabletProximity events or mouse events with subtype NSTabletProximityEventSubtype. The pointingDeviceType method returns one of these constants.
typedef enum {
NSUnknownPointingDevice = NX_TABLET_POINTER_UNKNOWN,
NSPenPointingDevice = NX_TABLET_POINTER_PEN,
NSCursorPointingDevice = NX_TABLET_POINTER_CURSOR,
NSEraserPointingDevice = NX_TABLET_POINTER_ERASER
} NSPointingDeviceType;
Constants
NSUnknownPointingDeviceRepresents an unknown type of pointing device.
Available in OS X v10.4 and later.
Declared in
NSEvent.h.NSPenPointingDeviceRepresents the tip end of a stylus-like pointing device.
Available in OS X v10.4 and later.
Declared in
NSEvent.h.NSCursorPointingDeviceRepresents a cursor (or puck-like) pointing device.
Available in OS X v10.4 and later.
Declared in
NSEvent.h.NSEraserPointingDeviceRepresents the eraser end of a stylus-like pointing device.
Available in OS X v10.4 and later.
Declared in
NSEvent.h.
Mouse-event subtypes
The following constants represent mouse-event subtypes for mouse and tablet events (accessed with the subtype method).
enum {
NSMouseEventSubtype = NX_SUBTYPE_DEFAULT,
NSTabletPointEventSubtype = NX_SUBTYPE_TABLET_POINT,
NSTabletProximityEventSubtype = NX_SUBTYPE_TABLET_PROXIMITY
NSTouchEventSubtype = NX_SUBTYPE_MOUSE_TOUCH
};
Constants
NSMouseEventSubtypeIndicates a purely mouse event.
Available in OS X v10.4 and later.
Declared in
NSEvent.h.NSTabletPointEventSubtypeIndicates a tablet-pointer event; see description of
NSTabletPoint.Available in OS X v10.4 and later.
Declared in
NSEvent.h.NSTabletProximityEventSubtypeIndicates a tablet-proximity event; see description of
NSTabletProximity.Available in OS X v10.4 and later.
Declared in
NSEvent.h.NSTouchEventSubtypeIndicates a touch event subtype.
Available in OS X v10.6 and later.
Declared in
NSEvent.h.
Tablet event masks
The following constants represent button masks for NSTabletPoint events or mouse events with subtype NSTabletPointEventSubtype. The buttonMask method returns a bit mask, which you test with one or more of these constants to determine the state of the buttons on a tablet pointing device.
enum {
NSPenTipMask = NX_TABLET_BUTTON_PENTIPMASK,
NSPenLowerSideMask = NX_TABLET_BUTTON_PENLOWERSIDEMASK,
NSPenUpperSideMask = NX_TABLET_BUTTON_PENUPPERSIDEMASK
};
Constants
NSPenTipMaskThe pen tip is activated.
Available in OS X v10.4 and later.
Declared in
NSEvent.h.NSPenLowerSideMaskThe button on the lower side of the device is activated.
Available in OS X v10.4 and later.
Declared in
NSEvent.h.NSPenUpperSideMaskThe button on the upper side of the device is activated.
Available in OS X v10.4 and later.
Declared in
NSEvent.h.
Types Defined by the Application Kit
These constants represent the types of events defined by the Application Kit.
enum {
NSWindowExposedEventType = 0,
NSApplicationActivatedEventType = 1,
NSApplicationDeactivatedEventType = 2,
NSWindowMovedEventType = 4,
NSScreenChangedEventType = 8,
NSAWTEventType = 16
};
Constants
NSWindowExposedEventTypeA non-retained NSWindow has been exposed.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSApplicationActivatedEventTypeThe application has been activated.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSApplicationDeactivatedEventTypeThe application has been deactivated.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSWindowMovedEventTypeAn NSWindow has moved.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSScreenChangedEventTypeAn NSWindow has changed screens.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSAWTEventTypeAn event type used to support Java applications.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.
Power-off event
This constant denotes that the user is turning off the computer.
enum {
NSPowerOffEventType = 1
};
Constants
NSPowerOffEventTypeSpecifies that the user is turning off the computer.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.
Function-Key Unicodes
These constants represent Unicode characters (0xF700–0xF8FF) that are reserved for function keys on the keyboard. Combined in NSStrings, they are the return values of the NSEvent methods characters and charactersIgnoringModifiers and may be used in some parameters in the NSEvent method keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:.
enum {
NSUpArrowFunctionKey = 0xF700,
NSDownArrowFunctionKey = 0xF701,
NSLeftArrowFunctionKey = 0xF702,
NSRightArrowFunctionKey = 0xF703,
NSF1FunctionKey = 0xF704,
NSF2FunctionKey = 0xF705,
NSF3FunctionKey = 0xF706,
NSF4FunctionKey = 0xF707,
NSF5FunctionKey = 0xF708,
NSF6FunctionKey = 0xF709,
NSF7FunctionKey = 0xF70A,
NSF8FunctionKey = 0xF70B,
NSF9FunctionKey = 0xF70C,
NSF10FunctionKey = 0xF70D,
NSF11FunctionKey = 0xF70E,
NSF12FunctionKey = 0xF70F,
NSF13FunctionKey = 0xF710,
NSF14FunctionKey = 0xF711,
NSF15FunctionKey = 0xF712,
NSF16FunctionKey = 0xF713,
NSF17FunctionKey = 0xF714,
NSF18FunctionKey = 0xF715,
NSF19FunctionKey = 0xF716,
NSF20FunctionKey = 0xF717,
NSF21FunctionKey = 0xF718,
NSF22FunctionKey = 0xF719,
NSF23FunctionKey = 0xF71A,
NSF24FunctionKey = 0xF71B,
NSF25FunctionKey = 0xF71C,
NSF26FunctionKey = 0xF71D,
NSF27FunctionKey = 0xF71E,
NSF28FunctionKey = 0xF71F,
NSF29FunctionKey = 0xF720,
NSF30FunctionKey = 0xF721,
NSF31FunctionKey = 0xF722,
NSF32FunctionKey = 0xF723,
NSF33FunctionKey = 0xF724,
NSF34FunctionKey = 0xF725,
NSF35FunctionKey = 0xF726,
NSInsertFunctionKey = 0xF727,
NSDeleteFunctionKey = 0xF728,
NSHomeFunctionKey = 0xF729,
NSBeginFunctionKey = 0xF72A,
NSEndFunctionKey = 0xF72B,
NSPageUpFunctionKey = 0xF72C,
NSPageDownFunctionKey = 0xF72D,
NSPrintScreenFunctionKey = 0xF72E,
NSScrollLockFunctionKey = 0xF72F,
NSPauseFunctionKey = 0xF730,
NSSysReqFunctionKey = 0xF731,
NSBreakFunctionKey = 0xF732,
NSResetFunctionKey = 0xF733,
NSStopFunctionKey = 0xF734,
NSMenuFunctionKey = 0xF735,
NSUserFunctionKey = 0xF736,
NSSystemFunctionKey = 0xF737,
NSPrintFunctionKey = 0xF738,
NSClearLineFunctionKey = 0xF739,
NSClearDisplayFunctionKey = 0xF73A,
NSInsertLineFunctionKey = 0xF73B,
NSDeleteLineFunctionKey = 0xF73C,
NSInsertCharFunctionKey = 0xF73D,
NSDeleteCharFunctionKey = 0xF73E,
NSPrevFunctionKey = 0xF73F,
NSNextFunctionKey = 0xF740,
NSSelectFunctionKey = 0xF741,
NSExecuteFunctionKey = 0xF742,
NSUndoFunctionKey = 0xF743,
NSRedoFunctionKey = 0xF744,
NSFindFunctionKey = 0xF745,
NSHelpFunctionKey = 0xF746,
NSModeSwitchFunctionKey = 0xF747
};
Constants
NSUpArrowFunctionKeyUp Arrow key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSDownArrowFunctionKeyDown Arrow key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSLeftArrowFunctionKeyLeft Arrow key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSRightArrowFunctionKeyRight Arrow key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF1FunctionKeyF1 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF2FunctionKeyF2 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF3FunctionKeyF3 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF4FunctionKeyF4 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF5FunctionKeyF5 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF6FunctionKeyF6 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF7FunctionKeyF7 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF8FunctionKeyF8 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF9FunctionKeyF9 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF10FunctionKeyF10 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF11FunctionKeyF11 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF12FunctionKeyF12 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF13FunctionKeyF13 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF14FunctionKeyF14 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF15FunctionKeyF15 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF16FunctionKeyF16 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF17FunctionKeyF17 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF18FunctionKeyF18 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF19FunctionKeyF19 key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF20FunctionKeyF20 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF21FunctionKeyF21 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF22FunctionKeyF22 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF23FunctionKeyF23 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF24FunctionKeyF24 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF25FunctionKeyF25 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF26FunctionKeyF26 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF27FunctionKeyF27 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF28FunctionKeyF28 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF29FunctionKeyF29 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF30FunctionKeyF30 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF31FunctionKeyF31 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF32FunctionKeyF32 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF33FunctionKeyF33 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF34FunctionKeyF34 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSF35FunctionKeyF35 key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSInsertFunctionKeyInsert key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSDeleteFunctionKeyForward Delete key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSHomeFunctionKeyHome key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSBeginFunctionKeyBegin key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSEndFunctionKeyEnd key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSPageUpFunctionKeyPage Up key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSPageDownFunctionKeyPage Down key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSPrintScreenFunctionKeyPrint Screen key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSScrollLockFunctionKeyScroll Lock key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSPauseFunctionKeyPause key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSSysReqFunctionKeySystem Request key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSBreakFunctionKeyBreak key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSResetFunctionKeyReset key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSStopFunctionKeyStop key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSMenuFunctionKeyMenu key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSUserFunctionKeyUser key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSSystemFunctionKeySystem key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSPrintFunctionKeyPrint key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSClearLineFunctionKeyClear/Num Lock key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSClearDisplayFunctionKeyClear Display key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSInsertLineFunctionKeyInsert Line key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSDeleteLineFunctionKeyDelete Line key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSInsertCharFunctionKeyInsert Character key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSDeleteCharFunctionKeyDelete Character key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSPrevFunctionKeyPrevious key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSNextFunctionKeyNext key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSSelectFunctionKeySelect key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSExecuteFunctionKeyExecute key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSUndoFunctionKeyUndo key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSRedoFunctionKeyRedo key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSFindFunctionKeyFind key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSHelpFunctionKeyHelp key.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.NSModeSwitchFunctionKeyMode Switch key. Not on most Macintosh keyboards.
Available in OS X v10.0 and later.
Declared in
NSEvent.h.
Discussion
Note that some function keys are handled at a lower level and are never seen by your application. They include the Volume Up key, Volume Down key, Volume Mute key, Eject key, and Function key found on many iBook and PowerBook computers.
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)