| Version: 3.3.1

Public Member Functions | List of all members
wxMouseState Class Reference
Class List by Category » Events

`#include <wx/mousestate.h>`

Inheritance diagram for wxMouseState:
[legend]

## Detailed Description

Represents the mouse state.

This class is used as a base class by wxMouseEvent and so its methods may be used to obtain information about the mouse state for the mouse events. It also inherits from wxKeyboardState and so carries information about the keyboard state and not only the mouse one.

This class is implemented entirely inline in <wx/mousestate.h> and thus has no linking requirements.

##

Library: None; this class implementation is entirely header-based.
Category: Events

See also
  wxGetMouseState(), wxMouseEvent

## Public Member Functions
| wxMouseState ()
| Default constructor. More...
wxCoord | GetX () const
| Returns X coordinate of the physical mouse event position. More...
wxCoord | GetY () const
| Returns Y coordinate of the physical mouse event position. More...
bool | LeftIsDown () const
| Returns true if the left mouse button is currently down. More...
bool | MiddleIsDown () const
| Returns true if the middle mouse button is currently down. More...
bool | RightIsDown () const
| Returns true if the right mouse button is currently down. More...
bool | Aux1IsDown () const
| Returns true if the first extra button mouse button is currently down. More...
bool | Aux2IsDown () const
| Returns true if the second extra button mouse button is currently down. More...
void | SetX (wxCoord x)
void | SetY (wxCoord y)
void | SetPosition (const wxPoint &pos)
void | SetLeftDown (bool down)
void | SetMiddleDown (bool down)
void | SetRightDown (bool down)
void | SetAux1Down (bool down)
void | SetAux2Down (bool down)
void | SetState (const wxMouseState &state)
wxPoint | GetPosition () const
| Returns the physical mouse position. More...
void | GetPosition (int *x, int *y) const
| Returns the physical mouse position. More...
Public Member Functions inherited from wxKeyboardState
| wxKeyboardState (bool controlDown=false, bool shiftDown=false, bool altDown=false, bool metaDown=false)
| Constructor initializes the modifier key settings. More...
int | GetModifiers () const
| Return the bit mask of all pressed modifier keys. More...
bool | HasAnyModifiers () const
| Returns true if any modifiers at all are pressed. More...
bool | HasModifiers () const
| Returns true if Control or Alt are pressed. More...
bool | ControlDown () const
| Returns true if the Control key or Apple/Command key under macOS is pressed. More...
bool | RawControlDown () const
| Returns true if the Control key (also under macOS). More...
bool | ShiftDown () const
| Returns true if the Shift key is pressed. More...
bool | MetaDown () const
| Returns true if the Meta/Windows/Apple key is pressed. More...
bool | AltDown () const
| Returns true if the Alt key is pressed. More...
bool | CmdDown () const
| Returns true if the key used for command accelerators is pressed. More...
void | SetControlDown (bool down)
void | SetRawControlDown (bool down)
void | SetShiftDown (bool down)
void | SetAltDown (bool down)
void | SetMetaDown (bool down)

## Constructor & Destructor Documentation

## ◆ wxMouseState()

wxMouseState::wxMouseState | ( |  | ) |

Default constructor.

## Member Function Documentation

## ◆ Aux1IsDown()

bool wxMouseState::Aux1IsDown | ( |  | ) | const

Returns true if the first extra button mouse button is currently down.

## ◆ Aux2IsDown()

bool wxMouseState::Aux2IsDown | ( |  | ) | const

Returns true if the second extra button mouse button is currently down.

## ◆ GetPosition() [1/2]

wxPoint wxMouseState::GetPosition | ( |  | ) | const

Returns the physical mouse position.

## ◆ GetPosition() [2/2]

void wxMouseState::GetPosition | ( | int * | x,
|  | int * | y
| ) |  | const

Returns the physical mouse position.

## ◆ GetX()

wxCoord wxMouseState::GetX | ( |  | ) | const

Returns X coordinate of the physical mouse event position.

## ◆ GetY()

wxCoord wxMouseState::GetY | ( |  | ) | const

Returns Y coordinate of the physical mouse event position.

## ◆ LeftIsDown()

bool wxMouseState::LeftIsDown | ( |  | ) | const

Returns true if the left mouse button is currently down.

## ◆ MiddleIsDown()

bool wxMouseState::MiddleIsDown | ( |  | ) | const

Returns true if the middle mouse button is currently down.

## ◆ RightIsDown()

bool wxMouseState::RightIsDown | ( |  | ) | const

Returns true if the right mouse button is currently down.

## ◆ SetAux1Down()

void wxMouseState::SetAux1Down | ( | bool | down | ) |

## ◆ SetAux2Down()

void wxMouseState::SetAux2Down | ( | bool | down | ) |

## ◆ SetLeftDown()

void wxMouseState::SetLeftDown | ( | bool | down | ) |

## ◆ SetMiddleDown()

void wxMouseState::SetMiddleDown | ( | bool | down | ) |

## ◆ SetPosition()

void wxMouseState::SetPosition | ( | const wxPoint & | pos | ) |

## ◆ SetRightDown()

void wxMouseState::SetRightDown | ( | bool | down | ) |

## ◆ SetState()

void wxMouseState::SetState | ( | const wxMouseState & | state | ) |

## ◆ SetX()

void wxMouseState::SetX | ( | wxCoord | x | ) |

## ◆ SetY()

void wxMouseState::SetY | ( | wxCoord | y | ) |