diff --git a/CHANGES b/CHANGES index cc5d390c8..7446bf671 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ CHANGES IN FLTK 1.1.10 + - Fixed selection bug in Fl_Int_Input (STR #2292) - Fixed character set conversion functions (STR #2268) - Fixed image lib configure and fltk-config issues by backporting the image lib and zlib configure code from FLTK 1.3 (STR #2203) diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index ba10c0694..33fb9d168 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -119,13 +119,16 @@ int Fl_Input::handle_key() { } #endif // HAVE_LOCALECONV + // find the insert position + int ip = position()= '0' && ascii <= '9') || - (position()==1 && index(0)=='0' && (ascii=='x' || ascii == 'X')) || - (position()>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X') - && (ascii>='A'&& ascii<='F' || ascii>='a'&& ascii<='f')) || - input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars, ascii)) { + if (!ip && (ascii == '+' || ascii == '-') + || (ascii >= '0' && ascii <= '9') + || (ip==1 && index(0)=='0' && (ascii=='x' || ascii == 'X')) + || (ip>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X') + && (ascii>='A'&& ascii<='F' || ascii>='a'&& ascii<='f')) + || input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars, ascii)) + { if (readonly()) fl_beep(); else replace(position(), mark(), &ascii, 1); }