Тема: AHK: ПКМ и wheelup = AltTab
Здравствуйте, подскажите пожалуйста в чём может быть причина того, что не работает ~rbutton & wheelup ?
Пробовал версии 1.1 и 1.0.48 без толку((
На данный момент использую скрипт Lexikos, но в нём есть 2 бага:
контекстное меню при простом правом клике открывается ровно через раз,
и если при зажатой правой клавише выполнять жест, то в начале выполнения мышь быстро дёргается от точки начала движения к точке реального смещённого положения курсора доли секунды, но этого достаточно чтобы жест был не узнаваем((
; - AutoHotkey (any version should be fine)
; - A with a wheel
; - Two or more fingers (optional but recommended)[/color]
; Start with wheel/MButton hotkeys disabled:[/color]
gosub DisableRButtonHotkeys
RButton::
; Enable hotkeys while RButton is down.[/color]
Hotkey WheelUp, On
Hotkey WheelDown, On
Hotkey MButton, On
; Determine initial position.[/color]
CoordMode , Screen
GetPos x1, y1
Loop
{
; If another hotkey has been triggered...[/color]
if (A_ThisHotkey != "RButton")
{
; Stop monitoring the other conditions (below). Just wait[/color]
; for the button to be released, then disable the hotkeys.[/color]
KeyWait RButton
break
}
; If button has been released...[/color]
if !GetKeyState("RButton", "P")
{
; Press and release the button.[/color]
Click R
; Break out of the loop to disable the hotkeys.[/color]
break
}
GetPos x2, y2
; If has moved...[/color]
if (x1 != x2 || y1 != y2)
{
; Set speed to "instant" for best results.[/color]
SetDefaultpeed 1
; Press the button down (at the initial position).[/color]
Click Right Down %x2%, %y2%
; Move back to where the user had moved the .[/color]
Move x2, y2
; Wait for the button to be released.[/color]
KeyWait RButton
; Release the button.[/color]
Click Right Up
; Break out of the loop to disable the hotkeys.[/color]
break
}
; Yield CPU time to other applications.[/color]
Sleep 1
}
; Disable the hotkeys.[/color]
DisableRButtonHotkeys:
Hotkey WheelUp, Off
Hotkey WheelDown, Off
Hotkey MButton, Off
return
WheelUp::
ifwinactive, _class MozillaWindowClass
{
If Count_Presses > 0 ; если таймер уже запущен, то...
{
Count_Presses += 1 ; плюсуем каждое нажатие клавиши (число будет обрабатываться в подпрограмме соответствующего таймера)
Return ; закончить обработку горячей клавиши (ее дальнейшую обработку уже определяет таймер и его подпрограмма)
}
; иначе - это первое нажатие из новой серии
Count_Presses = 1 ; выставляем флаг, что клавиша один раз нажата
SetTimer, Timer_Presses_3, 700 ; переходить к указанной подпрограмме через каждые 300 миллисекунд
Return ; закончить обработку горячей клавиши
Timer_Presses_3: ; подпрограмма действий в зависимости от количества нажатий
SetTimer, Timer_Presses_3, off ; выключить таймер
If Count_Presses < 5 ; если клавиша нажата однажды...
{
send, {Ctrl down}{Tab}
sleep, 500
send, {left}
}
If Count_Presses > 5
{
sleep, 200
send, {Ctrl up}{alt down}{Tab}
sleep, 500
send, {left}
}
Count_Presses = 0
return
}
IfWinExist, _class MozillaWindowClass
WinActivate _class MozillaWindowClass
else
run, "C:\ярлыки\m Google url.lnk"
return
WheelDown:: WinMinimizeAll
MButton:: Send {Volume_Mute}
Задача - хоткей на сочетание rbutton wheelup.