+
+/**
+ * chimara_glk_feed_char_input:
+ * @glk: a #ChimaraGlk widget
+ * @keyval: a key symbol as defined in <filename
+ * class="headerfile">gdk/gdkkeysyms.h</filename>
+ *
+ * Pretend that a key was pressed in the Glk program as a response to a
+ * character input request. You can call this function even when no window has
+ * requested character input, in which case the key will be saved for the
+ * following window that requests character input. This has the disadvantage
+ * that if more than one window has requested character input, it is arbitrary
+ * which one gets the key press.
+ */
+void
+chimara_glk_feed_char_input(ChimaraGlk *glk, guint keyval)
+{
+ g_return_if_fail(glk || CHIMARA_IS_GLK(glk));
+ CHIMARA_GLK_USE_PRIVATE(glk, priv);
+ g_async_queue_push(priv->char_input_queue, GUINT_TO_POINTER(keyval));
+ event_throw(glk, evtype_ForcedCharInput, NULL, 0, 0);
+}
+
+/**
+ * chimara_glk_feed_line_input:
+ * @glk: a #ChimaraGlk widget
+ * @text: text to pass to the next line input request
+ *
+ * Pretend that @text was typed in the Glk program as a response to a line input
+ * request. @text does not need to end with a newline. You can call this
+ * function even when no window has requested line input, in which case the text
+ * will be saved for the following window that requests line input. This has the
+ * disadvantage that if more than one window has requested character input, it
+ * is arbitrary which one gets the text.
+ */
+void
+chimara_glk_feed_line_input(ChimaraGlk *glk, const gchar *text)
+{
+ g_return_if_fail(glk || CHIMARA_IS_GLK(glk));
+ g_return_if_fail(text);
+ CHIMARA_GLK_USE_PRIVATE(glk, priv);
+ g_async_queue_push(priv->line_input_queue, g_strdup(text));
+ event_throw(glk, evtype_ForcedLineInput, NULL, 0, 0);
+}