Curses::UI::Widget - binding function keys
am 18.07.2006 07:53:46 von mumia.w.18.spam+nospam.usenetI read the documentation for Curses::UI::Widget on how to bind
control-keys to perl subs. Very nice. However, there are no
instructions on how to bind function keys to perl subs in
Curses::UI::*.
I'm not a newbie, and it took me an hour to find the
information in "perldoc Curses." And even then, that page is
geared toward people who've used curses before. Nothing on
that page, or any document in Curses::* that I've found,
explains how to bind function keys. Fortunately for me, I
figured it out when I saw KEY_F in the list of supported
functions in "perldoc Curses." Whereas it took me an hour to
find it, it would take a newbie a day.
This text should be added to the documentation for
Curses::UI::Widget:
The keys recognized by this module are controlled by the
Curses module. Read "perldoc Curses" for more information. You
can bind function keys such as F1 using something like this:
"$cui->set_binding(\&mysub, KEY_F(1));"