IMouseEvent

The IMouseEvent class represents a mouse-related event. IMouseHandler::dispatchHandlerEvent creates an object of this class to represent a mouse movement event. This class is also the base class for IMouseClickEvent.

You can use this event to query the location of the mouse pointer and the window under the mouse at the time the mouse event occurred. You can also query the keyboard state of the Alt key (on some keyboards, this is called the Menu key), the Ctrl (Control) key, and the Shift key at the time the mouse event occurred.


IMouseEvent - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


[view class]
~IMouseEvent
public:
virtual ~IMouseEvent()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IMouseEvent
public:
IMouseEvent(const IEvent& event)

Constructs an IMouseEvent object from the specified event. IMouseHandler::dispatchHandlerEvent constructs objects of this class from an object of the class IEvent and passes the resulting object to the function IMouseHandler::mouseMoved.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Keyboard State

You can query the keyboard state information at the time the mouse event was generated. This allows you to detect certain combinations of the keyboard and mouse, such as when the user presses mouse button 1 with the Alt key pressed.


[view class]
isAltKeyDown
public:
virtual bool isAltKeyDown() const

Returns true if the Alt key is down when the mouse event was generated. On some keyboards, this Alt key is called the Menu key.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isCtrlKeyDown
public:
virtual bool isCtrlKeyDown() const

Returns true if the Ctrl key is down when the mouse event was generated.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isShiftKeyDown
public:
virtual bool isShiftKeyDown() const

Returns true if the Shift key is down when the mouse event was generated.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Position

These members query the position of the mouse pointer. The position information is useful in determining what the user is interacting with.


[view class]
mousePosition
public:
virtual IPoint mousePosition() const

Returns the mouse pointer position relative to the window returned by IEvent::dispatchingWindow. The returned point is in application coordinates (see ICoordinateSystem for details).

If you need to obtain the mouse position relative to the desktop window, use the static function IWindow::mapPoint.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Window Information

Use these members to determine the window that the mouse is interacting with.


[view class]
windowUnderPointer
public:
virtual IWindowHandle windowUnderPointer() const

Returns the handle of the window that is under the mouse pointer.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IMouseEvent - Inherited Member Functions and Data

Inherited Public Functions

IEvent

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data