You need a squeak to lock the w a s d key , and the mouse at a certain pixel color

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Vailot
Posts: 1
Joined: 06 May 2024, 23:45
Contact:

You need a squeak to lock the w a s d key , and the mouse at a certain pixel color

06 May 2024, 23:50

We need a script that would block the keys w a s d , and the mouse when the color is red on one of the pixels
User avatar
mikeyww
Posts: 27169
Joined: 09 Sep 2014, 18:38

Re: You need a squeak to lock the w a s d key , and the mouse at a certain pixel color

07 May 2024, 04:40

Welcome to this AutoHotkey forum!

Code: Select all

#Requires AutoHotkey v2.0
x     := 1751 ; Screen coordinates
y     := 247
rgb   := 0xFF0000
block := 'MouseMoveOff'
SetTimer check, 100

#HotIf block = 'MouseMove'
w::
a::
s::
d::
LButton::
MButton::
RButton::
XButton1::
XButton2::
WheelUp::
WheelDown::
WheelLeft::
WheelRight::Return
#HotIf

check() {
 Global block
 CoordMode 'Pixel'
 If rgb = color := PixelGetColor(x, y) {  ; Color was found
  If block != 'MouseMove' {
   BlockInput block := 'MouseMove'
   SoundBeep 1500
  }
 } Else {                                 ; Color was not found
  If block = 'MouseMove' {
   BlockInput block := 'MouseMoveOff'
   SoundBeep 1000
  }
 }
 ToolTip color
}

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: kunkel321, semiono and 31 guests