static winid_t mainwin = NULL;
+void sayit(void)
+{
+ g_printerr("I'm the interrupt handler!\n");
+}
+
void glk_main(void)
{
/* Open the main window. */
glk_set_window(mainwin);
- gchar buffer[256] = "blaat";
+ glk_set_interrupt_handler(&sayit);
+
+ gchar buffer[256];
event_t ev;
while(1) {
glk_put_string("prompt> ");
- glk_request_line_event(mainwin, buffer, 256, 5);
+ glk_request_line_event(mainwin, buffer, 256, 0);
glk_select(&ev);
switch(ev.type) {
default:
printf("Var2: %d\n", ev.val2);
}
}
-
/* Bye bye */
glk_exit();