right click

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Alcrkai
Posts: 47
Joined: 16 Mar 2021, 10:51

right click

Post by Alcrkai » 25 May 2021, 07:37

How do I make sure that when I click with the right mouse button it opens something as if it were a tooltip and that when I click on one of the options it would do the action according to it.
if someone can show me a generic example like the one I gave below or even make the code of what I did below thank you

EX:
right click
opens the tooltip with options 1 and 2
clicked 1
msgbox you clicked on option 1

User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: right click

Post by mikeyww » 25 May 2021, 08:09

Code: Select all

Menu, options, Add, Option 1, Option1
Menu, options, Add, Option 2, Option2

#If !overClass("Shell_TrayWnd")
RButton::Menu, options, Show
#If

Option1:
MsgBox, 1
Return

Option2:
MsgBox, 2
Return

overClass(class) {
 MouseGetPos,,, uid
 WinGetClass, thisClass, ahk_id %uid%
 Return thisClass = class
}

User avatar
SirSocks
Posts: 360
Joined: 26 Oct 2018, 08:14

Re: right click

Post by SirSocks » 25 May 2021, 08:14

Code: Select all

#SingleInstance Force

Menu, MySubmenu, Add, SubItem1
Menu, MySubmenu, Add, SubItem2
Menu, MyMenu, Add, Item 1, :MySubmenu
Menu, MyMenu, Add, Item 2, Item2

RButton::
Menu, MyMenu, Show
return

SubItem1:
  MsgBox, You clicked on SubItem1
return

SubItem2:
  MsgBox, You clicked on SubItem2
return

Item2:
  MsgBox, You clicked on Item2
return

Esc::
ExitApp

Alcrkai
Posts: 47
Joined: 16 Mar 2021, 10:51

Re: right click

Post by Alcrkai » 25 May 2021, 08:22

Thanks a lot for the help

Post Reply

Return to “Ask for Help (v1)”