Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Arrow keys with Curses.pm

by caelifer (Scribe)
on Oct 12, 2006 at 21:15 UTC ( [id://578027]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Arrow keys with Curses.pm

You should call keypad(1) so you can compare returned key code to exported constants.
use strict; use Curses; my $screen = Curses->new(); # Enable keypad functionality keypad(1); while (my $key = getch()) { do { printw("KEY_LEFT\n"); refresh(); next } if $key eq KEY_L +EFT; do { printw("KEY_RIGHT\n"); refresh(); next } if $key eq KEY_R +IGHT; last; } exit 0;
BR

Replies are listed 'Best First'.
Re^2: Arrow keys with Curses.pm
by Pic (Scribe) on Oct 13, 2006 at 05:02 UTC
    D'oh. That's it of course.

    Now that you've said it I can even see where it's mentioned in the C language tutorial.

    Thanks a lot for your help.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://578027]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.