#include <CMouseSimple.h>
Public Types | |
enum | |
Public Member Functions | |
CMouseSimple () | |
~CMouseSimple () | |
int | GetNumButtons (void) const |
Get the number of buttons on the mouse. | |
bool | GetButton (int button) |
Get the state of a button. | |
bool | SetButton (int button, bool state) |
Set the statet of a button. | |
int | GetMouseXi (void) const |
Get mouse X coord as an int in screen space. | |
int | GetMouseYi (void) const |
Get mouse Y coord as an int in screen space. | |
float | GetMouseXf (void) const |
Get mouse X coord as a float in screen space. | |
float | GetMouseYf (void) const |
Get mouse Y coord as a float in screen space. | |
void | SetMouseXY (int x, int y) |
Set mouse screen coordinate (from GLUT function). | |
int | GetDragTime (int button) |
Get the length of time a mouse button has been down. | |
bool | ButtonClick (int button) |
Check if a button has just been clicked. | |
void | UnClickButton (int button) |
Reset a clicked button. | |
void | SetLimitRegion (int x1, int y1, int x2, int y2) |
Set a region to limit the mouse into. | |
bool | LimitMouseToRegion (void) |
Limit the mouse to a previously set limit region. | |
void | SetScreenSize (int w, int h) |
Set the screen size, required for float value calculations. |
This mouse class is really only used as a data collection point for GLUT functions. Only mouse position and button states are stored here, along with some timing for drags and such... Created from InitGL() and written to by the glutMotion...() functions, read by any class or object that needs to.
Definition at line 58 of file CMouseSimple.h.
|
Enumeration for some default mouse buttons. Values are assumed to be correct. Definition at line 65 of file CMouseSimple.h. |
|
Create a simple mouse object. Query GLUT for the number of buttons on the mouse and allocate button states. Determine number of buttons, and allocate bool flags for these. Fix for Mac single button: Add 1 to the reported number of mouse buttons so that the CTRL key correctly gives a mouse button 2. Set Default screen or window size. Set all buttons to off now. Definition at line 104 of file CMouseSimple.cpp. References SetLimitRegion(), SetMouseXY(), and SetScreenSize(). |
Here is the call graph for this function:
|
Destructor. Definition at line 135 of file CMouseSimple.cpp. |
|
Check if a button has just been clicked. Check if a button has been clicked.
Definition at line 254 of file CMouseSimple.cpp. |
|
Get the state of a button. Get a button's state.
Definition at line 151 of file CMouseSimple.cpp. |
|
Get the length of time a mouse button has been down. Check if drag has occured.
Definition at line 232 of file CMouseSimple.cpp. |
|
Limit the mouse to a previously set limit region. "Clip" the mouse to inside the limit region.
Definition at line 309 of file CMouseSimple.cpp. References SetMouseXY(). |
Here is the call graph for this function:
|
Set the statet of a button. Set a button's state.
Definition at line 169 of file CMouseSimple.cpp. |
|
Set a region to limit the mouse into. Set the limited region directly, using ints.
Definition at line 292 of file CMouseSimple.cpp. Referenced by CMouseSimple(). |
|
Set mouse screen coordinate (from GLUT function). Set the mouse position (data only).
Definition at line 197 of file CMouseSimple.cpp. Referenced by CMouseSimple(), and LimitMouseToRegion(). |
|
Set the screen size, required for float value calculations. Set the screen size, this MUST ABSOLUTELY BE DONE BEFORE THE MOUSE OBJECT IS USED!.
Definition at line 214 of file CMouseSimple.cpp. Referenced by CMouseSimple(). |
|
Reset a clicked button. Reset a button's drag timer.
Definition at line 275 of file CMouseSimple.cpp. |