# Keyboard shortcuts

## Overview

This article lists shortcuts built in Advanced Charts and Trading Platform. It also [explains](#manage-shortcuts) how to override the default shortcuts and specify custom ones.

:::info

The shortcut dialog that can be seen on [tradingview.com](https://www.tradingview.com/chart/) is not available in the libraries. Therefore, you need to implement a custom dialog if necessary.

:::

## Advanced Charts shortcuts

The shortcuts below are available in Advanced Charts and Trading Platform.

:::tip

On macOS, you can use &#8984;/&#8997;/&#8679; instead of Ctrl/Alt/Shift.

:::

### Chart

You can use the following shortcuts to interact with the [chart](https://charting-library-docs.xstaging.tv/latest/ui_elements/Chart.md).

| Action | Shortcut |
|---|---|
| Open Quick Search | Ctrl + K |
| Open indicators | / |
| Load chart layout | . |
| Save chart layout | Ctrl + S |
| Undo | Ctrl + Z |
| Redo | Ctrl + Y |
| Change symbol | Start typing a symbol name |
| Change interval | Digit or , |
| Move chart 1 bar to the left | &#8592; |
| Move chart 1 bar to the right | &#8594; |
| Move chart to the left/right | Shift + Mouse wheel |
| Zoom in | Ctrl + &#8593; |
| Zoom out | Ctrl + &#8595; |
| Move further to the left | Ctrl + &#8592; |
| Move further to the right | Ctrl + &#8594; |
| Toggle maximize pane | Double-click the pane |
| Toggle collapse pane | Ctrl + Double-click the pane |
| Go to date | Alt + G  |
| Take snapshot, saving URL to clipboard | Alt + S |
| Reset chart | Alt + R |
| Invert series scale | Alt + I |
| Enable/disable logarithmic series scale | Alt + L |
| Enable/disable percent series scale | Alt + P |
| Zoom in focused area | Ctrl + Mouse wheel |
| Start keyboard navigation| Alt + Z  Tab if [`accessible_keyboard_shortcuts`] is enabled|

### Indicators and drawings

You can use the following shortcuts to interact with [indicators](https://charting-library-docs.xstaging.tv/latest/ui_elements/indicators.md) and [drawings](https://charting-library-docs.xstaging.tv/latest/ui_elements/drawings.md).

| Action | Shortcut |
|---|---|
| Partially erase drawing | _Eraser_ + Ctrl  |
| Enable Gann box fixed increments | Hold Shift |
| Enable measure tool | Hold Shift + Click |
| Copy selected object | Ctrl + C |
| Paste object | Ctrl + V |
| Temporary turn on/off magnet mode | Ctrl  + Move a point |
| Hide all drawings | Ctrl  + Alt + H |
| Clone a drawing | Ctrl  + Drag |
| Select multiple drawings | Hold Ctrl  + Click |
| Move a drawing horizontally or vertically | Drag + Shift |
| Move selected drawing left | &#8592; |
| Move selected drawing right | &#8594; |
| Move selected drawing up | &#8593; |
| Move selected drawing down | &#8595; |
| Draw _Trend line_ | Alt + T |
| Draw _Horizontal line_ | Alt + H |
| Draw _Vertical line_ | Alt + V |
| Draw _Cross line_ | Alt + C |
| Draw _Fib retracement_ | Alt + F |
| Draw _Rectangle_ | Alt + Shift + R |
| Draw _Square_ | _Rectangle_ + Shift |
| Draw _Circle_ | _Ellipse_ + Shift |
| Draw 45 degrees angle or horizontal | _Trend line_ or _Channel_ + Shift |

## Trading Platform shortcuts

The shorcuts below are available in [Trading Platform](https://charting-library-docs.xstaging.tv/latest/trading_terminal.md) only.

### Chart

You can use the following shortcuts to interact with the [chart](https://charting-library-docs.xstaging.tv/latest/ui_elements/Chart.md).

| Action | Shortcut |
|---|---|
| Switch between charts | Tab  Shift + &#8594; if [`accessible_keyboard_shortcuts`](../customization/Featuresets.md#accessible_keyboard_shortcuts) is enabled|
| Switch between charts in reverse order |Shift + Tab  Shift + &#8592; if [`accessible_keyboard_shortcuts`] is enabled|
| Toggle maximize chart | Alt + Enter or Alt + Click |
| Add symbol to watchlist | Alt + W |

### Watchlist

You can use the following shortcuts to interact with [watchlist](https://charting-library-docs.xstaging.tv/latest/trading_terminal/Watch-List.md).

| Action | Shortcut |
|---|---|
| Switch to next symbol | &#8595; or Space |
| Switch to previous symbol | &#8593; or Shift + Space |
| Select all symbols | Ctrl + A |
| Select next symbol | Shift + &#8595; |
| Select previous symbol | Shift + &#8593; |

### Trading

You can use the following shortcuts to trade.

| Action | Shortcut |
|---|---|
| Place market order to buy | Shift + B |
| Place market order to sell | Shift + S |
| Place limit order | Click the [Depth of Market][DOM] (DOM) cell |
| Place limit order to buy | Shift + Alt + B |
| Place limit order to sell | Shift + Alt + S |
| Place stop order | Ctrl  + Click the [DOM] cell |
| Center [DOM] data | Shift + Alt + C |

## Manage shortcuts

:::warning

The shortcut system exclusively uses key code–based definitions.
Printable-character strings, such as `"alt+q"`, are no longer supported and throw an error.
Modifier keys like `ctrl`, `alt`, `shift`, and `meta`/`command` are still supported as strings.

:::

### Transition to key code-based shortcuts

All shortcuts must use **numeric key codes** for non-modifier keys.
This replaces character-literal definitions (e.g., `"alt+q"`, `"/"`, `"+"`), which were deprecated in version 30 and removed afterwards.

This change:

- Unifies the shortcut API across different keyboard layouts.
- Eliminates ambiguities between characters that map to the same physical key.

To update your code, follow the steps below.

1. Identify all `widget.onShortcut()` calls that pass printable characters as a single string or inside an array.
2. Replace each character with its corresponding numeric key code taken from the `KeyboardEvent.keyCode` or `which` property. For convenience, use a lookup tool like [Key code reference](https://www.toptal.com/developers/keycode).
3. Keep modifier keys (`ctrl`, `alt`, `shift`, and `meta`/`command`) as lowercase strings.
4. Test the shortcuts to confirm the callbacks are triggered using the new format.

### Override shortcuts

The [`onShortcut`](../api/interfaces/Charting_Library.IChartingLibraryWidget.md#onshortcut) method allows you to override the built‑in shortcuts or specify custom ones. To do this, pass a keyboard shortcut and a callback function as parameters:

- If a shortcut consists of a single non-modifier key, pass its numeric key code.

  ```javascript
  // F1
  widget.onShortcut(112, function() {
    widget.chart().executeActionById("symbolSearch");
  });
  ```

- If a shortcut includes modifiers, pass the shortcut as an array — the modifiers as strings, and the key as its numeric code.

  ```javascript
  // alt + q
  widget.onShortcut(["alt", 81], function() {
    widget.chart().executeActionById("symbolSearch");
  });

  // ctrl + shift + \
  widget.onShortcut(["ctrl", "shift", 220], function() {
      widget.chart().executeActionById("symbolSearch");
  });
  ```

### Disable shortcuts

The shortcuts listed below can be disabled using the corresponding [featureset](https://charting-library-docs.xstaging.tv/latest/customization/Featuresets.md):

- _Open indicators_ using [`insert_indicator_dialog_shortcut`]
- _Save chart layout_ using [`save_shortcut`]

[DOM]: https://charting-library-docs.xstaging.tv/latest/trading_terminal/depth-of-market.md
[`insert_indicator_dialog_shortcut`]: https://charting-library-docs.xstaging.tv/latest/customization/Featuresets.md#insert_indicator_dialog_shortcut
[`save_shortcut`]: https://charting-library-docs.xstaging.tv/latest/customization/Featuresets.md#save_shortcut
[`accessible_keyboard_shortcuts`]: https://charting-library-docs.xstaging.tv/latest/customization/Featuresets.md#accessible_keyboard_shortcuts

---

## Sitemap

- [All documentation pages](https://charting-library-docs.xstaging.tv/llms.txt)
- [Full page map with headings](https://charting-library-docs.xstaging.tv/docs_map.md)
