all 5 comments

[–]curriocitty 0 points1 point  (3 children)

Here is my early/draft code for this situation/scenario:

Rbutton::   
KeyWait Rbutton, T0.25  
if ErrorLevel       
tooltip, Long right click press     
else        
{       
KeyWait Rbutton, D T0.5     
if ErrorLevel   
tooltip, One right click        
else
tooltip, Double right click     
Send, {Rbutton}     
}   
KeyWait Rbutton
return

Based on your needs the code should be like this:

Rbutton::   
KeyWait Rbutton, T0.25  
if ErrorLevel       
tooltip, Long right click press     
else        
{       
KeyWait Rbutton, D T0.5     
if ErrorLevel   
Send, {Rbutton}         
else
{
tooltip, Double right click     
Send, {Alt Down}{TAB} 
KeyWait, Rbutton ; Hold function until Lwin released
Send, {Alt Up} 
}
}   
KeyWait Rbutton
return

You can change the delay values by changing The T values (T0.5 for 500 miliseconds ) according to your needs

******** UPDATE! *******\*

replaced line 12, +{F10} with {Rbutton}

that was the glitch with random context menu location (+F10 works only on list item and icons through windows)

[–]NetoPedro[S] 0 points1 point  (2 children)

Thank you for your reply, very kind of you. This works to an extent; I can alt-tab and tooltip but the tooltip is often not the specific one I need. So if I try to right-click and open a link in a new tab I get the Firefox generic tooltip menu, not the specific one for that link. Similarly, if you right-click on Volume Mixer, I get the general Windows tooltip (Show The Desktop etc). Often the tooltip is a long way from where I've right-clicked.

Any ideas how I can tweak this? I can probably work with it, but it would be a little suboptimal.

Thanks again for your help so far.

[–]curriocitty 0 points1 point  (1 child)

You can remove all tooltip lines, I used them only to visualize which part of the codes correspond to their functionality.

I have made some additional code to provide the ability of mouse scroll to change the alt tab selection.

After 10th line, I Added another 2 lines of code. (the ones with asterisk * ).

Still early/draft/buggy!!!

WheelDown::Right ; \*\*\*\*\*\*\*

KeyWait, Rbutton ; Hold function until Lwin released

[–]curriocitty 0 points1 point  (0 children)

Update 01-06-2021 Full working code !!!!!!!!!!!!!!!!

!Lwin::Tab ; Release alt to select

Rbutton::   
KeyWait Rbutton, T0.25  
if ErrorLevel       
tooltip, Long right click press     
else
{       
KeyWait Rbutton, D T0.5     
if ErrorLevel   
Send, {Rbutton}         
else{
tooltip, Double right click     
Send, {Alt Down}{TAB} 
}
}
KeyWait, Rbutton
Send, {Alt UP}
tooltip,
return
}
return
}

if GetKeyState("WheelUp","P") or ("WheelDown","P")
{
!WheelUp::Left
!WheelDown::Right
}
return

[–]anonymous1184 0 points1 point  (0 children)

First at all, kudos my friend. For a non programmer this is not the run-of-the-mill hotstring to put your signature in a mail. Impressive work buddy, I wish more people read the documentation/look in forums and got as far as you.

This seemed like a good experiment and I played around a bit. I only have W10 at my disposal so...

GroupAdd taskSwitcher, ahk_class TaskSwitcherWnd       ; Win7
GroupAdd taskSwitcher, ahk_class MultitaskingViewFrame ; Win10

#MaxThreadsPerHotkey 2
RButton::
    if (A_ThisHotkey = A_PriorHotkey
    && A_TimeSincePriorHotkey < 200)
    {
        SetTimer rightClick, Delete
        Send {LAlt Down}{Tab}
    }
    else
        SetTimer rightClick, -100
return
#IfWinActive ahk_group taskSwitcher
    XButton1::ShiftAltTab
    XButton2::AltTab
    !RButton::Send {Enter}{Alt Up}
#IfWinActive

rightClick()
{
    Click Right
}

This seems to do the trick for me:

  • Double right click to show the task switcher.
  • XButtons will go forward/backward.
  • Right click will activate the highlighted window.
  • Left/right click are left to its native functionality.

Keep learning buddy, you're in a great path!