in reply to How to intercept ctrl-S/ctrl-Q characters from STDIN

Is this the sort of thing you're after?
use Term::ReadKey; print "Press SPACE to exit\n"; ReadMode 4; while ( 1 ) { my $c = ReadKey(-1); next unless $c; last if $c eq ' '; printf "%02x ", ord $c; } END { ReadMode 1; }

I think Term::ReadKey works on windows.


Unless I state otherwise, all my code runs with strict and warnings