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?

If you're looking for any mouse movement, you could also just bind to the "<Motion>" event.  That would simplify your code even more:
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(); }

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

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

    Yep - I didn't think to try it out. For some reason, I was thinking it would only trigger events if it was over the widgets that had the binding.

    Thanks,

    Rob