| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 
 | #!/usr/bin/perl -w
# This is a port of the keypad.c demo.
# $Id: keypad,v 1.2 1999/09/01 18:04:46 daniel Exp $
use strict;
use ExtUtils::testlib;
use Term::Slang qw(:common :keys);
SLang_init_tty(-1,0,1);
SLsig_block_signals();
SLsig_unblock_signals();
SLkp_init();
my $timeout = 2;
print "This program illustrates the slkeypad facility.\n";
print "Press any key ('q' quits).\n";
while(SLang_input_pending(1000)) {
	my $ch = SLang_getkey();
	if ($ch == 033) {
		last if SLang_input_pending($timeout) == 0;
	}
   
	SLang_ungetkey($ch);
	$ch = SLkp_getkey;
	last if $ch == 113;
	printf "Keysym: %d\r\n", $ch;
}
   
SLang_reset_tty();
__END__
 |