# KBar support for Keystone 2

*Kbar* is a widely used extension for After Effects that allows to create customizable toolbars.\
More informations on: <https://aescripts.com/kbar/>

<figure><img src="/files/sAQznjBb8iTjLFSQchGo" alt=""><figcaption></figcaption></figure>

## Installing Keystone 2 features with .kbar files (recommended)

The easiest and most recommended way to set up the features of Keystone 2 in KBar is to use the .kbar files. It contains all KBar-compatible Keystone 2 functions and associated icons.

{% stepper %}
{% step %}
**Download** a .kbar file below

{% file src="/files/o8Q0l3q2ePz3klu8ZnQO" %}
Contains all the Keystone 2 functions in the most compact way possible (recommended)
{% endfile %}

{% file src="/files/eyKiVkviDJWJtnrR1MXb" %}
[Individual / window-less features](#invididual-window-less-features) (optional)
{% endfile %}
{% endstep %}

{% step %}
Go in **KBar settings** (right-click inside a KBar, then click **KBar Settings**)
{% endstep %}

{% step %}
Enter the **Settings** tab
{% endstep %}

{% step %}
Import the `Keystone-2.kbar` file using the **Import from .kbar** button
{% endstep %}
{% endstepper %}

{% hint style="warning" %}

### Switching from "jsx" to "Extension" buttons

In the latest releases (**v2.04 +**), Keystone 2 uses KBar 3's **"Extension"** buttons.

This change from the previous **"jsx"** buttons makes installation much easier for users, as it is no longer necessary to enter the path to the Keystone 2 .jsx file, and features run a little faster.

* **"jsx"** type buttons are now deprecated and may no longer work.
* **"Extension"** buttons are only available on **KBar v3**.
* In order for Keystone 2 features to work in KBar, the **Keystone 2 main extension must be open**. However, it can be hidden behind any other After Effects panel or script.
  {% endhint %}

## Install Keystone 2 features manually

1. Go in **KBar settings** (right-click inside a KBar, then click **KBar Settings**)
2. Click **Add Button**
3. Click **Open Extension**
4. On the first line, find and click on **Keystone 2** in the list.
5. Indicate the **CSEvent data** on the second line ([see the tables below](#icons-and-script-functions))
6. Add the corresponding **description** (optional)
7. Add the corresponding **icon** (optional)

<figure><img src="/files/VdRsv8TFCwWSenDR4zVS" alt=""><figcaption></figcaption></figure>

<table data-full-width="false"><thead><tr><th width="90" align="center">Icons</th><th width="259">CSEvent data</th><th>Description (optional)</th></tr></thead><tbody><tr><td align="center"><img src="/files/RNweV0P6Hpoi9BcLjjt7" alt="" data-size="line"></td><td><strong><code>keyLabels</code></strong></td><td>Keyframe labels</td></tr><tr><td align="center"><img src="/files/zEq3PAnrqR5DD4XBQN5q" alt="" data-size="line"></td><td><strong><code>keyAlignCTI</code></strong></td><td>Align keyframes on the CTI</td></tr><tr><td align="center"><img src="/files/896f8Ull06qF11wTPlHT" alt="" data-size="line"></td><td><strong><code>keyAlignEndPoints</code></strong></td><td>Align keyframes on the layer in/out point</td></tr><tr><td align="center"><img src="/files/is6kiVQFHVhgygwzW0Wu" alt="" data-size="line"></td><td><strong><code>keyStagger</code></strong></td><td>Stagger keyframes</td></tr><tr><td align="center"><img src="/files/qjAobgd6BIpDCtLKA4nF" alt="" data-size="line"></td><td><strong><code>keyDistribute</code></strong></td><td>Distribute keyframes evenly</td></tr><tr><td align="center"><img src="/files/c22bnchHeJiNwQXI99fN" alt="" data-size="line"></td><td><strong><code>keyStretch</code></strong></td><td>Stretch keyframes</td></tr><tr><td align="center"><img src="/files/wzwKWKn8tUBuvGYoF0lg" alt="" data-size="line"></td><td><strong><code>keyShift</code></strong></td><td>Shift keyframes</td></tr><tr><td align="center"><img src="/files/SQ8xN1AxlVHse26QQ6ec" alt="" data-size="line"></td><td><strong><code>keyDuplicate</code></strong></td><td>Duplicate on the CTI</td></tr><tr><td align="center"><img src="/files/bvkaPepC8pqpSXpws9OS" alt="" data-size="line"></td><td><strong><code>keyDuplicateFlip</code></strong></td><td>Duplicate and flip on the CTI</td></tr><tr><td align="center"><img src="/files/CagWAmugs5WYRiS32E9s" alt="" data-size="line"></td><td><strong><code>keyFlip</code></strong></td><td>Flip the keyframes</td></tr><tr><td align="center"><img src="/files/8SCbq0CMGU78qNwesVtH" alt="" data-size="line"></td><td><strong><code>keyCopyPaste</code></strong></td><td>Copy / Paste keyframes</td></tr><tr><td align="center"><img src="/files/jjCVVsIyy3brUQEbT4yn" alt="" data-size="line"></td><td><strong><code>keyAlignNearestFrame</code></strong></td><td>Align on the nearest frame</td></tr><tr><td align="center"><img src="/files/eq9XE0trVxTh8IxhbyUZ" alt="" data-size="line"></td><td><strong><code>keyConstantSpeed</code></strong></td><td>Set constant Speed</td></tr><tr><td align="center"><img src="/files/edmrjqmHNZ60Bcrso7Zy" alt="" data-size="line"> </td><td><strong><code>keyOverlapCleaning</code></strong></td><td>Delete all keys between selected keys</td></tr><tr><td align="center"><img src="/files/zyMsPSyciURtDuHcHXKe" alt="" data-size="line"></td><td><strong><code>layerLabels</code></strong></td><td>Layer labels</td></tr><tr><td align="center"><img src="/files/YnaQrER80lDF4PdPzhQR" alt="" data-size="line"></td><td><strong><code>layerAlign</code></strong></td><td>Align layers</td></tr><tr><td align="center"><img src="/files/pGTJndPJlYN1kHFZQGox" alt="" data-size="line"></td><td><strong><code>layerStagger</code></strong></td><td>Stagger layers</td></tr><tr><td align="center"><img src="/files/UN4f8rc8m0eeNk3kI2vK" alt="" data-size="line"></td><td><strong><code>layerStretch</code></strong></td><td>Stretch layers</td></tr><tr><td align="center"><img src="/files/VT87YLBt1B1uGyRCQiSn" alt="" data-size="line"></td><td><strong><code>layerShift</code></strong></td><td>Shift layers</td></tr><tr><td align="center"><img src="/files/sVzTo58lAMVgooiKiKTw" alt="" data-size="line"></td><td><strong><code>layerTrim</code></strong></td><td>Trim layers</td></tr></tbody></table>

### Invididual / Window-less features

By default, certain features are grouped together in a single KBar button, which displays a window of options when clicked. (e.g. `keyShift`)

<figure><img src="/files/pp0C5y7JtOE7gu4h3G6v" alt=""><figcaption></figcaption></figure>

Following on from the previous example of `keyShift`, you may wish to use the single functions allowing you to simply move keyframes by 1 or 10 frames without displaying the options window.

{% hint style="info" %}

* Modes (`property`, `layer` or `global`) are always accessible by using the appropriate [hotkey](/keystone-2/modes-hotkeys.md) directly on the KBar button.
* Options for linking layers and keyframes are not available.
  {% endhint %}

<table data-full-width="false"><thead><tr><th width="87" align="center">Icons</th><th width="295">CSEvent data</th><th>Description (optional)</th></tr></thead><tbody><tr><td align="center"><img src="/files/zEq3PAnrqR5DD4XBQN5q" alt="" data-size="line"></td><td><strong><code>keyAlignFirstKeyCTI</code></strong></td><td>Align on the first keyframe</td></tr><tr><td align="center"><img src="/files/ns9oT1CYxxQ5ml9nxyN7" alt="" data-size="line"></td><td><strong><code>keyAlignLastKeyCTI</code></strong></td><td>Align on the last keyframe</td></tr><tr><td align="center"><img src="/files/896f8Ull06qF11wTPlHT" alt="" data-size="line"></td><td><strong><code>keyAlignInPoint</code></strong></td><td>Align on the layer in point</td></tr><tr><td align="center"><img src="/files/ffbCewdQC7xZ34NdjXO7" alt="" data-size="line"></td><td><strong><code>keyAlignOutPoint</code></strong></td><td>Align on the layer out point</td></tr><tr><td align="center"><img src="/files/xRBSIg7UB97szECrBNkJ" alt="" data-size="line"></td><td><strong><code>keyShift10FramesLeft</code></strong></td><td>Shift 10 frames to the left</td></tr><tr><td align="center"><img src="/files/Fsbt8Dd3X31QcQa9WH55" alt="" data-size="line"></td><td><strong><code>keyShift1FrameLeft</code></strong></td><td>Shift 1 frame to the left</td></tr><tr><td align="center"><img src="/files/LxJmon18s2NTCmKWSRIq" alt="" data-size="line"></td><td><strong><code>keyShift1FrameRight</code></strong></td><td>Shift 1 frame to the right</td></tr><tr><td align="center"><img src="/files/wzwKWKn8tUBuvGYoF0lg" alt="" data-size="line"></td><td><strong><code>keyShift10FramesRight</code></strong></td><td>Shift 10 frames to the right</td></tr><tr><td align="center"><img src="/files/YnaQrER80lDF4PdPzhQR" alt="" data-size="line"></td><td><strong><code>layerAlignInPointCTI</code></strong></td><td>Align layers in point on the CTI</td></tr><tr><td align="center"><img src="/files/HZ2LISMPNqrWskyOn1j5" alt="" data-size="line"></td><td><strong><code>layerAlignOutPointCTI</code></strong></td><td>Align layers out point on the CTI</td></tr><tr><td align="center"><img src="/files/VhoafLIgtnhpwg0tocKG" alt="" data-size="line"></td><td><strong><code>layerAlignInPoint</code></strong></td><td>Align layers on the earliest in point</td></tr><tr><td align="center"><img src="/files/7pA6B059pNL8FfjXYugg" alt="" data-size="line"></td><td><strong><code>layerAlignOutPoint</code></strong></td><td>Align layers on the latest out point</td></tr><tr><td align="center"><img src="/files/Z2xDpXCaHIIdN8UsjPA9" alt="" data-size="line"></td><td><strong><code>layerShift10FramesLeft</code></strong></td><td>Shift 10 frames to the left</td></tr><tr><td align="center"><img src="/files/gOOrW8puPFqp908t3ETP" alt="" data-size="line"></td><td><strong><code>layerShift1FrameLeft</code></strong></td><td>Shift 1 frame to the left</td></tr><tr><td align="center"><img src="/files/yKMltXJ7sjjQYK7VCnvF" alt="" data-size="line"></td><td><strong><code>layerShift1FrameRight</code></strong></td><td>Shift 1 frame to the right</td></tr><tr><td align="center"><img src="/files/VT87YLBt1B1uGyRCQiSn" alt="" data-size="line"></td><td><strong><code>layerShift10FramesRight</code></strong></td><td>Shift 1 frame to the right</td></tr><tr><td align="center"><img src="/files/eJvQnwXt4y4VjiWQc4BY" alt="" data-size="line"></td><td><strong><code>layerTrimFirstKey</code></strong></td><td>Trim layer on the first keyframe</td></tr><tr><td align="center"><img src="/files/mmwmSFJklbZM3rxPsvQJ" alt="" data-size="line"></td><td><strong><code>layerTrimLastKey</code></strong></td><td>Trim layer on the last keyframe</td></tr><tr><td align="center"><img src="/files/sVzTo58lAMVgooiKiKTw" alt="" data-size="line"></td><td><strong><code>layerTrimAllKeys</code></strong></td><td>Trim layer on the first and last keyframes</td></tr></tbody></table>

## Download *Keystone 2* icons

{% file src="/files/6fMy7TuLBzv7RQktjupB" %}

{% hint style="info" %}
The icons are in svg format, so feel free to modify them if you wish.
{% endhint %}

## Suffixes *(optional)*

It is possible to add a suffix to the end of the script function in order to force *Keystone 2* to group keyframes by layer, by property or all together.

* **`-LAYER`** groups keyframes by layer. Correspond to the **default** behaviour of a simple click.
* **`-PROPERTY`** groups keyframes by property. Correspond to the **`ALT (⌥)`** + **`click`** behaviour.
* **`-GLOBAL`** groups keyframes all together. Correspond to the **`SHIFT`** + **`click`** behaviour.

### Suffix Example

**`keyAlignFirstKeyCTI-PROPERTY`** will force the alignement of all the selected keyframes of each property on the CTI without having to use the combination **`ALT (⌥)`** + **`click`**.

<figure><img src="/files/YIUA0ecAP8aUTxxqBjNy" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}

* Suffixes are **optional** and without any suffix the hotkeys **`ALT (⌥)`** and **`SHIFT`** apply like in the main extension.
* Suffixes are not available for all features (e.g. *Constant speed*, *Overlap cleaning*, *Align to nearest frame*...)
  {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://romaincousin.gitbook.io/keystone-2/kbar-support.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
