rmk 0.9.0

Keyboard firmware written in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
/// Create a layer in keymap.
///
/// This macro simplifies the syntax for defining keyboard layers by allowing
/// a more natural 2D array notation.
///
/// # Example
/// ```ignore
/// let layer = layer!([
///     [k!(Esc), k!(Kc1), k!(Kc2)],
///     [k!(Tab), k!(Q), k!(W)]
/// ]);
/// ```
#[macro_export]
macro_rules! layer {
    ([$([$($x: expr), +]), +]) => {
        [$([$($x), +]),+]
    };
}

/// Create a normal key action.
///
/// This macro creates a simple key press action for any HID keyboard key.
/// When the key is pressed, it sends the corresponding HID keycode.
///
/// # Parameters
/// - `$k`: The HID keycode identifier (e.g., `A`, `Space`, `Enter`, `F1`)
///
/// # Example
/// ```ignore
/// k!(A)        // Creates action for key 'A'
/// k!(Space)    // Creates action for Space key
/// k!(Enter)    // Creates action for Enter key
/// k!(F1)       // Creates action for F1 key
/// ```
///
/// # Expands to
/// `KeyAction::Single(Action::Key(KeyCode::Hid(HidKeyCode::A)))`
#[macro_export]
macro_rules! k {
    ($k: ident) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::Key(
            $crate::types::keycode::KeyCode::Hid($crate::types::keycode::HidKeyCode::$k),
        ))
    };
}

/// Create a key action with modifier combination.
///
/// This macro creates a key action that sends a key along with modifier keys
/// (Ctrl, Shift, Alt, GUI) pressed simultaneously.
///
/// # Parameters
/// - `$x`: The HID keycode identifier
/// - `$m`: A `ModifierCombination` expression specifying which modifiers to apply
///
/// # Example
/// ```ignore
/// // Ctrl+C
/// wm!(C, ModifierCombination::new_from(false, false, false, false, true))
///
/// // Shift+A (can also use the `shifted!` macro for this)
/// wm!(A, ModifierCombination::LSHIFT)
///
/// // Ctrl+Shift+Esc
/// wm!(Escape, ModifierCombination::LCTRL.with_left_shift(true))
/// ```
#[macro_export]
macro_rules! wm {
    ($x: ident, $m: expr) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::KeyWithModifier(
            $crate::types::keycode::HidKeyCode::$x,
            $m,
        ))
    };
}

/// Create a KeyAction variant directly.
///
/// This macro provides shorthand access to KeyAction enum variants.
///
/// # Parameters
/// - `$a`: The KeyAction variant name (e.g., `No`, `Transparent`)
///
/// # Example
/// ```ignore
/// a!(No)           // KeyAction::No - empty action
/// a!(Transparent)  // KeyAction::Transparent - pass through to next layer
/// ```
#[macro_export]
macro_rules! a {
    ($a: ident) => {
        $crate::types::action::KeyAction::$a
    };
}

/// Create a momentary layer activation action.
///
/// This macro creates an action that activates a layer while the key is held down.
/// The layer is deactivated when the key is released. Similar to QMK's `MO()`.
///
/// # Parameters
/// - `$x`: Layer number (0-255)
///
/// # Example
/// ```ignore
/// mo!(1)  // Activates layer 1 while held
/// mo!(2)  // Activates layer 2 while held
/// ```
#[macro_export]
macro_rules! mo {
    ($x: literal) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::LayerOn($x))
    };
}

/// Create a layer activation with modifier action.
///
/// This macro activates a layer while also applying modifier keys.
/// Both the layer and modifiers are active while the key is held.
///
/// # Parameters
/// - `$x`: Layer number (0-15)
/// - `$m`: A `ModifierCombination` expression
///
/// # Example
/// ```ignore
/// lm!(1, ModifierCombination::LSHIFT)  // Activates layer 1 with Left Shift
/// lm!(2, ModifierCombination::LCTRL)   // Activates layer 2 with Left Ctrl
/// ```
#[macro_export]
macro_rules! lm {
    ($x: literal, $m: expr) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::LayerOnWithModifier($x, $m))
    };
}

