Sign in to follow this  
Followers 0
mrjoli021

open textbox on mouse click

10 posts in this topic

I am looking for a way to open a text box on mouseclick.

Share this post


Link to post
Share on other sites



Check about _ispressed function in help file


----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Share this post


Link to post
Share on other sites

I several mouse positions and based on them I would like to display something diffrent.

Share this post


Link to post
Share on other sites

I several mouse positions and based on them I would like to display something diffrent.

Hi, mrjoli021. I believe you would have to put forth considerable effort to provide us with less information :)

Can you please explain in detail what you're trying to accomplish, and provide what you have thus far (even if it does not work).


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I want something like this. I have a map and need to make it as my wallpaper. When I click on certain cities, I would like to get a txt or msgbox to come up with more info on that city.

if MouseClick ( "left" , 373, 430, 1 ) Then
   MsgBox(4096, "Test", "This is a test", 10)
EndIf

Share this post


Link to post
Share on other sites

This is something that is quite easy to accomplish.

I suggest to try to solve it yourself, and try to break out of your usual routine

and providing lousy information, and not even trying anything except modifying

code handouts.

You know it makes sense and will be better for you, when you login with your next project.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

why is this shows up when I run the program, but when I click on position (373, 430) it does not show up

if MouseClick ( "left" , 373, 430, 1 ) = 1 then 
          ICG()
endif

Func ICG()
   ToolTip($account & @CRLF & $computer & @CRLF & $tvid & @CRLF & $ip,0, 0,"ICG Support Info:")
   Sleep(10000)
   ToolTip("")
EndFunc

Share this post


Link to post
Share on other sites

Because MouseClick Function Clicks the mouse at the coordinates you supply.

MouseClick returns non zero on success, so your function is called.

You should be looking at the functions

_IsPressed() ;can detect a mouseclick if called in a loop

MouseGetPos ; can return the position of the mouse at the time it is called.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Seems to me like you're thinking along the lines of Visual Studio programming where you can define events. AutoIt is a bit different in handling events...

#include <array.au3>
#include <guiconstants.au3>

GUICreate("test", 200, 200, -1, -1)
GUISetState(@SW_SHOW)

While 1
$msg = GUIGetMsg()
$aMouse = MouseGetPos() ; Remembers current mouse position

Select

Case $msg = $GUI_EVENT_PRIMARYDOWN
ConsoleWrite("Mouse Clicked at " & $aMouse[0] & "," & $aMouse[1] & @LF)

Case $msg = $GUI_EVENT_CLOSE
Exit

EndSelect
WEnd

What I've done here is told autoit to report in the console window where the mouse position is when the mouse is pressed. You can change it and add IF/THEN statements to perform functions on the x,y of the mouse position at the time of a click.

If this helps you, please post that it does. Thanks!

EDIT:

Had to add back the #includes as the forum stripped it out for some reason....

Also, I've read over some of the posts from others, and I must apologize for the way you've been spoken to. Not everyone in the tech world posesses soft skills.....

Edited by Colyn1337

Share this post


Link to post
Share on other sites

I belive I have a solution. I will get the mouse poistion and add +- 5 to it put thoose numbers into an array

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  
Followers 0