Author Topic: "Wait for Mouse Button Press" is not blocking mouse scroll events  (Read 129 times)

Jeremiah

  • Newbie
  • *
  • Posts: 6
In the "Wait for Mouse Button Press" settings, I have selected "Continue on any mouse button press" and "Do not allow button event to be passed through." Majority of the mouse button events are not being passed through except for scroll back and scroll forward, and I'm unable to test if scroll left or right passes through. The "Do not allow button event to be passed through" action window says it can block mouse scroll events from passing through, but this is not happening. I've tested this function with the command below.

Code: [Select]
Command executed - Left Ctrl Press
Start Indefinite Loop
    Wait for mouse button press [Any Button]
    Begin Condition : (Keyboard Key 'Left Alt' Is Not Pressed AND Keyboard Key 'Shift' Is Not Pressed)
        Begin Integer Compare : [~mouse] Equals 1
            Press Q key and hold for 0.1 seconds and release
        Else If Integer Compare : [~mouse] Equals 2
            Press W key and hold for 0.1 seconds and release
        Else If Integer Compare : [~mouse] Equals 3
            Press E key and hold for 0.1 seconds and release
        Else If Integer Compare : [~mouse] Equals 6
            Press R key and hold for 0.1 seconds and release
        Else If Integer Compare : [~mouse] Equals 7
            Press T key and hold for 0.1 seconds and release
        End Condition
    End Condition
End Loop

Command kill - Left Ctrl Release
« Last Edit: October 12, 2024, 10:19:45 AM by Jeremiah »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4767
  • RTFM
Re: "Wait for Mouse Button Press" is not blocking mouse scroll events
« Reply #1 on: October 12, 2024, 01:28:48 AM »
It does on my machine.

How fast are you scrolling? Keep in mind that the action will intercept one mouse button press/scroll, after which execution will proceed to the next action.
The next button press/scroll can only be intercepted when execution reaches the "Wait For Mouse Button Press" again.
I.E. if you press a button, or scroll, in the time that it takes for the conditions in your command to be processed, and the ~100ms your keypress action takes, it won't be intercepted because the "Wait For Mouse Button Press" action isn't actually running.

If you need every scroll to be intercepted regardless of timing, you'll need to assign it to a command instead.

Jeremiah

  • Newbie
  • *
  • Posts: 6
Re: "Wait for Mouse Button Press" is not blocking mouse scroll events
« Reply #2 on: October 12, 2024, 01:39:52 AM »
I tested it with just moving one scroll tick and it still passes through. Maybe it's my mouse?
« Last Edit: October 12, 2024, 10:20:04 AM by Jeremiah »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4767
  • RTFM
Re: "Wait for Mouse Button Press" is not blocking mouse scroll events
« Reply #3 on: October 12, 2024, 01:43:14 AM »
Are you testing with normal desktop applications, or with games?

Jeremiah

  • Newbie
  • *
  • Posts: 6
Re: "Wait for Mouse Button Press" is not blocking mouse scroll events
« Reply #4 on: October 12, 2024, 01:45:51 AM »
I'm testing with the game Rust.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4767
  • RTFM
Re: "Wait for Mouse Button Press" is not blocking mouse scroll events
« Reply #5 on: October 12, 2024, 01:48:32 AM »
Then it could be down to how the game's input system works.

VoiceAttack is using standard Windows API functions to intercept mouse input, but if the game uses a method that isn't affected by that, it would still detect the input.


Have you tested assigning the scroll input to the "When I press mouse" option of a command? Does that exhibit the same behavior?

Jeremiah

  • Newbie
  • *
  • Posts: 6
Re: "Wait for Mouse Button Press" is not blocking mouse scroll events
« Reply #6 on: October 12, 2024, 01:58:17 AM »
It is the same behavior.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4767
  • RTFM
Re: "Wait for Mouse Button Press" is not blocking mouse scroll events
« Reply #7 on: October 12, 2024, 02:00:52 AM »
Both the action and commands use the same Windows features to hook mouse input, so yes, it's a matter of how the game retrieves input, which effectively circumvents the normal workings of the Windows mouse APIs.