{"record":{"id":"e7a0ce3e682eaea1","repo":"streamlit/streamlit","slug":"shortcut-must-include-a-single-character-or-one-of","errorCode":null,"errorMessage":"shortcut must include a single character or one of the supported keys (e.g. Enter, Space, Tab, Escape).","messagePattern":"shortcut must include a single character or one of the supported keys \\(e\\.g\\. Enter, Space, Tab, Escape\\)\\.","errorType":"exception","errorClass":"StreamlitAPIException","httpStatus":null,"severity":"error","filePath":"lib/streamlit/elements/lib/shortcut_utils.py","lineNumber":114,"sourceCode":"    }\n)\n\n_warned_browser_reserved_shortcuts: set[str] = set()\n\n\ndef _normalize_key_token(lower_token: str) -> str:\n    \"\"\"Normalize a key token to a format that can be used on the client side.\"\"\"\n\n    if lower_token in _KEY_ALIASES:\n        return _KEY_ALIASES[lower_token]\n\n    if len(lower_token) == 1 and lower_token.isalnum():\n        return lower_token\n\n    if lower_token.startswith(\"f\") and lower_token[1:].isdigit():\n        return lower_token\n\n    raise StreamlitAPIException(\n        \"shortcut must include a single character or one of the supported keys \"\n        \"(e.g. Enter, Space, Tab, Escape).\"\n    )\n\n\ndef normalize_shortcut(shortcut: str) -> str:\n    \"\"\"Normalize a shortcut string to a format that can be used on the client side.\n\n    Parameters\n    ----------\n    shortcut : str\n        The shortcut string to normalize.\n\n    Returns\n    -------\n    str\n        The normalized shortcut string.\n","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/streamlit/streamlit/blob/202661fc552db98c2ba0bb0e113d619689baf9de/lib/streamlit/elements/lib/shortcut_utils.py#L96-L132","documentation":"Error \"shortcut must include a single character or one of the supported keys (e.g. Enter, Space, Tab, Escape).\" thrown in streamlit/streamlit.","triggerScenarios":"Thrown at lib/streamlit/elements/lib/shortcut_utils.py:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"202661fc552db98c2ba0bb0e113d619689baf9de","analyzedAt":"2026-08-26T09:13:21.291Z","schemaVersion":2},"datasetVersion":"2026-08-26T14:46:13.012Z"}