Middle-Click in the Hamburger Menu
Middle-Click in the Hamburger Menu
Can we please have the ability to middle-click locations in the Hamburger Menu? I use this menu so much and I forget that middle-click isn't possible. This feature would eliminate the need to open a new tab before clicking a location in the menu.
Windows 10 Pro 22H2
Re: Middle-Click in the Hamburger Menu
Just hold shift to open that item in a new tab?
One of my scripts helped you out? Please donate via Paypal
Re: Middle-Click in the Hamburger Menu
I would like middle click support in other menus, too: Favorite Folders menu which I get by double click on white space, Recent Locations button, are there any others.
Re: Middle-Click in the Hamburger Menu
Thanks, I wouldn't have thought of trying that. However, middle-click would still be preferable. 1) It's a more 'logical' way of opening an item in a new tab. 2) Holding Shift means two hands are required to do the same thing one click of the middle mouse button does.
Windows 10 Pro 22H2
Re: Middle-Click in the Hamburger Menu
If i remember correctly there are some problems with menus(like right-click one, favmenu, script-created, etc) and determining which mouse button was used - that's why there is no scripted way to react on that too.
Dunno maybe rocket-click could work in such situations?..
Dunno maybe rocket-click could work in such situations?..
Win 7 SP1 x64 100% 1366x768
-
- Site Admin
- Posts: 60618
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Middle-Click in the Hamburger Menu
True, Windows does not support Middle-Click on the standard menus.
FAQ | XY News RSS | XY Twitter
Re: Middle-Click in the Hamburger Menu
Well time to replace standard menus with Don's menus. Just kidding, programming is hard, I tried and failed.
Re: Middle-Click in the Hamburger Menu
Thanks Don, I sometimes forget that Windows can affect things in XY.
Windows 10 Pro 22H2
Re: Middle-Click in the Hamburger Menu
Using an autohotkey script seems to be the only way, passing a variable to XY.
perm $MButton = 1
Code: Select all
#HotIf WinActive("ahk_exe XYplorer.exe") && MouseIsOver("ahk_class #32768")
MouseIsOver(WinTitle) {
MouseGetPos ,, &Win
return WinExist(WinTitle " ahk_id " Win)
}
MButton::
{
xyHwnd := GetXYHWND()
if (xyHwnd)
Send_WM_COPYDATA(xyHwnd, '::perm $MButton = 1')
send "{LButton}"
}
GetXYHWND() {
static xyClass := 'ahk_class ThunderRT6FormDC'
if WinExist(xyClass) {
for xyid in WinGetList(xyClass)
for ctrl in WinGetControls(xyid)
if A_Index = 10 ; The Floating Preview has only a few controls
return xyid
}
}
Send_WM_COPYDATA(xyHwnd, message) {
if !(xyHwnd)
return
size := StrLen(message)
COPYDATA := Buffer(A_PtrSize * 3)
NumPut("Ptr", 4194305, COPYDATA, 0)
NumPut("UInt", size * 2, COPYDATA, A_PtrSize)
NumPut("Ptr", StrPtr(message), COPYDATA, A_PtrSize * 2)
return DllCall("User32.dll\SendMessageW", "Ptr", xyHwnd, "UInt", 74, "Ptr", 0, "Ptr", COPYDATA, "Ptr")
}
Win10, Win11 @100% 2560x1440 22H2
Re: Middle-Click in the Hamburger Menu
Thanks, I'll give that a go. A couple of questions:
1) Is this code for AutoHotkey v1 or v2?
2) What do I do with the perm variable?
Windows 10 Pro 22H2
Re: Middle-Click in the Hamburger Menu
Hi kiwichick. hotif is available is AHK Version 2 only so norn's script is version 2. I use the older version of AHK (many of us still do). You can get more background and examples here for using AHK to detect a right click or middle click in a XYplorer context menu viewtopic.php?t=18062. I just recently set up my BC hamburger menu to use left and right click, but you can easily use it for middle click also. I've been using it for years for detecting right clicking in other XYplorer menus. I can provide you with the code for the menu below if you want to use it as an example.
The perm is used in the XYplorer script to determine which mouse click was used. In this case the perm established in the AHK script is called $rmb. So, if $rmb is "1", one action is taken if not the other action is. The perm variable, $rmb must be cleared so it doesn't affect subsequent operations. For example:
The perm is used in the XYplorer script to determine which mouse click was used. In this case the perm established in the AHK script is called $rmb. So, if $rmb is "1", one action is taken if not the other action is. The perm variable, $rmb must be cleared so it doesn't affect subsequent operations. For example:
Code: Select all
::LayCatTools Session Manager;/:tabsets;if($rmb=="1"){load "<xyscripts>\SessionManager.xys";} else {load "<xyscripts>\LayCatTools.xys";}unset $rmb;
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440
Re: Middle-Click in the Hamburger Menu
Thanks, I managed to figure that out.
Yes please, that would be great!I can provide you with the code for the menu below if you want to use it as an example.
Thanks again, I realise that but was confused as to why that particular piece of code was posted separately and whether I needed to do something with it other than it being in the script.The perm is used in the XYplorer script to determine which mouse click was used.
So, as long as I have AutoHotkey V2 installed (which I do), do I just run the script as is and the middle-click should work in the Hamburger Menu? Only asking because that's what I did but it didn't work.
Windows 10 Pro 22H2
Re: Middle-Click in the Hamburger Menu
kiwichick wrote: ↑27 Aug 2023 04:57Thanks, I managed to figure that out.
Yes please, that would be great!I can provide you with the code for the menu below if you want to use it as an example.
Thanks again, I realise that but was confused as to why that particular piece of code was posted separately and whether I needed to do something with it other than it being in the script.The perm is used in the XYplorer script to determine which mouse click was used.
So, as long as I have AutoHotkey V2 installed (which I do), do I just run the script as is and the middle-click should work in the Hamburger Menu? Only asking because that's what I did but it didn't work.
EDITED TO ADD: OK so when I said it didn't work, I was wrong. It works when using middle-click on my mouse. However, I have an AutoHotkey script that uses a key on my keyboard to act as middle-click and the Hamburger Middle-Click script doesn't work when using that key.
Windows 10 Pro 22H2
Re: Middle-Click in the Hamburger Menu
You'll have to incorporate the fact that the AutoHotkey script is setting the perm variable to "1" (in norn's AHK v2 script that's that $MButton) which recognizes that a middle click was used. First, that AHK script has to be started. If it's something you want to use all the time, then it should be started when Windows starts.
I use a Visual basic file to start the AHK script when Windows boots. It does many other things along with this. The link to it in my case is in the folder/name: C:\Users\ken\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ahkVB.vbs.lnk The VB startup file, ahkVB.vbs is:That file refers to and starts the AHK file in my case that's:
I have a Logitech MX Keys keyboard which can simulate various mouse and keyboard actions. I'll have to check if I can simulate that middle click on the keyboard, but that would be independent of AHK and the XY script.
Edit: Sorry I forgot the hamburger script.
I use a Visual basic file to start the AHK script when Windows boots. It does many other things along with this. The link to it in my case is in the folder/name: C:\Users\ken\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ahkVB.vbs.lnk The VB startup file, ahkVB.vbs is:
Code: Select all
Set objShell = CreateObject("WScript.Shell")
objShell.run("D:\Tools\AutoHotkey\AHKscripts\AHK_01.ahk")
"D:\Tools\AutoHotkey\AHKscripts\AHK_01.ahk"
Your XYplorer script has to determine if the middle mouse button was clicked by checking if the variable $MButton= "1" was set. If the variable is "1", you specify one action if it is not then specify another action. Look at my script for the examples on how to do that. In my script I'm using the perm variable $rmb whereas norn's is $MButton. That variable has to be cleared or unset after the actiion is taken so it doesn't affect subsequent actions.I have a Logitech MX Keys keyboard which can simulate various mouse and keyboard actions. I'll have to check if I can simulate that middle click on the keyboard, but that would be independent of AHK and the XY script.
Code: Select all
[Left] [Right]
::XY Updater Control Panel;/D:\Graphics\Icons\xy_02.ico; if($rmb=="1") {run "%windir%\explorer.exe shell:::{ED7BA470-8E54-465E-825C-99712043E01C}";}else {update 1+16+128;}unset $rmb;
::Device Manager Disk Management;/<xyicons>\preferences.ico; if($rmb=="1") {open "C:\Windows\System32\diskmgmt.msc";}else {open "C:\Windows\System32\devmgmt.msc";}unset $rmb;
::Move to other pane Copy to Pane;/:dpmoveto;if($rmb=="1") {#803;} else {#804;}unset $rmb;
::LayCatTools Session Manager;/:tabsets;if($rmb=="1") {load "<xyscripts>\SessionManager.xys";} else {load "<xyscripts>\LayCatTools.xys";}unset $rmb;
::Latest 30 files Latest 5 files;/:visualfilter; if($rmb=="1"){tab("new",'vi:<pick 5.m> //"Latest 5"');} else {tab("new",'vi:<pick 30.m> //"Latest 30"');}
::Pick Gifs Pick Webms;/:cfi; if($rmb=="1") {goto 'vi:<get pick |.webm "G:\PDFs and Books\Misc\tools"> //"Webm Tools"';} else {goto 'vi:<get pick |.gif "G:\PDFs and Books\Misc\tools"> //"Gif Tools"';}unset $rmb;
::Copy Path/Name Clipboard;/:clip; if($rmb=="1") {#625;} else {#101;}unset $rmb;
-
::Modified Today Modified this week;/D:\Graphics\Icons\filter_01.ico;if($rmb=="1") {filter "ageM: <=7 d";}else{filter "ageM: d"}unset $rmb;
::New folder New file;/:newfolder;if($rmb=="1") {#234;}else{#231;}unset $rmb;
-
Toggle global filter;#387;D:\Graphics\Icons\filter_01.ico
::DoubleClick WhiteSpace Menu;/:cfi;userbutton 46;
Help scripting commands;#1459;D:\Graphics\Icons\system volume info_03.ico
ShowHelpTopics;#1460;D:\Graphics\Icons\Help.ico
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440
Re: Middle-Click in the Hamburger Menu
Thanks for all that. sorry it took me so long to reply, I've been away on holiday. Did you manage to check if you could simulate the middle-click on your keyboard?klownboy wrote: ↑27 Aug 2023 12:30 You'll have to incorporate the fact that the AutoHotkey script is setting the perm variable to "1" (in norn's AHK v2 script that's that $MButton) which recognizes that a middle click was used. First, that AHK script has to be started. If it's something you want to use all the time, then it should be started when Windows starts.
I use a Visual basic file to start the AHK script when Windows boots. It does many other things along with this. The link to it in my case is in the folder/name: C:\Users\ken\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ahkVB.vbs.lnk The VB startup file, ahkVB.vbs is:That file refers to and starts the AHK file in my case that's:Code: Select all
Set objShell = CreateObject("WScript.Shell") objShell.run("D:\Tools\AutoHotkey\AHKscripts\AHK_01.ahk")
"D:\Tools\AutoHotkey\AHKscripts\AHK_01.ahk"
Your XYplorer script has to determine if the middle mouse button was clicked by checking if the variable $MButton= "1" was set. If the variable is "1", you specify one action if it is not then specify another action. Look at my script for the examples on how to do that. In my script I'm using the perm variable $rmb whereas norn's is $MButton. That variable has to be cleared or unset after the actiion is taken so it doesn't affect subsequent actions.
I have a Logitech MX Keys keyboard which can simulate various mouse and keyboard actions. I'll have to check if I can simulate that middle click on the keyboard, but that would be independent of AHK and the XY script.Edit: Sorry I forgot the hamburger script.Code: Select all
[Left] [Right] ::XY Updater Control Panel;/D:\Graphics\Icons\xy_02.ico; if($rmb=="1") {run "%windir%\explorer.exe shell:::{ED7BA470-8E54-465E-825C-99712043E01C}";}else {update 1+16+128;}unset $rmb; ::Device Manager Disk Management;/<xyicons>\preferences.ico; if($rmb=="1") {open "C:\Windows\System32\diskmgmt.msc";}else {open "C:\Windows\System32\devmgmt.msc";}unset $rmb; ::Move to other pane Copy to Pane;/:dpmoveto;if($rmb=="1") {#803;} else {#804;}unset $rmb; ::LayCatTools Session Manager;/:tabsets;if($rmb=="1") {load "<xyscripts>\SessionManager.xys";} else {load "<xyscripts>\LayCatTools.xys";}unset $rmb; ::Latest 30 files Latest 5 files;/:visualfilter; if($rmb=="1"){tab("new",'vi:<pick 5.m> //"Latest 5"');} else {tab("new",'vi:<pick 30.m> //"Latest 30"');} ::Pick Gifs Pick Webms;/:cfi; if($rmb=="1") {goto 'vi:<get pick |.webm "G:\PDFs and Books\Misc\tools"> //"Webm Tools"';} else {goto 'vi:<get pick |.gif "G:\PDFs and Books\Misc\tools"> //"Gif Tools"';}unset $rmb; ::Copy Path/Name Clipboard;/:clip; if($rmb=="1") {#625;} else {#101;}unset $rmb; - ::Modified Today Modified this week;/D:\Graphics\Icons\filter_01.ico;if($rmb=="1") {filter "ageM: <=7 d";}else{filter "ageM: d"}unset $rmb; ::New folder New file;/:newfolder;if($rmb=="1") {#234;}else{#231;}unset $rmb; - Toggle global filter;#387;D:\Graphics\Icons\filter_01.ico ::DoubleClick WhiteSpace Menu;/:cfi;userbutton 46; Help scripting commands;#1459;D:\Graphics\Icons\system volume info_03.ico ShowHelpTopics;#1460;D:\Graphics\Icons\Help.ico
Windows 10 Pro 22H2