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.
| Fact | Value |
|---|---|
| Tool | Retool |
| Difficulty | Beginner |
| Time required | 10-15 min |
| Compatibility | Retool Cloud and Self-hosted |
| Last updated | March 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
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.
1// Essential editor shortcuts (Mac / Windows):2// Save app: Cmd+S / Ctrl+S3// Undo canvas change: Cmd+Z / Ctrl+Z4// Redo: Cmd+Shift+Z / Ctrl+Y5// Run selected query: Cmd+Enter / Ctrl+Enter6// Preview app: Cmd+Shift+P / Ctrl+Shift+P7// Command palette: Cmd+K / Ctrl+K8// Delete component: Backspace / Delete (when component selected)9// Duplicate component: Cmd+D / Ctrl+D10// Multi-select: Shift+click11// Pan canvas: Space + drag12// 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.
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.
1// Text Input Inspector → Interaction → Event Handlers:2// Event: Key press3// Key: Enter4// Action: Trigger query → submitForm56// Add 'Only run when' condition to prevent submission while invalid:7// Only run when: {{ !form1.invalid }}89// For a search field — Enter triggers search:10// Event: Key press11// Key: Enter12// Action: Trigger query → searchRecordsExpected result: Pressing Enter in the Text Input triggers the submit query. The Disabled check prevents submission with invalid data.
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.
1// Event handler on any input inside the modal:2// Event: Key press3// Key: Escape4// Action: Control component → modal1 → close56// To also reset the form when escaping:7// Add a second handler:8// Event: Key press9// Key: Escape10// Action: Control component → form1 → reset1112// Note: Event handlers on the same event run in parallel13// If you need sequential close then reset, use a JS Query:14// Key press → Escape → Trigger query → closeAndResetModal1516// JS Query: closeAndResetModal17form1.reset();18modal1.close();Expected result: Pressing Escape while the modal is open closes it. If you added the reset handler, the form also clears.
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.
1// JS Query: setInitialFocus (Run on page load: ON)2// Sets focus to the global shortcut catcher button3keyboardFocusTrap.focus();45// keyboardFocusTrap Button event handlers:6// Event: Key press, Key: Ctrl+N / Cmd+N7// Action: Control component → createModal → open89// Event: Key press, Key: Ctrl+F / Cmd+F10// Action: Control component → searchInput → focus1112// Event: Key press, Key: Escape13// Action: Trigger query → closeAllModals1415// Note: Cmd+F is captured by the browser's Find function — 16// use Ctrl+Shift+F or another combination to avoid browser conflictsExpected result: Global keyboard shortcuts work regardless of which component has focus, as long as the focus trap button retains focus.
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.
1// Known limitation: keyboard shortcuts in Custom Components2// 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 iframe5// - The app is inside an iframe embed (external website)67// Workaround for Custom Component shortcuts:8// Handle keyboard events inside the Custom Component itself9// using document.addEventListener('keydown', ...) in the component code10// and communicate back to Retool via Retool.modelUpdate()1112// Example Custom Component keyboard handler:13document.addEventListener('keydown', function(event) {14 if (event.key === 'Enter' && !event.isComposing) {15 Retool.modelUpdate({ enterPressed: true });16 }17});1819// Then in Retool, add a 'modelUpdate' event handler on the Custom Component20// that triggers the desired action when enterPressed is trueExpected result: You are aware of the iframe limitation and use the Retool.modelUpdate() workaround for keyboard shortcuts inside Custom Components.
Complete working example
1// Reference: Common end-user keyboard shortcuts to configure2// Add these as Key press event handlers in Inspector → Interaction34// === FORM SHORTCUTS ===5// On any Text Input:6// Enter → Trigger query: submitForm (Only run when: {{ !form1.invalid }})7// Escape → Control component: form1 → reset89// === MODAL SHORTCUTS ===10// On Button inside modal:11// Escape → Control component: editModal → close12// Enter → Trigger query: saveRecord1314// === SEARCH SHORTCUTS ===15// On searchInput Text Input:16// Enter → Trigger query: runSearch17// Escape → JS Query: clearAndBlurSearch1819// JS Query: clearAndBlurSearch20await searchInput.setValue('');21searchInput.blur();2223// === NAVIGATION SHORTCUTS ===24// On a focused Button (keyboardFocusTrap):25// Ctrl+N → Control component: createModal → open26// Ctrl+Shift+R → Trigger query: refreshAllData2728// JS Query: refreshAllData29await Promise.all([30 getCustomers.trigger(),31 getOrders.trigger(),32 getStats.trigger(),33]);3435utils.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.
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.
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.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation