Back to index

im-sdk  12.3.91
Functions
key_event.h File Reference
#include <stdio.h>
#include "le.h"
#include "encode.h"
#include "xaux_locale.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void keyevent_handler (iml_session_t *s, IMKeyListEvent *keylistevent)
void proc_key_switch_keyboard_layout_event (iml_session_t *s, int nKeyboardID)
void keyevent_switch_conversion_handler (iml_session_t *s, int on)

Function Documentation

void keyevent_handler ( iml_session_t s,
IMKeyListEvent keylistevent 
)

Definition at line 56 of file key_event.c.

{
  MyDataPerSession *session_data = (MyDataPerSession *) s->specific_data;
  MyDataPerDesktop *desktop_data =
    (MyDataPerDesktop *)(s->desktop->specific_data);
  IMKeyEventStruct *key_event =
    (IMKeyEventStruct *) keylistevent->keylist;
  IMEBufferMethods mthds = session_data->session_core.ime_methods_table;
  IMEBuffer a_buffer = session_data->session_core.ime_buffer;
  
  INPUT_MODE_T imode_return;
  Bool mthd_return;

  KOLE_LOG (LOGDEST_STDOUT, " proc_keyevent:   session:%x\n", s);

  keyevent_input_handler (s, key_event);
  
  mthd_return = (*mthds->ime_buffer_get_input_mode) (a_buffer,  &imode_return);
  if (!mthd_return){
    KOLE_LOG (LOGDEST_STDERR,
             "keyevent_handler: error in getting current input mode\n");
    return;
  }
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 130 of file key_event.c.

{
  MyDataPerSession *sd = (MyDataPerSession *) s->specific_data;
  MyDataPerDesktop *dd = (MyDataPerDesktop *)(s->desktop->specific_data);
  int engine_id;
  IMEBufferMethods ime_methods =  sd->session_core.ime_methods_table;
  INPUT_MODE_T imt;
  Bool mthd_return;
  
  KOLE_LOG (LOGDEST_STDOUT,
           "ENGLISH_KOREAN SWITCH IME KEY, on:%d", on);

  sd->paletteaux_status.on = on;
  engine_id = sd->paletteaux_status.engine_id;
  ime_methods = g_engines[engine_id]->so_methods;

  if (on == CONVERSION_OFF) {
    
    (*ime_methods->ime_buffer_conversion_end)(sd->session_core.ime_buffer);

    iml_conversion_off (s);
    iml_status_draw (s);
    
    mthd_return =
      (*ime_methods->ime_buffer_get_input_mode)(sd->session_core.ime_buffer, &imt);
    if (mthd_return)
      le_update_paletteaux_input_mode_info (s, imt);

  } else {

    (*ime_methods->ime_buffer_conversion_start)(sd->session_core.ime_buffer);
    
    iml_conversion_on(s);
    iml_status_draw (s);

    mthd_return =
      (*ime_methods->ime_buffer_get_input_mode)(sd->session_core.ime_buffer, &imt);
    if (mthd_return)
      le_update_paletteaux_input_mode_info (s, imt);
    /*
      iml_status_draw (s);
      if (engine_id != 0xff)
      le_switch_engine(s, engine_id);
    */
  }
#if 0
  /* test code */
  iml_inst *lp;
  iml_inst *rrv = NULL;
  lp = s->If->m->iml_make_lookup_done_inst(s);
  s->If->m->iml_link_inst_tail (&rrv, lp);
  s->If->m->iml_execute (s, &rrv);

  le_change_focus_notify(s);

  /* If PaletteAux can be started */
  if (dd->paletteaux_ready == True) {
    return;
  }

  /* PaletteAux can not be started */
  if (on == CONVERSION_ON && engine_id == 0xff) {
    system_locale_id = dd->aux_locale_id;
    engine_id = 0;
    for (i = 0; i< g_number_of_engines; i++) {
      locale_id = g_engines[i]->core.baseinfo.locale_id;
      if (locale_id == system_locale_id || locale_id == ENCODES_NUM) {
       engine_id = i;
       break;
      }
    }
    KOLE_LOG (LOGDEST_STDOUT, "engine_id:%d", engine_id);
    le_switch_engine(s, engine_id);
  }
#endif
}

Here is the call graph for this function:

void proc_key_switch_keyboard_layout_event ( iml_session_t s,
int  nKeyboardID 
)

Definition at line 209 of file key_event.c.

{
  MyDataPerSession *session_data = (MyDataPerSession *)s->specific_data;
  if(nKeyboardID == -1){ /* no change, this would be for hiding the keyboad aux */
    iml_status_draw (s);
    return;
  }

  if(nKeyboardID < -1 || nKeyboardID > 3)
    nKeyboardID = 0;

  iml_status_draw (s);
}

Here is the call graph for this function:

Here is the caller graph for this function: