Hello fellow monks,

I'm following Curses::UI::Tutorial on CPAN with the following code:

#!/usr/bin/env perl use strict; use Curses::UI; my $cui = new Curses::UI( -color_support => 1 ); my @menus = ( { -label => 'File', -submenu => [ { -label => 'Exit', -value => \&exit_dialog } ] } ); sub exit_dialog { my $ret = $cui->dialog( -message => "Quit?", -title => "Quit", -buttons => [ 'yes', 'no' ] ); exit(0) if $ret; } my $menu = $cui->add( 'menu', 'Menubar', -menu => \@menus, ); my $win1 = $cui->add( 'win1', 'Window', -border => 0, -y => 1 ); my $texteditor = $win1->add( 'text', 'TextEditor', -text => "Line1\n"."Line2\n" ); $cui->set_binding(sub { $menu->focus() }, "\cx"); $cui->set_binding( \&exit_dialog, "\cq"); $texteditor->focus(); $cui->mainloop();

The menubar will loose its focus when it receives an escape keystroke. When I run the program, it takes a full second to respond. According to ncurses(3), the default delay for escape keystroke is 1000ms and could be changed by ESCDELAY variable or c function set_escdelay(3X). However, I didn't see any method/function corresponding to set_escdelay in the CPAN documentation.

Is there any method, other than to change ESCDELAY, to change the escape keystroke delay?

Feel free to correct any of my mistakes. Thanks in advance.


In reply to Curses::UI - How to set escape delay? by withering

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.