当前位置: 首页>>代码示例>>C++>>正文


C++ HIME_module_main_functions::mf_tsin_pho_mode方法代码示例

本文整理汇总了C++中HIME_module_main_functions::mf_tsin_pho_mode方法的典型用法代码示例。如果您正苦于以下问题:C++ HIME_module_main_functions::mf_tsin_pho_mode方法的具体用法?C++ HIME_module_main_functions::mf_tsin_pho_mode怎么用?C++ HIME_module_main_functions::mf_tsin_pho_mode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HIME_module_main_functions的用法示例。


在下文中一共展示了HIME_module_main_functions::mf_tsin_pho_mode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: module_feedkey_release

int module_feedkey_release(KeySym xkey, int kbstate)
{
  switch (xkey) {
     case XK_Shift_L:
     case XK_Shift_R:
        if (
(  (*gmf.mf_tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_Shift) ||
   (*gmf.mf_tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_ShiftL
     && xkey == XK_Shift_L) ||
   (*gmf.mf_tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_ShiftR
     && xkey == XK_Shift_R))
          &&  gmf.mf_current_time() - key_press_time < 300000) {
#if WIN32
          if (!*gmf.test_mode)
#endif
          {
            module_flush_input();
            key_press_time = 0;
            gmf.mf_hide_selections_win();
            gmf.mf_tsin_set_eng_ch(!gmf.mf_tsin_pho_mode());
          }
          return 1;
        } else
          return 0;
     default:
        return 0;
  }
}
开发者ID:CarterTsai,项目名称:hime,代码行数:28,代码来源:anthy.cpp

示例2:

gboolean
module_feedkey (int nKeyVal, int nKeyState)
{
    if (!g_pChewingCtx)
        return FALSE;

    if (!g_himeModMainFuncs.mf_tsin_pho_mode ())
        return FALSE;

    hime_label_clear (MAX_SEG_NUM);

    chewing_set_ShapeMode (g_pChewingCtx, g_himeModMainFuncs.mf_current_shape_mode());

    if (nKeyState & (Mod1Mask|Mod4Mask|Mod5Mask|ControlMask))
        return FALSE;

    if (!hime_key_filter (&nKeyVal))
        return FALSE;

    if (!hime_buffer_commit ())
        return FALSE;

    if (!hime_buffer_label_show ())
        return FALSE;

    if (!hime_zuin_label_show ())
        return FALSE;

    module_show_win ();

    return TRUE;
}
开发者ID:Explorer09,项目名称:hime,代码行数:32,代码来源:chewing.c

示例3:

gboolean
module_feedkey (int nKeyVal, int nKeyState)
{
    if (!g_pChewingCtx)
        return FALSE;

    if (!g_himeModMainFuncs.mf_tsin_pho_mode ())
        return FALSE;

    hime_label_clear (MAX_SEG_NUM);

    if (!hime_key_filter (&nKeyVal))
        return FALSE;

    if (!hime_zuin_label_show ())
        return FALSE;

    if (!hime_buffer_label_show ())
        return FALSE;

    if (!hime_buffer_commit ())
        return FALSE;

    module_show_win ();

    return TRUE;
}
开发者ID:duomaxwellr,项目名称:hime,代码行数:27,代码来源:chewing.c

示例4: module_feedkey_release

int module_feedkey_release(KeySym xkey, int kbstate)
{
  switch (xkey) {
     case XK_Shift_L:
     case XK_Shift_R:
        if (
(  (*gmf.mf_tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_Shift) ||
   (*gmf.mf_tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_ShiftL
     && xkey == XK_Shift_L) ||
   (*gmf.mf_tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_ShiftR
     && xkey == XK_Shift_R))
          && key_press_alt) {
          module_flush_input();
          key_press_alt = FALSE;
          gmf.mf_hide_selections_win();
          gmf.mf_tsin_set_eng_ch(!gmf.mf_tsin_pho_mode());
          return 1;
        } else
          return 0;
     default:
        return 0;
  }
}
开发者ID:PeterDaveHello,项目名称:hime,代码行数:23,代码来源:anthy.c

示例5: module_feedkey

