Skip to main content
RapidDev - Software Development Agency
retool-tutorial

How to Use Keyboard Shortcuts in Retool

Retool has two sets of shortcuts: editor shortcuts for builders (Cmd+S save, Cmd+Z undo, Cmd+Enter run query) and configurable end-user shortcuts on component event handlers. Configure end-user shortcuts by adding a 'Key press' event handler in Inspector → Interaction, specifying the key combination, and setting the action to trigger.

What you'll learn

  • Use essential Retool editor shortcuts: Cmd+S to save, Cmd+Z to undo, Cmd+Enter to run a query
  • Configure custom keyboard shortcuts on event handlers using the 'Key press' event type
  • Trigger JS Queries and component actions from keyboard combinations defined in Inspector → Interaction
  • Understand the difference between editor shortcuts (for builders) and end-user shortcuts (for app users)
  • Work around limitations of keyboard shortcuts in Custom Components and iframes
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner9 min read10-15 minRetool Cloud and Self-hostedLast updated March 2026RapidDev Engineering Team
TL;DR

Retool has two sets of shortcuts: editor shortcuts for builders (Cmd+S save, Cmd+Z undo, Cmd+Enter run query) and configurable end-user shortcuts on component event handlers. Configure end-user shortcuts by adding a 'Key press' event handler in Inspector → Interaction, specifying the key combination, and setting the action to trigger.

Quick facts about this guide
FactValue
ToolRetool
DifficultyBeginner
Time required10-15 min
CompatibilityRetool Cloud and Self-hosted
Last updatedMarch 2026

Editor Shortcuts and Custom End-User Keyboard Shortcuts in Retool

Retool has two categories of keyboard shortcuts that serve different purposes. Editor shortcuts help builders develop apps faster — they work only in Retool's edit mode. End-user shortcuts are configured by builders and available to app users in Preview/Published mode.

Editor shortcuts are fixed and cannot be customized. The most important ones: Cmd+S (or Ctrl+S on Windows) saves the app, Cmd+Z undoes the last canvas change, Cmd+Enter runs the currently selected query, Ctrl+Shift+P (or Cmd+Shift+P) previews the app, and Cmd+K opens the command palette. A full reference is available in Retool's documentation and via the command palette.

End-user shortcuts are configured per component via the 'Key press' event type in the Inspector's Event Handlers section. A builder specifies a key combination (e.g., Enter, Cmd+K, Shift+S) and what action to take when it is pressed. This is how you make Enter submit a form, Escape close a modal, or a custom shortcut trigger a search.

Prerequisites

  • A Retool app in edit mode
  • Basic familiarity with the Inspector panel and event handlers

Step-by-step guide

1

Learn the essential editor shortcuts for faster building

Retool editor shortcuts work in the app editor (edit mode) only. The most-used shortcuts that every Retool builder should know: Cmd+S saves the app, Cmd+Z undoes canvas changes, Cmd+Y or Cmd+Shift+Z redoes, Cmd+Enter runs the currently focused query, Ctrl+Shift+P (Mac: Cmd+Shift+P) switches to Preview mode, Cmd+K opens the command palette (90+ actions), and Delete or Backspace removes the selected component.

typescript
1// Essential editor shortcuts (Mac / Windows):
2// Save app: Cmd+S / Ctrl+S
3// Undo canvas change: Cmd+Z / Ctrl+Z
4// Redo: Cmd+Shift+Z / Ctrl+Y
5// Run selected query: Cmd+Enter / Ctrl+Enter
6// Preview app: Cmd+Shift+P / Ctrl+Shift+P
7// Command palette: Cmd+K / Ctrl+K
8// Delete component: Backspace / Delete (when component selected)
9// Duplicate component: Cmd+D / Ctrl+D
10// Multi-select: Shift+click
11// Pan canvas: Space + drag
12// Zoom in/out: Cmd+= / Cmd+- (or scroll with Cmd held)

Expected result: You can save, undo, run queries, and navigate the editor without reaching for the mouse.

2

Configure an Enter key shortcut to submit a form

The most common end-user keyboard shortcut is pressing Enter to submit a form. In Retool, this is configured by adding a 'Key press' event handler to a Text Input or Form component. Select the Text Input where the user types last before submitting. In Inspector → Interaction → Event Handlers, click '+ Add'. Set Event to 'Key press'. In the key field, enter 'Enter'. Set Action to 'Trigger query' → your submit query. Now pressing Enter in that Text Input triggers the submission.

