Wt: Wt::WMouseEvent Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions
Wt::WMouseEvent Class Reference
Signal/slot system

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

`#include <Wt/WEvent>`

List of all members.

## Public Types
enum | Button { NoButton = 0, LeftButton = 1, MiddleButton = 2, RightButton = 4 }
| Enumeration for the mouse button. More...
typedef Wt::Coordinates | Coordinates
| Mouse coordinates.
## Public Member Functions
| WMouseEvent ()
| Default constructor.
Button | 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.
bool | altKey () const
| Returns whether the alt key is pressed (deprecated).
bool | metaKey () const
| Returns whether the meta key is pressed (deprecated).
bool | ctrlKey () const
| Returns whether the control key is pressed (deprecated).
bool | shiftKey () const
| Returns whether the shift key is pressed (deprecated).

## 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 Enumeration Documentation

enum Wt::WMouseEvent::Button

Enumeration for the mouse button.

Enumerator:

  NoButton | No button.
  LeftButton | Left button.
  MiddleButton | Middle button.
  RightButton | Right button.

## Member Function Documentation

bool Wt::WMouseEvent::altKey | ( |  | ) | const

Returns whether the alt key is pressed (deprecated).

Deprecated:
  Use modifiers() instead.

WMouseEvent::Button 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.

bool Wt::WMouseEvent::ctrlKey | ( |  | ) | const

Returns whether the control key is pressed (deprecated).

Deprecated:
  Use modifiers() instead.

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

Returns the distance over which the mouse has been dragged.

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

bool Wt::WMouseEvent::metaKey | ( |  | ) | const

Returns whether the meta key is pressed (deprecated).

Deprecated:
  Use modifiers() instead.

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

Returns keyboard modifiers.

The result is a logical OR of KeyboardModifier flags.

bool Wt::WMouseEvent::shiftKey | ( |  | ) | const

Returns whether the shift key is pressed (deprecated).

Deprecated:
  Use modifiers() instead.

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.

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

Returns the mouse position relative to the window.

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

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator