- button widget skill combo enhanced to macro

- widget picker view UI fixes
This commit is contained in:
True Zhuanjia committed 2026-05-21 14:18:50 +08:00
1 parent a7088c70e5
commit 2c2088e4b1
11 files changed
+2057 -312

No files matched your search

+29
View File
@@ -368,6 +368,21 @@ struct VirtualKeyboardView: View {
let keyID = regularHighlightID(for: key)
if highlightedKeyIDs.contains(keyID) {
if mode != .shortcutPicker {
let cmd = key.cmdString(for: keyboardType) ?? ""
guard !cmd.isEmpty else { return }
if canSelectCommand?(cmd) == false {
return
}
VirtualKeyboardView.tappedKeyLabels = [key.label]
VirtualKeyboardView.selectedCmd = cmd
VirtualKeyboardView.lastSelectionDisplayText = poolDisplayText(for: key)
VirtualKeyboardView.lastSelectionUsesMacLayout = keyboardType == .mac
VirtualKeyboardView.lastSelectionFromMouseWidgets = isMouseWidgetKey(key)
VirtualKeyboardView.lastSelectionUsesFnCommandDisplay = usesFnCommandDisplay(for: key)
onCommandSelected?(cmd)
return
}
highlightedKeyIDs.remove(keyID)
if let cmd = key.cmdString(for: keyboardType), !cmd.isEmpty {
onCommandDeselected?(cmd)
@@ -406,6 +421,20 @@ struct VirtualKeyboardView: View {
}
if directionSingleKeyLabels.contains(key.label) {
if mode != .shortcutPicker {
let command = key.cmdString(for: keyboardType) ?? key.label
if canSelectCommand?(command) == false {
return
}
VirtualKeyboardView.tappedKeyLabels = [key.label]
VirtualKeyboardView.selectedCmd = command
VirtualKeyboardView.lastSelectionDisplayText = poolDisplayText(for: key)
VirtualKeyboardView.lastSelectionUsesMacLayout = keyboardType == .mac
VirtualKeyboardView.lastSelectionFromMouseWidgets = false
VirtualKeyboardView.lastSelectionUsesFnCommandDisplay = false
onCommandSelected?(command)
return
}
directionSingleKeyLabels.remove(key.label)
if let cmd = key.cmdString(for: keyboardType), !cmd.isEmpty {
onCommandDeselected?(cmd)