Here is a quick script to start from…
var oActionMgr = MainWindow.getActionMgr();
var nActions = oActionMgr.getNumActions();
var oAction = undefined;
var sShortcut = undefined;
var aShortcuts = [];
var i = 0;
// Create a new dialog
var wDlg = new DzBasicDialog;
wDlg.caption = "Keyboard Shortcuts";
// Create a listbox
var wListBx = new DzListBox( wDlg );
wDlg.addWidget( wListBx );
// Collect shortcuts
for( i = 0; i < nActions; i += 1 ){
oAction = oActionMgr.getAction( i );
sShortcut = oAction.shortcut.toString();
if( !sShortcut.isEmpty() ){
aShortcuts.push( String("%1 = %2").arg( sShortcut ).arg( oAction.text.replace("&", "" ) ) );
}
}
aShortcuts.sort();
// Populate the listbox
for( i = 0; i < aShortcuts.length; i += 1 ){
wListBx.insertItem( aShortcuts[ i ] );
}
// Show the dialog
wDlg.exec();
Just copy the contents of the code block above, paste it into a new text document in your favorite text editor and save it to a file named “Keyboard Shortcuts.dsa”. Then, depending on where you save it, you can launch the script via drag-n-drop onto the viewport, double click from within the Content Library pane, a Custom Action in the Main Menu Bar or a Toolbar, etc.
-Rob