Page 1 of 1

get("listofcommands",..) - kbd-accelerators

Posted: 17 Jan 2021 19:23
by MBaas
As the subject says.

Proof:
17-01-_2021_19-16-51.png

Code: Select all

gettoken(get("listofcommands"),396,<crlf>);
#1407	User | Go To | Root	
I'd like to use it in a popupnested, so the accelerator would be useful to have.

Re: get("listofcommands",..) removes kbd-accelerators

Posted: 17 Jan 2021 19:57
by highend
I don't see a bug here. List of All Commands does not provide that information (and it never has).

You are proving it by posting #1407 while you are showing #1404 :party:

I'll move this to Wishes...

I'll guess the best way would be to add flags=4 for the commands to include their accelerator.
Don't make this the default without a new flag, it would break (my) existing scripts :mrgreen:

Re: get("listofcommands",..) - kbd-accelerators

Posted: 17 Jan 2021 20:15
by klownboy
highend beat me to it, but you can use "1" flag with get("listfofcommands") to append Command IDs and use "2" flag to append keyboard shortcuts per the help file, So...

Code: Select all

 $accel = gettoken(gettoken(get("listofcommands",2),320,<crlf>), "-1", "<tab>");  // keyboard shortcut alone
 $command = gettoken(get("listofcommands",2),320,<crlf>);   //the entire command line
 e $accel;
 e $command;
 
I'm not sure if that's what you're after.

Re: get("listofcommands",..) - kbd-accelerators

Posted: 18 Jan 2021 09:10
by MBaas
highend: sorry for the confusion. I thought that it was a bug and wanted to post it there. But then I went back and RTFM'ed again and noticed that flags can be used to include keyboard shortcuts, not accelerators. So I ended the msg as if it was a feature request - but then forgot to update title and post to a different forum. Thanks for rectifying that!

klownboy: I think this answered your comment :wink: