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.
You can construct and destruct objects of this class.
![]() |
public:
virtual ~IMouseEvent()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
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.
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool isCtrlKeyDown() const
Returns true if the Ctrl key is down when the mouse event was generated.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool isShiftKeyDown() const
Returns true if the Shift key is down when the mouse event was generated.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
These members query the position of the mouse pointer. The position information is useful in determining what the user is interacting with.
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to determine the window that the mouse is interacting with.
![]() |
public:
virtual IWindowHandle windowUnderPointer() const
Returns the handle of the window that is under the mouse pointer.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
virtual ~IEvent()
IWindowHandle controlHandle() const
virtual IWindow* controlWindow() const
IEvent& decrementOwnerLevels()
virtual IWindow* dispatchingWindow() const
unsigned long eventId() const
IWindowHandle handle() const
IEvent( const IWindowHandle& handle, unsigned long eventId, const IEventParameter1& parameter1, const IEventParameter2& parameter2 )
IEvent( IWindow* window, unsigned long eventId, const IEventParameter1& parameter1, const IEventParameter2& parameter2 )
IEvent(const IEvent& event)
IEvent& operator =(const IEvent& event)
IEventParameter1 parameter1() const
IEventParameter2 parameter2() const
bool passToOwner() const
IEventResult result() const
IEvent& setControlHandle(const IWindowHandle& handle)
IEvent& setDispatchingHandle(const IWindowHandle& handle)
IEvent& setDispatchingWindow(IWindow* window)
IEvent& setHandle(const IWindowHandle& handle)
IEvent& setNumberOfLevels(int levels = - 1)
IEvent& setPassToOwner(bool passOn = true)
IEvent& setResult(const IEventResult& eventResult)
IEvent& setResult(bool eventResult)
virtual IWindow* window() const