Jump to content

Recommended Posts

Posted

in the UDF header comment MRCreator Mentions

4) When using obfuscator, make sure to add event functions to ignore list (#Obfuscator_Ignore_Funcs).

Hope that helps..

  • 4 weeks later...
Posted

Latest Unofficial version 1.11

for those searching for x buttons look no further! I've got X buttons working

X buttons added!

'x'tra buttons 4 & 5 on side of mouse. See my this post further down

If you still have problems with this UDF then try mouse trap UDF

  • 1 month later...
Posted (edited)

Hi !

The script is very helpfull but i've got a problem when i'm using it on a remote computer.

When I use UltraVNC to take control of the remote computer using this script, the mouse movements are slow down like there was latency.

If i desactivate the Hook, the mouse movements are fine.

I guess UltraVNC change the input mouse movements in a certain way and so the script can't follow the updates ?

Do you have any idea ?

Thanks for your work.

P.S : Event handlers i'm using : Left/Right click up/down, Wheel up/down, MouseMove

EDIT : I didn't notice until now but the slow down movement is present only outside of the GUI not inside ! Any idea ?

Edited by tatane
  • 4 weeks later...
Posted

Hey there ppl, got an issue with a script, as described in this topic:

The issue is that it works fine, until i click in the gui, then it crashes.

#include <misc.au3>
#include <WindowsConstants.au3>
#include <MouseOnEvent.au3>
#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
Local $hDLL = DllOpen("user32.dll")
$GUI = GUICreate("GUI Test", 200, 100, 100, 100, -1, $WS_EX_ACCEPTFILES)
GUISetOnEvent($GUI_EVENT_CLOSE, "Quit")
GUISetState()

_MouseSetOnEvent($MOUSE_WHEELSCROLLUP_EVENT, "_MouseWheelUP")
_MouseSetOnEvent($MOUSE_WHEELSCROLLDOWN_EVENT, "_MouseWheelDN")

;=============================================================================

Func _MouseWheelUP($iEvent)
    If _IsPressed("56") Then ;V
        ConsoleWrite('UP' & @CRLF)
    EndIf
EndFunc   ;==>_MouseWheelUP

;=============================================================================

Func _MouseWheelDN($iEvent)
    If _IsPressed("56") Then ;V
        ConsoleWrite('DN' & @CRLF)
    EndIf
EndFunc   ;==>_MouseWheelDN

;=============================================================================

While 1
    Sleep(15)
WEnd

Func Quit()
    Exit
EndFunc
  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

  • 2 weeks later...
Posted (edited)

MouseClickDrag('left', 100, 100, 500, 500)

Or do you mean, block to not be able to drag and drop?

Edited by careca
  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted
  On 6/7/2013 at 7:40 AM, careca said:
MouseClickDrag('left', 100, 100, 500, 500)

Or do you mean, block to not be able to drag and drop?

Yeah, I need block to not be able to drag and drop file (disable drag) in Windows Explorer.

Thanks.

Posted (edited)

Never seen that, i would try to make a script that detects the mouse click, and then have a timer, after that key has been pressed for more than X msecs, force button up. Not sure how it can be done, but i believe it's possible, as for this udf, i don't see the option you need, available.

Sugestion: _ispressed, timerinit, send

Edited by careca
  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

  • 5 months later...
Posted

#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

Don't work ... Mouse buttons are enabled ...

Posted
  On 11/27/2013 at 6:09 PM, MrKris7100 said:
#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

Don't work ... Mouse buttons are enabled ...

Wheres __Dummy?

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Posted
  On 11/28/2013 at 2:36 PM, MrKris7100 said:

How should the __ Dummy?

I never really looked into the UDF, but I think I may assume you need to define __Dummy somwhere.

  Reveal hidden contents

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Posted

#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
Func __Dummy()
EndFunc

 

Don't work.... Buttons are enabled

  • 3 weeks later...
Posted

See the example BlockMouseClicksInput, you must pass a 0 , 1 you don't even need to define a dummy func..

hope it helps.

Func _BlockMouseClicksInput($iOpt = 0)
    If $iOpt = 0 Then
        _MouseSetOnEvent($MOUSE_PRIMARYUP_EVENT, "__Dummy", 0, 1)
        _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "__Dummy", 0, 1)
        _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "__Dummy", 0, 1)
        _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "__Dummy", 0, 1)
    Else
        _MouseSetOnEvent($MOUSE_PRIMARYUP_EVENT)
        _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT)
        _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT)
        _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT)
    EndIf
EndFunc
  • 1 year later...
Posted (edited)

Hi, MrCreatoR. I'v been interested in setting some mouse hotkeys, but at current state this UDF has some very limited use. For example, following code is valid, because standard HotkeySet leaks the key into processing chain, while yours doesn't.

#include <misc.au3>

HotkeySet("z", "SomeFunc")
While 1
   Sleep(40)
WEnd

Func SomeFunc()
   While _IsPressed "5A"
      SomeRepeatableFunc()
      Sleep(10)
   WEnd
EndFunc

Func SomeRepeatableFunc()
   Send("Holla! ")
EndFunc

If it would, then there would be a lot easier to set a "combined hotkey" such as:

#include <misc.au3>
#include "MouseOnEvent.au3"

_MouseSetOnEvent($RMouse, "SomeFunc")

While 1
   Sleep(100)
WEnd

Func SomeFunc()
   _MouseSetOnEvent($LMouse, "SomeRepeatableFunc")
   While _IsPressed (2)
      Sleep(50)
   WEnd
   _MouseSetOnEvent($LMouse)
EndFunc

