Keyboard Shortcuts Manager (REST)

The Keyboard Shortcuts Manager service supports retrieving all keyboard shortcuts available in a workspace, or a specific subset of them, such as those assigned to the system, choices, or fields. It also provides information about the actions that these shortcuts trigger.

As a sample use case, you might want to implement custom keyboard shortcuts in layouts, such as the review interface. You could use this service to retrieve the information required to attach the appropriate shortcut to a specific field or choice, or for global use at the system level. Users could then navigate with the custom keyboard shortcuts through fields and choices or trigger global actions with them.

You can also use the Keyboard Shortcuts Manager service through .NET. For more information, see Keyboard Shortcuts Manager (.NET).

This page contains the following information:

Client code sample

You can use the following .NET code as a sample client for retrieving keyboard shortcuts.

public async Task<IList<KeyboardShortcutInformation>> ReadKeyboardShortcutsViaREST(int workspaceID)
{
    IList<KeyboardShortcutInformation> results;
    string email = "username@email.com";
    string password = "password";
    using (HttpClient client = new HttpClient())
    {
        client.DefaultRequestHeaders.Add("X-CSRF-Header", "-");
        client.DefaultRequestHeaders.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1").GetBytes($"{email}:{password}")));
        client.DefaultRequestHeaders.Add("X-Kepler-Version", "2.0");
 
        var url = $"http://localhost/Relativity.REST/api/relativity-review/v1/workspaces/{workspaceID}/keyboard-shortcuts";
        var response = await client.GetAsync(url);
        response.EnsureSuccessStatusCode();
        var content = await response.Content.ReadAsStringAsync();
        results = JsonConvert.DeserializeObject<IList<KeyboardShortcutInformation>>(content);
    }
 
    return results;
}

Retrieve keyboard shortcut

To retrieve the keyboard shortcuts for a workspace, use these guidelines:

  • Don't use the admin level context, specified by -1, as the target workspace.
  • Ensure that the user has permissions to view documents in the workspace.
  • Ensure that the user has permissions to view any fields associate with keyboard shortcuts. This requirement includes fields used for choices.

Send a GET request to a URL with the following format:

<host>/Relativity.Rest/API/relativity-review/{{versionNumber}}/workspaces/{{workspaceID}}/keyboard-shortcuts?includeSystemShortcuts=<true|false>&includeChoiceShortcuts=<true|false>&includeFieldShortcuts=<true|false>

Set the required variables as follows:

  • {{versionNumber}} - set to the version of the API, using the format lowercase v and the version number, such as v1.
  • {{Workspace ID}} - set to variable to the Artifact ID of the workspace containing the keyboard shortcuts.

Set the following optional query string parameters in any order delimited by ampersands:

  • includeSystemShortcuts - a Boolean value indicating whether to retrieve System shortcuts. The default value is true.
  • includeChoiceShortcuts - a Boolean value indicating whether to retrieve Choice shortcuts. The default value is true.
  • includeFieldShortcuts - a Boolean value indicating whether to retrieve Field shortcuts. The default value is true.

The body of the request is empty.

The response contains the following fields:

  • KeyboardShortcutID - a number used as the identifier for the keyboard shortcut.
  • Type - a string indicating the type of keyboard shortcut, such as system, choice, or field.
  • ArtifactID - a number representing the Artifact ID of a field or choice associated with the keyboard shortcut. This property is only returned when the type is "Choice" or "Field".
  • Action - a string indicating an action taken when a keyboard shortcut is triggered. The following types of action are available:
    • ToggleChoice - an action of this type is returned for Choice type keyboard shortcuts.
    • SelectField - an action of this type is returned for Field type keyboard shortcuts.
    • Other actions - include those for System type keyboard shortcuts.
  • KeysCombination - indicates whether additional keys are used as part of the shortcut. The following properties are available:
    • Shift - a Boolean value indicating whether the Shift key is used in the key combination.
    • Ctrl - a Boolean value indicating whether the Control key is used in the key combination.
    • Alt - a Boolean value indicating whether the Alt key is used in the key combination.
    • Key - a number indicating a key used in a specific keyboard shortcut combination.
[
  {
    "KeyboardShortcutID": 44,
    "Type": "System",
    "Action": "ViewerSwitchModeExtractedText",
    "KeyCombination": {
      "Shift": false,
      "Ctrl": false,
      "Alt": true,
      "Key": 69
    }
  },
  {
    "KeyboardShortcutID": 45,
    "Type": "System",
    "Action": "NavigateLastDocument",
    "KeyCombination": {
      "Shift": false,
      "Ctrl": false,
      "Alt": true,
      "Key": 35
    }
  }
]

Community Updates

Aero Developer FAQ Evolving the Platform Most recent release notes
Learn more Learn more Learn more

Additional Resources

   
Access Third-Party Tools with GitHub     Create .NET Apps Faster with NuGet
Visit github     visit nuget