Changeset 4044

Show
Ignore:
Timestamp:
2006年02月24日 19時46分43秒 (2 years ago)
Author:
horiguti
Message:

Refine IME control. Protect key strokes around switching of fep from
disordering and/or vanishing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/ChangeLog.Meadow

    r4039 r4044  
     12006-02-24  Kyotaro HORIGUCHI  <horiguti@meadowy.org> 
     2 
     3        * international/meadow.el (mw32-input-method): Protect key strokes 
     4        around switching of fep from disordering and/or vanishing. 
     5 
    162006-02-21  Hideyuki SHIRAI  <shirai@meadowy.org> 
    27 
  • trunk/lisp/international/meadow.el

    r4009 r4044  
    529529    (let ((redisplay-dont-pause t)) 
    530530      (sit-for 0)) 
     531    (mw32-protect-fep-input) 
    531532    (fep-force-on) 
    532533    (let* ((pos (point)) 
  • trunk/src/ChangeLog.Meadow

    r4043 r4044  
     12006-02-24  Kyotaro HORIGUCHI  <horiguti@meadowy.org> 
     2 
     3        * mw32ime.c (CHOKEDKEYBUFLEN): New macro. 
     4        (choke_keystroke): New variable. 
     5        (choked_key_index): New variable. 
     6        (choked_key_buf): New variable. 
     7        (mw32_ime_choke_keystroke): New function. 
     8        (mw32-ime-input-method-function): Protect key strokes around 
     9        switching of fep from disordering and/or vanishing. 
     10        (mw32-protect-fep-input): New lisp function. 
     11 
     12        * mw32term.c (mw32_message_loop<WM_KEYDOWN>): Protect key strokes 
     13        around switching of fep from disordering and/or vanishing. 
     14 
    1152006-02-20  Kyotaro HORIGUCHI  <horiguti@meadowy.org> 
    216 
  • trunk/src/mw32ime.c

    r4026 r4044  
    162162int mw32_fep_switch_by_key_event; 
    163163 
     164#define CHOKEDKEYBUFLEN 16 
    164165int IME_event_off_count; 
    165166static int last_ime_vkeycode; 
    166167static int last_ime_vkeymod; 
     168static int choke_keystroke = FALSE; 
     169static int choked_key_index = 0; 
     170static char choked_key_buf [CHOKEDKEYBUFLEN]; 
    167171 
    168172EXFUN (Fsubstring_no_properties, 3); 
     
    795799} 
    796800 
     801int 
     802mw32_ime_choke_keystroke (int keycode) 
     803{ 
     804  if (! choke_keystroke 
     805      || keycode == 0 
     806      || choked_key_index >= CHOKEDKEYBUFLEN) return FALSE; 
     807 
     808  choked_key_buf[choked_key_index++] = keycode; 
     809 
     810  return TRUE; 
     811} 
     812 
    797813void 
    798814mw32_ime_cancel_input_function (void) 
     
    850866  ResetEvent (input_method_function_event); 
    851867 
     868  Fmw32_protect_fep_input (); 
    852869  Ffep_force_on (Qnil); 
    853870 
    854871  result = Qnil; 
    855   redisplay_preserve_echo_area (30); 
    856872 
    857873  /* If new ascii (expected..) key event comes after this function 
     
    869885        } 
    870886    } 
     887  /* redisplay won't done when waiting keyevents exist. */ 
     888  redisplay_preserve_echo_area (30); 
     889 
     890  /* Key strokes after keystroke choking has turned on till here is 
     891     stored into choked_key_buf */ 
     892  if (choked_key_index > 0) 
     893    { 
     894      Lisp_Object args[2]; 
     895      args[0] = str; 
     896      args[1] = make_string (choked_key_buf, choked_key_index); 
     897      str = Fconcat (2, args); 
     898    } 
     899  choke_keystroke = FALSE; 
     900  choked_key_index = 0; 
    871901 
    872902  mw32_set_ime_conv_window (hwnd, 
     
    969999{ 
    9701000  return (make_number (((int)GetKeyboardLayout (0)) & 0xffff)); 
     1001} 
     1002 
     1003DEFUN ("mw32-protect-fep-input", Fmw32_protect_fep_input, Smw32_protect_fep_input, 0, 0, 0, 
     1004       doc: /* Start choking of fep-input to protect them from disordering 
     1005on fep-swithing. 
     1006This function is internal function for mw32-input-method. */) 
     1007  () 
     1008{ 
     1009  if (NILP (Ffep_get_mode ())) 
     1010    choke_keystroke = TRUE; 
     1011 
     1012  return Qnil; 
    9711013} 
    9721014 
     
    18901932  defsubr (&Smw32_ime_available); 
    18911933  defsubr (&Smw32_input_language_code); 
     1934  defsubr (&Smw32_protect_fep_input); 
    18921935  defsubr (&Sfep_force_on); 
    18931936  defsubr (&Sfep_force_off); 
  • trunk/src/mw32term.c

    r4043 r4044  
    46274627                { 
    46284628                  int vkey = mw32_ime_get_virtual_key (msg.hwnd); 
    4629                   keyflag = 
    4630                     mw32_emacs_translate_message (dpyinfo, 1, vkey, 
    4631                                                   &keycode, &keymod); 
     4629                  mw32_emacs_translate_message (dpyinfo, 1, vkey, 
     4630                                                &keycode, &keymod); 
    46324631                  mw32_ime_record_keycode (keycode, keymod); 
     4632                  if (mw32_ime_choke_keystroke (keycode)) 
     4633                    break; 
    46334634                } 
    46344635              keyflag = mw32_emacs_translate_message (dpyinfo, 1, msg.wParam, 
    46354636                                                      &keycode, &keymod); 
     4637 
     4638              if (keyflag ==1 && mw32_ime_choke_keystroke (keycode)) 
     4639                break; 
     4640 
    46364641              EVENT_INIT (*bufp); 
    46374642              MW32_INIT_EMACS_EVENT (*bufp);