mirror of
https://github.com/QB64Official/qb64.git
synced 2024-08-30 16:30:15 +00:00
46 lines
1.8 KiB
Text
46 lines
1.8 KiB
Text
|
The '''_MOUSEMOVE''' statement moves the mouse pointer to a new position on the screen as determined by the column and row coordinates.
|
||
|
|
||
|
|
||
|
{{PageSyntax}}
|
||
|
:::'''_MOUSEMOVE ''column%'', ''row%'''''
|
||
|
|
||
|
|
||
|
{{Parameters}}
|
||
|
* [[INTEGER]] ''column'' is the horizontal pixel coordinate to place the mouse pointer and can be any value from 0 to [[_WIDTH (function)|_WIDTH]](0) - 1.
|
||
|
* [[INTEGER]] ''row'' is the vertical pixel position to place the mouse pointer and can be any value from 0 to [[_HEIGHT]](0) - 1
|
||
|
|
||
|
|
||
|
''Usage:''
|
||
|
* Maximum coordinate values are based on a program's current [[SCREEN]] mode resolution or the pixel size set by [[_NEWIMAGE]].
|
||
|
* [[SCREEN]] 0 uses text block coordinates. '''Coordinates off of the screen will create an "Illegal Function Call" [[ERROR Codes|ERROR]]!'''
|
||
|
* Can be used to position the pointer to a default dialog button or move the cursor away from a button so it is not clicked twice.
|
||
|
* Does NOT require [[_MOUSEINPUT]] to be used, but all moves will be remembered by it.
|
||
|
|
||
|
|
||
|
''Example:'' How to move the mouse cursor using remembered mouse movements. Press any key to quit.
|
||
|
{{CodeStart}}
|
||
|
i = {{Cl|_MOUSEINPUT}}
|
||
|
{{Cl|PRINT}}
|
||
|
{{Cl|INPUT}} "Move the mouse pointer and make a few clicks, then press Enter!", dummy$
|
||
|
{{Cl|_MOUSEMOVE}} 1, 1
|
||
|
DO
|
||
|
count = count + 1
|
||
|
i = {{Cl|_MOUSEINPUT}}
|
||
|
x = {{Cl|_MOUSEX}}: y = {{Cl|_MOUSEY}}
|
||
|
{{Cl|PRINT}} count, x, y, {{Cl|_MOUSEBUTTON}}(1)
|
||
|
{{Cl|_MOUSEMOVE}} x, y
|
||
|
{{Cl|_DELAY}} .05
|
||
|
{{Cl|LOOP}} {{Cl|UNTIL}} i = 0 {{Cl|OR (boolean)|OR}} {{Cl|INKEY$}} > ""
|
||
|
{{Cl|PRINT}} "Done!" '' ''
|
||
|
{{CodeEnd}}
|
||
|
: ''Explanation:'' The [[_MOUSEINPUT]] function will hold previous and _MOUSEMOVE events so press any key when you want to quit.
|
||
|
|
||
|
|
||
|
|
||
|
''See also:''
|
||
|
* [[_MOUSEX]], [[_MOUSEY]]
|
||
|
* [[_NEWIMAGE]], [[_SCREENIMAGE]]
|
||
|
* [[DECLARE LIBRARY|MouseMove]] {{text|(SDL Library Function)}}
|
||
|
|
||
|
|
||
|
{{PageNavigation}}
|