/// Create a layer-tap action (tap/hold behavior).
///
/// This macro creates a dual-function key:
/// - **Tap**: Sends the specified key
/// - **Hold**: Activates the specified layer
///
/// Uses default timing configuration for tap/hold detection.
///
/// # Parameters
/// - `$x`: Layer number to activate when held
/// - `$k`: HID keycode to send when tapped
///
/// # Example
/// ```ignore
/// lt!(1, Space)  // Tap for Space, hold for layer 1
/// lt!(2, Enter)  // Tap for Enter, hold for layer 2
/// ```
#[macro_export]
macro_rules! lt {
    ($x: literal, $k: ident) => {
        $crate::types::action::KeyAction::TapHold(
            $crate::types::action::Action::Key($crate::types::keycode::KeyCode::Hid(
                $crate::types::keycode::HidKeyCode::$k,
            )),
            $crate::types::action::Action::LayerOn($x),
            ::core::primitive::u8::MAX,
        )
    };
}

/// Create a layer-tap action with custom timing profile.
///
/// Same as `lt!` but references a morse profile by its table index.
///
/// # Parameters
/// - `$x`: Layer number to activate when held
/// - `$k`: HID keycode to send when tapped
/// - `$p`: Morse profile index (`u8`, into `MorsesConfig::profiles`); an index with no entry falls back to the default profile
///
/// # Example
/// ```ignore
/// ltp!(1, Space, 0)  // layer-tap using morse profile 0
/// ```
#[macro_export]
macro_rules! ltp {
    ($x: literal, $k: ident, $p: expr) => {
        $crate::types::action::KeyAction::TapHold(
            $crate::types::action::Action::Key($crate::types::keycode::KeyCode::Hid(
                $crate::types::keycode::HidKeyCode::$k,
            )),
            $crate::types::action::Action::LayerOn($x),
            $p,
        )
    };
}

/// Create a modifier-tap action (tap/hold behavior).
///
/// This macro creates a dual-function key:
/// - **Tap**: Sends the specified key
/// - **Hold**: Applies the specified modifier(s)
///
/// Commonly used for home row mods. Uses default timing configuration.
///
/// # Parameters
/// - `$k`: HID keycode to send when tapped
/// - `$m`: `ModifierCombination` to apply when held
///
/// # Example
/// ```ignore
/// mt!(A, ModifierCombination::LCTRL)   // Tap for A, hold for Ctrl
/// mt!(S, ModifierCombination::LSHIFT)  // Tap for S, hold for Shift
/// mt!(D, ModifierCombination::LALT)    // Tap for D, hold for Alt
/// ```
#[macro_export]
macro_rules! mt {
    ($k: ident, $m: expr) => {
        $crate::types::action::KeyAction::TapHold(
            $crate::types::action::Action::Key($crate::types::keycode::KeyCode::Hid(
                $crate::types::keycode::HidKeyCode::$k,
            )),
            $crate::types::action::Action::Modifier($m),
            ::core::primitive::u8::MAX,
        )
    };
}

/// Create a modifier-tap action with custom timing profile.
///
/// Same as `mt!` but allows specifying custom tap/hold timing configuration.
///
/// # Parameters
/// - `$k`: HID keycode to send when tapped
/// - `$m`: `ModifierCombination` to apply when held
/// - `$p`: Morse profile index (`u8`, into `MorsesConfig::profiles`); an index with no entry falls back to the default profile
///
/// # Example
/// ```ignore
/// mtp!(A, ModifierCombination::LCTRL, 0)  // held modifier uses morse profile 0
/// ```
#[macro_export]
macro_rules! mtp {
    ($k: ident, $m: expr, $p: expr) => {
        $crate::types::action::KeyAction::TapHold(
            $crate::types::action::Action::Key($crate::types::keycode::KeyCode::Hid(
                $crate::types::keycode::HidKeyCode::$k,
            )),
            $crate::types::action::Action::Modifier($m),
            $p,
        )
    };
}

