Jump to content

Help: How to detect Hardware Mouse Button? - (Locked)


BrAiNee
 Share

Recommended Posts

Hi, i have a problem, i use the function _IsPressed("01") but this will also detect the button is pressed when the script is pressing it. so is there a way to detect only the real mouse button and not the "software buttons" ?

While _IsPressed("01") 
MouseUp("left")

;do stuff while pressing the real mouse button
WEnd

 

the MouseUp event will also disable the while, but the real mouse button is pressed... how to fix ? dllcall something ????

Link to comment
Share on other sites

Not sure I fully understand your issue. Can you show a real example of what is not working ?  And what is the application you are trying to automate.  Mouse Clicks is not the best way to automation, unless it is for a video game, is it ?

Link to comment
Share on other sites

theres really not a whole heck of alot of difference between a virtual keypress and a real one. As far as i know the only difference is a real key press gets a "flag" from a signed driver that theres only 1 way that i know of to fake that, its a pita and probably would get this topic shut down.  I'm sure theres easier ways to go about whatever it is you're attempting to do .

Link to comment
Share on other sites

Well, I don't know if it would work in your case but in general if you want to avoid a specific event from happening, you set a boolean type variable and switch it before and after actions that may trigger it.Then check against the boolean variable inside the function that gets called, and add an if statement, etc.

This may work for you perhaps. Can't really say, as I am not sure the order of events. Instead of checking for boolean in the while condition perhaps add an if statement for it inside.

Global $g_bBypass = False


While _IsPressed("01") and $g_bBypass = False
    
    $g_bBypass = True   
    MouseUp("left")
    $g_bBypass = False

    ;do stuff while pressing the real mouse button
WEnd

 

Edited by GokAy
Link to comment
Share on other sites

Im just sitting here in awe trying to wrap my mind around why in God's name you'd need to use IsPressed from inside of a script to determine if the mouse button was being pressed or not.  Theres got to be another trigger that lets the mouse know when to press or not to press..... use whatever that is instead.  Unless this is some type of attempt at a keylogger.

Edited by markyrocks
Link to comment
Share on other sites

34 minutes ago, Nine said:

Not sure I fully understand your issue. Can you show a real example of what is not working ?  And what is the application you are trying to automate.  Mouse Clicks is not the best way to automation, unless it is for a video game, is it ?

yes its for a game, the problem is the game blocks different inputs, i fixxed this by using a second shoot key, but this will also stop the trigger, i try to catch the "real" mouse button

then i will deactivate it and let the script do the shooting, so like a mouse proxy ;) i dont know how to describe.... here my function.

<snip>

 

Edited by JLogan3o13
Link to comment
Share on other sites

  • Moderators

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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