On 03/29/12 12:38, Jeff Paranich wrote:
> Hi All,
> 
> I have a class that extends Fl_Table and handles FL_KEYUP events such that 
> releasing the up and down keyboard arrows moves a colored line up and down in 
> the table.  However I would like the user to be able to depress AND HOLD the 
> up and down keyboard arrows and the colored line to move up and down the 
> table without the need to release the key.
> 
> On this note I have tried FL_KEYDOWN as well but still can't get the event 
> handler to constantly call the FL_KEYDOWN event case.  I did retry calling 
> the handler (this->handle(e)) within the FL_KEYDOWN scope but the program 
> quickly crashes from overflow.
> 
> If anyone can point me in the right direction I greatly appreciate it!

        Would need to see the code for your handle() function(s).
        The 0|1 values it returns are probably critical.

        Also, which version of FLTK and what operating system?

        FWIW, I added a handle() function to the the table-sort.cxx
        example program to print the events it received, and if I hold
        a key down, it repeatedly gets FL_KEYDOWN. Tested with fltk 1.3.x
        current svn on linux.

        I basically added this line at the top of the example:

#include <FL/names.h>

        ..and added this method to its MyTable class:

    int handle(int e) {
        printf("EVENT %s (%d)\n", fl_eventnames[e],e);
        return Fl_Table_Row::handle(e);
    }

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

Reply via email to