/// Create a dual-key tap-hold action.
///
/// This macro creates a key with two different key behaviors:
/// - **Tap**: Sends the first key
/// - **Hold**: Sends the second key
///
/// Uses default timing configuration.
///
/// # Parameters
/// - `$t`: HID keycode to send when tapped
/// - `$h`: HID keycode to send when held
///
/// # Example
/// ```ignore
/// th!(Space, Backspace)  // Tap for Space, hold for Backspace
/// th!(Escape, Grave)     // Tap for Escape, hold for Grave
/// ```
#[macro_export]
macro_rules! th {
    ($t: ident, $h: ident) => {
        $crate::types::action::KeyAction::TapHold(
            $crate::types::action::Action::Key($crate::types::keycode::KeyCode::Hid(
                $crate::types::keycode::HidKeyCode::$t,
            )),
            $crate::types::action::Action::Key($crate::types::keycode::KeyCode::Hid(
                $crate::types::keycode::HidKeyCode::$h,
            )),
            ::core::primitive::u8::MAX,
        )
    };
}

/// Create a dual-key tap-hold action with custom timing profile.
///
/// Same as `th!` but allows specifying custom tap/hold timing configuration.
///
/// # Parameters
/// - `$t`: HID keycode to send when tapped
/// - `$h`: HID keycode to send when held
/// - `$p`: Morse profile index (`u8`, into `MorsesConfig::profiles`); an index with no entry falls back to the default profile
///
/// # Example
/// ```ignore
/// thp!(Space, Backspace, 0)  // tap-hold using morse profile 0
/// ```
#[macro_export]
macro_rules! thp {
    ($t: ident, $h: ident, $p: expr) => {
        $crate::types::action::KeyAction::TapHold(
            $crate::types::action::Action::Key($crate::types::keycode::KeyCode::Hid(
                $crate::types::keycode::HidKeyCode::$t,
            )),
            $crate::types::action::Action::Key($crate::types::keycode::KeyCode::Hid(
                $crate::types::keycode::HidKeyCode::$h,
            )),
            $p,
        )
    };
}

/// Create a one-shot layer action.
///
/// This macro creates a key that activates a layer for the next keypress only.
/// After the next key is pressed, the layer automatically deactivates.
///
/// # Parameters
/// - `$x`: Layer number (0-255)
///
/// # Example
/// ```ignore
/// osl!(1)  // Next key will be from layer 1, then return to current layer
/// osl!(2)  // Next key will be from layer 2, then return to current layer
/// ```
#[macro_export]
macro_rules! osl {
    ($x: literal) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::OneShotLayer($x))
    };
}

/// Create a one-shot modifier action.
///
/// This macro creates a key that applies modifiers for the next keypress only.
/// They automatically deactivate if:
/// - other key that sends keyboard report is pressed,
/// - timeout has passed before next key is triggered.
///
/// # Parameters
/// - `$m`: `ModifierCombination` to apply for the next keypress
///
/// # Example
/// ```ignore
/// // Next key will be shifted
/// osm!(ModifierCombination::LSHIFT)
/// // Next key will have both Shift and Ctrl applied
/// osm!(ModifierCombination::LSHIFT | ModifierCombination::LCTRL)
/// ```
#[macro_export]
macro_rules! osm {
    ($m: expr) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::OneShotModifier($m))
    };
}

/// Create a layer toggle action.
///
/// This macro creates a key that toggles a layer on/off with each press.
/// First press activates the layer, second press deactivates it.
///
/// # Parameters
/// - `$x`: Layer number (0-255)
///
/// # Example
/// ```ignore
/// tg!(1)  // Toggle layer 1 on/off
/// tg!(2)  // Toggle layer 2 on/off
/// ```
#[macro_export]
macro_rules! tg {
    ($x: literal) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::LayerToggle($x))
    };
}

/// Create a layer tap-toggle action.
///
/// This macro creates a dual-function key:
/// - **Tap**: Toggles the layer on/off
/// - **Hold**: Momentarily activates the layer (like `mo!`)
///
/// # Parameters
/// - `$x`: Layer number (0-255)
///
/// # Example
/// ```ignore
/// tt!(1)  // Tap to toggle layer 1, hold to activate momentarily
/// tt!(2)  // Tap to toggle layer 2, hold to activate momentarily
/// ```
#[macro_export]
macro_rules! tt {
    ($x: literal) => {
        $crate::types::action::KeyAction::TapHold(
            $crate::types::action::Action::LayerToggle($x),
            $crate::types::action::Action::LayerOn($x),
            ::core::primitive::u8::MAX,
        )
    };
}

