[Script] WhiteSpaceCtxMenu

Discuss and share scripts and script files...
Stef123

Re: [Script] WhiteSpaceCtxMenu

Post by Stef123 »

Thanks for pointing it out Ken,
cannot upgrade atm, working on a protected system and need to finish here. Will be out for the weekend, if I don't find the time tonight, I'll check up on it Monday.

Stef123

Re: [Script] WhiteSpaceCtxMenu

Post by Stef123 »

klownboy wrote:Hey Stef123 , I was hoping you could check the operation of WhiteSpaceCtxMenu. Specifically, right click selecting of a files(s) from outside the file to the file to select it, and see if the menu comes up as it did before. It's not happening anymore since 15.80.0002
Confirmed.
Come to think of it, Ken, with the new modifier-detection we could open our menus by say, Ctrl-right-clicking on a selection. Which I'd like better anyway, it's more mainstream and similar to other apps, as opposed to right-clicking on white. But how do I script this?

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: [Script] WhiteSpaceCtxMenu

Post by highend »

I'll script it xD
One of my scripts helped you out? Please donate via Paypal

Stef123

Re: [Script] WhiteSpaceCtxMenu

Post by Stef123 »

highend wrote:I'll script it xD
Awesome. :tup: :appl: :beer:

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

Re: [Script] WhiteSpaceCtxMenu

Post by klownboy »

Stef123 wrote:
klownboy wrote:Hey Stef123 , I was hoping you could check the operation of WhiteSpaceCtxMenu. Specifically, right click selecting of a files(s) from outside the file to the file to select it, and see if the menu comes up as it did before. It's not happening anymore since 15.80.0002
Confirmed.
Come to think of it, Ken, with the new modifier-detection we could open our menus by say, Ctrl-right-clicking on a selection. Which I'd like better anyway, it's more mainstream and similar to other apps, as opposed to right-clicking on white. But how do I script this?
Hi Stef123, yes clicking directly on the file/folder is definitely the way to go, but it's really not possible using XY scripting alone. You need a trigger to accomplish it all by mouse directly and immediately (not though another menu). We can detect that we are over a certain file type (with itematpos) and control area (with controlatpos) and that a certain modifier is pressed, but how do you initiate the action like you do with right click on white (which is handled internally by XY)? I can take advantage of the modifier key in WhiteSpaceCtxMenu as I did with the vTB script and I may do that just to have an extra option such that if you click on white with a modifier you would get a different menu.

Highend has something very special coming our way. You'll love it. Bring up different menus or run programs where ever you click. :D

Back on my original issue or question. I wonder what caused the change in behavior as far as starting the selection with the right mouse button on white and moving onto the file to select it not working as before. I'm considering reporting it anyway to Don. It may be an unintended result of some other change like the modifiers. It seems like the difference between a mouse down reaction (as it was before) versus a mouse release action as it is now (i.e., WhiteSpace action is now being triggered on mouse release vs mouse down). What do you think? Thanks.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

Stef123

Re: [Script] WhiteSpaceCtxMenu

Post by Stef123 »

klownboy wrote: It seems like the difference between a mouse down reaction (as it was before) versus a mouse release action as it is now (i.e., WhiteSpace action is now being triggered on mouse release vs mouse down). What do you think? Thanks.
Way beyond my realm of knowledge, I am afraid. I remember reading about such subtle distinctions in ahk help, but couldn't figure out what to do with it. Even more clueless when it comes to XY. Not the slightest idea how this up/down mouse button thingie may apply to our right-click trigger. Probably best to hand it over to Don, just like you said.

You making me even more curious about the special brew that's cooking on highend's stove. His plate is already loaded with plenty of other scripts we keep throwing his way - XY updater, archive handler .... :mrgreen: - well, if there is one guy to juggle it all, it's gotta be highend, he's really living up to his screen name. :D

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

Re: [Script] WhiteSpaceCtxMenu

Post by klownboy »

Hi Stef123, I passed that behavior change to Don in Bug Reports though not so much a bug as a unwelcomed change. Yes highend, has a lot on his plate between this new script and YAUM and who knows what else, but he can handle it. :appl:
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

sheeeple
Posts: 13
Joined: 08 Aug 2016 17:31

Re: [Script] WhiteSpaceCtxMenu

Post by sheeeple »

Hey Ken,
I made a script to somewhat automate building the open-with portion of the menu. It uses the tags database to find the relevant .exe(s).
It's currently quite basic so it has a few limitations:
[*] The label depends on the ProductName property of the exe.
[*] You can't set a custom icon, it uses the application icon.
[*] there's probably some more, idk.
I still haven't thoroughly tested this so I'm sure I overlooked something somewhere. I just thought I'd share this anyway.

