API  1.0.0
CPEvent Class Reference

#import <CPEvent.h>

+ Inheritance diagram for CPEvent:

Instance Methods

(int) - buttonNumber
 
(CPString- characters
 
(CPString- charactersIgnoringModifiers
 
(int) - clickCount
 
(int) - data1
 
(int) - data2
 
(float) - deltaX
 
(float) - deltaY
 
(float) - deltaZ
 
(CPString- description
 
(CGPoint) - globalLocation
 
(BOOL) - hasPreciseScrollingDeltas
 
(BOOL) - isARepeat
 
(unsigned short) - keyCode
 
(CGPoint) - locationInWindow
 
(unsigned) - modifierFlags
 
(float) - pressure
 
(float) - scrollingDeltaX
 
(float) - scrollingDeltaY
 
(CPEventType) - subtype
 
(CPTimeInterval) - timestamp
 
(CPTrackingArea- trackingArea
 
(CPEventType) - type
 
(CPWindow- window
 
(int) - windowNumber
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray) - exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(id) - init
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(CPTimeInterval) + currentTimestamp
 
(id) + enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingArea:
 
(CPEvent+ keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:
 
(id) + mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:
 
(CGPoint) + mouseLocation
 
(CPEvent+ otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:
 
(void) + startPeriodicEventsAfterDelay:withPeriod:
 
(void) + stopPeriodicEvents
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(void) + cancelPreviousPerformRequestsWithTarget:
 
(void) + cancelPreviousPerformRequestsWithTarget:selector:object:
 
(Class) + class
 
(BOOL) + conformsToProtocol:
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesImplementSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isBindingExclusive:
 
(BOOL) + isSubclassOfClass:
 
(CPSet) + keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + object:performSelector:withObject:afterDelay:inModes:
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Detailed Description

CPEvent encapsulates the details of a Cappuccino keyboard or mouse event.

Definition at line 2 of file CPEvent.h.

Method Documentation

◆ buttonNumber()

- (int) buttonNumber
implementation

Returns the button number for the mouse that generated the event.

Definition at line 361 of file CPEvent.j.

◆ characters()

- (CPString) characters
implementation

Returns the characters associated with this event (keyboard only).

Exceptions
CPInternalInconsistencyExceptionif this method is called on a non-key event

Definition at line 382 of file CPEvent.j.

◆ charactersIgnoringModifiers()

- (CPString) charactersIgnoringModifiers
implementation

Returns the character ignoring any modifiers (except shift).

Exceptions
CPInternalInconsistencyExceptionif this method is called on a non-key event

Definition at line 392 of file CPEvent.j.

◆ clickCount()

- (int) clickCount
implementation

Returns the number of clicks that caused this event (mouse only).

Definition at line 372 of file CPEvent.j.

◆ currentTimestamp()

+ (CPTimeInterval) currentTimestamp
implementation

Returns the current time in fractional seconds since startup.

Definition at line 84 of file CPEvent.j.

◆ data1()

- (int) data1
implementation

Definition at line 442 of file CPEvent.j.

◆ data2()

- (int) data2
implementation

Definition at line 447 of file CPEvent.j.

◆ deltaX()

- (float) deltaX
implementation

Returns the change in the x-axis for a mouse event.

Definition at line 456 of file CPEvent.j.

◆ deltaY()

- (float) deltaY
implementation

Returns the change in the y-axis for a mouse event.

Definition at line 464 of file CPEvent.j.

◆ deltaZ()

- (float) deltaZ
implementation

Returns the change in the x-axis for a mouse event.

Definition at line 472 of file CPEvent.j.

◆ description()

- (CPString) description
implementation

Returns a human readable string describing the receiver

Reimplemented from CPObject.

Definition at line 608 of file CPEvent.j.

◆ enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingArea:()

+ (id) enterExitEventWithType: (CPEventType)  anEventType
location: (CGPoint)  aPoint
modifierFlags: (unsigned)  modifierFlags
timestamp: (CPTimeInterval)  aTimestamp
windowNumber: (int)  aWindowNumber
context: (CPGraphicsContext aGraphicsContext
eventNumber: (int)  anEventNumber
trackingArea: (CPTrackingArea aTrackingArea 
implementation

Creates a new mouse tracking event.

Parameters
anEventTypethe event type
aPointthe location of the cursor in the window specified by aWindowNumber
modifierFlagsa bitwise combination of the modifiers specified in the CPEvent globals
aTimestampthe time the event occurred
aWindowNumberthe number of the CPWindow where the event occurred
aGraphicsContextthe graphics context where the event occurred
anEventNumbera number for this event
aTrackingAreathe tracking area that triggered the event
Exceptions
CPInternalInconsistencyExceptionif an invalid event type is provided
Returns
the new mouse event

Definition at line 152 of file CPEvent.j.

◆ globalLocation()

- (CGPoint) globalLocation
implementation

Definition at line 295 of file CPEvent.j.

◆ hasPreciseScrollingDeltas()

- (BOOL) hasPreciseScrollingDeltas
implementation

Definition at line 477 of file CPEvent.j.

◆ isARepeat()

- (BOOL) isARepeat
implementation

Returns YES if the keyboard event was caused by the key being held down.

Exceptions
CPInternalInconsistencyExceptionif this method is called on a non-key event

Definition at line 402 of file CPEvent.j.

◆ keyCode()

- (unsigned short) keyCode
implementation

Returns the key's key code.

Exceptions
CPInternalInconsistencyExceptionif this method is called on a non-key event

Definition at line 412 of file CPEvent.j.

◆ keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:()

+ (CPEvent) keyEventWithType: (CPEventType)  anEventType
location: (CGPoint)  aPoint
modifierFlags: (unsigned int)  modifierFlags
timestamp: (CPTimeInterval)  aTimestamp
windowNumber: (int)  aWindowNumber
context: (CPGraphicsContext aGraphicsContext
characters: (CPString characters
charactersIgnoringModifiers: (CPString unmodCharacters
isARepeat: (BOOL)  repeatKey
keyCode: (unsigned short)  code 
implementation

Creates a new keyboard event.

Parameters
anEventTypethe event type. Must be one of CPKeyDown, CPKeyUp or CPFlagsChanged
aPointthe location of the cursor in the window specified by aWindowNumber
modifierFlagsa bitwise combination of the modifiers specified in the CPEvent globals
aTimestampthe time the event occurred
aWindowNumberthe number of the CPWindow where the event occurred
aGraphicsContextthe graphics context where the event occurred
charactersthe characters associated with the event
unmodCharactersthe string of keys pressed without the presence of any modifiers other than Shift
repeatKeyYES if this is caused by the system repeat as opposed to the user pressing the key again
codea number associated with the keyboard key of this event
Exceptions
CPInternalInconsistencyExceptionif anEventType is not a CPKeyDown, CPKeyUp or CPFlagsChanged
Returns
the keyboard event

Definition at line 106 of file CPEvent.j.

◆ locationInWindow()

- (CGPoint) locationInWindow
implementation

Returns the location of the mouse (for mouse events). If the receiver is not a mouse event, it returns nil. If window returns nil, then the mouse coordinates will be based on the screen coordinates. Otherwise, the coordinates are relative to the window's coordinates.

Returns
the location of the mouse, or nil for non-mouse events.

Definition at line 290 of file CPEvent.j.

◆ modifierFlags()

- (unsigned) modifierFlags
implementation

Returns event information as a bit mask.

Provided by category CPEvent(CPApplicationModifierFlags).

Definition at line 309 of file CPEvent.j.

◆ mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:()

+ (id) mouseEventWithType: (CPEventType)  anEventType
location: (CGPoint)  aPoint
modifierFlags: (unsigned)  modifierFlags
timestamp: (CPTimeInterval)  aTimestamp
windowNumber: (int)  aWindowNumber
context: (CPGraphicsContext aGraphicsContext
eventNumber: (int)  anEventNumber
clickCount: (int)  aClickCount
pressure: (float)  aPressure 
implementation

Creates a new mouse event.

Parameters
anEventTypethe event type
aPointthe location of the cursor in the window specified by aWindowNumber
modifierFlagsa bitwise combination of the modifiers specified in the CPEvent globals
aTimestampthe time the event occurred
aWindowNumberthe number of the CPWindow where the event occurred
aGraphicsContextthe graphics context where the event occurred
anEventNumbera number for this event
aClickCountthe number of clicks that caused this event
aPressurethe amount of pressure applied to the input device (ranges from 0.0 to 1.0)
Exceptions
CPInternalInconsistencyExceptionif an invalid event type is provided
Returns
the new mouse event

Definition at line 130 of file CPEvent.j.

◆ mouseLocation()

+ (CGPoint) mouseLocation
implementation

Definition at line 417 of file CPEvent.j.

◆ otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:()

+ (CPEvent) otherEventWithType: (CPEventType)  anEventType
location: (CGPoint)  aLocation
modifierFlags: (unsigned)  modifierFlags
timestamp: (CPTimeInterval)  aTimestamp
windowNumber: (int)  aWindowNumber
context: (CPGraphicsContext aGraphicsContext
subtype: (short)  aSubtype
data1: (int)  aData1
data2: (int)  aData2 
implementation

Creates a new custom event.

Parameters
anEventTypethe event type. Must be one of CPAppKitDefined, CPSystemDefined, CPApplicationDefined or CPPeriodic
aLocationthe location of the cursor in the window specified by aWindowNumber
modifierFlagsa bitwise combination of the modifiers specified in the CPEvent globals
aTimestampthe time the event occurred
aWindowNumberthe number of the CPWindow where the event occurred
aGraphicsContextthe graphics context where the event occurred
aSubtypea numeric identifier to differentiate this event from other custom events
aData1more data that describes the event
aData2even more data that describes the event
Exceptions
CPInternalInconsistencyExceptionif an invalid event type is provided
Returns
the new custom event

Definition at line 174 of file CPEvent.j.

◆ pressure()

- (float) pressure
implementation

Definition at line 429 of file CPEvent.j.

◆ scrollingDeltaX()

- (float) scrollingDeltaX
implementation

Returns the change in points on the x-axis for a mouse movement, unless hasPreciseScrollingDeltas is NO, in which case the change is measured in number of "lines" or "rows" and needs to be multiplied as appropriate to get change in pixels.

Definition at line 487 of file CPEvent.j.

◆ scrollingDeltaY()

- (float) scrollingDeltaY
implementation

Returns the change in points on the y-axis for a mouse movement, unless hasPreciseScrollingDeltas is NO, in which case the change is measured in number of "lines" or "columns" and needs to be multiplied as appropriate to get change in pixels.

Definition at line 497 of file CPEvent.j.

◆ startPeriodicEventsAfterDelay:withPeriod:()

+ (void) startPeriodicEventsAfterDelay: (CPTimeInterval)  aDelay
withPeriod: (CPTimeInterval)  aPeriod 
implementation

Generates periodic events every aPeriod seconds.

Parameters
aDelaythe number of seconds before the first event
aPeriodthe length of time in seconds between successive events

Definition at line 587 of file CPEvent.j.

◆ stopPeriodicEvents()

+ (void) stopPeriodicEvents
implementation

Stops the periodic events from being generated.

Definition at line 598 of file CPEvent.j.

◆ subtype()

- (CPEventType) subtype
implementation

Returns the subtype of the event.

Definition at line 333 of file CPEvent.j.

◆ timestamp()

- (CPTimeInterval) timestamp
implementation

Returns the time the event occurred in seconds since startup.

Definition at line 317 of file CPEvent.j.

◆ trackingArea()

- (CPTrackingArea) trackingArea
implementation

Definition at line 631 of file CPEvent.j.

◆ type()

- (CPEventType) type
implementation

Returns the type of event.

Definition at line 325 of file CPEvent.j.

◆ window()

- (CPWindow) window
implementation

Returns the event's associated window.

Definition at line 341 of file CPEvent.j.

◆ windowNumber()

- (int) windowNumber
implementation

The number of the window associated with the event.

Definition at line 352 of file CPEvent.j.


The documentation for this class was generated from the following files: