Send keystrokes to an application

It’s quite hard-coded and hacky, but, nonetheless :tada:

Couldn’t find a public API, but I did find a slightly cleaner way by grepping for all instances of AS_BRING_TEAM_TO_FRONT to find all the functions that used it.

#include <WindowInfo.h> // private header
// ...
do_bring_to_front_team(BRect(), messenger.Team(), false);

do_bring_to_front_team takes two extra parameters related to window zooming. It then promptly proceeds to ignore those two parameters :stuck_out_tongue: . So I’ve just filled them in with some sensible default values.

The intent wasn’t to create a general purpose solution but who knows…

It’s where I’ve taken the code from. It’s a bit cleaner but it doesn’t change the substance of using a private call.

Fair enough, as long as it works :slight_smile:

Is this type of solution required on a native app? Or is this just a result of using a foreign app in Haiku?

Native apps offer better and easier mechanisms to communicate. This solution is required because Claws is a GTK app which offers almost no way to integrate with Haiku unless you use some nasty hacks like this.

1 Like