Skip to content

Hotkeys sent from external program (MobiFlight) do not get recognized, but are seen in chat text field #147

Open
@tigert

Description

@tigert

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions