CUGL 2.3
Cornell University Game Library
|
#include <CUMouse.h>
Public Member Functions | |
ButtonState () | |
ButtonState (Uint32 state) | |
bool | hasLeft () const |
bool | hasMiddle () const |
bool | hasRight () const |
bool | hasX1 () const |
bool | hasX2 () const |
void | setLeft (bool value) |
void | setMiddle (bool value) |
void | setRight (bool value) |
void | setX1 (bool value) |
void | setX2 (bool value) |
ButtonState & | operator&= (ButtonState mouse) |
ButtonState & | operator|= (ButtonState mouse) |
ButtonState & | operator^= (ButtonState mouse) |
ButtonState & | operator-= (ButtonState mouse) |
const ButtonState | operator& (ButtonState mouse) const |
const ButtonState | operator| (ButtonState mouse) const |
const ButtonState | operator^ (ButtonState mouse) const |
const ButtonState | operator- (ButtonState mouse) const |
const ButtonState | operator~ () const |
Friends | |
class | MouseEvent |
This class is a bit vector representing a mouse and a set of mouse buttons
As this class is intended to be used as a bit set, it supports bit-wise operations for combining mouse states together.
The exact meaning of a ButtonState depends on the context. It could be a set of buttons held down. It could be a set of buttons recently released. It is simply a way to record a set of buttons.
|
inline |
Creates an empty mouse state with no buttons
|
inline |
Creates a mouse state from the given collection of masks.
state | A collection of SDL button masks. |
|
inline |
Returns true if this state has the left button included
|
inline |
Returns true if this state has the middle button included
|
inline |
Returns true if this state has the right button included
|
inline |
Returns true if this state has the first extra button included
This button only appears on mice that have four or more buttons. It is occasionally mapped to the scroll wheel buton.
|
inline |
Returns true if this state has the second extra button included
This button only appears on mice that have five or more buttons.
|
inline |
Returns the intersection of these buttons with those in mouse.
The new state will be equivalent to this one if mouse is a different device than this one. If they are the same, the new state will contain those buttons that are in both the state of this object and mouse.
mouse | The mouse state to interset with |
|
inline |
Assigns the intersection of these buttons with those in mouse.
This method will do nothing if mouse is a different device from this one. If the are the same, this mouse state will now contain those buttons that are in both the state this object and mouse.
mouse | The mouse state to interset with |
|
inline |
Returns the set difference of these buttons exluding those in mouse.
The new state will be equivalent to this one if mouse is a different device than this one. If they are the same, the new state will contain those buttons that are in this state of this object, but not in mouse.
mouse | The mouse state to exclude |
|
inline |
Assigns the set difference of these buttons exluding those in mouse.
This method will do nothing if mouse is a different device from this one. If the are the same, this mouse state will now contain those buttons that are in the state of this object, but not in mouse.
mouse | The mouse state to exclude |
|
inline |
Returns the symmetric difference of these buttons with those in mouse.
The new state will be equivalent to this one if mouse is a different device than this one. If they are the same, the new state will contain those buttons that are in either the state of this object or in mouse, but not in both.
mouse | The mouse state to symmetric difference with |
|
inline |
Assigns the symmetric difference of these buttons with those in mouse.
This method will do nothing if mouse is a different device from this one. If the are the same, this mouse state will now contain those buttons that are in either the state of this object or in mouse, but not in both.
mouse | The mouse state to symmetric difference with |
|
inline |
Returns the union of these buttons with those in mouse.
The new state will be equivalent to this one if mouse is a different device than this one. If they are the same, the new state will contain those buttons that are in either the state of this object or in mouse.
mouse | The mouse state to union with |
|
inline |
Assigns the union of these buttons with those in mouse.
This method will do nothing if mouse is a different device from this one. If the are the same, this mouse state will now contain those buttons that are in either the state of this object or in mouse.
mouse | The mouse state to union with |
|
inline |
Returns the complement of this set of buttons.
The new mouse state will contain those buttons that are not in the state of this object.
|
inline |
Sets whether this state has the left button included
value | Whether this state has the left button included |
|
inline |
Sets whether this state has the middle button included
value | Whether this state has the middle button included |
|
inline |
Sets whether this state has the right button included
value | Whether this state has the right button included |
|
inline |
Sets whether this state has the first extra button included
This button only appears on mice that have four or more buttons. It is occasionally mapped to the scroll wheel buton.
value | Whether this state has the first extra button included |
|
inline |
Sets whether this state has the second extra button included
This button only appears on mice that have five or more buttons.
value | Whether this state has the second extra button included |