Jump to content

Is is possible to stop a mousclick while a hotkey is pressed?


Recommended Posts

I'm trying to figure it if its possible to stop mouse / keyboard input while a hotkey is pressed...

I know the logic for while the key is pressed... but at that point how do you block further input? (and ideally still track what keys / clicks are being pressed lol)

ie:

Case _IsPressed("C0", $dll) ; ` (tilde) Key
    ;Lockout mouse clicks yet still detect what the click would have been...
    ; <insert mystery code>
    While _IsPressed("C0", $dll)
        Sleep(10)
        ; Display Clicks
        MsgBox(0, "Had this click not been blocked... Mouse x,y:", $pos[0] & "," & $pos[1])
    WEnd
    ;Unlock the 'lockdown' feature
    ; <insert mystery code>

((for anyone curious why in the world i'm doing this :) i'm 'multiboxing' playing a game from multiple pc's.... already been up and running for a while now sending keystrokes but wanting to get better at remote mouse clicks, and to implement that logic i need to idealy lock out local mouse clicks)) :P

Don't let that status fool you, I am no advanced memeber!

Link to comment
Share on other sites

Link to comment
Share on other sites

NOTE THIS IS A TERRIBLE IDEA!!! lol i had to reboot >.<

my failed logic was that it would still tell when i released the key despite ALL input blocked lol

#include <Misc.au3>

$dll = DllOpen("user32.dll")


While 1
    Select
    Case _IsPressed("C0", $dll) ; ` (tilde) Key
        ;Lockout mouse clicks yet still detect what the click would have been...
        BlockInput(1)
        While _IsPressed("C0", $dll)
            Sleep(10)
            ; Display Clicks
            If _IsPressed("01", $dll) Then 
                While _IsPressed("01", $dll)
                    ; do nothing 
                WEnd
                $pos = MouseGetPos()
                MsgBox(0, "Had this click not been blocked... Mouse x,y:", $pos[0] & "," & $pos[1])
            EndIf 
        WEnd
        ;Unlock the 'lockdown' feature
        BlockInput(0)
    Case Else
        sleep (10)
    EndSelect

WEnd

Don't let that status fool you, I am no advanced memeber!

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