Keyboard Shortcuts

From Opentaps Wiki

Jump to: navigation, search

Many older mainframe or desktop-based business applications have keyboard shortcuts, or hotkeys, that allow you to navigate the application by using keyboard sequences such as F2, Ctrl-FT, Ctrl-O-E. opentaps supports a similar capability. You can configure keyboard shortcuts for your users, either globally for all the application or for a particular applications such as CRM or purchasing.

Configuring keyboard shortcuts is a two-step process. First, you need to have a JavaScript handler for your shortcuts. Opentaps comes with two default handlers, KB_URL and KB_FOCUS. The first one redirects the browser to a different URL, the second one focuses the browser on an element of the current screen document. These are defined in hot-deploy/opentaps-common/data/CommonSeedData.xml, and you can define other JavaScript handlers like this:

<KeyboardShortcutHandler actionTypeId="KB_URL" description="Redirects to the target URL" handler="opentaps.addUrlShortcut" />
<KeyboardShortcutHandler actionTypeId="KB_FOCUS" description="Set focus on the target DOM element" handler="opentaps.addFocusShortcut" />

Then, you would define the shortcuts for your applications using the KeyboardShortcut entity, like this:

 <KeyboardShortcut shortcutId="CRMSFA_FIND_OPPRT" sequenceNum="120" shortcut="f6" actionTypeId="KB_URL" actionTarget="findOpportunities" applicationName="crmsfa" description="Find Opportunities" />

If you do not specify an application name, then the shortcut will be valid for all the applications.

Once you have defined the shortcuts, the user can click on the [Shortcuts] link in the upper right-hand corner, and he would see the shortcuts available:

Image:Keyboard Shortcuts.png

There are sample shortcuts already defined in opentaps. In each application's data/<tt> directory, you will find a file called <tt>DemoKeyboardShortcuts.xml with these predefined shortcuts.

© Open Source Strategies, Inc. Development of this documentation site is sponsored by Open Source Strategies, Inc.
Help support opentaps with a subscription to this documentation site.