Usage:
The user might have a huge tag database and reading through it might slow the context menu initialization so Its probably better (I think) to use permanent vars and just do the exe finding/menu building at start-up (I use /script="_init.xys").

In my _init.xys

Code: Select all

include_once "MenuBuildHelper";
$tagdata    = GetExeTagData();
    $videoExes   = GetTaggedExes($tagdata, "VideoPlayer"); // you can use whatever tags you want
    $videoApp    = GetTaggedExes($tagdata, "VideoApp");    // diff tag for 'open only' apps :(
    $imageExes  = GetTaggedExes($tagdata, "ImageViewer|ImageEditor"); // can use multiple tags
    
    perm $p_videomenu = BuildMenu($videoExes) . BuildMenu($videoApp, 1); // second parameter: 0 = openwith; everything else = open
    perm $p_imagemenu = BuildMenu($imageExes);
    
    ......
    some other stuff to do at start-up
Then on WhiteSpaceCtxMenu.xys

Code: Select all


    $image = $p_imagemenu . <<<IMAGE
    ... // your stuff with custom icons and etc.
IMAGE;

    $vid = $p_videomenu . <<<VIDEO
    ... // other stuff
VIDEO;
Attachments
MenuBuildHelper.xys
v0.8
(3.45 KiB) Downloaded 165 times

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: [Script] WhiteSpaceCtxMenu

Post by Filehero »

Hi,

what logic is supposed to happen when the list is empty? Here I can't get any "standard" right context menu popping up (especially the Tortuoise SVN entries for repo checkout).

I do handle modifiers in my defined script.

Code: Select all

end((<get "shift"> == 1  || <get "shift"> == 2), );
I guess once this happens the event is already consumed to re-enter the default context menu path.


FH

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

Re: [Script] WhiteSpaceCtxMenu

Post by klownboy »

Hi Filehero,

I hope all is well. I assume you mean when you have nothing selected in the list you want a default menu to display. I have a combination of a Favorite Folders and a Copy/Move /New folders/New files menu come up when nothing is selected in the list pane as the default - it's the final "else" after a series of elseif's. Of course that can be different for different locations like the tree or the list panel. I've attached what my WhiteSpaceCtxMenu looks like now using: $mod = get("shift"); $loc = ControlatPos();
I don't think I've ever updated the script on the forum to reflect using control position or get("shift").
WhiteSpaceCtxMenu.xys
(6.72 KiB) Downloaded 168 times
I use this still along with highend's UMC, but it's been awhile since I've done any modifications to it. I hope it helps.

Best regards,
Ken
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: [Script] WhiteSpaceCtxMenu

Post by Filehero »

Hi Ken,

thanks, yes it helps, sort of.
klownboy wrote:in the list you want a default menu to display.
. Not a, but the default Windows File Explorer menu. Maybe I can build the entries by myself.

Yes, all is fine over here.

FH

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

Re: [Script] WhiteSpaceCtxMenu

Post by klownboy »

Sorry Filehero, I should have realized you were referring to "the default" context menu. Is it surprising that there isn't a command ID for that? I don't know. Obviously the context menu changes depending on the file type so if there is no file type or I should say no file or files selected, then how does XY know what to display. I suppose it could display the context menu shown when multiple file types are selected. If there was an ID, it would make it quite easy to do what you want. Without it you'd probably have to build one which is what highend has done in UMC. I still wonder if it would be possibly for Don to have a Command ID for the context menu so you could use the default context menu for a case like this or use the specific one if/when a specific file type is selected. It might be handy for building menus.

I experimented a bit with my keyboard since it has a context menu key which I never use normally. If I have no files selected in the list and I hit the key, my default WhiteSpaceCtxMenu displays. If I have a file selected of course the appropriate context menu displays just as if I had right clicked on the file.

Edit: And yes, I see what you mean about not being able to back track to the original context menu once you click on white space using a script.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

CookieMonster

Re: [Script] WhiteSpaceCtxMenu

Post by CookieMonster »

I searched this thread twice, I don't think there was a mention if no folder is selected how to modify the menu when clicking on white space ? There is a folder menu but that is strictly when a folder is selected, not when one clicks within white space.

What does the <<< represent ?

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: [Script] WhiteSpaceCtxMenu

Post by highend »

Code: Select all

CEA_ListRightClickOnWhite=0
CEA_ListRightClickOnWhite_Script=
What does the <<< represent ?
The help file will explain it...
One of my scripts helped you out? Please donate via Paypal

CookieMonster

Re: [Script] WhiteSpaceCtxMenu

Post by CookieMonster »

What is the white space in any pane called ?

Post Reply