@keydown option HELP

I created a button that can show and save layout lists. But the option @keydown doesn't work with it:

<?xml version="1.0"?> <button backcol="none" display="icon" textcol="none" type="menu_button"> <label>Layout</label> <tip>Show layout list</tip> <icon1>#savedlayoutsedit</icon1> <function type="normal"> <instruction>Prefs LAYOUTEDIT</instruction> </function> <button backcol="none" display="label" separate="yes" textcol="none"> <label>Prefs LAYOUTLIST</label> <tip>Close opened list when &quot;SHIFT&quot; is pressed</tip> <function type="normal"> <instruction>@keydown:none </instruction> <instruction>Prefs LAYOUTCLOSELISTERS=yes LAYOUTLIST </instruction> <instruction>@keydown:shift</instruction> <instruction>Prefs LAYOUTCLOSELISTERS=no LAYOUTLIST </instruction> <instruction> </instruction> </function> </button> <button backcol="none" display="both" textcol="none"> <label>Backup all lists layout...</label> <tip>bla bla</tip> <icon1>#savealllisters</icon1> <function type="normal"> <instruction>Prefs LAYOUTSAVE</instruction> </function> </button> </button>

Please can you test it and tell me why when I press shift+left click on a layout, it's the same as just left click?

The Prefs LAYOUTLIST command doesn't run anything directly; it generates a list of other buttons.

The code you have there will change which buttons are generated depending on whether or not shift is held down when the toolbar/menu is opened or updated, not when you click on something in the menu. By the time you click the choice has already been made.

You can see it better using a command like this:

@keydown:none Go DRIVEBUTTONS @keydown:shift Prefs LAYOUTLIST
If you put that in a sub-menu and click open the sub-menu, you'll get a list of drive buttons. If you hold shift when you click open the sub-menu then you'll get a list of layouts. By the time you can see the menu items the choice of which type you see has already been made.