Page 1 of 2
Is there a kbd-shortcut to open the hamburger-menu?
Posted: 29 Oct 2020 18:51
by MBaas
I mean the Hamburger in the breadcrumb-bar...and I'm looking for a shortcut to open that...
Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 29 Oct 2020 18:58
by WirlyWirly
I belive Ctrl+Backspace is what you're looking for
If you go to Tools -> Customize Keyboard Shortcuts -> Jump..., you can lookup the shortcuts by name.
Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 29 Oct 2020 20:33
by MBaas
No, I mean this:
29-10-_2020_18-49-07.png
I had looked through that jump-list but found no item that seemed to match this function...
Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 29 Oct 2020 20:49
by highend
If in doubt you could get the position of the bc 1 / bc 2 controls and and open a popupmenu() there with the content of CrumbHamburger= from the .ini file...
Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 30 Oct 2020 09:23
by MBaas
Thanks - sounds like a plan! I'll see if I'm able to do that...

Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 30 Oct 2020 10:13
by MBaas
Duh - I can't just read "CrumbHamburger", because that setting is used twice, it seems: there is one entry =1 (which seems to enable the Hamburger) and the second one which sets the menu.
Does the Hamburger not have an internal ID? (Would be sooo much simpler...)
Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 30 Oct 2020 10:20
by highend
Ask Don to add one^^
Apart from that, sure you can read it...
Code: Select all
$hamburgerMenu = gettoken(gettoken(regexmatches(readfile("<xydata>\<xyini>"), "^CrumbHamburger=.+?(?=\r?\n|$)", "<::>"), 2, "<::>"), 2, "=", , 2);
Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 30 Oct 2020 10:50
by MBaas
Beautiful - thanks!
Sad to see how I suck at scripting

Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 30 Oct 2020 14:31
by highend
At least you get the simple way back again with getkey() (in the next beta)...
Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 30 Oct 2020 14:39
by MBaas
Oh, I
see - great!

Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 31 Oct 2020 20:14
by highend
I had a few minutes, so as an example:
Code: Select all
// We're assuming that menu entries are separated via "|" and multiple statements / expressions via ";" in "CrumbHamburger="!
$hamburgerMenu = gettoken(gettoken(regexmatches(readfile("<xydata>\<xyini>"), "^CrumbHamburger=.+?(?=\r?\n|$)", "<::>"), 2, "<::>"), 2, "=", , 2);
if ($hamburgerMenu) {
// Use breadcrumb bar 1
$bc = controlposition("BC 1");
$bcX = gettoken($bc, 1, "|");
$bcY = gettoken($bc, 2, "|");
$command = popupnested($hamburgerMenu, $bcX, $bcY);
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";
}
}
}
}
Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 31 Oct 2020 21:34
by klownboy
Works great highend.

If Don breaks the CrumbHamburgers from 2 identical single patty burgers to slightly different burgers, you'll be able to use SC getkey.

Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 31 Oct 2020 22:00
by highend
More hamburgers for me
This script is missing to use a temp ini and saving it's settings to it first (and read the data from there) to take all current changes to the menu into account, but I leave that to MBaas for small learning example...
Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 31 Oct 2020 23:58
by klownboy
highend wrote: ↑31 Oct 2020 22:00
This script is missing to use a temp ini and saving it's settings to it first (and read the data from there) to take all current changes to the menu into account...
Yeah, but it's really not that necessary unless you're frequently changing hamburgers.
Re: Is there a kbd-shortcut to open the hamburger-menu?
Posted: 01 Nov 2020 11:50
by MBaas
Oh well - to be honest: I'm happy with the humble script I ended up with:
Code: Select all
$hamburgerMenu = gettoken(gettoken(regexmatches(readfile("<xydata>\<xyini>"), "^CrumbHamburger=.+?(?=\r?\n|$)", "<::>"), 2, "<::>"), 2, "=", , 2);
$sel = popupnested($hamburgerMenu);
W/o controlling position, it just pops up whereever the cursor is - which make it appear like a context-menu - and that's more how I use it (most options I have deal with a current or selected file(s) or folder(s)).
But I accept the challenge
Code: Select all
$inifile = "%temp%\xysettings.tmp";
if (exists($inifile)==2) {delete 0,0,$inifile;}; /* naive way to avoid name clashes */
savesettings 1,$inifile;
$hamburgerMenu = gettoken(gettoken(regexmatches(readfile($inifile), "^CrumbHamburger=.+?(?=\r?\n|$)", "<::>"), 2, "<::>"), 2, "=", , 2);
$sel = popupnested($hamburgerMenu);
delete 0,0,$inifile;
Granted - one could be more sophisticated about the name of $inifile - but for my usage it is totally sufficient (until proof of contrary...)