/// Create a layer tap-toggle action with custom timing profile.
///
/// Same as `tt!` but allows specifying custom tap/hold timing configuration.
///
/// # Parameters
/// - `$x`: Layer number (0-255)
/// - `$p`: Morse profile index (`u8`, into `MorsesConfig::profiles`); an index with no entry falls back to the default profile
#[macro_export]
macro_rules! ttp {
    ($x: literal, $p: expr) => {
        $crate::types::action::KeyAction::TapHold(
            $crate::types::action::Action::LayerToggle($x),
            $crate::types::action::Action::LayerOn($x),
            $p,
        )
    };
}

/// Create a "to layer" action (exclusive layer activation).
///
/// This macro activates the specified layer and deactivates all other layers
/// (except the default layer). This creates an exclusive layer switch.
///
/// # Parameters
/// - `$x`: Layer number (0-255)
///
/// # Example
/// ```ignore
/// to!(1)  // Switch exclusively to layer 1
/// to!(0)  // Return to base layer
/// ```
#[macro_export]
macro_rules! to {
    ($x: literal) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::LayerToggleOnly($x))
    };
}

/// Create a default layer switch action.
///
/// This macro sets the default/base layer. The default layer is always active
/// and serves as the fallback when no other layers are active.
///
/// # Parameters
/// - `$x`: Layer number (0-255)
///
/// # Example
/// ```ignore
/// df!(0)  // Set layer 0 as the default layer
/// df!(1)  // Set layer 1 as the default layer (e.g., for Dvorak layout)
/// ```
#[macro_export]
macro_rules! df {
    ($x: literal) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::DefaultLayer($x))
    };
}

/// Create a persistent default layer switch action.
///
/// Like [`df!`], but the new default layer is saved to storage and restored on
/// the next boot (requires the `storage` feature). This is the QMK `PDF` key.
///
/// # Parameters
/// - `$x`: Layer number (0-255)
///
/// # Example
/// ```ignore
/// pdf!(1)  // Set layer 1 as the default layer, persisting across reboots
/// ```
#[macro_export]
macro_rules! pdf {
    ($x: literal) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::PersistentDefaultLayer($x))
    };
}

/// Create a shifted key action.
///
/// This is a convenience macro that creates a key with left shift applied.
/// Equivalent to `wm!($x, ModifierCombination::LSHIFT)`.
///
/// # Parameters
/// - `$x`: HID keycode identifier
///
/// # Example
/// ```ignore
/// shifted!(A)      // Sends Shift+A (uppercase 'A')
/// shifted!(Kc1)    // Sends Shift+1 (exclamation mark '!')
/// shifted!(Slash)  // Sends Shift+/ (question mark '?')
/// ```
#[macro_export]
macro_rules! shifted {
    ($x: ident) => {
        $crate::wm!(
            $x,
            $crate::types::modifier::ModifierCombination::new_from(false, false, false, true, false)
        )
    };
}

/// Create a rotary encoder action.
///
/// This macro defines the behavior of a rotary encoder, specifying different
/// actions for clockwise and counter-clockwise rotation.
///
/// # Parameters
/// - `$clockwise`: `KeyAction` to execute on clockwise rotation
/// - `$counter_clockwise`: `KeyAction` to execute on counter-clockwise rotation
///
/// # Example
/// ```ignore
/// // Volume control encoder
/// encoder!(
///     k!(KbVolumeUp),     // Clockwise increases volume
///     k!(KbVolumeDown)    // Counter-clockwise decreases volume
/// )
///
/// // Scroll encoder
/// encoder!(
///     k!(MouseWheelUp),
///     k!(MouseWheelDown)
/// )
/// ```
#[macro_export]
macro_rules! encoder {
    ($clockwise: expr, $counter_clockwise: expr) => {
        $crate::types::action::EncoderAction::new($clockwise, $counter_clockwise)
    };
}

/// Create a tap dance action (Morse action).
///
/// This macro creates a reference to a tap dance configuration by index.
/// Tap dance allows multiple actions based on the number of taps.
/// In Vial, this appears as "Tap Dance".
///
/// # Parameters
/// - `$index`: Index of the tap dance configuration (0-255)
///
/// # Example
/// ```ignore
/// td!(0)  // References tap dance configuration at index 0
/// td!(1)  // References tap dance configuration at index 1
/// ```
///
/// # Note
/// The actual tap dance behavior must be configured separately in the
/// keyboard's tap dance configuration array.
#[macro_export]
macro_rules! td {
    ($index: literal) => {
        $crate::types::action::KeyAction::Morse($index)
    };
}