gboolean module_feedkey(int kv, int kvstate)
{
  int lkv = tolower(kv);
  int shift_m=(kvstate&ShiftMask) > 0;
//  printf("%x %c  %d\n", kv, kv, shift_m);

  if (kvstate & ControlMask)
    return FALSE;
  if (kvstate & (Mod1Mask|Mod4Mask|Mod5Mask))
    return FALSE;

  if (kv==XK_Shift_L||kv==XK_Shift_R) {
    key_press_time = gmf.mf_current_time();
  }

  if (!gmf.mf_tsin_pho_mode())
    return 0;

  gboolean b_is_empty = is_empty();

  switch (kv) {
    case XK_F7:
      if (is_empty())
        return FALSE;
      state = STATE_ROMANJI;
      if (state_hira_kata != STATE_kata)
        state_hira_kata = STATE_kata;
      else
        state_hira_kata = STATE_hira;
      disp_input();
      return TRUE;
    case XK_F8:
      if (is_empty())
        return FALSE;
      state = STATE_ROMANJI;
      if (state_hira_kata != STATE_half_kata)
        state_hira_kata = STATE_half_kata;
      else
        state_hira_kata = STATE_hira;
      disp_input();
      return TRUE;
    case XK_F11:
      system("kasumi &");
      return TRUE;
    case XK_F12:
      system("kasumi -a &");
      return TRUE;
    case XK_Up:
      if (b_is_empty)
        return FALSE;
      if (state==STATE_SELECT) {
        int N = page_N();
        gmf.mf_tss->pho_menu_idx--;
        if (gmf.mf_tss->pho_menu_idx < 0)
          gmf.mf_tss->pho_menu_idx = N - 1;
        disp_select();
      }
      return TRUE;
    case XK_Down:
      if (b_is_empty)
        return FALSE;
      if (state==STATE_CONVERT) {
        state = STATE_SELECT;
        gmf.mf_tss->sel_pho = TRUE;
  //      puts("STATE_SELECT");
        disp_select();
      } else
      if (state==STATE_SELECT) {
        int N = page_N();
        gmf.mf_tss->pho_menu_idx=(gmf.mf_tss->pho_menu_idx+1)% N;
        disp_select();
      }
      return TRUE;
    case XK_Return:
      if (b_is_empty)
        return FALSE;
      if (state==STATE_SELECT) {
        if (select_idx(gmf.mf_tss->pho_menu_idx))
          goto send;
        return TRUE;
      }
send:
      return module_flush_input();
    case XK_Escape:
        if (state==STATE_SELECT) {
          state = STATE_CONVERT;
          gmf.mf_tss->sel_pho = FALSE;
          gmf.mf_clear_sele();
        }
        else
        if (state==STATE_CONVERT)
          goto rom;
      return FALSE;
    case XK_BackSpace:
      if (b_is_empty) {
        state_hira_kata = STATE_hira;
        return FALSE;
      }

      gmf.mf_hide_selections_win();
//.........这里部分代码省略.........
开发者ID:CarterTsai,项目名称:hime,代码行数:101,代码来源:anthy.cpp

示例6: memset

gboolean
module_feedkey (int nKeyVal, int nKeyState)
{
    char *pszTmp         = NULL;
    char *pszChewingCand = NULL;
    int nZuinLen         = 0;
    char szWord[4];
    int nPhoIdx, nBufIdx;
    int nIdx;

    if (!g_pChewingCtx)
        return FALSE;

    memset (szWord, 0x00, 4);

    if (!g_himeModMainFuncs.mf_tsin_pho_mode ())
        return FALSE;

    switch (nKeyVal)
    {
        case XK_space:
            chewing_handle_Space (g_pChewingCtx);
            break;

        case XK_Escape:
            chewing_handle_Esc (g_pChewingCtx);
            break;

        case XK_Return:
        case XK_KP_Enter:
            chewing_handle_Enter (g_pChewingCtx);
            break;

        case XK_Delete:
        case XK_KP_Delete:
            chewing_handle_Del (g_pChewingCtx);
            break;

        case XK_BackSpace:
            chewing_handle_Backspace (g_pChewingCtx);
            break;

        case XK_Up:
        case XK_KP_Up:
            chewing_handle_Up (g_pChewingCtx);
            break;

        case XK_Down:
        case XK_KP_Down:
            chewing_handle_Down (g_pChewingCtx);
            break;

        case XK_Left:
        case XK_KP_Left:
            chewing_handle_Left (g_pChewingCtx);
            break;

        case XK_Right:
        case XK_KP_Right:
            chewing_handle_Right (g_pChewingCtx);
            break;

#if 0
        case XK_Shift_L:
            chewing_handle_ShiftLeft (g_pChewingCtx);
            break;

        case XK_Shift_R:
            chewing_handle_ShiftRight (g_pChewingCtx);
            break;
#endif

        case XK_Tab:
            chewing_handle_Tab (g_pChewingCtx);
            break;

        default:
            if (nKeyVal > 32 && nKeyVal < 127)
                chewing_handle_Default (g_pChewingCtx, nKeyVal);
            break;
    }

    hime_label_clear (MAX_SEG_NUM);
    g_nCurrentCursorPos = chewing_cursor_Current (g_pChewingCtx);

    if (g_nCurrentCursorPos < 0 || g_nCurrentCursorPos > MAX_SEG_NUM)
        return FALSE;

    // zuin symbols
    pszTmp = chewing_zuin_String (g_pChewingCtx, &nZuinLen);
    if (pszTmp)
    {
        for (nBufIdx = 0; nBufIdx < nZuinLen; nBufIdx++)
        {
            memcpy (szWord, pszTmp + nBufIdx * 3, 3);
            for (nPhoIdx = 0; nPhoIdx < 3; nPhoIdx++)
                if (strstr (g_himeModMainFuncs.mf_pho_chars[nPhoIdx], szWord) != NULL)
                    hime_label_show (szWord, nPhoIdx + chewing_buffer_Len (g_pChewingCtx) + 1);
        }
        free (pszTmp);
//.........这里部分代码省略.........
开发者ID:CarterTsai,项目名称:hime,代码行数:101,代码来源:chewing.c


注:本文中的HIME_module_main_functions::mf_tsin_pho_mode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。