FocusedValues / FocusedKeyValue

I have an app with multiple Windows, but hardly any "input" field. I want to control certain stuff via Menu (FocusedValues / FocusedKeyValue)...

first I thought: this does not work at all... then I figured: If I write in a text field something.. then the focus is clear and the proper windows is targeted..

Just bringing the other window to focus (no edit nothing, just clicking on the window header)

does not seem to trigger "hey.. I'm the focus now"...

anyone experiencing the same? could I "fake" that? thinking of putting a very small text field so when I focus a windows, I could like, don't know: focus that input field such that the menu command realises: ah.. here's the windows I need to talk to...

so by adding .focusable() on the corresponding view.. a "click" on that view is fine enough...

still it would be nice if a "window" became focused by clicking on it's tab or window bar.. cause eventually this is what you are doing: activating (focusing) that window

mean time I figured out how to "modify" the menu with modifiers

CommandMenu("Message") {
            if var message = message {
                
                Button("Send \(message.text)") {
                    message.send()
                }
                .disabled(message.text.isEmpty ?? true)
                .modifierKeyAlternate(.shift) {
                    Button("Send (Shift)") {
                        message.text += " shift pressed"
                        message.send()
                    }
                    .disabled(message.text.isEmpty ?? true)
                }
            }
        }
FocusedValues / FocusedKeyValue
 
 
Q