API 0.9.5
CPEvent Class Reference

#import <CPEvent.h>

Inheritance diagram for CPEvent:

List of all members.

Instance Methods

(int) - buttonNumber
(CPString- characters
(CPString- charactersIgnoringModifiers
(int) - clickCount
(float) - deltaX
(float) - deltaY
(float) - deltaZ
(CGPoint) - globalLocation
(BOOL) - isARepeat
(unsigned short) - keyCode
(CGPoint) - locationInWindow
(unsigned) - modifierFlags
(float) - pressure
(CPTimeInterval) - timestamp
(CPEventType) - type
(CPWindow- window
(int) - windowNumber

Class Methods

(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

Detailed Description

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

Definition at line 2 of file CPEvent.h.


Method Documentation

- (int) buttonNumber

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

Definition at line 428 of file CPEvent.j.

- (CPString) characters

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

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

Definition at line 449 of file CPEvent.j.

- (CPString) charactersIgnoringModifiers

Returns the character ignoring any modifiers (except shift).

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

Definition at line 459 of file CPEvent.j.

- (int) clickCount

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

Definition at line 439 of file CPEvent.j.

- (float) deltaX

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

Definition at line 513 of file CPEvent.j.

- (float) deltaY

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

Definition at line 521 of file CPEvent.j.

- (float) deltaZ

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

Definition at line 529 of file CPEvent.j.

- (CGPoint) globalLocation

Definition at line 370 of file CPEvent.j.

- (BOOL) isARepeat

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 469 of file CPEvent.j.

- (unsigned short) keyCode

Returns the key's key code.

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

Definition at line 479 of file CPEvent.j.

+ (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 

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 227 of file CPEvent.j.

- (CGPoint) locationInWindow

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 365 of file CPEvent.j.

- (unsigned) modifierFlags

Returns event information as a bit mask.

Definition at line 384 of file CPEvent.j.

+ (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 

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 251 of file CPEvent.j.

+ (CGPoint) mouseLocation

Definition at line 484 of file CPEvent.j.

+ (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 

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 274 of file CPEvent.j.

- (float) pressure

Definition at line 496 of file CPEvent.j.

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

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 601 of file CPEvent.j.

+ (void) stopPeriodicEvents

Stops the periodic events from being generated.

Definition at line 612 of file CPEvent.j.

- (CPTimeInterval) timestamp

Returns the time the event occurred.

Definition at line 392 of file CPEvent.j.

- (CPEventType) type

Returns the type of event.

Definition at line 400 of file CPEvent.j.

- (CPWindow) window

Returns the event's associated window.

Definition at line 408 of file CPEvent.j.

- (int) windowNumber

The number of the window associated with the event.

Definition at line 419 of file CPEvent.j.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines