Class: TMouseInputDevice

Declaration: MouseInput.h

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.

Member Function: TMouseInputDevice::~TMouseInputDevice

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.

Member Function: TMouseInputDevice::operator=

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.

Member Function: TMouseInputDevice::operator>>=

virtual TStream & operator >>=(TStream & writeTo) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

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.

Member Function: TMouseInputDevice::operator<<=

virtual TStream & operator <<= (TStream & readFrom)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

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

  1. bool IsMouseButtonDown () const
  2. bool IsMouseButtonDown (const short buttonNumber) const

Interface Category:

API.

Purpose:

  1. Returns the current state of a mouse button.
  2. Returns the current state of the specified mouse button.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

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:

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:

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

  1. static const TMouseInputDevice * GetDefaultMouseInputDevice (const TEvent & forEvent)
  2. static const TMouseInputDevice * GetDefaultMouseInputDevice (TStandardEventReceiver & fromReceiver)

Interface Category:

API.

Purpose:

  1. Returns the default mouse input device for the specified event object.
  2. Returns the default mouse input device for the specified event receiver.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

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.

Member Function: TMouseInputDevice::TMouseInputDevice

  1. TMouseInputDevice ()
  2. TMouseInputDevice (const TMouseInputDevice & copy)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. 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.