void owl_process_input_char(owl_input j) { int ret; owl_popwin *pw; owl_editwin *tw; owl_global_set_lastinputtime(&g, time(NULL)); pw=owl_global_get_popwin(&g); tw=owl_global_get_typwin(&g); owl_global_set_lastinputtime(&g, time(NULL)); /* find and activate the current keymap. * TODO: this should really get fixed by activating * keymaps as we switch between windows... */ if (pw && owl_popwin_is_active(pw) && owl_global_get_viewwin(&g)) { owl_context_set_popless(owl_global_get_context(&g), owl_global_get_viewwin(&g)); owl_function_activate_keymap("popless"); } else if (owl_global_is_typwin_active(&g) && owl_editwin_get_style(tw)==OWL_EDITWIN_STYLE_ONELINE) { /* owl_context_set_editline(owl_global_get_context(&g), tw); owl_function_activate_keymap("editline"); */ } else if (owl_global_is_typwin_active(&g) && owl_editwin_get_style(tw)==OWL_EDITWIN_STYLE_MULTILINE) { owl_context_set_editmulti(owl_global_get_context(&g), tw); owl_function_activate_keymap("editmulti"); } else { owl_context_set_recv(owl_global_get_context(&g)); owl_function_activate_keymap("recv"); } /* now actually handle the keypress */ ret = owl_keyhandler_process(owl_global_get_keyhandler(&g), j); if (ret!=0 && ret!=1) { owl_function_makemsg("Unable to handle keypress"); } }
void owl_global_set_typwin_inactive(owl_global *g) { int d = owl_global_get_typewindelta(g); if (d > 0 && owl_editwin_get_style(g->tw) == OWL_EDITWIN_STYLE_MULTILINE) owl_function_resize_typwin(owl_global_get_typwin_lines(g) - d); if (!g->typwin_erase_id) { g->typwin_erase_id = g_signal_connect(g->mainpanel.typwin, "redraw", G_CALLBACK(owl_window_erase_cb), NULL); } owl_window_dirty(g->mainpanel.typwin); owl_editwin_unref(g->tw); g->tw = NULL; }