Jump to content
Sign in to follow this  

MouseMove Help

Recommended Posts


Hi, i'm trying to make a short script that when the left mouse button is pressed the Y coords will change depending on what value they are set too.

I can move the mouse with just useing this

MouseMove($pos[0],$pos[1]+10, 5)

But as i'm wanting to eddit the value without having to keep altering the source it would be more uselfull.

Heres the code so far:

#include <Misc.au3>

Opt ("MouseCoordMode",2)

HotKeySet ("{ESC}","_ExitApp")

While 1
    $var1 = (100)   
    $pos = MouseGetPos()
    $End = ($var1 -1)
    If _IsPressed(0x01) Then
    MouseMove($pos[0],$pos[1]+$var1, 5)

Func _ExitApp()

I'm trying to make $var1 the variable to be changed when pressing the 'End' key. With ToolTip showing the current value. Any help would be much appreciated. I'm new to this and still learning, sorry for any crappy code.

Share this post

Link to post
Share on other sites


I am not altogether sure what you are trying to do - is this close? :unsure:

#include <GUIConstantsEx.au3>

Opt("MouseCoordMode", 2)

HotKeySet("{END}", "Inc_Var")

Global $var = 100

$hGUI = GUICreate("Test", 500, 500)

$hLabel = GUICtrlCreateLabel(100, 10, 10, 30, 20)


While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            $pos = MouseGetPos()
            MouseMove($pos[0], $pos[1] + $var, 5)
            Until GUIGetMsg() = $GUI_EVENT_PRIMARYUP


Func Inc_Var()
    $var -= 1
    GUICtrlSetData($hLabel, $var)
EndFunc   ;==>Inc_Var

If not, can you explain again or at least tell me why this is not correct. :>


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites

Almost what I was wanting :> With the code you provided I was able to finish it! Thank's a ton for your help! :unsure:

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this