| [ Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]
STR #2989
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 2 - Low, e.g. a documentation error or undocumented side-effect |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Core Library |
Summary: | 'Up' and 'Down' keys don't work in Fl_Spinner at all |
Version: | 1.3-current |
Created By: | Nikego |
Assigned To: | AlbrechtS |
Fix Version: | 1.4.0 (SVN: v12191) |
Update Notification: | |
Trouble Report Files:
Trouble Report Comments:
|
#1 | Nikego 04:51 Oct 03, 2013 |
| The Fl_Spinner class can't handle properly the Fl_Up and Fl_Down keys (increment/decrement) because Fl_Input handler catches FL_KEYDOWN. Thus the Fl_Spinner never receives this event.
Any ideas how to fix it? | |
|
#2 | retux 16:46 Jan 22, 2016 |
| How about subclassing 'Fl_Input' and overwrite the 'handle' method? The subclass may return 0 in case of any 'FL_Up' or 'FL_Down' event and redirect the event handling to Fl_Input otherwise. Have a look at my attached diff. | |
|
#3 | retux 16:57 Jan 22, 2016 |
| Obviously the first 'return Fl_Input::handle(event);' can be removed. | |
|
#4 | AlbrechtS 17:26 Jan 22, 2016 |
| Thanks for the patch. Looks good and works - in a short test in test/valuators.cxx
Note that Fl_Spinner did already handle Up and Down keys if for instance the spinner buttons (small arrows) had the focus - to verify, click on one of the up/down arrow buttons first, then press Up/Down key.
But I agree that the user expectation would be to use the arrow keys also while the input field has the focus. Historically the up/down keys were navigation keys and would move the focus to another widget, but this has been changed in FLTK 1.3 (it is now an option, IIRC).
I'd say the patch is generally okay, but needs more thorough checking. If tests pass, then this might be applied. | |
|
#5 | AlbrechtS 13:58 Mar 10, 2017 |
| Fixed in Subversion repository.
svn r12191 fixes the issue for FLTK 1.4.0 (svn branch-1.4).
The fix is based on STR_2989.patch by retux with a small modification and applied to two files since the header and implementation were split meanwhile. Thanks for the patch again.
@OP (Nikego): can you please test if this fixes the issue for you and report back so I can close this STR? TIA. | |
|
#6 | AlbrechtS 04:08 Apr 03, 2017 |
| This STR has not been updated by the submitter for two or more weeks and has been closed as required by the FLTK Configuration Management Plan. If the issue still requires resolution, please re-submit a new STR. | |
[ Return to Bugs & Features ]
|
| |