Creating a custom widget that overrides all input

I’d like to use LVGL to draw my application’s UI, but also use some of the device’s OS facilities for some of the inputs, such as text input.

The way they work, is that you call some functions in a loop until they signal they are done:

while(true) {
  // Draw your UI here...
  int status = updateTextInputDialog(); // This paints over your UI
  if(status == DONE) {

I’m trying to figure out a way to integrate this into my LVGL application…

Any ideas?