Difference between revisions of "83Plus:Software:usb8x/BASIC Interface/MouseDo"

From WikiTI
Jump to: navigation, search
(Notes: errTimeout)
m (Fixed all links)
 
Line 24: Line 24:
 
X and Y dimension movement are returned in a somewhat strange format.  If the number is between 1 and 127, the mouse was moved that many "ticks" to the right or down.  If the number is between 128 and 255, the mouse was moved 256 minus that many ticks to the left or up.  See the code example of details on how to convert these numbers to something that makes sense.
 
X and Y dimension movement are returned in a somewhat strange format.  If the number is between 1 and 127, the mouse was moved that many "ticks" to the right or down.  If the number is between 128 and 255, the mouse was moved 256 minus that many ticks to the left or up.  See the code example of details on how to convert these numbers to something that makes sense.
  
If no changes in the mouse are reported within a certain length of time, MouseDo will return with an error code of [[../../Error_Codes|errTimeout]].  This is not an unrecoverable error, just ignore the rest of the output list for this particular iteration.
+
If no changes in the mouse are reported within a certain length of time, MouseDo will return a [[83Plus:Software:usb8x/Error_Codes|Timeout]] error.  This is not an unrecoverable error, just ignore the rest of the output list for this particular iteration.
  
 
== Example ==
 
== Example ==
See the [[../../Sample_Code#Mouse_Demo|Sample Code]] page for an example of using MouseDo, and for how to convert the x/y dimension movement outputs into useful values.
+
See the [[83Plus:Software:usb8x/Sample_Code#Mouse_Demo|Sample Code]] page for an example of using MouseDo, and for how to convert the x/y dimension movement outputs into useful values.
  
 
== See Also ==
 
== See Also ==
[[../MouseInit|MouseInit]] - Initialize the mouse driver.
+
[[83Plus:Software:usb8x/BASIC_Interface/MouseInit|MouseInit]] - Initialize the mouse driver.

Latest revision as of 15:21, 9 November 2009

Synopsis

Name: MouseDo

Function Number: 3

Minimum usb8x version: 0.07

Gets movement and keypress information from the mouse driver.

Inputs

None

Outputs

  • 1: Error code
  • 2: Button presses
  • 3: X dimension movement
  • 4: Y dimension movement

Notes

Be sure to initialize the mouse driver before calling this entry point.

Each bit of the 2nd output represents one button. So if the left mouse button is pressed the returned value will be 1. If the right mouse button is pressed it will be 2. If both are pressed it will be 3. Etc.

X and Y dimension movement are returned in a somewhat strange format. If the number is between 1 and 127, the mouse was moved that many "ticks" to the right or down. If the number is between 128 and 255, the mouse was moved 256 minus that many ticks to the left or up. See the code example of details on how to convert these numbers to something that makes sense.

If no changes in the mouse are reported within a certain length of time, MouseDo will return a Timeout error. This is not an unrecoverable error, just ignore the rest of the output list for this particular iteration.

Example

See the Sample Code page for an example of using MouseDo, and for how to convert the x/y dimension movement outputs into useful values.

See Also

MouseInit - Initialize the mouse driver.