|
|
I really wanted to process ENTER, DELETE, LEFT and RIGHT keyboard
events at the callback level
header file:
#ifndef FL_BROWSER2_
#define FL_BROWSER2_
#include <FL/Fl_Browser.H>
class Fl_Browser2 : public Fl_Browser
{
public:
Fl_Browser2(int x, int y, int w, int h, const char* l = 0);
int handle(int event);
};
#endif // FL_BROWSER2_
class implementation:
#include "flbrowser2.h"
Fl_Browser2::Fl_Browser2(int x, int y, int w, int h, const char*
l)
: Fl_Browser(x, y, w, h, l)
{
}
int Fl_Browser2::handle(int event)
{
int key = Fl::event_key();
if (event == FL_KEYUP &&
( key == FL_Enter ||
key == FL_Left ||
key == FL_Right ||
key == FL_Delete ) ) {
do_callback();
return 1;
}
return Fl_Browser::handle(event);
}
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/5c1332c4-ab3a-eb50-9a08-be1706f781ad%40bellsouth.net.
[ Direct Link to Message ] | |
|
| |