CPEvent Class Reference
[AppKit]
List of all members.
Detailed Description
CPEvent encapsulates the details of a Cappuccino keyboard or mouse event.
Definition at line 114 of file CPEvent.j.
Member Function Documentation
- (int) buttonNumber |
|
|
|
[implementation] |
Returns the button number for the mouse that generated the event.
Definition at line 346 of file CPEvent.j.
- (CPString) characters |
|
|
|
[implementation] |
Returns the characters associated with this event (keyboard only)
- Exceptions:
-
| CPInternalInconsistencyException | if this method is called on a non-key event |
Definition at line 363 of file CPEvent.j.
- (CPString) charactersIgnoringModifiers |
|
|
|
[implementation] |
Returns the character ignoring any modifiers (except shift).
- Exceptions:
-
| CPInternalInconsistencyException | if this method is called on a non-key event |
Definition at line 372 of file CPEvent.j.
- (int) clickCount |
|
|
|
[implementation] |
Returns the number of clicks that caused this event. (mouse only)
Definition at line 354 of file CPEvent.j.
- (float) deltaX |
|
|
|
[implementation] |
Returns the change in the x-axis for a mouse event.
Definition at line 424 of file CPEvent.j.
- (float) deltaY |
|
|
|
[implementation] |
Returns the change in the y-axis for a mouse event.
Definition at line 432 of file CPEvent.j.
- (float) deltaZ |
|
|
|
[implementation] |
Returns the change in the x-axis for a mouse event.
Definition at line 440 of file CPEvent.j.
- (CGPoint) globalLocation |
|
|
|
[implementation] |
- (BOOL) isARepeat |
|
|
|
[implementation] |
Returns YES
if the keyboard event was caused by the key being held down.
- Exceptions:
-
| CPInternalInconsistencyException | if this method is called on a non-key event |
Definition at line 381 of file CPEvent.j.
- (unsigned short) keyCode |
|
|
|
[implementation] |
Returns the key's key code.
- Exceptions:
-
| CPInternalInconsistencyException | if this method is called on a non-key event |
Definition at line 390 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 | |
|
|
| | [implementation] |
Creates a new keyboard event.
- Parameters:
-
| anEventType | the event type. Must be one of CPKeyDown, CPKeyUp or CPFlagsChanged |
| aPoint | the location of the cursor in the window specified by aWindowNumber |
| modifierFlags | a bitwise combination of the modifiers specified in the CPEvent globals |
| aTimestamp | the time the event occurred |
| aWindowNumber | the number of the CPWindow where the event occurred |
| aGraphicsContext | the graphics context where the event occurred |
| characters | the characters associated with the event |
| unmodCharacters | the string of keys pressed without the presence of any modifiers other than Shift |
| repeatKey | YES if this is caused by the system repeat as opposed to the user pressing the key again |
| code | a number associated with the keyboard key of this event |
- Exceptions:
-
| CPInternalInconsistencyException | if anEventType is not a CPKeyDown, CPKeyUp or CPFlagsChanged |
- Returns:
- the keyboard event
Definition at line 153 of file CPEvent.j.
- (CGPoint) locationInWindow |
|
|
|
[implementation] |
Returns the location of the mouse (for mouse events). If this 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 283 of file CPEvent.j.
- (unsigned) modifierFlags |
|
|
|
[implementation] |
Returns event information as a bit mask
Definition at line 302 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 | |
|
|
| | [implementation] |
Creates a new mouse event
- Parameters:
-
| anEventType | the event type |
| aPoint | the location of the cursor in the window specified by aWindowNumber |
| modifierFlags | a bitwise combination of the modifiers specified in the CPEvent globals |
| aTimestamp | the time the event occurred |
| aWindowNumber | the number of the CPWindow where the event occurred |
| aGraphicsContext | the graphics context where the event occurred |
| anEventNumber | a number for this event |
| aClickCount | the number of clicks that caused this event |
| aPressure | the amount of pressure applied to the input device (ranges from 0.0 to 1.0) |
- Exceptions:
-
| CPInternalInconsistencyException | if an invalid event type is provided |
- Returns:
- the new mouse event
Definition at line 176 of file CPEvent.j.
+ (CGPoint) mouseLocation |
|
|
|
[implementation] |
+ (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:
-
| anEventType | the event type. Must be one of CPAppKitDefined, CPSystemDefined, CPApplicationDefined or CPPeriodic |
| aLocation | the location of the cursor in the window specified by aWindowNumber |
| modifierFlags | a bitwise combination of the modifiers specified in the CPEvent globals |
| aTimestamp | the time the event occurred |
| aWindowNumber | the number of the CPWindow where the event occurred |
| aGraphicsContext | the graphics context where the event occurred |
| aSubtype | a numeric identifier to differentiate this event from other custom events |
| aData1 | more data that describes the event |
| aData2 | even more data that describes the event |
- Exceptions:
-
| CPInternalInconsistencyException | if an invalid event type is provided |
- Returns:
- the new custom event
Definition at line 198 of file CPEvent.j.
- (float) pressure |
|
|
|
[implementation] |
+ (void) startPeriodicEventsAfterDelay: |
|
(CPTimeInterval) |
aDelay |
withPeriod: |
|
(CPTimeInterval) |
aPeriod | |
|
|
| | [implementation] |
Generates periodic events every aPeriod
seconds.
- Parameters:
-
| aDelay | the number of seconds before the first event |
| aPeriod | the length of time in seconds between successive events |
Definition at line 458 of file CPEvent.j.
+ (void) stopPeriodicEvents |
|
|
|
[implementation] |
Stops the periodic events from being generated
Definition at line 469 of file CPEvent.j.
- (CPTimeInterval) timestamp |
|
|
|
[implementation] |
Returns the time the event occurred
Definition at line 310 of file CPEvent.j.
- (CPEventType) type |
|
|
|
[implementation] |
Returns the type of event.
Definition at line 318 of file CPEvent.j.
Returns the event's associated window
Definition at line 326 of file CPEvent.j.
- (int) windowNumber |
|
|
|
[implementation] |
The number of the window associated with the event.
Definition at line 337 of file CPEvent.j.
The documentation for this class was generated from the following file: