in reply to Re: Perl/Tk: Is there a way to key off of any user input event?
in thread Perl/Tk: Is there a way to key off of any user input event?
use Tk; use strict; use warnings; my $mw = MainWindow->new; $mw->bind('<KeyPress>', \&keyPress); $mw->bind('<Motion>', \&mouseMotion); MainLoop; sub quit { print "User triggered event -- exiting!\n"; exit; } sub keyPress { print "Debug: keypress occurred\n"; quit(); } sub mouseMotion { print "Debug: mouse motion occurred\n"; quit(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl/Tk: Is there a way to key off of any user input event?
by rcseege (Pilgrim) on Oct 14, 2006 at 16:48 UTC |