Пример #1
0
void owl_process_input_char(owl_input j)
{
  int ret;

  owl_global_set_lastinputtime(&g, time(NULL));
  ret = owl_keyhandler_process(owl_global_get_keyhandler(&g), j);
  if (ret!=0 && ret!=1) {
    owl_function_makemsg("Unable to handle keypress");
  }
}
Пример #2
0
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");
  }
}