Jump to content

Trying to map mouse output to DOWN arrow & nothing else


Recommended Posts

Hi:

Newbie here to the forum although I've been using autoIT for years & absolutely love it!

I'm trying to map the mouse output to DOWN arrow & nothing else.  I ran across this old 2013 topic that seems to address this very issue, but when I try these includes

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

I get this error 

error: can't open include file "MouseOnEvent.au3"

 

 

If you're interested I'm using an application in which I want to move through hundreds of screens each day looking at each every couple of seconds (but I need to determine how much time I need as I look).  I am currently doing this using the down arrow key, but it is starting to kill my hand.  I would like to use the middle mouse button instead (I have a foot mouse clicking device) so I can switch between my feet and hands.

This sort of works, but it not only causes the DOWN arrow key to output, but it also causes the middle mouse to output it's "click."  It's the click I need to eliminate.

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

Local $hDLL = DllOpen("user32.dll")

Func MiddleMouseDOWN()
   Send("{DOWN}")
EndFunc


While 1
   if _IsPressed("04") Then MiddleMouseDOWN() ; DOWN key  #note lookup up _IsPressed >> 04 is the Middle Mouse Button per the help Function Reference
   if _IsPressed("1B") Then Exit ; ESC key
   Sleep(100)
Wend

DllClose($hDLL)

 

Please help!

Link to comment
Share on other sites

@ruffle

Hi ruffle, check the explanations below. 

 

#include "MouseOnEvent.au3"    ;Means your script and the UDF reside in the same location\folder
#include "..\MouseOnEvent.au3"  ;Means the UDF resides one folder above
#include "C:\temp\MouseOnEvent.au3" ;Means your UDF resides in a specific location
#include <MouseOnEvent.au3> ; Means the UDF resides in your includes folder "..AutoIt3\Include"

 

 

Kind Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

Link to comment
Share on other sites

Thanks for you help so far, I've found my include folder:

    C:\Program Files (x86)\AutoIt3\Include

I don't have the MouseOnEvent.au3 file.  I found this link by searching:

    https://github.com/pf981/AutoItHotkeys/blob/master/MouseOnEvent.au3

Is it ok to simply copy the contents of this page into a text file and name it MouseOnEvent.au3 and then put it in my include folder?

Just making sure I'm not creating a problem for myself further down the line; otherwise, I would just try it and see what happens.

Please help!

Link to comment
Share on other sites

Good morning @ruffle:)
You don't need to open the file, copy the content, and then create a new file with that name.
Just download the file, and put in the Include folder of AutoIt.
Since you did this, you're done, and you can include your "library" in the script with

#include <MouseOnEvent.au3>

at the top of your script :)
Hope that helps.

Best Regards.

Edited by FrancescoDiMuro

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

Hi:  It wasn't clear to me how to obtain the file, but eventually my searching turned up the *.au3 file on this forum in a *.zip file with other help.  I now have it up & running.

Thanks for the help everyone!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...