Shortcut recorderPro
Record a key combination into caps: held modifiers show as you build it, reserved and taken shortcuts ask first, plus a searchable cheatsheet that lights held keys.
oxyn add shortcut-recorderThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- Let people rebind keys: pick a combination, see it as caps, and be warned before taking one the browser or another command already uses.
When not to use
- A small turning arc for work that runs right now, plus dots, ray and orbit styles: use Spinner instead.
- Search and run anything from one field: use Command palette instead.
- An app sidebar: use Sidebar instead.
Installation
Shortcut recorder is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add shortcut-recorderUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Set
A custom shortcut with Reset.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Recording
Listening for keys.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Sequence
G then I.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Windows
Ctrl glyphs.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
ShortcutRecorder
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | String | — | Label. |
hide_label | bool | Default::default() | Visually hide the label. |
value | Option<String> | Default::default() | Value (`mod+shift+k`). |
reset_value | Option<String> | Default::default() | What reset restores (defaults to the value). |
bindings | Vec<Binding> | Default::default() | Shortcuts in use. |
warn_reserved | bool | true | Warn about reserved combinations. |
require_modifier | bool | true | Require a modifier. |
platform | String | "mac" | `mac` · `other`. |
placeholder | String | "Record shortcut" | Placeholder. |
description | Option<String> | Default::default() | Hint. |
disabled | bool | Default::default() | Disabled. |
size | String | "md" | `sm` · `md`. |
sequences | bool | Default::default() | Two-key sequences. |
recording | bool | Default::default() | Start recording. |
on_change | EventHandler<(Option<String>, Option<String>)> | — | Value changed (value, replaced binding label). |
ShortcutList
| Prop | Type | Default | Description |
|---|---|---|---|
groupsrequired | Vec<ShortcutGroup> | — | Groups. |
label | String | "Keyboard shortcuts" | Accessible name. |
searchable | bool | true | Search field. |
highlight_pressed | bool | true | Light held caps and fade other rows. |
platform | String | "mac" | `mac` · `other`. |
width | f32 | 560.0 | Width px. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| EnterorSpace | Start recording |
| Any combination | Record it |
| Esc | Cancel recording |
| BackspaceorDelete | Clear |
| Tab | Stop and move on |
Accessibility
- A button with aria-pressed while recording, named by the label and the spoken shortcut.
- Conflicts offer Use anyway and Cancel as real buttons; results are announced.
From the spec
The recorder is a toggle button named by its label and the spoken shortcut ("Command Shift P"). Results, conflicts and cancels are announced. Conflict choices are real buttons.
Motion & interaction
Caps pop in one after another; held modifiers light as they're pressed; the message line opens with a height transition; the recording dot pulses.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Caps in | 180 ms + 40 ms stagger | ease.out | none |
| Message | 260 ms | ease.out | instant |
| Dot pulse | 1 s loop | ease-in-out | static |
Responsive behaviour
- The cheatsheet goes two columns from 520 px.
Edge cases (spec)
mod is ⌘ on Mac and Ctrl elsewhere; shortcuts written in any order normalise before comparing. Function keys are allowed alone. Recording blurs back to idle.
Notes for AI
- Import
ShortcutRecorder,ShortcutListfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
ShortcutRecorderElinoxyn_gpui. - Props to set first:
label,groups. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.