libs-gui/Documentation/gsdoc/NSEvent.html
Adam Fedor 8cd9572170 Version 0.7.9
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14167 72102866-910b-0410-8b05-ffd578937521
2002-07-17 14:06:33 +00:00

477 lines
22 KiB
HTML

<html>
<head>
<title>NSEvent</title>
</head>
<body>
<a href="Gui.html">Up</a>
<br />
<h1><a name="title$NSEvent">NSEvent</a></h1>
<h3>Authors</h3>
<dl>
<dt>Scott Christley(<a href="mailto:scottc@net-community.com"><code>
scottc@net-community.com
</code></a>)</dt>
<dd>
</dd>
<dt>Ovidiu Predescu(<a href="mailto:ovidiu@net-community.com"><code>
ovidiu@net-community.com
</code></a>)</dt>
<dd>
</dd>
<dt>Felipe A. Rodriguez(<a href="mailto:far@ix.netcom.com"><code>
far@ix.netcom.com
</code></a>)</dt>
<dd>
</dd>
</dl>
<blockquote>
The event class
</blockquote>
<p><b>Copyright:</b> (C) 1996 Free Software Foundation, Inc.</p>
<div>
<hr width="50%" align="left" />
<h3>Contents -</h3>
<ol>
<li>
<a href="#001000000000">Software documentation for the NSEvent class</a>
</li>
</ol>
<hr width="50%" align="left" />
</div>
<h1><a name="001000000000">
Software documentation for the NSEvent class
</a></h1>
<h2><a name="class$NSEvent">NSEvent</a> : <a rel="gsdoc" href="/usr/GNUstep-devel/System/Documentation/Base/NSObject.html#class$NSObject">NSObject</a></h2>
<blockquote>
<dl>
<dt><b>Declared in:</b></dt>
<dd>AppKit/NSEvent.h</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>Conforms to:</b></dt>
<dd><a rel="gsdoc" href="/usr/GNUstep-devel/System/Documentation/Base/NSObject.html#protocol$(NSCoding)">NSCoding</a></dd>
<dd><a rel="gsdoc" href="/usr/GNUstep-devel/System/Documentation/Base/NSObject.html#protocol$(NSCopying)">NSCopying</a></dd>
</dl>
</blockquote>
<blockquote>
<b>Standards:</b>
<ul>
<li>GNUstep</li>
<li>MacOS-X</li>
<li>OpenStep</li>
</ul>
</blockquote>
<p>
<em>Description forthcoming.</em>
</p>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent+enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:">+enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent+keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:">+keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent+mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:">+mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent+mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:buttonNumber:deltaX:deltaY:deltaZ:">+mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:buttonNumber:deltaX:deltaY:deltaZ:</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent+mouseLocation">+mouseLocation</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent+otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:">+otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent+startPeriodicEventsAfterDelay:withPeriod:">+startPeriodicEventsAfterDelay:withPeriod:</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent+stopPeriodicEvents">+stopPeriodicEvents</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-buttonNumber">-buttonNumber</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-characters">-characters</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-charactersIgnoringModifiers">-charactersIgnoringModifiers</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-clickCount">-clickCount</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-context">-context</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-data1">-data1</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-data2">-data2</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-deltaX">-deltaX</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-deltaY">-deltaY</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-deltaZ">-deltaZ</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-eventNumber">-eventNumber</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-isARepeat">-isARepeat</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-keyCode">-keyCode</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-locationInWindow">-locationInWindow</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-modifierFlags">-modifierFlags</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-pressure">-pressure</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-subtype">-subtype</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-timestamp">-timestamp</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-trackingNumber">-trackingNumber</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-type">-type</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-userData">-userData</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-window">-window</a></li>
<li><a rel="gsdoc" href="NSEvent.html#method$NSEvent-windowNumber">-windowNumber</a></li>
</ul>
<hr width="50%" align="left" />
<h3><a name="method$NSEvent+enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:">enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:</a></h3>
+ (<a rel="gsdoc" href="#class$NSEvent">NSEvent</a>*) <b>enterExitEventWithType:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSEventType">NSEventType</a>)type<b> location:</b> (NSPoint)location<b> modifierFlags:</b> (unsigned int)flags<b> timestamp:</b> (NSTimeInterval)time<b> windowNumber:</b> (int)windowNum<b> context:</b> (<a rel="gsdoc" href="NSGraphicsContext.html#class$NSGraphicsContext">NSGraphicsContext</a>*)context<b> eventNumber:</b> (int)eventNum<b> trackingNumber:</b> (int)trackingNum<b> userData:</b> (void*)userData;<br />
<p>
<em>Description forthcoming.</em>
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent+keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:">keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:</a></h3>
+ (<a rel="gsdoc" href="#class$NSEvent">NSEvent</a>*) <b>keyEventWithType:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSEventType">NSEventType</a>)type<b> location:</b> (NSPoint)location<b> modifierFlags:</b> (unsigned int)flags<b> timestamp:</b> (NSTimeInterval)time<b> windowNumber:</b> (int)windowNum<b> context:</b> (<a rel="gsdoc" href="NSGraphicsContext.html#class$NSGraphicsContext">NSGraphicsContext</a>*)context<b> characters:</b> (<a rel="gsdoc" href="/usr/GNUstep-devel/System/Documentation/Base/NSString.html#class$NSString">NSString</a>*)keys<b> charactersIgnoringModifiers:</b> (<a rel="gsdoc" href="/usr/GNUstep-devel/System/Documentation/Base/NSString.html#class$NSString">NSString</a>*)ukeys<b> isARepeat:</b> (BOOL)repeatKey<b> keyCode:</b> (unsigned short)code;<br />
<p>
<em>Description forthcoming.</em>
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent+mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:">mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:</a></h3>
+ (<a rel="gsdoc" href="#class$NSEvent">NSEvent</a>*) <b>mouseEventWithType:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSEventType">NSEventType</a>)type<b> location:</b> (NSPoint)location<b> modifierFlags:</b> (unsigned int)flags<b> timestamp:</b> (NSTimeInterval)time<b> windowNumber:</b> (int)windowNum<b> context:</b> (<a rel="gsdoc" href="NSGraphicsContext.html#class$NSGraphicsContext">NSGraphicsContext</a>*)context<b> eventNumber:</b> (int)eventNum<b> clickCount:</b> (int)clickNum<b> pressure:</b> (float)pressureValue;<br />
<p>
<em>Description forthcoming.</em>
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent+mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:buttonNumber:deltaX:deltaY:deltaZ:">mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:buttonNumber:deltaX:deltaY:deltaZ:</a></h3>
+ (<a rel="gsdoc" href="#class$NSEvent">NSEvent</a>*) <b>mouseEventWithType:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSEventType">NSEventType</a>)type<b> location:</b> (NSPoint)location<b> modifierFlags:</b> (unsigned int)flags<b> timestamp:</b> (NSTimeInterval)time<b> windowNumber:</b> (int)windowNum<b> context:</b> (<a rel="gsdoc" href="NSGraphicsContext.html#class$NSGraphicsContext">NSGraphicsContext</a>*)context<b> eventNumber:</b> (int)eventNum<b> clickCount:</b> (int)clickNum<b> pressure:</b> (float)pressureValue<b> buttonNumber:</b> (int)buttonNum<b> deltaX:</b> (float)deltaX<b> deltaY:</b> (float)deltaY<b> deltaZ:</b> (float)deltaZ;<br />
<p>
<em>Description forthcoming.</em>
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent+mouseLocation">mouseLocation</a></h3>
+ (NSPoint) <b>mouseLocation</b>;<br />
<p>
Returns the current mouse location.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent+otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:">otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:</a></h3>
+ (<a rel="gsdoc" href="#class$NSEvent">NSEvent</a>*) <b>otherEventWithType:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSEventType">NSEventType</a>)type<b> location:</b> (NSPoint)location<b> modifierFlags:</b> (unsigned int)flags<b> timestamp:</b> (NSTimeInterval)time<b> windowNumber:</b> (int)windowNum<b> context:</b> (<a rel="gsdoc" href="NSGraphicsContext.html#class$NSGraphicsContext">NSGraphicsContext</a>*)context<b> subtype:</b> (short)subType<b> data1:</b> (int)data1<b> data2:</b> (int)data2;<br />
<p>
<em>Description forthcoming.</em>
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent+startPeriodicEventsAfterDelay:withPeriod:">startPeriodicEventsAfterDelay:withPeriod:</a></h3>
+ (void) <b>startPeriodicEventsAfterDelay:</b> (NSTimeInterval)delaySeconds<b> withPeriod:</b> (NSTimeInterval)periodSeconds;<br />
<p>
<em>Description forthcoming.</em>
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent+stopPeriodicEvents">stopPeriodicEvents</a></h3>
+ (void) <b>stopPeriodicEvents</b>;<br />
<p>
<em>Description forthcoming.</em>
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-buttonNumber">buttonNumber</a></h3>
- (int) <b>buttonNumber</b>;<br />
<p>
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.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-characters">characters</a></h3>
- (<a rel="gsdoc" href="/usr/GNUstep-devel/System/Documentation/Base/NSString.html#class$NSString">NSString</a>*) <b>characters</b>;<br />
<p>
Returns the string of characters for a keyboard
event. <br /> Raises an
NSInternalInconsistencyException
if applied to any other type of event.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-charactersIgnoringModifiers">charactersIgnoringModifiers</a></h3>
- (<a rel="gsdoc" href="/usr/GNUstep-devel/System/Documentation/Base/NSString.html#class$NSString">NSString</a>*) <b>charactersIgnoringModifiers</b>;<br />
<p>
Returns the string of characters for a keyboard
event, as if no modifier keys had been pressed when
the keyboard event occirred. <br /> Raises an
NSInternalInconsistencyException
if applied to any other type of event.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-clickCount">clickCount</a></h3>
- (int) <b>clickCount</b>;<br />
<p>
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.
<br /> Raises an NSInternalInconsistencyException if
applied to any other type of event.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-context">context</a></h3>
- (<a rel="gsdoc" href="NSGraphicsContext.html#class$NSGraphicsContext">NSGraphicsContext</a>*) <b>context</b>;<br />
<p>
Returns the graphics context for which this event
was generated.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-data1">data1</a></h3>
- (int) <b>data1</b>;<br />
<p>
Returns the 'data1' item associated with the event.
<br /> Raises NSInternalInconsistencyException if
the event is not of type NSAppKitDefined,
NSSystemDefined, NSApplicationDefined, or
NSPeriodic
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-data2">data2</a></h3>
- (int) <b>data2</b>;<br />
<p>
Returns the 'data2' item associated with the event.
<br /> Raises NSInternalInconsistencyException if
the event is not of type NSAppKitDefined,
NSSystemDefined, NSApplicationDefined, or
NSPeriodic
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-deltaX">deltaX</a></h3>
- (float) <b>deltaX</b>;<br />
<p>
</p>
<p>
Returns the movement of the mouse on the X axis. </p>
<p>
</p>
<p>
This method is only valid for NSMouseMoved,
NS*MouseDragged and NSScrollWheel events,
otherwise it will raise an
NSInternalInconsistencyException.
</p>
<p>
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-deltaY">deltaY</a></h3>
- (float) <b>deltaY</b>;<br />
<p>
</p>
<p>
Returns the movement of the mouse on the Y axis. </p>
<p>
</p>
<p>
This method is only valid for NSMouseMoved,
NS*MouseDragged and NSScrollWheel events,
otherwise it will raise an
NSInternalInconsistencyException.
</p>
<p>
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-deltaZ">deltaZ</a></h3>
- (float) <b>deltaZ</b>;<br />
<p>
</p>
<p>
Returns the movement of the mouse on the Z axis. </p>
<p>
</p>
<p>
This method is only valid for NSMouseMoved,
NS*MouseDragged and NSScrollWheel events,
otherwise it will raise an
NSInternalInconsistencyException.
</p>
<p>
</p>
<p>
The value returned is 0.0 in most cases. </p>
<p>
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-eventNumber">eventNumber</a></h3>
- (int) <b>eventNumber</b>;<br />
<p>
Returns the event number associated with any mouse
event or tracking event. Event numbers are allocated
sequentially when the system creates these
events. <br /> Raises an
NSInternalInconsistencyException
if applied to any other type of event.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-isARepeat">isARepeat</a></h3>
- (BOOL) <b>isARepeat</b>;<br />
<p>
Returns a flag to say if this is a keyboard repeat
event. <br /> Raises an
NSInternalInconsistencyException
if applied to any other type of event than an NSKeyUp or
NSKeyDown.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-keyCode">keyCode</a></h3>
- (unsigned short) <b>keyCode</b>;<br />
<p>
Returns the numeric key code of a keyboard event.
<br /> Raises an NSInternalInconsistencyException if
applied to any other type of event than an NSKeyUp
or NSKeyDown.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-locationInWindow">locationInWindow</a></h3>
- (NSPoint) <b>locationInWindow</b>;<br />
<p>
Returns the window location for which this event
was generated (in the base coordinate system of the
window).
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-modifierFlags">modifierFlags</a></h3>
- (unsigned int) <b>modifierFlags</b>;<br />
<p>
Returns the modifier flag bits associated with the
event.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-pressure">pressure</a></h3>
- (float) <b>pressure</b>;<br />
<p>
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.
<br /> Raises an NSInternalInconsistencyException if
applied to any other type of event than a mouse
event.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-subtype">subtype</a></h3>
- (short) <b>subtype</b>;<br />
<p>
Returns the 'subtype' item associated with the
event. <br /> Raises
NSInternalInconsistencyException
if the event is not of type NSAppKitDefined,
NSSystemDefined, NSApplicationDefined, or
NSPeriodic
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-timestamp">timestamp</a></h3>
- (NSTimeInterval) <b>timestamp</b>;<br />
<p>
Returns the time interval since system startup at
which this event was generated.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-trackingNumber">trackingNumber</a></h3>
- (int) <b>trackingNumber</b>;<br />
<p>
Returns a number identifying the tracking rectangle
entered or exited. <br /> Raises an
NSInternalInconsistencyException
if applied to any other type of event than a mouse
entered or exited event.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-type">type</a></h3>
- (<a rel="gsdoc" href="TypesAndConstants.html#type$NSEventType">NSEventType</a>) <b>type</b>;<br />
<p>
returns the type of this event.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-userData">userData</a></h3>
- (void*) <b>userData</b>;<br />
<p>
Returns usder data associated with a tracking
event... the data assigned to the tracking
rectangle concerned when it was created.. <br />
Raises an NSInternalInconsistencyException if
applied to any other type of event than a mouse
entered or exited event.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-window">window</a></h3>
- (<a rel="gsdoc" href="NSWindow.html#class$NSWindow">NSWindow</a>*) <b>window</b>;<br />
<p>
Returns the window for which this event was
generated. <br /> Periodic events have no
associated window, and you should not call this
method for those events.
</p>
<hr width="25%" align="left" />
<h3><a name="method$NSEvent-windowNumber">windowNumber</a></h3>
- (int) <b>windowNumber</b>;<br />
<p>
Returns the window number of the window for which
this event was generated. <br /> Periodic events have
no associated window, and you should not call this
method for those events.
</p>
<hr width="25%" align="left" />
<br />
<a href="Gui.html">Up</a>
</body>
</html>