niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » Perl » modules
Curses::UI::Widget - binding function keys
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Mumia W.
*nix forums Guru Wannabe


Joined: 08 May 2006
Posts: 153

PostPosted: Tue Jul 18, 2006 5:53 am    Post subject: Curses::UI::Widget - binding function keys Reply with quote

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

PostPosted: Tue Jul 18, 2006 7:35 am    Post subject: Re: Curses::UI::Widget - binding function keys Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Mon Dec 01, 2008 11:22 pm | All times are GMT
navigation Forum index » Programming » Perl » modules
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Function Pointer Sikandar C 3 Fri Jul 21, 2006 1:23 pm
No new posts Arbitrary function with parameter darknails@gmail.com C++ 2 Fri Jul 21, 2006 9:58 am
No new posts Is there C/C++ corresponding function in Linux for Java's... xiebopublic@gmail.com apps 4 Fri Jul 21, 2006 3:22 am
No new posts Is there C/C++ corresponding function in Linux for Java's... xiebopublic@gmail.com C++ 1 Fri Jul 21, 2006 2:44 am
No new posts can I call a internal function directly? minrobin@gmail.com shell 2 Fri Jul 21, 2006 2:17 am

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
[ Time: 0.2528s ][ Queries: 16 (0.1071s) ][ GZIP on - Debug on ]