typescript
1// Text Input Inspector → Interaction → Event Handlers:
2// Event: Key press
3// Key: Enter
4// Action: Trigger query → submitForm
5
6// Add 'Only run when' condition to prevent submission while invalid:
7// Only run when: {{ !form1.invalid }}
8
9// For a search field — Enter triggers search:
10// Event: Key press
11// Key: Enter
12// Action: Trigger query → searchRecords

Expected result: Pressing Enter in the Text Input triggers the submit query. The Disabled check prevents submission with invalid data.

3

Add an Escape key handler to close a modal

The Escape key conventionally closes dialogs. Add a Key press event handler to a Text Input or Button inside a Modal component. Set Key to 'Escape' and Action to 'Control component' → modal1 → close. Alternatively, add the handler to any component that has keyboard focus while the modal is open.

typescript
1// Event handler on any input inside the modal:
2// Event: Key press
3// Key: Escape
4// Action: Control component → modal1 → close
5
6// To also reset the form when escaping:
7// Add a second handler:
8// Event: Key press
9// Key: Escape
10// Action: Control component → form1 → reset
11
12// Note: Event handlers on the same event run in parallel
13// If you need sequential close then reset, use a JS Query:
14// Key press → Escape → Trigger query → closeAndResetModal
15
16// JS Query: closeAndResetModal
17form1.reset();
18modal1.close();

Expected result: Pressing Escape while the modal is open closes it. If you added the reset handler, the form also clears.

4

Configure a custom shortcut for a global action

For global shortcuts that should work anywhere in the app (not just inside a specific component), add the Key press event handler to a component that always has focus, such as a search input or a dedicated invisible Button component. Place a Button named keyboardFocusTrap at the top of the canvas with width 0 and height 0, give it auto-focus via a 'Run on page load' JS Query that calls keyboardFocusTrap.focus(), and add your global keyboard shortcuts as Key press handlers on it.

typescript
1// JS Query: setInitialFocus (Run on page load: ON)
2// Sets focus to the global shortcut catcher button
3keyboardFocusTrap.focus();
4
5// keyboardFocusTrap Button event handlers:
6// Event: Key press, Key: Ctrl+N / Cmd+N
7// Action: Control component → createModal → open
8
9// Event: Key press, Key: Ctrl+F / Cmd+F
10// Action: Control component → searchInput → focus
11
12// Event: Key press, Key: Escape
13// Action: Trigger query → closeAllModals
14
15// Note: Cmd+F is captured by the browser's Find function —
16// use Ctrl+Shift+F or another combination to avoid browser conflicts

Expected result: Global keyboard shortcuts work regardless of which component has focus, as long as the focus trap button retains focus.

5

Understand limitations of keyboard shortcuts in Custom Components

Custom Components in Retool are rendered inside an iframe sandbox. Keyboard events inside a Custom Component are captured by the iframe and do not bubble up to the Retool app's event handler system. This means Key press event handlers configured on Retool components do not fire when the keyboard focus is inside a Custom Component. Shortcuts also do not work inside embedded iframes or the JSON Explorer component.

typescript
1// Known limitation: keyboard shortcuts in Custom Components
2// Key press events on Retool components are NOT fired when:
3// - Keyboard focus is inside a Custom Component (iframe)
4// - Keyboard focus is inside an embedded URL iframe
5// - The app is inside an iframe embed (external website)
6
7// Workaround for Custom Component shortcuts:
8// Handle keyboard events inside the Custom Component itself
9// using document.addEventListener('keydown', ...) in the component code
10// and communicate back to Retool via Retool.modelUpdate()
11
12// Example Custom Component keyboard handler:
13document.addEventListener('keydown', function(event) {
14 if (event.key === 'Enter' && !event.isComposing) {
15 Retool.modelUpdate({ enterPressed: true });
16 }
17});
18
19// Then in Retool, add a 'modelUpdate' event handler on the Custom Component
20// that triggers the desired action when enterPressed is true

Expected result: You are aware of the iframe limitation and use the Retool.modelUpdate() workaround for keyboard shortcuts inside Custom Components.

Complete working example

