diff --git a/src/Qt5/imports/FluentUI/Controls/FluShortcutPicker.qml b/src/Qt5/imports/FluentUI/Controls/FluShortcutPicker.qml index 0efb0389..7e6acb3b 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluShortcutPicker.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluShortcutPicker.qml @@ -189,24 +189,25 @@ FluIconButton { forceActiveFocus() } Keys.enabled: true - Keys.onPressed: { - var keyNames = [] - if (event.modifiers & Qt.AltModifier) { - keyNames.push("Alt") - } - if (event.modifiers & Qt.ControlModifier) { - keyNames.push("Ctrl") - } - if (event.modifiers & Qt.ShiftModifier) { - keyNames.push("Shift") - } - var keyName = d.keyToString(event.key,false) - if(keyName!==""){ - keyNames.push(keyName) - content_dialog.keysModel = keyNames + Keys.onPressed: + (event)=>{ + var keyNames = [] + if (event.modifiers & Qt.AltModifier) { + keyNames.push("Alt") + } + if (event.modifiers & Qt.ControlModifier) { + keyNames.push("Ctrl") + } + if (event.modifiers & Qt.ShiftModifier) { + keyNames.push("Shift") + } + var keyName = d.keyToString(event.key,false) + if(keyName!==""){ + keyNames.push(keyName) + content_dialog.keysModel = keyNames + } + event.accepted = true } - event.accepted = true - } Keys.onTabPressed: (event)=>{ event.accepted = true diff --git a/src/Qt6/imports/FluentUI/Controls/FluShortcutPicker.qml b/src/Qt6/imports/FluentUI/Controls/FluShortcutPicker.qml index 9f84beb4..1b1ea7f4 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluShortcutPicker.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluShortcutPicker.qml @@ -189,24 +189,25 @@ FluIconButton { forceActiveFocus() } Keys.enabled: true - Keys.onPressed: { - var keyNames = [] - if (event.modifiers & Qt.AltModifier) { - keyNames.push("Alt") - } - if (event.modifiers & Qt.ControlModifier) { - keyNames.push("Ctrl") - } - if (event.modifiers & Qt.ShiftModifier) { - keyNames.push("Shift") - } - var keyName = d.keyToString(event.key,false) - if(keyName!==""){ - keyNames.push(keyName) - content_dialog.keysModel = keyNames + Keys.onPressed: + (event)=>{ + var keyNames = [] + if (event.modifiers & Qt.AltModifier) { + keyNames.push("Alt") + } + if (event.modifiers & Qt.ControlModifier) { + keyNames.push("Ctrl") + } + if (event.modifiers & Qt.ShiftModifier) { + keyNames.push("Shift") + } + var keyName = d.keyToString(event.key,false) + if(keyName!==""){ + keyNames.push(keyName) + content_dialog.keysModel = keyNames + } + event.accepted = true } - event.accepted = true - } Keys.onTabPressed: (event)=>{ event.accepted = true