Embed: (wiki syntax)

« Back to documentation index

GenericMouse Class Reference

GenericMouse Class Reference

Generic Mouse. More...

#include <GenericMouse.h>

Inherited by USBAbsMouse, USBAbsMouseKeyboard, USBMouse, and USBMouseKeyboard.

Public Member Functions

 GenericMouse ()
 Constructor for a Generic Mouse.
virtual bool update (int16_t x, int16_t y, uint8_t buttons, int8_t z)
 Update the state of the mouse.
bool move (int16_t x, int16_t y)
 Move the cursor to (x, y)
bool press (uint8_t button)
 Press one or several buttons.
bool release (uint8_t button)
 Release one or several buttons.
bool doubleClick ()
 Double click (MOUSE_LEFT)
bool click (uint8_t button)
 Click.
bool scroll (int8_t z)
 Scrolling.

Detailed Description

Generic Mouse.

This class is just an API to use in a child class. See USBMouse.h for instance for more information.

Definition at line 36 of file GenericMouse.h.


Constructor & Destructor Documentation

GenericMouse (  )

Constructor for a Generic Mouse.

Definition at line 42 of file GenericMouse.h.


Member Function Documentation

bool click ( uint8_t  button )

Click.

Parameters:
buttonstate of the buttons ( ex: clic(MOUSE_LEFT))
Returns:
true if there is no error, false otherwise

Definition at line 26 of file GenericMouse.c.

bool doubleClick (  )

Double click (MOUSE_LEFT)

Returns:
true if there is no error, false otherwise

Definition at line 19 of file GenericMouse.c.

bool move ( int16_t  x,
int16_t  y 
)

Move the cursor to (x, y)

Parameters:
xx-axis position (can be absolute or relative)
yy-axis position (can be absolute or relative)
Returns:
true if there is no error, false otherwise

Definition at line 10 of file GenericMouse.c.

bool press ( uint8_t  button )

Press one or several buttons.

Parameters:
buttonbutton state (ex: press(MOUSE_LEFT))
Returns:
true if there is no error, false otherwise

Definition at line 33 of file GenericMouse.c.

bool release ( uint8_t  button )

Release one or several buttons.

Parameters:
buttonbutton state (ex: release(MOUSE_LEFT))
Returns:
true if there is no error, false otherwise

Definition at line 38 of file GenericMouse.c.

bool scroll ( int8_t  z )

Scrolling.

Parameters:
zvalue of the wheel (>0 to go down, <0 to go up)
Returns:
true if there is no error, false otherwise

Definition at line 14 of file GenericMouse.c.

virtual bool update ( int16_t  x,
int16_t  y,
uint8_t  buttons,
int8_t  z 
) [virtual]

Update the state of the mouse.

Parameters:
xx-axis position (can be absolute or relative)
yy-axis position (can be absolute or relative)
buttonsbuttons state (first bit represents MOUSE_LEFT, second bit MOUSE_RIGHT and third bit MOUSE_MIDDLE)
zwheel state (>0 to scroll down, <0 to scroll up)
Returns:
true if there is no error, false otherwise

Reimplemented in USBAbsMouse, USBAbsMouseKeyboard, USBMouse, and USBMouseKeyboard.

Definition at line 53 of file GenericMouse.h.