|
|
|
|
|
|
| Author |
Message |
Mumia W. *nix forums Guru Wannabe
Joined: 08 May 2006
Posts: 153
|
Posted: Tue Jul 18, 2006 5:53 am Post subject:
Curses::UI::Widget - binding function keys
|
|
|
I 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:
<quote>
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));"
</quote> |
|
| Back to top |
|
 |
Mumia W. *nix forums Guru Wannabe
Joined: 08 May 2006
Posts: 153
|
Posted: Tue Jul 18, 2006 7:35 am Post subject:
Re: Curses::UI::Widget - binding function keys
|
|
|
On 07/18/2006 12:53 AM, Mumia W. wrote:
| Quote: | [...]
This text should be added to the documentation for Curses::UI::Widget:
quote
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));"
/quote
|
Rehash:
<quote>
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:
use Curses;
use Curses::UI;
my $cui = new Curses::UI;
$cui->set_binding(\&mysub, KEY_F(1));
sub mysub { }
</quote> |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Mon Dec 01, 2008 11:22 pm | All times are GMT
|
|
Buy Shares | MPAA | Personal Loans | Nancy Ajram | Car Loan
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|