Func SomeRepeatableFunc()
   Send("Holla! ")
EndFunc

AHK has mouse hotkeys, hotkeys combination and Keyb+mouse hotkeys supported natively, but Autoit is much more convenient to use :), so I was wondering... ;)

P.S.

;Altered var names for convenience measures
Global Const $MouseMv_EV                    = 0x200         ;512 (WM_MOUSEMOVE)         ; ==> Mouse moving.
Global Const $LMouse                        = 0x201         ;513 (WM_LBUTTONDOWN)       ; ==> Primary mouse button down.
Global Const $LMouseUP                      = 0x202         ;514 (WM_LBUTTONUP)         ; ==> Primary mouse button up.
Global Const $LMouseDClick                  = 0x203         ;515 (WM_LBUTTONDBLCLK)     ; ==> Primary mouse button double click.
Global Const $RMouse                        = 0x204         ;516 (WM_RBUTTONDOWN)       ; ==> Secondary mouse button down.
Global Const $RMouseUP                      = 0x205         ;517 (WM_RBUTTONUP)         ; ==> Secondary mouse button up.
Global Const $RMouseDClick                  = 0x206         ;518 (WM_RBUTTONDBLCLK)     ; ==> Secondary mouse button double click.
Global Const $MMouse                        = 0x207         ;519 (WM_MBUTTONDOWN)       ; ==> Wheel mouse button pressed down.
Global Const $MMouseUP                      = 0x208         ;520 (WM_MBUTTONUP)         ; ==> Wheel mouse button up.
Global Const $MMouseDClick                  = 0x209         ;521 (WM_MBUTTONDBLCLK)     ; ==> Wheel mouse button double click.
Global Const $Wheel_EV                      = 0x20A         ;522 (WM_MOUSEWHEEL)        ; ==> Wheel mouse scroll.
Global Const $WheelDown                     = 0x20A + 8     ;530 (WM_MOUSEWHEEL + 8)    ; ==> Wheel mouse scroll Down.
Global Const $WheelUp                       = 0x20A + 16    ;538 (WM_MOUSEWHEEL + 16)   ; ==> Wheel mouse scroll Up.
Global Const $MouseX_EV                     = 0x20B         ;523 (WM_XBUTTONDOWN)       ; ==> Side mouse button down (usually navigating next/back buttons).
Global Const $MouseXUP_EV                   = 0x20C         ;524 (WM_XBUTTONUP)         ; ==> Side mouse button up.
Global Const $MouseXDClick                  = 0x20D         ;525 (WM_XBUTTONDBLCLK)     ; ==> Side mouse button double click.
Edited by PsiLink
Posted
  On 3/29/2015 at 12:59 PM, PsiLink said:

Hi, MrCreatoR. I'v been interested in setting some mouse hotkeys, but at current state this UDF has some very limited use. For example, following code is valid, because standard HotkeySet leaks the key into processing chain, while yours doesn't.

Hi, i am not sure that i understand, what exactly are you trying to do, what your expecting to happen?

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

The thing is, that native Autoit function HotkeySet and your UDF function a little differently.

#include <misc.au3>
#include "mouseOnEvent.au3"

HotkeySet("z", "SomeFunc")
_MouseSetOnEvent($RMouse, "AnotherFunc")

While 1
   Sleep(100
WEnd

Func SomeFunc()
   While _IsPressed("5A")
      ConsoleWrite('KeybZ ')
      Sleep(10)
   WEnd
EndFunc

Func AnotherFunc()
   While _IsPressed(2)
      ConsoleWrite('RMB2 ')
      Sleep(10)
   WEnd
EndFunc

I want to set some "combined hotkeys" like RMB+LMB, RMB+WheelDown or even RMB+move mouse in certain direction. For this to work, _IsPressed should notice the key was actually pressed and that is a problem.

My current solution is all about using _IsPressed(), but it could have been much more convenient if there were actual hotkey

#include <MouseOnEvent.au3>
#include <Misc.au3>

Global Const $Btn1Down = '_IsPressed(1)' ;LMB
Global Const $Btn2Down = '_IsPressed(2)' ;RMB

$bRBMUsedInHK = False

Loop()

Func Loop()
   While 1
      If Execute($Btn2Down) Then
         While Execute($Btn2Down)
            Sleep(30)

            If Execute($Btn1Down) Then
               While Execute($Btn1Down)
                  Sleep(10)
               WEnd

               ConsoleWrite('1 ')
               $bRBMUsedInHK = True
            EndIf
         WEnd
      EndIf

      If $bRBMUsedInHK Then ;Close context menu if any
         Send("{altdown}")
         Sleep(40)
         Send("{altup}")
         $bRBMUsedInHK = False
      EndIf

      Sleep(50)
   WEnd
EndFunc

P.S. Можно и на русском, но форум ведь зарубежный :)

  • 3 months later...
Posted

i have some troubles with using MouseSetOnEvent udf in x64 script - after mouse clicks it always crush with "AutoIt3.exe ended.rc:128"

#AutoIt3Wrapper_UseX64=Y
#include "MouseOnEvent.au3"

$Form1 = GUICreate("some gui", 333, 222, @DesktopWidth/2-175, @DesktopHeight/2-111)
$Input1 = GUICtrlCreateInput("some text", 8, 8, 921, 21)
GUISetState(@SW_SHOW)
_MouseSetOnEvent($MOUSE_PRIMARYDBLCLK_EVENT, '_DblClk_Event')

While 1
    Sleep(10)
WEnd
_MouseSetOnEvent($MOUSE_PRIMARYDBLCLK_EVENT)

is there a some fix for it?

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...