'How to click OK when pressing the Return key in Xdialog?

This is part of the source code in the file callbacks.c it handles the return only if the focus is outside the inputbox, how can I modify it to handle return when pressed inside the inputbox?

Xdialog --inputbox Test 10 50

Xdialog entry

    if (event->type == GDK_KEY_PRESS && (event->keyval == GDK_Return ||
                                         event->keyval == GDK_KP_Enter)) {
            if (Xdialog.default_no)
                    Xdialog.exit_code = 1;
            else
                    Xdialog.exit_code = 0;

            return(FALSE);
    }

https://github.com/wdlkmpx/Xdialog

gtk


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source