Possible set "name" for "on right click" in user buttons?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
cadu
Posts: 287
Joined: 18 Mar 2012 21:50

Possible set "name" for "on right click" in user buttons?

Post by cadu »

Hi,

When setting user buttons, I could give name for the "on left click" command, which is the default name field.
I also set a command for "on right click", but couldn't find how to name it.
Is it possible set "name" for "on right click" in user buttons?
I recorded my screen showing the issue: https://goo.gl/DU27mi

Thanks for assistance,
Carlos

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Possible set "name" for "on right click" in user buttons?

Post by TheQwerty »

You need to specify a caption for your scripts.

So change your click definitions to:

Code: Select all

"Paste Image Into New File" #206;
"Paste As Shortcut(s)" #218;
Further you can use the variable version of get('MenuCaption', command_ID, flags) to pull the captions used by XY for these command. This is nice in that it will use the active translation and optionally show the assigned shortcut key:

Code: Select all

"<get MenuCaption 206 5>" #206;
"<get MenuCaption 218 5>" #218;
In this case the flags value of 5 means include the keyboard shortcut and show an error message if the specified command ID does not exist.

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

Re: Possible set "name" for "on right click" in user buttons?

Post by klownboy »

Depending on how far or how carried away you want to get for CTBs, you can also achieve a hover tooltip with a return so that you can more clearly see the left click name and the right click name. See what I mean in the example caption below. The problem is you can't accomplish this by modifying the name edit field for the CTB. Unfortunately, you also can't accomplish it by using SC ctbname either. At least I haven't found a way (though it might be nice if we could Don). So you have to edit the XYplorer.ini file directly. Personally though I think it's worth it for those CTBs you have which have actions assigned for both the left and right mouse buttons made and will use forever...well a long time.
CTB_Tooltip_Capture.JPG
CTB_Tooltip_Capture.JPG (12.47 KiB) Viewed 2353 times
So you have to find the listing of CTB assignments in the XYplorer.ini file and modify the CTB name assignments (listed under the header [CustomButtons]) that you desire as follows:

Code: Select all

5=""[L] Layout Manager¶	[R] Session Manager|:tabsets|0|0" global $DYN_InpSess = "Normal"; load "SessionManager.xys", "_Load";	load("<xyscripts>\SessionManager.xys");"
You can see there's a return and tab (the tab doesn't display here) "¶ " between [L] left and [R] right name assignments...the rest is not important for the desired result. The [L] left name and [R]right name will show up in the name block of the CTB edit box, but you will not see the return and tab. Remember you have to save the ini file when done and exit XY without saving and then restart XYplorer.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Possible set "name" for "on right click" in user buttons?

Post by bdeshi »

klownboy wrote:you can also achieve a hover tooltip with a return so that you can more clearly see the left click name and the right click name. [...] Unfortunately, you also can't accomplish it by using SC ctbname either.

Code: Select all

ctbname('LClick caption'.<crlf>.'RClick caption');
should work.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Possible set "name" for "on right click" in user buttons?

Post by klownboy »

Good to see you back here more often Sammay and thanks that did work fine. Though I suppose if one was doing this for a bunch of CTBs for the first time, they might as well modify the ini file. Thanks again.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Possible set "name" for "on right click" in user buttons?

Post by bdeshi »

klownboy wrote:Good to see you back here more often Sammay
Thanks, happy to be in the club with you all. :) Life's hectic. And that's great.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

cadu
Posts: 287
Joined: 18 Mar 2012 21:50

Re: Possible set "name" for "on right click" in user buttons?

Post by cadu »

Thanks for all responses!
Regarding
Though I suppose if one was doing this for a bunch of CTBs for the first time, they might as well modify the ini file.
, could you please give more directions on how to modify the ini file?

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

Re: Possible set "name" for "on right click" in user buttons?

Post by klownboy »

Go to the "Tools" menu item and select "Open Configuration file..." It will open the XYplorer.ini file with the designated editor. From there just scroll down or search for [CustomButtons] and you will see the listing of all your CTBs. You'll see that they start with 1=""bla, bla, bla, 2= ""bla, bla bla. So in the very beginning now you can modify the names for Left and Right clicks similar to what I have above. I use [L] name for left click action and [R] name for right click action, but you can do what ever you want. Another example:

Code: Select all

33=""[L] Configuration¶	[R] List Management
As I mentioned above you need the return symbol and tab between the left and right name. Good luck and remember what I said above about saving the ini file and then exiting XYplorer without saving and then restarting.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

cadu
Posts: 287
Joined: 18 Mar 2012 21:50

Re: Possible set "name" for "on right click" in user buttons?

Post by cadu »

Many thanks guys for all information!
So far I was dealing with single commands when "right clickling", and I could acomplish to caption them.
Then I tried to add a script with several commands to be listed when "right clickling". However, the list doesn't appear when I right click. Just a single messed line is appearing. If I click on the "click" option that appears just below this messed line, then the expect list works properly. I'm trying this script:

Code: Select all

$menus = <<<>>>
Paste;#202;:paste
Paste Text;#219
Paste Shortcut;#218
Paste SymLink;#270
Paste Special...;#210
>>>;
    $selected = popupmenu($menus, , , , , , <crlf>);
    if ($selected) { load $selected, , "s" }
    else { status "No item chosen, aborted!", "8B4513", "stop"; }
I also recorded my screen showing the issue in more detail: https://goo.gl/xDFhxJ
Does anyone know if it is possible, when "right clickling" a user button, a list with commands in script be showed?
Thanks!
Carlos

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

Re: Possible set "name" for "on right click" in user buttons?

Post by klownboy »

Hi cadu, do you have the XYplorer tweak CTBNoRClickDefaultCommands set to "1" as follows:

Code: Select all

CTBNoRClickDefaultCommands=1
That may be causing your problem because I ran your example script on the right click of a CTB and it ran without issues. Also make sure you have your code lines all indented at least one space. EDIT: Sorry no indents on your heredoc lines.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

cadu
Posts: 287
Joined: 18 Mar 2012 21:50

Re: Possible set "name" for "on right click" in user buttons?

Post by cadu »

Code: Select all

CTBNoRClickDefaultCommands=1
It worked. Many thanks!

Post Reply