<get "shift"|"Trigger"> on submenus?

Features wanted...
highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: <get "shift"|"Trigger"> on submenus?

Post by highend »

So it looks like there no way to force it to continue with the XY script execution after the AHK right click detection?
There is eventually one solution. When the entry that is clicked on loads another script...This one could check what you've set (e.g.
as a permanent variable) through the .ahk script. Still work to split and design scripts appropriately and imho not worth the effort...

You would need to implement something in the .ahk that cancels the XY menu, once one item was right clicked...
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4141
Joined: 28 Feb 2012 19:27

Re: <get "shift"|"Trigger"> on submenus?

Post by klownboy »

highend wrote:When the entry that is clicked on loads another script...
I actually was thinking along those lines, but the AHK script takes over so-to-speak as soon as the right click is detected. So, I haven't yet been able to obtain the menu caption either in AHK or the XY script. * I was trying to 'load' the subscript clicked on after the main menu was displayed since any code immediately after the menu caption isn't run. I guess I need to figure out how to load another script, as you say, when the menu entry is clicked, but first figure out which menu entry was clicked. If I can do that I think this thing would actually work. :)

Code: Select all

	load "$mn", *, 's';  // loads the main script
	$caption = caller('caption');   //get the caption either here or get it in the AHK script itself
	load "$mn", '$caption', 's';
	end
I'll give it a fresh look tomorrow. Thanks for the hints.

* EDIT: The caption returned via the AHK script is unfortunately the parent caption not the caption clicked. I haven't been able to get a caption from within the XY script.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

klownboy
Posts: 4141
Joined: 28 Feb 2012 19:27

Re: <get "shift"|"Trigger"> on submenus?

Post by klownboy »

Well I looked into this topic (i.e., right clicking an XYplorer menu item) off and on for awhile and it turns out the solution was right under my mouse. The above AHK code, loaded when the computer starts up along with my existing AHK start-up code (or loaded separately), only needed a automated 'click" of the mouse to function properly with XYplorer. So what is happening is the code above detects when a right click is accomplished on an XYplorer on an XYplorer menu/ctx menu. If it is true (i.e., XY is active and the user right mouse clicks on a context menu), then a XY permanent variable is created. So at this point, the AHK script then sends a normal left mouse click on the XYmenu item. In the XYplorer script, we differentiate between the normal left click of the menu and the right click by the fact that the permanent variable is set. The AHK script is not involved when the user performs a normal left click of the mouse (i.e., the above action is taken for the right click only).

I posted a simple sample script in the forum script section along with an updated AHK script where users can see how to easy it is to code some XYplorer menu scripts which utilize both the left and right mouse buttons. See viewtopic.php?f=7&t=18062 One most obvious example is being able to execute the normal action of an XYplorer built-in toolbar button with the left mouse button and the button's context menu with the right mouse button. You can also do the same with your Customized Toolbar Buttons. You could assign totally different actions to the left & right mouse buttons. Most importantly, I notice no lag once-so-ever, the right click mouse actions execute as fast as the left.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

Post Reply