Omnis Technical Note TNID0006 July 2010
Changing the Built-in Shortcut Keys
for Omnis Studio 5.0.1 or above
As of Studio 5.0.1, it is possible to edit the default shortcut keys used by Omnis, allowing users to customise Omnis to suit their preferences, or to overcome any issues that different keyboards may have with certain characters. These shortcut keys are now defined, and editable in Studio's default string table (studio.stb).
All character keys are supported as shortcut keys, although you should take care not to conflict with existing shortcuts. For example, Setting a new shortcut to Ctrl-C will override the default 'copy' shortcut. Several non-character keys will also work, but by no means all of them, so you are best advised to test these individually.
Note that Studio will automatically load the translations from studio.stb for the column that matches your $language preference's locale setting (Languages can be added or edited using the omnisloc.lbs, found in your installation's 'local' folder).
Changing the size of list text
By default, you are able to change the size of the text within a list on the fly using Ctrl-[ and Ctrl-]. It is now a simple matter to change this, individually, for each language you are supporting.
- Press F9 (Cmd-9 on Mac) to open the Catalog.
- Browse to the "StringTable" tab, and locate the "Built-in Strings" entry. Right-click and select "find strings" - this allows you to search for the STRINGID of all strings used by Omnis.
- In the search box, search for "". Select the line " (list font size)", right click and copy to clipboard.
- Now return to the Catalog, right click "built-in strings" again, and select "Edit built-in strings". This will open the string table editor, allowing you to create your custom translations.
- Add a row if needed, then in the STRINGID column, paste the contents of your clipboard. Rename your first translation column, using the country code in your $language setting, e.g. if your $language preference is ENGLISH, rename the column as 'en_gb'."
- Copy the STRINGID into your translation column and change '' to the 2 characters you wish to use.
Save and exit the String Table Editor, and if your current $language matches that of your translation column name, the new shortcut keys will now be in effect.
(Note, you will still have to hold the Ctrl/Cmd key whilst pressing your new key binding)
Comment/Uncomment code lines
By default, you are able to comment or uncomment selected lines of code in the method editor using the ; and ' keys respectively, whilst holding Ctrl/Cmd.
To change these bindings, repeat the steps above, but you should search instead for "comment". Select the line with "2846!~Comment Selected Lines\; 2221", add a row to your string table, and in your translation column, just change the ; character to your new comment key..
Do the same for "2847!~Uncomment Selected Lines\' 2222", changing the ' character to your new uncomment key.
The above examples illustrate the processes involved in customising shortcut keys. The same approach can be used to customise any of the other shortcut keys in Omnis by searching for them and editing them in a similar fashion.