notifications
Use notifications to configure alerts for the keyboard on/off command and Click Mode or Move Mode transitions. A positive duration displays transient feedback; a duration of 0 creates a persistent alert with a dismiss button.
Purpose: Announces the current mode and workflow feedback visually and programmatically.
Use the OpenKeyNav toolbar to keep contextual activation, shortcut-guide, and exit commands visible. Pair the toolbar with a complete command reference, and use notification alerts for timely workflow feedback.
Configuration Option
notifications
- Type:
Object - Description: An object to configure notification settings.
Properties
-
enabled(boolean): Enables or disables notifications. Default istrue. -
displayToolName(boolean): Determines whether the OpenKeyNav name is displayed in notifications. Default istrue.displayToolNameincludes “OpenKeyNav” in visible and announced notifications, identifying the active command layer and pointing users to its help and documentation. Notifications use a fixed assertiverole="alert"live region. -
duration(number): Specifies how long (in milliseconds) each notification is displayed. Default is3000milliseconds.
Example
Here's an example of how to configure notifications in OpenKeyNav:
const openKeyNav = new OpenKeyNav();
const config = {
notifications: {
enabled: true, // Enable notifications
displayToolName: true, // Display the OpenKeyNav name in notifications
duration: 10000 // Set notification duration to 10 seconds
}
};
openKeyNav.init(config);
In this example, notifications are enabled, the duration is set to 10 seconds, and the OpenKeyNav name is included in the notifications.
Configure notifications to enable alerts, include the OpenKeyNav name, and set their display duration for the integration.