From 0c45759f9ac5e13250c803f2ff7114a8e274516f Mon Sep 17 00:00:00 2001 From: Hane Date: Sat, 1 Jul 2023 02:33:35 +0200 Subject: [PATCH] mausuHoldo: poggers func + mouse btn stuck fix? added todos --- mausuHoldo.ahk | 194 +++++++++++++++++-------------------------------- 1 file changed, 66 insertions(+), 128 deletions(-) diff --git a/mausuHoldo.ahk b/mausuHoldo.ahk index ec2e88f..fa4ad2d 100644 --- a/mausuHoldo.ahk +++ b/mausuHoldo.ahk @@ -1,7 +1,9 @@ +;;TODO: calcular tuckaway con getpos en launch y pensar en multiscreen +;; poner clics laterales del raton +;; comprobar puntero en local +;; ugly af lo de flagear para compartir un sincro sin sincro, bro. no creo que lo cambie xddd +;; ;;eveentos down del teclado no paraban de joder porque paraban el unico hilo, so _h it was, its threading time -;;vaya puto apaņazo de mierda, flipas -;;obs lo rompe wtf??????????????? y relive caputrar la pantalla basically -;;TODO ugly af no entrar en el mutex. bro q te pasa, habia prisa pero...... #MaxThreadsPerHotkey 2 #HotkeyInterval 10000 #MaxHotkeysPerInterval 9999 @@ -32,30 +34,44 @@ rBtnHold := 0 mBtnHold := 0 lBtnHold := 0 -speedUp := 1 -speedUpFactor := 20 +defaultSpeed := 10 +slowDown := 0 +slowDownFactor := 90 test1 := 0 test2 := 0 test3 := 0 test4 := 0 -share:=CriticalObject({"lefMov" : 0,"rightMov" : 0,"downMov" : 0,"upMov" : 0,"mouseSpeed" : speedUp * speedUpFactor + 3}) +;;pressMouseButton("Left", lBtnHold, u) +pressMouseButton(ByRef mouseButton, ByRef toggleState, ByRef keyPressed, ByRef toggle := 0) +{ + Global mouseActive + if(mouseActive == 1) + { + if (toggleState == 1) + { + MouseClick, %mouseButton%, , , 1, , U + toggleState := 0 + return + } + if (toggleState == 0 && toggle == 1) + { + MouseClick, %mouseButton%, , , 1, , D + toggleState := 1 + return + } + if (toggle == 0) + { + MouseClick, %mouseButton% + return + } + KeyWait, %keyPressed% + } + return +} -;;Toggle speed -RCtrl & ,:: - ;;SendInput, {RCtrl Up} - speedUp := !(speedUp) - mouseSpeed := speedUp * speedUpFactor + 3 - ;;SendInput, {RCtrl Down} - return - -;;tuckaway -;;targeting 1080p displays with taskbar on top. Change at your leisure. -RCtrl & .:: - MouseMove, 1940, 100 - ;;inputCleaning() - return +share:=CriticalObject({"lefMov" : 0,"rightMov" : 0,"downMov" : 0,"upMov" : 0,"mouseSpeed" : slowDown * slowDownFactor + defaultSpeed}) ;;TODO DAVBID Y EL ENTER LAlt & RAlt:: @@ -79,7 +95,7 @@ RAlt & LAlt:: DllCall(freqUpdater, ""Int64*"" , baseTime) DllCall(freqUpdater, ""Int64*"" , currentTime) DllCall(""QueryPerformanceFrequency"", ""Int64*"", updateRate) - ticksPerSecond := 10000 + ticksPerSecond := 1000 updateRate := Floor(updateRate / ticksPerSecond) currentTime := currentTime ;;/ 1.0 baseTime := baseTime ;;/ 1.0 @@ -100,7 +116,7 @@ RAlt & LAlt:: DllCall(freqUpdater, ""Int64*"" , currentTime) if (currentTime - baseTime >= updateRate) { delta := (currentTime - baseTime) / ticksPerSecond - MouseMove, (obj.rightMov + obj.lefMov) * (delta), (obj.upMov + obj.downMov) * (delta), 0, R + MouseMove, (obj.rightMov + obj.lefMov) * (delta / obj.mouseSpeed), (obj.upMov + obj.downMov) * (delta / obj.mouseSpeed), 0, R ;;DllCall(freqUpdater, ""Int64*"" , baseTime) baseTime := currentTime } @@ -128,6 +144,27 @@ RAlt & LAlt:: return #if mouseActive == 1 + +;;Toggle speed +':: +h:: + Global share + ;;SendInput, {RCtrl Up} + slowDown := !(slowDown) + share.mouseSpeed := slowDown * slowDownFactor + defaultSpeed + ;;SendInput, {RCtrl Down} + return + +;;tuckaway +;;targeting 1080p displays with taskbar on top. Change at your leisure. +p:: +y:: + ;;DllCall("ShowCursor", "Int", slowDown) + MouseMove, 1940, 100 + ;;inputCleaning() + return + + $j:: if (test1 == 0) { @@ -177,133 +214,34 @@ k Up:: return $u:: - if (mouseActive == 1) - { - if(lBtnHold == 1) - { - SendInput, {LButton Up} - lBtnHold := 0 - } - else - { - SendInput, {LButton} - } - KeyWait, u - } - else - { - SendInput, u - } + pressMouseButton("Left", lBtnHold, u) return u Up::return $m:: - if (mouseActive == 1) - { - if(lBtnHold == 1) - { - SendInput, {LButton Up} - lBtnHold := 0 - } - else - { - SendInput, {LButton Down} - lBtnHold := 1 - } - KeyWait, m - } - else - { - SendInput, m - } + pressMouseButton("Left", lBtnHold, m, 1) return m Up::return $i:: - if (mouseActive == 1) - { - if(mBtnHold == 1) - { - SendInput, {MButton Up} - mBtnHold := 0 - } - else - { - SendInput, {MButton} - } - KeyWait, i - } - else - { - SendInput, i - } + pressMouseButton("Middle", mBtnHold, i) return i Up::return $sc033:: - if (mouseActive == 1) - { - if(mBtnHold == 1) - { - SendInput, {MButton Up} - mBtnHold := 0 - } - else - { - SendInput, {MButton Down} - mBtnHold := 1 - } - KeyWait, `, - } - else - { - SendInput, `, - } + pressMouseButton("Middle", mBtnHold, sc033m, 1) return sc033 Up::return $o:: - if (mouseActive == 1) - { - if(RBtnHold == 1) - { - SendInput, {RButton Up} - mBtnHold := 0 - } - else - { - SendInput, {RButton} - } - KeyWait, o - } - else - { - SendInput, o - } + pressMouseButton("Right", rBtnHold, o) return o Up::return $.:: - if (mouseActive == 1) - { - if(rBtnHold == 1) - { - SendInput, {RButton Up} - mBtnHold := 0 - } - else - { - SendInput, {RButton Down} - mBtnHold := 1 - } - KeyWait, `. - } - else - { - SendInput, `. - } + pressMouseButton("Right", rBtnHold, ".", 1) return - +. Up::return #if return