Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to capture the upper, lower, left, and right arrow keys using the code below.
Please see below when I run this code,#!/usr/bin/perl use strict; use Term::ReadKey; ReadMode( 'cbreak' ); while (1) { my $char = ReadKey( 0 ); print "Character: $char\n"; } ReadMode( 'normal' );
Can anyone explain this? Or how do I capture the arrow keys?When I type 'c', I get this which is okay. Character: c When I hit 'the upper arrow', I get this output. Character: Character: [ Character: A
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Capturing Arrow Keys Input
by jakobi (Pilgrim) on Sep 30, 2009 at 00:02 UTC | |
Re: Capturing Arrow Keys Input
by Utilitarian (Vicar) on Sep 30, 2009 at 07:29 UTC | |
Re: Capturing Arrow Keys Input
by Anonymous Monk on Sep 30, 2009 at 02:06 UTC | |
by jakobi (Pilgrim) on Sep 30, 2009 at 09:02 UTC |
Back to
Seekers of Perl Wisdom