/// Create a Morse action (alias for tap dance).
///
/// This is an alias for `td!` macro. "Morse" is the internal name for
/// the superset of tap dance and tap-hold functionality.
///
/// # Parameters
/// - `$index`: Index of the Morse configuration (0-255)
///
/// # Example
/// ```ignore
/// morse!(0)  // Same as td!(0)
/// ```
#[macro_export]
macro_rules! morse {
    ($index: literal) => {
        $crate::types::action::KeyAction::Morse($index)
    };
}

/// Create a macro trigger action.
///
/// This macro creates a key that triggers a predefined macro sequence by index.
/// Macros can send multiple keypresses or perform complex sequences.
///
/// # Parameters
/// - `$index`: Index of the macro (0-255)
///
/// # Example
/// ```ignore
/// macros!(0)  // Triggers macro at index 0
/// macros!(1)  // Triggers macro at index 1
/// ```
#[macro_export]
macro_rules! macros {
    ($index: literal) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::TriggerMacro($index))
    };
}

/// Create a user key action with given index.
///
/// # Parameters
/// - `$index`: Index of the user key (0-31)
#[macro_export]
macro_rules! user {
    ($index: literal) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::User($index))
    };
}

/// Create a keyboard control action.
///
/// This macro creates actions for system-level keyboard operations.
///
/// # Available Actions
/// - Bootloader: Enter bootloader mode for firmware updates
/// - Reboot: Reboot the keyboard
/// - DebugToggle: Toggle debug mode
/// - ClearEeprom: Clear EEPROM storage
/// - OutputAuto: Auto-select output (USB/Bluetooth)
/// - OutputUsb: Force USB output
/// - OutputBluetooth: Force Bluetooth output
/// - ComboOn: Enable combos
/// - ComboOff: Disable combos
/// - ComboToggle: Toggle combos
/// - CapsWordToggle: Toggle caps word mode
///
/// # Example (internal use only)
/// ```ignore
/// kbctrl!(Bootloader)
/// kbctrl!(OutputUsb)
/// ```
#[macro_export]
macro_rules! kbctrl {
    ($action: ident) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::KeyboardControl(
            $crate::types::action::KeyboardAction::$action,
        ))
    };
}

/// Create a light control action.
///
/// This macro creates light control actions for backlight and RGB lighting.
///
/// # Available Actions
/// Backlight: BacklightOn, BacklightOff, BacklightToggle, BacklightDown,
/// BacklightUp, BacklightStep, BacklightToggleBreathing
///
/// RGB: RgbTog, RgbModeForward, RgbModeReverse, RgbHui, RgbHud, RgbSai,
/// RgbSad, RgbVai, RgbVad, RgbSpi, RgbSpd, RgbModePlain, RgbModeBreathe,
/// RgbModeRainbow, RgbModeSwirl, RgbModeSnake, RgbModeKnight, RgbModeXmas,
/// RgbModeGradient, RgbModeRgbtest, RgbModeTwinkle
///
/// # Example (internal use only)
/// ```ignore
/// light!(BacklightOn)
/// light!(RgbTog)
/// ```
#[macro_export]
macro_rules! light {
    ($action: ident) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::Light(
            $crate::types::action::LightAction::$action,
        ))
    };
}

/// Create a special key action.
///
/// This macro creates special key actions that are not in the HID spec
/// but are commonly used.
///
/// # Available Actions
/// - GraveEscape: Acts as Grave when pressed alone, Escape when pressed with Shift/Ctrl/Alt/GUI
/// - Repeat: Repeats the last key pressed
///
/// # Example (internal use only)
/// ```ignore
/// special!(GraveEscape)
/// special!(Repeat)
/// ```
#[macro_export]
macro_rules! special {
    ($key: ident) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::Special(
            $crate::types::keycode::SpecialKey::$key,
        ))
    };
}

#[cfg(feature = "steno")]
#[macro_export]
macro_rules! steno {
    ($key: ident) => {
        $crate::types::action::KeyAction::Single($crate::types::action::Action::Steno(
            $crate::types::steno::StenoKey::$key,
        ))
    };
}