On 02.04.2008, at 08:29, JulienV wrote:
> Hello, I'm working with FLTK 1.1.7 and 1.1.8, on a Red Hat Linux.
>
> I'm trying to use an arrow key (Up, Down) as fl_button shortcut.
> Fluid seems to accept the shortcut, the generated FLTK code is  
> correct ( fl_button::shortcut() is called ), but the callback is not  
> called when I stroke the key.
>
> I've try several mix of shortcut : Keynum Arrow/ Standard Arrow,  
> with all key modificators (Ctrl, Alt, Shift ...).
>
> Did I miss something ?

The arrow key is used by mny widgets for navigation, either within the  
widget data, or to navigate from one widget to another. For this  
reason, the arrow keystrokes rarely become available as a shortcut.

If you *must* use the arrow keys as shortcuts, you have to teach all  
other keys in your user interface to not use the arrow keys.  You have  
to derive your own class from every widget that uses arrow keys that  
may be active in your UI, and override the handle() method to not use  
arrow keys during the FL_KEYBOARD event.

There is one other way to use the arrow keys, but not via the shortcut  
interface. For that, you derive your own button class and handle the  
arrow keys yourself during FL_KEYBOARD events. Now as long as no text  
input widget is active, your buttons will likely get the event first  
(at least before Fl_Group uses them for navigating between widgets).

Matthias

----
http://robowerk.com/


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to