Apycom jQuery Menus

Class MouseCtrl Used to control user gesture (scrolling, clicks...) With this class, you can know if user try to click, double click, do a long press, scroll up/down or left/right. More...

#include <SDK_Manila_Sense.h>

Collaboration diagram for MouseCtrl:

List of all members.

Public Member Functions

 ~MouseCtrl (void)
ElementchangeMouseAnalyse (Element *e)
 used to change the element which will analyze the user gestures
int getMouseDX ()
 to get the speed of horizontal scrolling
double getMouseDXMean ()
 to get the mean speed of horizontal scrolling
int getMouseDY ()
 to get the speed of vertical scrolling
void getMousePosition (int &x, int &y)
 get the mouse position (update x and y)
ElementgiveControlBack ()
 This method is used by element when the control of interaction with user is no longer needed.
bool isClicked ()
 Get infos about mouse.
bool isDblClicked ()
 Get infos about mouse.
bool isMouseDown ()
 To know if left button of mouse is down.
bool isRightClicked () const
 Get infos about mouse.
bool isSelected ()
 To know if left button of mouse is down.
bool isSlidingLeft ()
 Get infos about mouse.
void leftBtnDown (int x, int y)
 used to emulate a left button down in (x,y).
void leftBtnMove (int x, int y)
 used to emulate a left button move in (x,y).
void leftBtnUp (int x, int y)
 used to emulate a left button up in (x,y).
bool pickChange ()
 This method is used know if user is trying to do something since the last time you use this method (contrary to MouseCtrl::sthgHasChange).
void rightBtnDown (int x, int y)
 used to emulate a right click in (x,y). A right click is a long press in rthe same position
void setClickSelected (bool val)
 used to emulate a left button movement
bool setMouseAnalyse (Element *e)
 used to set the main proc for mouse analyze (should not be used)
bool sthgHasChange ()
 Get infos about mouse.
void stopScroll ()
 When you want to stop the scrolling effect, use this method.
int updateElement ()
 This method is called before each frame to know what user has done.

Static Public Member Functions

static MouseCtrlgetInstance ()
 Use this method to obtain a valid pointer on MouseCtrl.

Detailed Description

Class MouseCtrl Used to control user gesture (scrolling, clicks...) With this class, you can know if user try to click, double click, do a long press, scroll up/down or left/right.

Definition at line 733 of file SDK_Manila_Sense.h.


Constructor & Destructor Documentation

MouseCtrl::~MouseCtrl ( void   ) 

Definition at line 43 of file MouseCtrl.cpp.


Member Function Documentation

Element * MouseCtrl::changeMouseAnalyse ( Element e  ) 

used to change the element which will analyze the user gestures

Parameters:
e new element which will be responsible of decision according to user gesture.
Returns:
previous element in charge of decision. Be careful to set back this value when you no longer need to capture user gestures

Definition at line 218 of file MouseCtrl.cpp.

MouseCtrl * MouseCtrl::getInstance (  )  [static]

Use this method to obtain a valid pointer on MouseCtrl.

Returns:
valid pointer

Definition at line 49 of file MouseCtrl.cpp.

int MouseCtrl::getMouseDX (  ) 

to get the speed of horizontal scrolling

Definition at line 288 of file MouseCtrl.cpp.

double MouseCtrl::getMouseDXMean (  ) 

to get the mean speed of horizontal scrolling

Definition at line 304 of file MouseCtrl.cpp.

int MouseCtrl::getMouseDY (  ) 

to get the speed of vertical scrolling

Definition at line 240 of file MouseCtrl.cpp.

void MouseCtrl::getMousePosition ( int &  x,
int &  y 
)

get the mouse position (update x and y)

Definition at line 349 of file MouseCtrl.cpp.

Element* MouseCtrl::giveControlBack (  )  [inline]

This method is used by element when the control of interaction with user is no longer needed.

Returns:
pointer of element which had control

Definition at line 784 of file SDK_Manila_Sense.h.

bool MouseCtrl::isClicked (  ) 

Get infos about mouse.

Returns:
True if user has done a left click

Definition at line 326 of file MouseCtrl.cpp.

bool MouseCtrl::isDblClicked (  ) 

Get infos about mouse.

Returns:
True if user has done a double click

Definition at line 338 of file MouseCtrl.cpp.

bool MouseCtrl::isMouseDown (  ) 

To know if left button of mouse is down.

Returns:
true until user release the button

Definition at line 334 of file MouseCtrl.cpp.

bool MouseCtrl::isRightClicked (  )  const [inline]

Get infos about mouse.

Returns:
True if user has done a right click. (A right click is a long press in the same position)

Definition at line 860 of file SDK_Manila_Sense.h.

bool MouseCtrl::isSelected (  ) 

To know if left button of mouse is down.

Returns:
true only during a single frame

Definition at line 323 of file MouseCtrl.cpp.

bool MouseCtrl::isSlidingLeft (  ) 

Get infos about mouse.

Returns:
True if user try to do a scrolling left

Definition at line 342 of file MouseCtrl.cpp.

void MouseCtrl::leftBtnDown ( int  x,
int  y 
)

used to emulate a left button down in (x,y).

Definition at line 84 of file MouseCtrl.cpp.

void MouseCtrl::leftBtnMove ( int  x,
int  y 
)

used to emulate a left button move in (x,y).

Definition at line 160 of file MouseCtrl.cpp.

void MouseCtrl::leftBtnUp ( int  x,
int  y 
)

used to emulate a left button up in (x,y).

Definition at line 116 of file MouseCtrl.cpp.

bool MouseCtrl::pickChange (  )  [inline]

This method is used know if user is trying to do something since the last time you use this method (contrary to MouseCtrl::sthgHasChange).

Returns:
true if user has done something...

Definition at line 823 of file SDK_Manila_Sense.h.

void MouseCtrl::rightBtnDown ( int  x,
int  y 
)

used to emulate a right click in (x,y). A right click is a long press in rthe same position

Definition at line 55 of file MouseCtrl.cpp.

void MouseCtrl::setClickSelected ( bool  val  )  [inline]

used to emulate a left button movement

Parameters:
val true if you want to emulate a button down, false else

Definition at line 808 of file SDK_Manila_Sense.h.

bool MouseCtrl::setMouseAnalyse ( Element e  ) 

used to set the main proc for mouse analyze (should not be used)

Returns:
true if set is valid

Definition at line 207 of file MouseCtrl.cpp.

bool MouseCtrl::sthgHasChange (  ) 

Get infos about mouse.

Returns:
true if something has change since the last frame (contrary to MouseCtrl::pickChange)

Definition at line 345 of file MouseCtrl.cpp.

void MouseCtrl::stopScroll (  ) 

When you want to stop the scrolling effect, use this method.

Definition at line 152 of file MouseCtrl.cpp.

int MouseCtrl::updateElement (  ) 

This method is called before each frame to know what user has done.

Returns:
in pixels, the scrolling in vertical direction

Definition at line 314 of file MouseCtrl.cpp.


The documentation for this class was generated from the following files:
Thibault LELORE