I made a button in my sim cockpit using Mobiflight that lets you generate keystrokes from buttons, so I made a PTT button on my panel, which makes a keystroke when pressed.
This works fine in Notepad for testing, and in VPilot it works as PTT just fine.
But for some reason Swift does not see the key events when set up as a hotkey (or when trying to set it up as one). The keystroke is just not doing anything.
But it works fine when I focus the text commands / chat input field and press the button, the text is entered there.
So Swift hotkey listening code is doing something differently and does not see synthetic key events?
MobiFlight, if I understood correctly, uses WindowsForms SendInput to do this.
I made a button in my sim cockpit using Mobiflight that lets you generate keystrokes from buttons, so I made a PTT button on my panel, which makes a keystroke when pressed.
This works fine in Notepad for testing, and in VPilot it works as PTT just fine.
But for some reason Swift does not see the key events when set up as a hotkey (or when trying to set it up as one). The keystroke is just not doing anything.
But it works fine when I focus the text commands / chat input field and press the button, the text is entered there.
So Swift hotkey listening code is doing something differently and does not see synthetic key events?
MobiFlight, if I understood correctly, uses WindowsForms SendInput to do this.
https://github.com/MobiFlight/MobiFlight-Connector/blob/main/MobiFlight/KeyboardInput.cs#L116 maybe? Unfortunately I am not very experienced in code so I could be wrong too.