Is there a kbd-shortcut to open the hamburger-menu?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Is there a kbd-shortcut to open the hamburger-menu?

Post by highend »

But I accept the challenge
:)

You don't need to delete the ini file first, savesettings will overwrite it if it already exists

As long as you don't use button names for commands and no ids your script looks fine as well
One of my scripts helped you out? Please donate via Paypal

MBaas
Posts: 709
Joined: 15 Feb 2016 21:08

Re: Is there a kbd-shortcut to open the hamburger-menu?

Post by MBaas »

You don't need to delete the ini file first, savesettings will overwrite it if it already exists
Oh right - and it's even mentioned in the doc (which I read) :oops:
As long as you don't use button names for commands and no ids your script looks fine as well.
I'm not using button-names, but "#1070;;:go" would qualify as an ID, right? But even w/o special treatment that option works fine.
____________________________________________________________________________________
Happy user. Screen scaling 100% and W11Pro [Version 10.0.26200.7922], XY 28.30.14000 * F² * LinkTree

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

Re: Is there a kbd-shortcut to open the hamburger-menu?

Post by highend »

It would. Interestingly in a similar context the menu tends to execute the id twice. So, if it works fine here, you don't need that check
One of my scripts helped you out? Please donate via Paypal

MBaas
Posts: 709
Joined: 15 Feb 2016 21:08

Re: Is there a kbd-shortcut to open the hamburger-menu?

Post by MBaas »

Or maybe I'm just lucky - because :go can be executed repeatedly without damage :wink:

I will adopt your code - because otherwise I will have long forgotten this discussion when my enhanced Hamburger produces garbage in a year or so :whistle:
____________________________________________________________________________________
Happy user. Screen scaling 100% and W11Pro [Version 10.0.26200.7922], XY 28.30.14000 * F² * LinkTree

MBaas
Posts: 709
Joined: 15 Feb 2016 21:08

Re: Is there a kbd-shortcut to open the hamburger-menu?

Post by MBaas »

Things just got easier:

Code: Select all

$inifile = "%temp%\xysettings.tmp";
  savesettings 1,$inifile;
  $hamburgerMenu = getkey("CrumbHamburger","Settings", $inifile);
  delete 0,0,$inifile;
    if ($hamburgerMenu) {
        $command = popupnested($hamburgerMenu);
        if ($command) {
            // Don't execute XY ids twice
            if (!regexmatches($command, "^#\d+")) {
                // We need to translate items like ":newfolder" to the button id that needs to be used for it
                if (regexmatches($command, "^:[^:]")) {
                    button $command;

                // Normal script execution
                } else {
                    load $command, , "s";
                }
            }
        }
    }
____________________________________________________________________________________
Happy user. Screen scaling 100% and W11Pro [Version 10.0.26200.7922], XY 28.30.14000 * F² * LinkTree

klownboy
Posts: 4481
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Is there a kbd-shortcut to open the hamburger-menu?

Post by klownboy »

For some reason I was thinking that SC getkey did not require a save of settings before use (i.e., that it got the latest in memory even if not saved to disk yet). That may be an old age thing. Anyway, I had made a SC getkey change to your script highend. $hamburgerMenu = getkey("CrumbHamburger","Settings"); in place of your line which was required at the time because of the duel "CrumbHamburger" lines. When I made a change to the Hamburger menu itself, the change was carried out (no save necessary). No change was seen in the save settings toolbar icon indicating a save was necessary. When I used the script however, with the above SC getkey change, the change was not carried out.

I haven't tested further, but I assume that means a savesettings should be accomplished first always to get the latest SC getkey from XYplorer.ini. If that's the case should the help file explicitly state that point?

klownboy
Posts: 4481
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Is there a kbd-shortcut to open the hamburger-menu?

Post by klownboy »

Hi MBaas, you do have to savesettings prior to using SC getkey here, but you do not have to save settings to a temp file to read. See my previous post.

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

Re: Is there a kbd-shortcut to open the hamburger-menu?

Post by highend »

I don't know if it's necessary to point that out. getkey() reads from a file, not something that may have changed in the current session but wasn't saved so far.

But I see this as a kind of bug that after changing the hamburger menu, "Settings Special" doesn't show the * for "Save Settings". Maybe you file a bug report for this?
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4481
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Is there a kbd-shortcut to open the hamburger-menu?

Post by klownboy »

highend wrote: ↑03 Nov 2020 16:39 I don't know if it's necessary to point that out. getkey() reads from a file, not something that may have changed in the current session but wasn't saved so far.
Well maybe but Don does make a point of saving settings in the help for SC setkey, so they should probably be consistent.
Note: Only the key on disk is changed, not the current setting in memory! To realize any changes made via setkey you should use "Restart without Saving" in menu File!
highend wrote: ↑03 Nov 2020 16:39 But I see this as a kind of bug that after changing the hamburger menu, "Settings Special" doesn't show the * for "Save Settings". Maybe you file a bug report for this?
Yeah, I thought that a bit odd and I think that's what got me on the wrong trail concerning savesettings and getkey. I can submit a bug.

Post Reply