Hi everyone! I am using Compose Hot Reload MCP ser...
# compose-desktop
d
Hi everyone! I am using Compose Hot Reload MCP server with a CuP presentation. I need my agent to focus an element, press a key and maybe awaiting the UI becomes idle (to wait for an animation to finish), in order to be able to navigate through the slides. It seems to not be possible with the current provided tools. Is it a use case you deem reasonable and should I open a ticket?
u
d
@אליהו הדס I am speaking specifically about this: https://github.com/JetBrains/compose-hot-reload
u
d
Huh, interesting. I'll look into it. Thanks for the pointer.
u
You can speak directly with the maintainer @seb if you have any comments
s
Should work fine! Do let me know if you find issues
❤️ 1
I'm on vacation for the next couple weeks but I can still forward bug reports for triage
d
I tried it and it seems to work great. However, it is unclear to me if it possible to send key presses to the Compose app without having my agent to manually give focus to the Compose app window. Currently, it needs to play with the window manager (I'm on Linux/Ubuntu/X11) which is rather cumbersome when working while my agent works autonomously. I've seen the Input Coordination in the docs, but it is still unclear to me as to how I should proceed...
s
Who gets key events is usually up to the OS/WM
Meaning which window gets them; if you want to receive key events even when not focused you need to hack around — this is not a Compose thing, usually all WMs work this way: the focused window is the one that gets the keys. Unless you're asking about Spectre — in which case you should be using the synthetic or semantics drivers as documented (synthetic is the default and doesn't require being focused)
If you use the AWT Robot mechanism to inject key events at the system level, then the events follow OS rules meaning they're delivered to whatever window is focused. That is the whole reason this is not the default.
d
OK, I understand. So I cannot rely on key presses if I want my agents to work in the background. I think I will cook a home-made protocol for my agent to go to a particular slide and navigate between slides.
Thanks a lot for your explanations.
s
No worries. Again, spectre offers two ways to send key and mouse events to non-focused windows, but probably a well defined API for you specific use case will be a ton faster