This commit is contained in:
朱子楚\zhuzi 2023-12-04 21:52:57 +08:00
parent 46148b3c5c
commit bc0c36772f
2 changed files with 36 additions and 34 deletions

View File

@ -189,24 +189,25 @@ FluIconButton {
forceActiveFocus() forceActiveFocus()
} }
Keys.enabled: true Keys.enabled: true
Keys.onPressed: { Keys.onPressed:
var keyNames = [] (event)=>{
if (event.modifiers & Qt.AltModifier) { var keyNames = []
keyNames.push("Alt") 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
} }
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
}
Keys.onTabPressed: Keys.onTabPressed:
(event)=>{ (event)=>{
event.accepted = true event.accepted = true

View File

@ -189,24 +189,25 @@ FluIconButton {
forceActiveFocus() forceActiveFocus()
} }
Keys.enabled: true Keys.enabled: true
Keys.onPressed: { Keys.onPressed:
var keyNames = [] (event)=>{
if (event.modifiers & Qt.AltModifier) { var keyNames = []
keyNames.push("Alt") 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
} }
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
}
Keys.onTabPressed: Keys.onTabPressed:
(event)=>{ (event)=>{
event.accepted = true event.accepted = true