Look at input.c input_osc_52 at the start it checks wp == NULL which means it needs a pane.
It doesn't use wp until twice at the end of the function. The notify is easy enough, you can just skip it if wp is NULL.
But for the screen_write_start - I'm not sure why it calls screen_write_start/stop rather than using ictx->ctx, so you could maybe try removing them and using that instead of the stack screen_write_ctx.
If that won't work it may be difficult to set up the context because the input code may not have everything it needs. It may mean another callback back to the screen owner.