I want to when I choose radio1 and press F2 (MosGetPos) ,the Gui can get the mosuse's x and y into the edit (x1,y1).
when I choose radio2 and press F2 (MosGetPos) , I also can get the information of mouse's and show it in the edit (x2,y2).
but it doesn't work as I excepted,how can I improve this script.
Code: Select all
Gui, Add, edit, vx1 ghotkey22
Gui, Add, edit, vy1 ghotkey22
Gui, Add, Radio , gHotkey22 ,Radio1
Gui, Add, edit, vx2 ghotkey33
Gui, Add, edit, vy2 ghotkey33
Gui, Add, Radio , gHotkey33, Radio2
Gui,show, w200 h200
F2::
{
CoordMode ,Mouse,Relative
MouseGetPos get_mousex, get_mousey
varx = %get_mousex%
vary = %get_mousey%
}
Hotkey22:
{
Gui,Submit,NoHide
GuiControl,,x1,%varx%
GuiControl,,y1,%vary%
return
}
Hotkey33:
{
Gui,Submit,NoHide
GuiControl,,x2,%varx%
GuiControl,,y2,%vary%
return
}