// // "$Id$" // // Input header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2008 by Bill Spitzak and others. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Library General Public License for more details. // // You should have received a copy of the GNU Library General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA. // // Please report all bugs and problems on the following page: // // http://www.fltk.org/str.php // /** \file Fl_Input widget . */ #ifndef Fl_Input_H #define Fl_Input_H #include "Fl_Input_.H" /** This is the FLTK text input widget. It displays a single line of text and lets the user edit it. Normally it is drawn with an inset box and a white background. The text may contain any characters (even 0), and will correctly display anything, using ^X notation for unprintable control characters and \\nnn notation for unprintable characters with the high bit set. It assumes the font can draw any characters in the ISO-8859-1 character set.

Mouse button 1Moves the cursor to this point. Drag selects characters. Double click selects words. Triple click selects all text. Shift+click extends the selection. When you select text it is automatically copied to the clipboard.
Mouse button 2Insert the clipboard at the point clicked. You can also select a region and replace it with the clipboard by selecting the region with mouse button 2.
Mouse button 3Currently acts like button 1.
BackspaceDeletes one character to the left, or deletes the selected region.
EnterMay cause the callback, see when().
^A or HomeGo to start of line.
^B or LeftMove left
^CCopy the selection to the clipboard
^D or DeleteDeletes one character to the right or deletes the selected region.
^E or EndGo to the end of line.
^F or RightMove right
^KDelete to the end of line (next \\n character) or deletes a single \\n character. These deletions are all concatenated into the clipboard.
^N or DownMove down (for Fl_Multiline_Input only, otherwise it moves to the next input field).
^P or UpMove up (for Fl_Multiline_Input only, otherwise it moves to the previous input field).
^UDelete everything.
^V or ^YPaste the clipboard
^X or ^WCopy the region to the clipboard and delete it.
^Z or ^_Undo. This is a single-level undo mechanism, but all adjacent deletions and insertions are concatenated into a single "undo". Often this will undo a lot more than you expected.
Shift+moveMove the cursor but also extend the selection.
RightCtrl or
Compose
Start a compose-character sequence. The next one or two keys typed define the character to insert (see table that follows.)

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

The character "nbsp" (non-breaking space) is typed by using [compose][space].

The single-character sequences may be followed by a space if necessary to remove ambiguity. For instance, if you really want to type "ª~" rather than "ã" you must type [compose][a][space][~].

The same key may be used to "quote" control characters into the text. If you need a ^Q character you can get one by typing [compose][Control+Q].

X may have a key on the keyboard defined as XK_Multi_key. If so this key may be used as well as the right-hand control key. You can set this up with the program xmodmap.

If your keyboard is set to support a foreign language you should also be able to type "dead key" prefix characters. On X you will actually be able to see what dead key you typed, and if you then move the cursor without completing the sequence the accent will remain inserted.

Character Composition Table
KeysChar KeysChar KeysChar KeysChar KeysChar KeysChar
spnbsp *° ` AÀ D -Ð ` aà d -ð
!¡ + -± ' AÁ ~ NÑ ' aá ~ nñ
%¢ 2² A ^Â ` OÒ ^ aâ ` oò
#£ 3³ ~ AÃ ' OÓ ~ aã ' oó
$¤ '´ : AÄ ^ OÔ : aä ^ oô
y =¥ uµ * AÅ ~ OÕ * aå ~ oõ
|¦ p A EÆ : OÖ a eæ : oö
&§ .· , CÇ x× , cç - :÷
:¨ ,¸ E `È O /Ø ` eè o /ø
c© 1¹ ' EÉ ` UÙ ' eé ` uù
aª oº ^ EÊ ' UÚ ^ eê ' uú
< <« > >» : EË ^ UÛ : eë ^ uû
~¬ 1 4¼ ` IÌ : UÜ ` iì : uü
-­ 1 2½ ' IÍ ' YÝ ' ií ' yý
r® 3 4¾ ^ IÎ T HÞ ^ iî t hþ
_¯ ?¿ : IÏ s sß : iï : yÿ
*/ class FL_EXPORT Fl_Input : public Fl_Input_ { int handle_key(); int shift_position(int p); int shift_up_down_position(int p); void handle_mouse(int keepmark=0); public: void draw(); int handle(int); Fl_Input(int,int,int,int,const char * = 0); }; #endif // // End of "$Id$". //