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. -
| Keys | Char | -Keys | Char | -Keys | Char | -Keys | Char | -Keys | Char | -Keys | Char | -Keys | Char | + | Keys | Char | + | Keys | Char | + | Keys | Char | + | Keys | Char | + | Keys | Char |
|---|---|---|---|---|---|---|---|---|---|---|---|
| sp | nbsp | -* | ° | -A` | À | -D- | Ð | -a` | à | -d- | ð | -space | nbsp | + | * | ° | + | 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~ | õ |
| | | ¦ | -p | ¶ | -AE | Æ | -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].
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 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... -// This string lists a pair for each possible foreign letter in Latin-NR1 +// 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 $". //