Jump to content
Sign in to follow this  
jaenster

MouseClick detecting ?

Recommended Posts

jaenster

Can you detect if there is pressed a mousebutton ? No or yes ?


-jaenster

Share this post


Link to post
Share on other sites
jaenster

Can you tell me how ? ^^


-jaenster

Share this post


Link to post
Share on other sites
greenmachine

Should have asked that question in the first post.

I could do it several ways. HotkeySet is one, _ispressed is another. Those are the simplest ways.

Share this post


Link to post
Share on other sites
The Kandie Man

First, to use the _Ispressed you have to have the latest beta which you can find under the downloads section.

This is in the help file:

01 Left mouse button

02 Right mouse button

04 Middle mouse button (three-button mouse)

#Include <Misc.au3>

While 1

If _IsPressed(02) Then Msgbox(0,"Pressed","The second mouse button was pressed.")

sleep(50)

Wend

I hope this helps.


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites
jaenster

no :S

This error

d:\jan\autoitbackup\Include\Misc.au3 (64) : ==> Unknown function name.: 
Local $p = DllStructCreate ($struct) 
Local $p = ^ ERROR

-jaenster

Share this post


Link to post
Share on other sites
Richard Robertson

Can no one use complete sentances?

Share this post


Link to post
Share on other sites
greenmachine

I don't think jaenster knows english very well. It's obviously not his primary language, because he really can't use it.

The rest of us did use complete sentences.

Share this post


Link to post
Share on other sites
NicoTn

nl 2 tha bone :lmao:


while 1
     If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe")
wend
[size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]

Share this post


Link to post
Share on other sites
smellystudent

I could do it several ways. HotkeySet is one

I'm trying to capture a mouseclick using HotkeySet.

What 'key' will allow it to register a mouseclick?

Share this post


Link to post
Share on other sites
jaenster

None , use that , it works


-jaenster

Share this post


Link to post
Share on other sites
Xenobiologist

I'm trying to capture a mouseclick using HotkeySet.

What 'key' will allow it to register a mouseclick

Hi and welcome,

you should use _isPressed()

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    If _IsPressed("23", $dll) Then
        MsgBox(0,"_IsPressed", "End Key Pressed")
        ExitLoop
    EndIf
WEnd
DllClose($dll)

01 Left mouse button

02 Right mouse button

04 Middle mouse button (three-button mouse)

05 Windows 2000/XP: X1 mouse button

06 Windows 2000/XP: X2 mouse button

Hope that helps...

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
greenmachine

I'm trying to capture a mouseclick using HotkeySet.

What 'key' will allow it to register a mouseclick?

I might have been wrong with HotKeySet and mouse clicks.... I think I had the $GUI_EVENT_PRIMARYDOWN in mind. Using that constant in a gui will send an event message when the primary mouse button is clicked.

Anyway, as stated above, _ispressed() will do the job.

Share this post


Link to post
Share on other sites
smellystudent

Thanks for all the replies; after realising that I was still using the release version rather than the beta, I got _IsPressed working nicely.

Share this post


Link to post
Share on other sites
jaenster

how you detect mouse 5 ?


-jaenster

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.