Jump to content

Recommended Posts

  • 1 month later...
Posted

One mounth, 51 downloads (views?), and no comments? :)

:)

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

Hi,

seems to work quite fine! But I do not use OnEvent mode.

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

Posted

  Xenobiologist said:

seems to work quite fine!

Thanks.

  Xenobiologist said:

But I do not use OnEvent mode.

The UDF has nothing to do with OnEvent mode :) - you can use it with any mode :)

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

  MsCreatoR said:

Thanks.

The UDF has nothing to do with OnEvent mode :) - you can use it with any mode :)

:party: did just one short run and assumed the rest.

It is cool. This way, it is possible to add an option to BlockInput to just disable the mouse.

I tried this but it gets an error.

#include <MouseSetOnEvent_UDF.au3>
_blockInput()
ToolTip('MouseClicks is disabled')
Sleep(5000)
_blockInput(1)
ToolTip('MouseClicks is enabled')
Sleep(5000)

Func _blockInput($opt = 0)
    If $opt = 0 Then
        _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_do")
        _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "_do")
    Else
        _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT)
        _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT)
    EndIf
EndFunc   ;==>_blockInput

Func _do()
EndFunc

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

Posted

  Xenobiologist said:

:) did just one short run and assumed the rest.

It is cool. This way, it is possible to add an option to BlockInput to just disable the mouse.

I tried this but it gets an error.

Oops :) , the error is because i did a mistake when the array is Redimmed... just find in the UDF this line:

ReDim $aTmp_Mouse_Events[$aTmp_Mouse_Events[0][0]+1][0]

and replace last [0] by [4]

And nice example btw, i will include it into the archive, but i changed it a little(?)...

#include <MouseSetOnEvent_UDF.au3>

_BlockMouseClicksInput(0)

ToolTip('MouseClicks is disabled')
Sleep(3000)

_BlockMouseClicksInput(1)

ToolTip('MouseClicks is enabled')
Sleep(3000)

Func _BlockMouseClicksInput($iOpt=0)
    If $iOpt = 0 Then
        _MouseSetOnEvent($MOUSE_PRIMARYUP_EVENT, "__Dummy")
        _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "__Dummy")
        _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "__Dummy")
        _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "__Dummy")
    Else
        _MouseSetOnEvent($MOUSE_PRIMARYUP_EVENT)
        _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT)
        _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT)
        _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT)
    EndIf
EndFunc   ;==>_BlockMouseClicksInput

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

Updated first post:

CHANGELOG:

v1.1 [22.03.2008]

* Fixed: Incorrect ReDim when remove event from the array, it was causing UDF to crash script with error.

* Spell/Grammar corrections :)

* Added: An example of _BlockMouseClicksInput().

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

Hi,

thanks for credit.

That is what I meant. (example)

Blocking the mouse is really helpful sometimes!

Great!

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

Posted

  weaponx said:

Maybe the problem is that the title says "_MoseSetOnEvent"

The title of the topic and and the first post have a misspelling.

  • 2 weeks later...
Posted

Hi,

I tried to play around with the following script.

The intention is to demonstrate right mouse click in a specific application, say UltraEdit.

It is very simple, if you right mouse click (down/up) when UltraEdit is active, then a tooltip will be displayed.

If you right mouse click in another Window, it will perform normal right mouse click.

If middle mouse button is clicked, the application will exit.

I have two questions

1. what is the best way to make this program stay in memory to track mouse clicks until it is terminated?

sleep(2147483647) is a bad way I suppose, but for testing purpose, it is ok

another way is

while 1

wend

2. this is really annoying me

After this program exits, left mouse click is not able to activate other Window

Only after I press Alt+Tab to switch to other Window, left mouse click starts to work normally

Any inputs will be appreciated :)

#include <MouseSetOnEvent_UDF.au3>

_MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "RightMouseUp")
_MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "RightMouseDown")
_MouseSetOnEvent($MOUSE_WHELLUP_EVENT , "MiddleMouseUp")

sleep(2147483647)

Func RightMouseUp()
  If WinActive("UltraEdit") Then
    ToolTip("Right Mouse up")
  Else
    MouseUp("Right")
  EndIf
EndFunc

Func RightMouseDown()
  If WinActive("UltraEdit") Then
    ToolTip("Right Mouse down")
  Else
    MouseDown("Right")
  EndIf
EndFunc

Func MiddleMouseUp()
  _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT);Enable mouse button back.
  _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT);Enable mouse button back.
  _MouseSetOnEvent($MOUSE_WHELLUP_EVENT);Enable mouse button back.
  exit
EndFunc
Posted

First post updated:

v1.2 [05.04.2008]

* Added: [Optional] parameter $hTargetWnd, if set, the OnEvent function will be called only on $hTargetWnd window, otherwise will be standard Event processing.

Note: Can be a little(?) buggy when you mix different events :)

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

  Quote

what is the best way to make this program stay in memory to track mouse clicks until it is terminated?

sleep(2147483647) is a bad way I suppose

You can just set a loop:

While 1
   Sleep(10)
WEnd

:)

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted (edited)

I know it's an older topic, but this is one of the few UDF's posted lately that I actually needed to use in a project of mine.

Awesome UDF :)

EDIT: I may have found a possible bug (Unless this is intended behavior)

Try this code in SciTe:

#include <MouseSetOnEvent_UDF.au3>

_MouseSetOnEvent(516, "BlowUp")
Sleep(5000)
_MouseSetOnEvent(516)
Func BlowUp()
    MsgBox(0, "Kaboom", "You all die")
EndFunc

Now press the right mouse button. You see the MsgBox. Now when you exit the MsgBox, the context menu appears as if you pressed the button twice. Is this intended?

Edited by KentonBomb
Posted

Great udf!

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

  • 4 weeks later...
Posted

damn, i really want to use your udf !!!

but am i the only one who has problems ? i have got the "MouseSetOnEvent_UDF.au3", i tried it with v 3.2.8.1 and 3.2.10.0 and the latest beta, but i do not have the following functions:

- DllCallbackRegister

- DllCallbackGetPtr

- DllCallbackFree

and so on. so please where can i find these ? i've been searching the forum for hours, but there seems to be a problem with lots of functions with similar names.

thx

j.

  Reveal hidden contents

 

Posted

  jennico said:

damn, i really want to use your udf !!!

but am i the only one who has problems ? i have got the "MouseSetOnEvent_UDF.au3", i tried it with v 3.2.8.1 and 3.2.10.0 and the latest beta, but i do not have the following functions:

- DllCallbackRegister

- DllCallbackGetPtr

- DllCallbackFree

and so on. so please where can i find these ? i've been searching the forum for hours, but there seems to be a problem with lots of functions with similar names.

thx

j.

It requires Beta.

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
×
×
  • Create New...