What's the trick to reading raw input from a tty (xterm in my case) to make Perl not miss things? I've written a rough draft of a text mode (text user interface; TUI) game yesterday and today, and it works, but the controls feel janky, like it might take two key presses to get something done. The full source is here: https://codeberg.org/elithebearded/flow-thy-pipes You could `git clone` it to see the whole thing, but the input boils down to three functions. sub set_raw_tty() { qx( stty raw -echo -isig -icanon -ixon -icrnl ); } sub restore_tty() { qx( stty echo icanon isig opost imaxbel ixon icrnl brkint ); } sub process_keyboard() { my $rin = ''; my $rout; my $nfound; vec($rin, fileno(STDIN), 1) = 1; $nfound = select($rout = $rin, undef, undef, 0.05); if($nfound) { my $c; if ( read STDIN, $c, 1 ) { if ($c eq 'Q') { end_play } if (! $win) { if ($c eq 'h') { $cursor_col --; if ($cursor_col < 1) { $cursor_col = 1; }} if ($c eq 'l') { $cursor_col ++; if ($cursor_col > ($wide-1)) { $cursor_col = $wide-1; }} if ($c eq 'k') { $cursor_row --; if ($cursor_row < 1) { $cursor_row = 1; }} if ($c eq 'j') { $cursor_row ++; if ($cursor_row > ($tall-1)) { $cursor_row = $tall-1; }} if ($c eq 'a') { my $cell = $board[$cursor_row][$cursor_col]; if (defined($rotations{$cell})) { $board[$cursor_row][$cursor_col] = rot_ccw( $cell ); } } if ($c eq 'z') { my $cell = $board[$cursor_row][$cursor_col]; if (defined($rotations{$cell})) { $board[$cursor_row][$cursor_col] = rot_cw( $cell ); } } } else { if ($c eq ' ') { $level ++; $remaining = -1; } } } } } The main loop looks like: while (1) { draw_board; process_keyboard; if ($win) { # ... return; } } Moving around the board, or rotating things under the cursor, can take multiple keystrokes where one is needed. I would rather not use a curses library for this, as I want to understand what a library like that is doing for me (besides reading the termcap / terminfo files to generalize the control sequences). I suspect there's something better to do with select() and read(), but what? Elijah ------ wants to get input solved before moving on to maze generation