diff --git a/Commons/Keybinds.qml b/Commons/Keybinds.qml index cb464054d..1bebe3ec9 100644 --- a/Commons/Keybinds.qml +++ b/Commons/Keybinds.qml @@ -102,8 +102,13 @@ QtObject { } function checkKey(event, settingName, settings) { - // Map simplified names to the actual setting property names - var propName = "key" + settingName.charAt(0).toUpperCase() + settingName.slice(1); + // Accept both simplified names ("remove") and full property names ("keyRemove") + // so callers are less error-prone. + var normalized = String(settingName || ""); + if (!normalized) + return false; + + var propName = normalized.startsWith("key") ? normalized : ("key" + normalized.charAt(0).toUpperCase() + normalized.slice(1)); var boundKeys = settings.data.general.keybinds[propName]; if (!boundKeys || boundKeys.length === 0) return false; diff --git a/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml b/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml index b14117afc..e2fd3036b 100644 --- a/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml +++ b/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml @@ -79,7 +79,7 @@ SmartPanel { } // Removal (Delete/Remove) - if (checkKey(event, 'keyRemove') || event.key === Qt.Key_Delete) { + if (checkKey(event, 'remove') || event.key === Qt.Key_Delete) { removeSelection(); event.accepted = true; return;