Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I already have this code that holds the mouse on the middle of the screen. and by pressing CTRL+F5 it disables the script. I would only like to add a part where when the script is on, the letters of my keyboards won't work, until I press CTRL+f5 (that will disable both keyboard holding and mouse holing).

Here is the current code I have for my mouse. Please also tell me what to add, and where:

CoordMode, Mouse, Screen
Toggle := 0
settimer Mousehold, 10
NMoved = 0
return


Mousehold:
MouseGetPos, x, y
If ((x<>x2) or (y<>y2)) {
        if !on
                {
                NMoved+=1
                VarText =
                (
Please get off my computer
%NMoved%
                )
                SplashTextOn, 200, 100, Stop!, %VarText%
                Settimer, TextOff, -2000
                on := true
                }
        }
x2 := x, y2 := y
MouseMove, A_ScreenWidth/2, A_ScreenHeight/2, 0
return


TextOff:
SplashTextoff
on := false
return


^F5::
Toggle := !Toggle
if !Toggle
        settimer, Mousehold, On
else
        settimer, Mousehold, off
return
share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.