From 2f22abf4e2713eee5a4bf199cd86cd807e08e4fd Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Tue, 20 Apr 1999 04:43:24 +0000 Subject: Compose for Icelandic thorn character is "TH" or "th". Also fixed the comments in Fl_Input.cxx and fixed the documentation. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@552 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/events.html | 225 +++++++++++++++++++++------------------------- src/Fl_Input.cxx | 49 +++++----- 2 files changed, 132 insertions(+), 142 deletions(-) diff --git a/documentation/events.html b/documentation/events.html index a7fcdb44c..e43066dd5 100644 --- a/documentation/events.html +++ b/documentation/events.html @@ -182,147 +182,130 @@ characters. The two characters can be in either order. The [compose] key is any of: Ctrl+Q, the righthand control key, or any key your X server calls XK_Multi_key. -
+

- - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - +
KeysCharKeysCharKeysCharKeysCharKeysCharKeysChar
KeysChar + KeysChar + KeysChar + KeysChar + KeysChar + KeysChar
spnbsp*°A`ÀD-Ða`àd-ð
spacenbsp + *° + A`À + D-Ð + a`à + d-ð
!¡+-±A'ÁN~Ña'án~ñ
!¡ + +-± + A'Á + N~Ñ + a'á + n~ñ
%¢2²A^ÂO`Òa^âo`ò
%¢ + 2² + A^Â + O`Ò + a^â + o`ò
#£3³A~ÃO'Óa~ão'ó
#£ + 3³ + A~Ã + O'Ó + a~ã + o'ó
$¤'´A:ÄO^Ôa:äo^ô
$¤ + '´ + A:Ä + O^Ô + a:ä + o^ô
y=¥uµA*ÅO~Õa*åo~õ
y=¥ + uµ + A*Å + O~Õ + a*å + o~õ
|¦pAEÆO:Öaeæo:ö
|¦ + p + AEÆ + O:Ö + aeæ + o:ö
&§.·C,Çx×c,ç-:÷
&§ + .· + C,Ç + x× + c,ç + -:÷
:¨,¸E`ÈO/Øe`èo/ø
:¨ + ,¸ + E`È + O/Ø + e`è + o/ø
c©1¹E'ÉU`Ùe'éu`ù
c© + 1¹ + E'É + U`Ù + e'é + u`ù
aªoºE^ÊU'Úe^êu'ú
aª + oº + E^Ê + U'Ú + e^ê + u'ú
<<«>>»E:ËU^Ûe:ëu^û
<<« + >>» + E:Ë + U^Û + e:ë + u^û
~¬14¼I`ÌU:Üi`ìu:ü
~¬ + 14¼ + I`Ì + U:Ü + i`ì + u:ü
-­12½I'ÍY'Ýi'íy'ý
-­ + 12½ + I'Í + Y'Ý + i'í + y'ý
r®34¾I^ÎDDÞi^îddþ
r® + 34¾ + I^Î + THÞ + i^î + thþ
_¯?¿I:Ïssßi:ïy:ÿ
_¯ + ?¿ + I:Ï + ssß + i:ï + y:ÿ
-For instance, to type "á" type [compose][a]['] or [compose]['][a]. +

For instance, to type "á" type [compose][a]['] or [compose]['][a].

The character "nbsp" (non-breaking space) is typed by using [compose][space]. diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index 95b0de087..d0e1fc8a3 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input.cxx,v 1.10 1999/01/24 15:28:59 mike Exp $" +// "$Id: Fl_Input.cxx,v 1.10.2.1 1999/04/20 04:43:24 bill Exp $" // // Input widget for the Fast Light Tool Kit (FLTK). // @@ -54,29 +54,36 @@ int Fl_Input::shift_up_down_position(int p) { //////////////////////////////////////////////////////////////// // Fltk "compose" -// I tried to do compose characters "correctly" with much more user -// feedback. They can see the character they will get, rather than -// the "dead key" effect. Notice that I completely ignore that horrid -// XIM extension! -// Although the current scheme only works for Latin-NR1 character sets -// the intention is to expand this to UTF-8 someday, to allow you to -// compose all characters in all languages with no stupid "locale" -// setting. -// To use, you call "fl_compose()" for each keystroke. You pass it -// the characters it displayed last time plus the new character. It -// returns a new set of characters to replace the old one with. If -// it returns zero length you should leave the old set unchanged and -// treat the new key normally. -// Pressing any function keys or moving the cursor should set the -// compose state back to zero. - -// This string lists a pair for each possible foreign letter in Latin-NR1 +// +// This is a demonstration of a IMHO "correct" interface to compose +// character sequences. It does not have a "dead key" effect: the +// user has feedback at all times, and sees exactly the symbol they +// will get if they stop typing at that point. Notice that I totally +// ignore the horrid XIM extension! +// +// You only need to keep track of your normal text buffer and a +// single integer "state". Call fl_compose() for each character +// keystroke. The return value is the new "state" that must be passed +// the next time you call fl_compose(). It also returns the number of +// characters to delete to the left, a buffer of new characters, and +// the number of characters in that buffer. Obey these editing +// instructions. Reset the state to zero if the user types any +// function keys or clicks the mouse. +// +// Fl_Input does not call fl_compose unless you hit the "compose" key +// first. It may be interesting and useful to always call it, though... + +// Although this simple code is only for ISO-8859-1 character +// encodings, I think the interface can be expanded to UTF-8 (encoded +// Unicode) someday. + +// This string lists a pair for each possible foreign letter in ISO-8859-1 // starting at code 0xa0 (nbsp). If the second character is a space then // only the first character needs to by typed: static const char* const compose_pairs = " ! % # $ y=| & : c a <<~ - r _ * +-2 3 ' u p . , 1 o >>141234? " -"A`A'A^A~A:A*AEC,E`E'E^E:I`I'I^I:D-N~O`O'O^O~O:x O/U`U'U^U:Y'DDss" -"a`a'a^a~a:a*aec,e`e'e^e:i`i'i^i:d-n~o`o'o^o~o:-:o/u`u'u^u:y'ddy:"; +"A`A'A^A~A:A*AEC,E`E'E^E:I`I'I^I:D-N~O`O'O^O~O:x O/U`U'U^U:Y'THss" +"a`a'a^a~a:a*aec,e`e'e^e:i`i'i^i:d-n~o`o'o^o~o:-:o/u`u'u^u:y'thy:"; int fl_compose(int state, char c, int& del, char* buffer, int& ins) { del = 0; ins = 1; buffer[0] = c; @@ -330,5 +337,5 @@ Fl_Input::Fl_Input(int x, int y, int w, int h, const char *l) } // -// End of "$Id: Fl_Input.cxx,v 1.10 1999/01/24 15:28:59 mike Exp $". +// End of "$Id: Fl_Input.cxx,v 1.10.2.1 1999/04/20 04:43:24 bill Exp $". // -- cgit v1.2.3