Author: matt
Date: 2010-11-18 12:33:16 -0800 (Thu, 18 Nov 2010)
New Revision: 7876
Log:
Removed FLTK compose system for MSWindows. This should leave keyboard control 
to the OS instead of having something FLTK specific on top. I can't fully test 
this because I have merely a U.S. keyboard, but dad keys still seem to work... .

Modified:
   branches/branch-1.3/src/Fl_compose.cxx

Modified: branches/branch-1.3/src/Fl_compose.cxx
===================================================================
--- branches/branch-1.3/src/Fl_compose.cxx      2010-11-18 20:02:27 UTC (rev 
7875)
+++ branches/branch-1.3/src/Fl_compose.cxx      2010-11-18 20:33:16 UTC (rev 
7876)
@@ -28,17 +28,9 @@
 #include <FL/Fl.H>
 #include <FL/x.H>
 
-//
-// MRS: Uncomment the following define to get the original (pre-1.1.2)
-//      dead key support code.  The original code apparently did not
-//      work on Belgian keyboards.
-//
 
-//#define OLD_DEAD_KEY_CODE
+#if !defined(__APPLE__) && !defined(WIN32)
 
-
-#ifndef __APPLE__
-
 static const char* const compose_pairs =
 "=E  _'f _\"..+ ++^ %%^S< OE  ^Z    ^''^^\"\"^-*- --~ TM^s> oe  ^z:Y" 
 "  ! % # $ y=| & : c a <<~ - r _ * +-2 3 ' u p . , 1 o >>141234? "
@@ -47,38 +39,11 @@
 
 #endif
 
-#if !defined(WIN32) && defined(OLD_DEAD_KEY_CODE) // X only
-// X dead-key lookup table.  This turns a dead-key keysym into the
-// first of two characters for one of the compose sequences.  These
-// keysyms start at 0xFE50.
-// Win32 handles the dead keys before FLTK can see them.  This is
-// unfortunate, because you don't get the preview effect.
-static char dead_keys[] = {
-  '`', // XK_dead_grave
-  '\'',        // XK_dead_acute
-  '^', // XK_dead_circumflex
-  '~', // XK_dead_tilde
-  '_', // XK_dead_macron
-  0,   // XK_dead_breve
-  '.', // XK_dead_abovedot
-  ':', // XK_dead_diaeresis
-  '*', // XK_dead_abovering
-  0,   // XK_dead_doubleacute
-  'v', // XK_dead_caron
-  ','  // XK_dead_cedilla
-//   0,        // XK_dead_ogonek
-//   0,        // XK_dead_iota
-//   0,        // XK_dead_voiced_sound
-//   0,        // XK_dead_semivoiced_sound
-//   0 // XK_dead_belowdot
-};
-#endif // !WIN32 && OLD_DEAD_KEY_CODE
-
 #ifndef FL_DOXYGEN
 int Fl::compose_state = 0;
 #endif
 
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(WIN32)
 // under Mac OS X character composition is handled by the OS
 int Fl::compose(int& del) {
   if(Fl::e_length == 0 || Fl::e_keysym == FL_Enter || Fl::e_keysym == 
FL_KP_Enter || 
@@ -196,18 +161,9 @@
     return 1;
   }
 
-#ifndef WIN32
   // See if they typed a dead key.  This gets it into the same state as
   // typing prefix+accent:
   if (i >= 0xfe50 && i <= 0xfe5b) {
-#  ifdef OLD_DEAD_KEY_CODE
-    ascii = dead_keys[i-0xfe50];
-    for (const char *p = compose_pairs; *p; p += 2)
-      if (p[0] == ascii) {
-       compose_state = ascii;
-       return 1;
-      }
-#  else
     ascii = e_text[0];
     for (const char *p = compose_pairs; *p; p += 2)
       if (p[0] == ascii ||
@@ -215,11 +171,9 @@
         compose_state = p[0];
         return 1;
       }
-#  endif // OLD_DEAD_KEY_CODE
     compose_state = 0;
     return 1;
   }
-#endif
 
   // Only insert non-control characters:
   if (e_length && (ascii & ~31 && ascii!=127)) {compose_state = 0; return 1;}
@@ -227,7 +181,7 @@
   return 0;
 }
 
-#endif // __APPLE__
+#endif // __APPLE__ || WIN32
 
 //
 // End of "$Id$"

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to