# NSEvent

scottc@net-community.com
ovidiu@net-community.com
far@ix.netcom.com
Generated at 2026-06-27 19:09:52 +0000

The event class

1996 Free Software Foundation, Inc.
Software documentation for the NSEvent class
AppKit/NSEvent.h
NSCoding
NSCopying
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
doubleClickInterval
Description forthcoming.
enterExitEventWithType:
type
location:
location
modifierFlags:
flags
timestamp:
time
windowNumber:
windowNum
context:
context
eventNumber:
eventNum
trackingNumber:
trackingNum
userData:
userData
Description forthcoming.
eventWithEventRef:
eventRef
Description forthcoming.
isMouseCoalescingEnabled
Description forthcoming.
keyEventWithType:
type
location:
location
modifierFlags:
flags
timestamp:
time
windowNumber:
windowNum
context:
context
characters:
keys
charactersIgnoringModifiers:
ukeys
isARepeat:
repeatKey
keyCode:
code
Description forthcoming.
keyRepeatDelay
Description forthcoming.
keyRepeatInterval
Description forthcoming.
modifierFlags
Description forthcoming.
mouseEventWithType:
type
location:
location
modifierFlags:
flags
timestamp:
time
windowNumber:
windowNum
context:
context
eventNumber:
eventNum
clickCount:
clickNum
pressure:
pressureValue
Description forthcoming.
mouseEventWithType:
type
location:
location
modifierFlags:
flags
timestamp:
time
windowNumber:
windowNum
context:
context
eventNumber:
eventNum
clickCount:
clickNum
pressure:
pressureValue
buttonNumber:
buttonNum
deltaX:
deltaX
deltaY:
deltaY
deltaZ:
deltaZ
Description forthcoming.
mouseLocation
Returns the current mouse location.
otherEventWithType:
type
location:
location
modifierFlags:
flags
timestamp:
time
windowNumber:
windowNum
context:
context
subtype:
subType
data1:
data1
data2:
data2
Description forthcoming.
pressedMouseButtons
Description forthcoming.
setMouseCoalescingEnabled:
flag
Description forthcoming.
startPeriodicEventsAfterDelay:
delaySeconds
withPeriod:
periodSeconds
Description forthcoming.
stopPeriodicEvents
Description forthcoming.
absoluteX
Description forthcoming.
absoluteY
Description forthcoming.
absoluteZ
Description forthcoming.
associatedEventsMask
Description forthcoming.
buttonMask
Description forthcoming.
buttonNumber
Returns the button number for the mouse button pressed in a mouse event. Intended primarily for the case where a mouse has three or more buttons, and you want to know which button an 'other' mouse event refers to.
capabilityMask
Description forthcoming.
characters
Returns the string of characters for a keyboard event.
Raises an NSInternalInconsistencyException if applied to any other type of event.
charactersIgnoringModifiers
Returns the string of characters for a keyboard event, as if no modifier keys had been pressed when the keyboard event occirred.
Raises an NSInternalInconsistencyException if applied to any other type of event.
clickCount
Return the number of clicks associated with the mouse down or up event. This method is not applicable for any event type other than a mouse down or mouse up.
Raises an NSInternalInconsistencyException if applied to any other type of event.
context
Returns the graphics context for which this event was generated.
data1
Returns the 'data1' item associated with the event.
Raises NSInternalInconsistencyException if the event is not of type NSAppKitDefined, NSSystemDefined, NSApplicationDefined, or NSPeriodic
data2
Returns the 'data2' item associated with the event.
Raises NSInternalInconsistencyException if the event is not of type NSAppKitDefined, NSSystemDefined, NSApplicationDefined, or NSPeriodic
deltaX

Returns the movement of the mouse on the X axis.

This method is only valid for NSMouseMoved, NS*MouseDragged and NSScrollWheel events, otherwise it will return 0.

deltaY

Returns the movement of the mouse on the Y axis.

This method is only valid for NSMouseMoved, NS*MouseDragged and NSScrollWheel events, otherwise it will return 0.

deltaZ

Returns the movement of the mouse on the Z axis.

This method is only valid for NSMouseMoved, NS*MouseDragged and NSScrollWheel events, otherwise it will return 0.

The value returned is 0.0 in most cases.

deviceID
Description forthcoming.
eventNumber
Returns the event number associated with any mouse event or tracking event. Event numbers are allocated sequentially when the system creates these events.
Raises an NSInternalInconsistencyException if applied to any other type of event.
eventRef
Description forthcoming.
isARepeat
Returns a flag to say if this is a keyboard repeat event.
Raises an NSInternalInconsistencyException if applied to any other type of event than an NSKeyUp or NSKeyDown.
isEnteringProximity
Description forthcoming.
keyCode
Returns the numeric key code of a keyboard event.
Raises an NSInternalInconsistencyException if applied to any other type of event than an NSKeyUp or NSKeyDown.
locationInWindow
Returns the window location for which this event was generated (in the base coordinate system of the window).
modifierFlags
Returns the modifier flag bits associated with the event.
momentumPhase
Description forthcoming.
phase
Description forthcoming.
pointingDeviceID
Description forthcoming.
pointingDeviceSerialNumber
Description forthcoming.
pointingDeviceType
Description forthcoming.
pressure
Returns the pressure associated with a mouse event. This is a value in the range 0.0 to 1.0 and for mormal mouse events should be set to one of those extremes. This is used by pressure sensitive input devices.
Raises an NSInternalInconsistencyException if applied to any other type of event than a mouse event.
rotation
Description forthcoming.
subtype
Returns the 'subtype' item associated with the event.
Raises NSInternalInconsistencyException if the event is not of type NSAppKitDefined, NSSystemDefined, NSApplicationDefined, NSPeriodic or a mouve event.
systemTabletID
Description forthcoming.
tabletID
Description forthcoming.
tangentialPressure
Description forthcoming.
tilt
Description forthcoming.
timestamp
Returns the time interval since system startup at which this event was generated.
trackingNumber
Returns a number identifying the tracking rectangle entered or exited.
Raises an NSInternalInconsistencyException if applied to any other type of event than a mouse entered or exited event.
type
returns the type of this event.
uniqueID
Description forthcoming.
userData
Returns usder data associated with a tracking event... the data assigned to the tracking rectangle concerned when it was created..
Raises an NSInternalInconsistencyException if applied to any other type of event than a mouse entered or exited event.
vendorDefined
Description forthcoming.
vendorID
Description forthcoming.
vendorPointingDeviceType
Description forthcoming.
window
Returns the window for which this event was generated.
Periodic events have no associated window, and you should not call this method for those events.
windowNumber
Returns the window number of the window for which this event was generated.
Periodic events have no associated window, and you should not call this method for those events.