Download Chameleon AVR User Manual Ver 1 ().
Transcript
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon AVR 8-Bit”
Mouse Reading
int Mouse_Read(gid_event_ptr mouse);
Reads the mouse message.
25.3 API Functional Declarations
The following lists each function, a description, comments, and example usage of the function.
_________________________________________________________________________________________________
Function Prototype:
int Mouse_Load(void);
Description:
Example(s):
Mouse_Load() loads the mouse driver up on a free Propeller core. If the driver is already loaded this
function has no effect. Returns 1.
Load the mouse driver.
Mouse_Load();
_________________________________________________________________________________________________
Function Prototype:
int Mouse_Unload(void);
Description:
Example(s):
Mouse_Unload() unloads the mouse driver freeing a core on the Propeller. Typically, you will do this
when you want to load the keyboard driver. Returns 1.
Load the mouse driver.
Mouse_Load();
_________________________________________________________________________________________________
Function Prototype:
int Mouse_Read(gid_event_ptr mouse);
Description:
Example(s):
Mouse_Read(…) reads the current mouse event from the driver. In this case, it only reads “relative”
events and thus the data is in delta format. You send a pointer to a gid_event structure and the function
will write the latest mouse deltas and button states into the structure. Returns 1.
Read the mouse position and test if left button is down.
gid_event mouse;
Mouse_Read(&mouse);
// test bit 3, left button?
if (mouse.buttons & (0b01000))
{
// do stuff…
} // end if
202