Skip to main content

parse_key_and_modifiers

Function parse_key_and_modifiers 

Source
pub fn parse_key_and_modifiers(
    payload: Option<&Map<String, Value>>,
) -> (String, Value)
Expand description

Parse key and modifiers from an interact payload.

Supports three formats via plushie_core::key::KeyPress::from_wire:

  1. Combined combo string: {"combo": "Ctrl+s"}
  2. Explicit key + modifiers: {"key": "s", "modifiers": {"ctrl": true}}
  3. Combined key field: {"key": "ctrl+s"}

All key names and modifiers are normalized (case-insensitive, underscores/hyphens stripped, aliases resolved).