Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TInputDevice
Inherited By:
None.
Purpose:
Represents mouse device to mouse event handlers and stores the state of the mouse input device. This class is used primarily by mouse input frameworks, and secondarily by applications needing to get information from the mouse.
TMouseInputDevice creates and distributes the multibutton-aware mouse-down and up events from the event messages. This class also keeps the current button state information for all the buttons. Mouse buttons are always counted in a one-based manner. Buttons are numbered starting from 1 through n. Thus, the first mouse button is always 1 and not 0.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
TMouseInputDevice is rarely derived from.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
virtual ~ TMouseInputDevice ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TMouseInputDevice & operator =(const TMouseInputDevice & assign)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Call this function by using the operator in an assignment statement.
Parameters:
Return Value:
Returns a const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TStream & operator >>=(TStream & writeTo) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & writeTo -The stream the object streams itself out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TStream & operator <<= (TStream & readFrom)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & readFrom -The stream the object streams itself in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws a TInvalidVersionError if the version of the object on the stream is unknown to the version of the shared library installed.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMouseInputDevice::IsMouseButtonDown
- bool IsMouseButtonDown () const
- bool IsMouseButtonDown (const short buttonNumber) const
Interface Category:
API.
Purpose:
- Returns the current state of a mouse button.
- Returns the current state of the specified mouse button.
Calling Context:
- Call this function directly.
- Call this function directly.
Parameters:
- Takes no parameters.
- const short buttonNumber -A value which specifies a particular mouse button. Mouse button numbering is one-based and starts with 1, not 0.
Return Value:
Returns true if the button is pressed; false otherwise.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMouseInputDevice::SendEventFromMessage
virtual void SendEventFromMessage (TRandomAccessStream & message, TStandardEventReceiver & receiver, const TEventSynchronizer & sync)
Interface Category:
API.
Purpose:
Turns the specified message from the driver into an event and distributes that event to the system.
Calling Context:
Call this function directly.
Parameters:
- TRandomAccessStream & message -The message from which the event is to be created.
- TStandardEventReceiver & receiver -The receiver to which to send the new event.
- const TEventSynchronizer & sync -The event synchronizer that makes the event synchronous. This allows the device handler to block only for the amount of time it takes the client to process the event, thereby improving performance.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMouseInputDevice::UpdateInternalStateFromMessage
virtual void UpdateInternalStateFromMessage (TRandomAccessStream & message)
Interface Category:
API.
Purpose:
Updates the internal state of this object according to the contents of the specified stream.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMouseInputDevice::CreateInternalStateDelta
virtual void CreateInternalStateDelta (TRandomAccessStream & putDeltaHere) const
Interface Category:
API.
Purpose:
Streams this object's internal state into the specified stream.
Calling Context:
Call this function directly.
Parameters:
- TRandomAccessStream & putDeltaHere -The stream into which to write this object's internal state.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMouseInputDevice::UpdateInternalStateFromDelta
virtual void UpdateInternalStateFromDelta (TRandomAccessStream & delta)
Interface Category:
API.
Purpose:
Updates this object's internal state according to the contents of the specified stream.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMouseInputDevice::GetDefaultMouseInputDevice
- static const TMouseInputDevice * GetDefaultMouseInputDevice (const TEvent & forEvent)
- static const TMouseInputDevice * GetDefaultMouseInputDevice (TStandardEventReceiver & fromReceiver)
Interface Category:
API.
Purpose:
- Returns the default mouse input device for the specified event object.
- Returns the default mouse input device for the specified event receiver.
Calling Context:
- Call this function directly.
- Call this function directly.
Parameters:
- const TEvent & forEvent -The event for which to determine the mouse input device.
- TStandardEventReceiver & fromReceiver -The receiver for which to determine the mouse input device.
Return Value:
Returns the TMouseInputDevice appropriate for the input value.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMouseInputDevice::GetNumberOfButtons
virtual short GetNumberOfButtons () const
Interface Category:
API.
Purpose:
Returns the total number of buttons available on the mouse device. Mouse button numbering is one-based and starts with 1, not 0.
Calling Context:
Called when a button-down event is received from the mouse device.
Parameters:
Return Value:
Returns the number of buttons available on the mouse device.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
- TMouseInputDevice ()
- TMouseInputDevice (const TMouseInputDevice & copy)
Interface Category:
API.
Purpose:
- Default constructor.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- Called to copy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.