Control the Behavior of the Enter Key
You can control the behavior of the Enter key. Normally the Enter key opens the content completion list, but you can set an option to make the Enter key work similar to the behavior in a normal word processor. The user still has the ability to open the content completion list by pressing CTRL+Enter.
There are several ways to control the behavior of the
Enter key:
- The Show content completion list when pressing Enter option in the General tab of the Administration page.
- Set the ccOnEnter property in a plugin (using the LoadingOptions type definition from
the Workspace API).Possible values for the ccOnEnter property:
- true - When the user presses the Enter key, the content completion list will be displayed.
- false - When the user presses the Enter key, it will work similar to the behavior in a normal word processor. For example, a new paragraph will be inserted, or the element will be spilt, or the same element will be inserted.
You can set this property in your plugin's JavaScript code like this:
goog.events.listen(workspace,
sync.api.Workspace.EventType.BEFORE_EDITOR_LOADED, function(e) {
if(non-technical-user) {
e.options.ccOnEnter = 'false';
}
}); Tip: You can also use this property in an embedded
link that launches Web Author so that when a user clicks the constructed link, the
documented will be opened in Web Author with the
Enter key working according to the value you
set.