Add new shortcuts to shortcuts dialog (#26836)

This commit is contained in:
Bram Kragten
2025-09-02 16:08:32 +02:00
committed by GitHub
parent c49d2a0be6
commit f3b214c30a
3 changed files with 23 additions and 2 deletions

View File

@@ -88,7 +88,10 @@ export class HaAutomationRow extends LitElement {
(ev.ctrlKey || ev.metaKey) &&
!ev.shiftKey &&
!ev.altKey &&
(ev.key === "c" || ev.key === "x" || ev.key === "Delete")
(ev.key === "c" ||
ev.key === "x" ||
ev.key === "Delete" ||
ev.key === "Backspace")
)
) {
return;
@@ -119,7 +122,7 @@ export class HaAutomationRow extends LitElement {
return;
}
if (ev.key === "Delete") {
if (ev.key === "Delete" || ev.key === "Backspace") {
fireEvent(this, "delete-row");
return;
}

View File

@@ -71,6 +71,21 @@ const _SHORTCUTS: Section[] = [
{
key: "ui.dialogs.shortcuts.automation_script.title",
items: [
{
type: "shortcut",
shortcut: [{ key: "ui.dialogs.shortcuts.shortcuts.ctrl_cmd" }, "C"],
key: "ui.dialogs.shortcuts.automation_script.copy",
},
{
type: "shortcut",
shortcut: [{ key: "ui.dialogs.shortcuts.shortcuts.ctrl_cmd" }, "X"],
key: "ui.dialogs.shortcuts.automation_script.cut",
},
{
type: "shortcut",
shortcut: [{ key: "ui.dialogs.shortcuts.shortcuts.ctrl_cmd" }, "del"],
key: "ui.dialogs.shortcuts.automation_script.delete",
},
{
type: "shortcut",
shortcut: [{ key: "ui.dialogs.shortcuts.shortcuts.ctrl_cmd" }, "V"],

View File

@@ -2061,6 +2061,9 @@
},
"automation_script": {
"title": "Automations / Scripts",
"copy": "to copy the selected automation/script action/condition/trigger",
"cut": "to cut the selected automation/script action/condition/trigger",
"delete": "to delete the selected automation/script action/condition/trigger",
"paste": "to paste automation/script YAML from clipboard to editor",
"save": "to save automation/script"
},