JS Query: handleGlobalShortcuts
1// Reference: Common end-user keyboard shortcuts to configure
2// Add these as Key press event handlers in Inspector → Interaction
3
4// === FORM SHORTCUTS ===
5// On any Text Input:
6// Enter → Trigger query: submitForm (Only run when: {{ !form1.invalid }})
7// Escape → Control component: form1 → reset
8
9// === MODAL SHORTCUTS ===
10// On Button inside modal:
11// Escape → Control component: editModal → close
12// Enter → Trigger query: saveRecord
13
14// === SEARCH SHORTCUTS ===
15// On searchInput Text Input:
16// Enter → Trigger query: runSearch
17// Escape → JS Query: clearAndBlurSearch
18
19// JS Query: clearAndBlurSearch
20await searchInput.setValue('');
21searchInput.blur();
22
23// === NAVIGATION SHORTCUTS ===
24// On a focused Button (keyboardFocusTrap):
25// Ctrl+N → Control component: createModal → open
26// Ctrl+Shift+R → Trigger query: refreshAllData
27
28// JS Query: refreshAllData
29await Promise.all([
30 getCustomers.trigger(),
31 getOrders.trigger(),
32 getStats.trigger(),
33]);
34
35utils.showNotification({
36 title: 'Data refreshed',
37 notificationType: 'success',
38});

Common mistakes

Why it's a problem: Testing keyboard shortcuts while in edit mode — the editor's own shortcuts (Cmd+S to save) intercept before the component's Key press handler fires

How to avoid: Always test end-user keyboard shortcuts in Preview mode (Ctrl+Shift+P) where editor shortcuts are inactive.

Why it's a problem: Adding multiple event handlers for the same Key press event and expecting them to run in sequence — they run in parallel

How to avoid: For sequential operations (close modal then reset form), combine all actions in a single JS Query and trigger it from the Key press event handler.

Why it's a problem: Expecting Key press handlers on a Retool component to fire when focus is inside a Custom Component or iframe

How to avoid: Key events inside iframes (Custom Components, embedded URLs) do not propagate to Retool. Handle keyboard shortcuts inside the Custom Component code and communicate via Retool.modelUpdate().

Why it's a problem: Configuring Cmd+F as a custom shortcut — browsers intercept this before Retool can handle it

How to avoid: Use Cmd+Shift+F or another non-reserved combination. Check browser keyboard shortcut documentation for your target browsers to avoid conflicts.

Best practices

  • Use Enter for form submission and Escape for cancel/close — these are universal conventions that users expect without any documentation
  • Avoid overriding browser shortcuts (Cmd+F, Cmd+T, Cmd+W, Cmd+S) — use Cmd+Shift or Ctrl+Shift combinations for app-specific shortcuts
  • Document custom keyboard shortcuts in the app's help text or a keyboard shortcuts modal — users cannot discover custom shortcuts without guidance
  • Add 'Only run when' conditions to keyboard-triggered queries to prevent accidental submissions when validation fails
  • Test keyboard shortcuts in Preview mode, not Edit mode — some editor shortcuts (Cmd+S, Cmd+Z) interfere with testing end-user shortcuts in edit mode
  • For shortcuts that need to work app-wide, use a focus trap component rather than adding the same handler to every input
  • Remember that event handlers on the same event run in parallel — use a JS Query for sequential ordered operations triggered by a single keypress

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I am building a Retool app and want to configure keyboard shortcuts for my users: (1) pressing Enter in any Text Input inside a form should trigger the submitForm query (but only when form1.invalid is false), (2) pressing Escape anywhere should close editModal, (3) pressing Ctrl+N should open createModal. For each shortcut, show me exactly where in the Retool Inspector to configure it, what the event type is, and what the action/condition should be. Also explain the limitation of keyboard shortcuts in Custom Component iframes.

Retool Prompt

What is the shortcut to run a query in the Retool editor without clicking the Run button? Also, how do I configure a custom keyboard shortcut so that when a user presses Enter in the searchInput Text Input, it triggers the runSearch query?

Frequently asked questions

Is there a list of all keyboard shortcuts available in the Retool editor?

Yes — open the command palette with Cmd+K (Ctrl+K on Windows) and look for 'Keyboard shortcuts' or 'Shortcuts reference' in the search. Retool also shows keyboard shortcut hints next to actions in context menus and the command palette results. The most complete reference is Retool's official documentation under the Editor section.

Can I disable Retool editor keyboard shortcuts to prevent them from interfering with my custom shortcuts?

No — editor shortcuts cannot be disabled or remapped in Retool's current editor. To test end-user shortcuts without interference, always use Preview mode. Published apps delivered to users also do not have editor shortcuts active.

Can I show users which keyboard shortcuts are available in my app?

Yes — build a keyboard shortcuts reference modal that lists your custom shortcuts. Add a '?' Key press event handler or a Keyboard Shortcuts button that opens a Modal containing a Table or list of available shortcuts. This is the standard pattern for apps with non-obvious keyboard interactions.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Learning is great. Shipping is faster with help.

Our engineers have built 600+ apps on Retool and the tools around it. If your project needs to be live sooner than your learning curve allows — book a free consultation.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.