1
edit
Changes
→Shortcut Help Window
===Shortcut Help Window===
The Shortcut Help Window, found at dev/bigbluebutton-client/src/org/bigbluebutton/main/views/ShortcutHelpWindow.mxml, is an in-client guide to all hotkeys in the application. There are several things that need to be done before we can really look at how they all work together, so let's get started. The first thing you have to do is add your keycodes into the locale files. For each keycode, you want both the ASCII value of the key and a plain-language description of what the hotkey does. For example, these two lines are the English locale entry for the "focus Presentation window" hotkey already mentioned:
<pre>
bbb.shortcutkey.focus.presentation = 52
</pre>
'''NOTE: It is VERY important that it follow the same pattern of bbb.X, bbb.X.function. Otherwise, the Shortcut Window will not process it correctly.'''
While you are editing the locale, you also need to add a string to describe your module in the Help window dropdown list. As an example, let's say that you are developing something called the Opinion module:
<code>bbb.shortcuthelp.dropdown.opinion = Opinion shortcuts</code>
'''REMINDER: After any change to the locale file, you will need to recompile with ant locales.'''
Now, we edit the ShortcutWindow.mxml itself. First, in the instance variables you will see a set of ArrayLists (genKeys, presKeys, chatKeys, etc) and a set of corresponding Arrays. You want to create one of each, following the pattern you'll be able to see in the file. For example, let's say that your Opinion module lets a user fill in a text box and then click a button to submit their text, and it is called the Opinion module. The instance variables in your ShortcutWindow.mxml should look like this:<br>''/**/ symbol used to denote areas to really pay attention to.''
<pre>
private var genKeys:ArrayList;
private var audKeys:ArrayList;
private var viewerKeys:ArrayList;
/**/private var opinionKeys:ArrayList;/**/
private var genResource:Array = ['bbb.shortcutkey.flash.exit', 'bbb.shortcutkey.focus.viewers', 'bbb.shortcutkey.focus.listeners',
'bbb.shortcutkey.focus.video', 'bbb.shortcutkey.focus.presentation', 'bbb.shortcutkey.focus.chat',
private var viewerResource:Array = ['bbb.shortcutkey.viewers.makePresenter'];
/**/private var opinionResource:Array = ['bbb.shortcutkey.opinion.focusInput', 'bbb.shortcutkey.opinion.submit'];/**/</pre> Now, look at the reloadKeys() method, and add <code>opinionKeys = loadKeys(opinionResource);</code><br> Also, in the changeArray() method, add a case to the switch-case clause for your module to add its hotkeys to the shownKeys ArrayCollection:<pre>private function changeArray():void { shownKeys = new ArrayCollection(); switch(categories.selectedIndex) { case 0: //General shownKeys.addAll(genKeys); break; case 1: //Presentation shownKeys.addAll(presKeys); break; case 2: //Chat shownKeys.addAll(chatKeys); break; case 3: //Audio shownKeys.addAll(audKeys); break; case 4: //Viewers shownKeys.addAll(viewerKeys); break; case 5: //Opinion shownKeys.addAll(opinionKeys); break; }}</pre> Finally, at the end of the MXML, there is an ArrayCollection hard-coded with a set of "bbb.shortcuthelp.dropdown.x" strings; add your bbb.shortcuthelp.dropdown.opinion to that set. Now that everything is in place, we can have a look at how it all fits together. The ArrayCollection we edited at the end populates the Help window's dropdown list with the different categories of hotkeys: General, for the global scope, and then the local hotkeys for each module. The switch-case clause we added to links each category in the dropdown list to one of the Key ArrayLists, and uses them to populate the window's DataGrid. The DataGrid shows the full hotkey sequence and plain-language description for each hotkey, as it takes them from the relevant Resource Array. But the important thing is, it works, and users can now see which hotkeys do what in your module. Now we actually have to make them do something.
===Global Shortcuts===