Extend the Thinfinity® Workspace Toolbar

To extend the toolbar with new Send Key options, you have to use the toolbar JSON structure. It contains a JavaScript object array named shortcuts where each object represents a Send Key option and has two fields:

  • text: Option caption text (String).

  • keys: Object array where each element contains a keyboard action.

Action name
Associated Field
Meaning

down

key

It represents a keydown (just the key down, without the key release).

stroke

key

It represents the complete keystroke sequence action, from the keydown to the keyup (i.e.: when pressing and releasing a key).

up

key

It represents a keyup (key release).

type

text

Send text.

Value field
Meaning

key

Numeric code for the key.

text

A text to be remotely typed.

Adding New Toolbar Options

To add new toolbar options, use one of the following methods:

Using customSettings.js to extend the Thinfinity Workspace toolbar

The customSettings global variable is a JSON object defined in the customSettings.js file found in the Thinfinity Workspace installation web folder. This variable, a JavaScript object, contains attributes to set or modify connection features, including those related to the toolbar. By default, it doesn’t have attributes enabled in the source code and looks like this:

var customSettings = {
  /*
  "createToolbar": true, // Creates the ThinRDP toolbar
  "toolbarVisible": false, // ThinRDP toolbar starts expanded (visible)
  "checkBeforeWindowClose": true, // When false, skips user confirmation popup of onBeforeUnload event
  "noSsnDialog": false, // Avoids the share session popup dialog
  "noShowPopupsOnClose": false // When true, skips session closed message popup
  */
};

To add the toolbar.shortcuts structure to customSettings, do the following:

  var customSettings = {
  ...
    "toolbar": {
    "shortcuts": [ ... ]
  }
}

Example of Actions and Values

Here’s an example of the toolbar configuration with actions and values:

"toolbar": {
  "shortcuts": [
    {
      "text": "Help (F1)",
      "keys": [
        { "action": "stroke", "key": 0x70 } // F1
      ]
    },
    {
      "text": "Find",
      "keys": [
        { "action": "down", "key": 0x11 }, // CTRL
        { "action": "stroke", "key": 0x46 }, // F
        { "action": "up", "key": 0x11 } // CTRL
      ]
    },
    {
      "text": "Type 'Hello'",
      "keys": [
        { "action": "type", "text": "Hello" }
      ]
    },
    {
      "text": "Find 'Hello'",
      "keys": [
        { "action": "down", "key": 0x11 }, // CTRL
        { "action": "stroke", "key": 0x46 }, // F
        { "action": "up", "key": 0x11 }, // CTRL
        { "action": "type", "text": "Hello" },
        { "action": "stroke", "key": 0x0D } // ENTER
      ]
    }
  ]
}

In this example:

  • The first shortcut sends an F1 key press.

  • The second triggers a find/search command ([CTRL]+F).

  • The third types “Hello.”

  • The fourth combines the second and third examples to find “Hello.”

Last updated

Was this helpful?