summaryrefslogtreecommitdiff
path: root/src/Fl_Input.cxx
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2000-06-10 21:31:00 +0000
committerBill Spitzak <spitzak@gmail.com>2000-06-10 21:31:00 +0000
commitabcd0b44882811764557c00c509dd145baf81bb8 (patch)
tree0d340864d19ccb0226bb07bbc993aa01361dcc0c /src/Fl_Input.cxx
parentb3d9c227bc6d167fe24fc21e318c04a05d810be8 (diff)
You can no longer insert ^J,^K,^L,^M into Fl_Int/Float_Input.
Fixed bug noticed by Alexander Rabi Beels, if you are in point-to-type and move the cursor to a different window with a multiline input and type up/down, the saved up/down horizontal position from the previous multiline input was used. It now resets this on any focus change, fixing this. Some code cleanup in Fl_Input.cxx, removed unneeded calls to Fl::compose_reset. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1191 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Input.cxx')
-rw-r--r--src/Fl_Input.cxx22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index fd8068a73..3e6194982 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Input.cxx,v 1.10.2.10 2000/06/05 21:20:52 mike Exp $"
+// "$Id: Fl_Input.cxx,v 1.10.2.11 2000/06/10 21:31:00 bill Exp $"
//
// Input widget for the Fast Light Tool Kit (FLTK).
//
@@ -112,16 +112,12 @@ int Fl_Input::handle_key() {
else
return 0; // reserved for shortcuts
case FL_Tab:
- if (Fl::event_state(FL_CTRL) || type()!=FL_MULTILINE_INPUT) return 0;
+ if (Fl::event_state(FL_CTRL|FL_SHIFT) || type()!=FL_MULTILINE_INPUT) return 0;
return replace(position(), mark(), &ascii, 1);
- default:
- if (!ascii) return 0; // don't reset compose on shift keys
}
- Fl::compose_reset();
-
int i;
- switch(ascii) {
+ switch (ascii) {
case ctrl('A'):
if (type() == FL_MULTILINE_INPUT)
for (i=position(); i && index(i-1)!='\n'; i--) ;
@@ -189,7 +185,7 @@ int Fl_Input::handle_key() {
case ctrl('L'):
case ctrl('M'):
// insert a few selected control characters literally:
- if (type() != FL_FLOAT_INPUT || type() != FL_INT_INPUT)
+ if (type() != FL_FLOAT_INPUT && type() != FL_INT_INPUT)
return replace(position(), mark(), &ascii, 1);
}
@@ -218,13 +214,12 @@ int Fl_Input::handle(int event) {
case 0xfe20: // XK_ISO_Left_Tab
position(size(),0);
break;
+ default:
+ position(position(),mark());// turns off the saved up/down arrow position
+ break;
}
break;
- case FL_UNFOCUS:
- Fl::compose_reset();
- break;
-
case FL_KEYBOARD:
return handle_key();
@@ -240,7 +235,6 @@ int Fl_Input::handle(int event) {
}
#endif
}
- Fl::compose_reset();
break;
case FL_RELEASE:
@@ -265,5 +259,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.2.10 2000/06/05 21:20:52 mike Exp $".
+// End of "$Id: Fl_Input.cxx,v 1.10.2.11 2000/06/10 21:31:00 bill Exp $".
//