.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.MouseState:

==========================================================================================================================================
|phoenix_title|  **wx.MouseState**
==========================================================================================================================================

Represents the mouse state.          

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

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







         



.. seealso:: :ref:`wx.GetMouseState`, :ref:`wx.MouseEvent`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>MouseState</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.MouseState_inheritance.png" alt="Inheritance diagram of MouseState" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.MouseState.html" title="wx.MouseState" alt="" coords="13,83,131,112"/> <area shape="rect" id="node2" href="wx.KeyboardState.html" title="wx.KeyboardState" alt="" coords="4,5,139,35"/> </map> 
   </p>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.MouseEvent`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.MouseState.__init__`                                                  Default constructor.
:meth:`~wx.MouseState.Aux1IsDown`                                                Returns ``True`` if the first extra button mouse button is currently down.
:meth:`~wx.MouseState.Aux2IsDown`                                                Returns ``True`` if the second extra button mouse button is currently down.
:meth:`~wx.MouseState.GetPosition`                                               Returns the physical mouse position.
:meth:`~wx.MouseState.GetX`                                                      Returns X coordinate of the physical mouse event position.
:meth:`~wx.MouseState.GetY`                                                      Returns Y coordinate of the physical mouse event position.
:meth:`~wx.MouseState.LeftIsDown`                                                Returns ``True`` if the left mouse button is currently down.
:meth:`~wx.MouseState.MiddleIsDown`                                              Returns ``True`` if the middle mouse button is currently down.
:meth:`~wx.MouseState.RightIsDown`                                               Returns ``True`` if the right mouse button is currently down.
:meth:`~wx.MouseState.SetAux1Down`                                               
:meth:`~wx.MouseState.SetAux2Down`                                               
:meth:`~wx.MouseState.SetLeftDown`                                               
:meth:`~wx.MouseState.SetMiddleDown`                                             
:meth:`~wx.MouseState.SetPosition`                                               
:meth:`~wx.MouseState.SetRightDown`                                              
:meth:`~wx.MouseState.SetState`                                                  
:meth:`~wx.MouseState.SetX`                                                      
:meth:`~wx.MouseState.SetY`                                                      
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.MouseState.Position`                                                  See :meth:`~wx.MouseState.GetPosition` and :meth:`~wx.MouseState.SetPosition`
:attr:`~wx.MouseState.X`                                                         See :meth:`~wx.MouseState.GetX` and :meth:`~wx.MouseState.SetX`
:attr:`~wx.MouseState.Y`                                                         See :meth:`~wx.MouseState.GetY` and :meth:`~wx.MouseState.SetY`
:attr:`~wx.MouseState.aux1IsDown`                                                See :meth:`~wx.MouseState.Aux1IsDown` and :meth:`~wx.MouseState.SetAux1Down`
:attr:`~wx.MouseState.aux2IsDown`                                                See :meth:`~wx.MouseState.Aux2IsDown` and :meth:`~wx.MouseState.SetAux2Down`
:attr:`~wx.MouseState.leftIsDown`                                                See :meth:`~wx.MouseState.LeftIsDown` and :meth:`~wx.MouseState.SetLeftDown`
:attr:`~wx.MouseState.middleIsDown`                                              See :meth:`~wx.MouseState.MiddleIsDown` and :meth:`~wx.MouseState.SetMiddleDown`
:attr:`~wx.MouseState.rightIsDown`                                               See :meth:`~wx.MouseState.RightIsDown` and :meth:`~wx.MouseState.SetRightDown`
:attr:`~wx.MouseState.x`                                                         See :meth:`~wx.MouseState.GetX` and :meth:`~wx.MouseState.SetX`
:attr:`~wx.MouseState.y`                                                         See :meth:`~wx.MouseState.GetY` and :meth:`~wx.MouseState.SetY`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.MouseState(KeyboardState)

   **Possible constructors**::

       MouseState()
       
   
   Represents the mouse state.



   .. method:: __init__(self)

      Default constructor.                   





   .. method:: Aux1IsDown(self)

      Returns ``True`` if the first extra button mouse button is currently down.                  

      :rtype: `bool`








   .. method:: Aux2IsDown(self)

      Returns ``True`` if the second extra button mouse button is currently down.                  

      :rtype: `bool`








   .. method:: GetPosition(self)

      Returns the physical mouse position.                  

      :rtype: :ref:`wx.Point`








   .. method:: GetX(self)

      Returns X coordinate of the physical mouse event position.                  

      :rtype: :ref:`wx.Coord`








   .. method:: GetY(self)

      Returns Y coordinate of the physical mouse event position.                  

      :rtype: :ref:`wx.Coord`








   .. method:: LeftIsDown(self)

      Returns ``True`` if the left mouse button is currently down.                  

      :rtype: `bool`








   .. method:: MiddleIsDown(self)

      Returns ``True`` if the middle mouse button is currently down.                  

      :rtype: `bool`








   .. method:: RightIsDown(self)

      Returns ``True`` if the right mouse button is currently down.                  

      :rtype: `bool`








   .. method:: SetAux1Down(self, down)




      :param `down`: 
      :type `down`: bool







   .. method:: SetAux2Down(self, down)




      :param `down`: 
      :type `down`: bool







   .. method:: SetLeftDown(self, down)




      :param `down`: 
      :type `down`: bool







   .. method:: SetMiddleDown(self, down)




      :param `down`: 
      :type `down`: bool







   .. method:: SetPosition(self, pos)




      :param `pos`: 
      :type `pos`: wx.Point







   .. method:: SetRightDown(self, down)




      :param `down`: 
      :type `down`: bool







   .. method:: SetState(self, state)




      :param `state`: 
      :type `state`: wx.MouseState







   .. method:: SetX(self, x)




      :param `x`: 
      :type `x`: int







   .. method:: SetY(self, y)




      :param `y`: 
      :type `y`: int







   .. attribute:: Position

      See :meth:`~wx.MouseState.GetPosition` and :meth:`~wx.MouseState.SetPosition`


   .. attribute:: X

      See :meth:`~wx.MouseState.GetX` and :meth:`~wx.MouseState.SetX`


   .. attribute:: Y

      See :meth:`~wx.MouseState.GetY` and :meth:`~wx.MouseState.SetY`


   .. attribute:: aux1IsDown

      See :meth:`~wx.MouseState.Aux1IsDown` and :meth:`~wx.MouseState.SetAux1Down`


   .. attribute:: aux2IsDown

      See :meth:`~wx.MouseState.Aux2IsDown` and :meth:`~wx.MouseState.SetAux2Down`


   .. attribute:: leftIsDown

      See :meth:`~wx.MouseState.LeftIsDown` and :meth:`~wx.MouseState.SetLeftDown`


   .. attribute:: middleIsDown

      See :meth:`~wx.MouseState.MiddleIsDown` and :meth:`~wx.MouseState.SetMiddleDown`


   .. attribute:: rightIsDown

      See :meth:`~wx.MouseState.RightIsDown` and :meth:`~wx.MouseState.SetRightDown`


   .. attribute:: x

      See :meth:`~wx.MouseState.GetX` and :meth:`~wx.MouseState.SetX`


   .. attribute:: y

      See :meth:`~wx.MouseState.GetY` and :meth:`~wx.MouseState.SetY`

