Wt: Wt::WMouseEvent Class Reference

Wt 4.10.4

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Wt::WMouseEvent Class Reference
Signal/slot system

A class providing details for a mouse event. More...

`#include <Wt/WEvent.h>`

## Public Types
typedef MouseButton | Button
| Typedef for enum Wt::MouseButton.

## Public Member Functions
| WMouseEvent ()
| Default constructor.
MouseButton | button () const
| Returns the button.
WFlags< KeyboardModifier > | modifiers () const
| Returns keyboard modifiers.
Coordinates | document () const
| Returns the mouse position relative to the document.
Coordinates | window () const
| Returns the mouse position relative to the window.
Coordinates | screen () const
| Returns the mouse position relative to the screen.
Coordinates | widget () const
| Returns the mouse position relative to the widget.
Coordinates | dragDelta () const
| Returns the distance over which the mouse has been dragged.
int | wheelDelta () const
| Returns the scroll wheel delta.

## Detailed Description

A class providing details for a mouse event.

See also
  WInteractWidget::clicked(), WInteractWidget::doubleClicked(), WInteractWidget::mouseWentDown(), WInteractWidget::mouseWentUp(), WInteractWidget::mouseWentOver(), WInteractWidget::mouseMoved()

## Member Function Documentation

## ◆ button()

MouseButton Wt::WMouseEvent::button | ( |  | ) | const

Returns the button.

If multiple buttons are currently pressed for a mouse moved or mouse dragged event, then the one with the smallest numerical value is returned.

## ◆ dragDelta()

Coordinates Wt::WMouseEvent::dragDelta | ( |  | ) | const

Returns the distance over which the mouse has been dragged.

This is only defined for a WInteractWidget::mouseWentUp() event.

## ◆ modifiers()

WFlags< KeyboardModifier > Wt::WMouseEvent::modifiers | ( |  | ) | const

Returns keyboard modifiers.

The result is a logical OR of KeyboardModifier flags.

## ◆ wheelDelta()

int Wt::WMouseEvent::wheelDelta | ( |  | ) | const

Returns the scroll wheel delta.

This is 1 when wheel was scrolled up or -1 when wheel was scrolled down.

This is only defined for a WInteractWidget::mouseWheel() event.

## ◆ window()

Coordinates Wt::WMouseEvent::window | ( |  | ) | const

Returns the mouse position relative to the window.

This differs from documentX() only through scrolling through the document.