/[cvs]/joko/Scripts/psh/lib/POE/Component/Terminal.pm
ViewVC logotype

Diff of /joko/Scripts/psh/lib/POE/Component/Terminal.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by cvsjoko, Sat Jun 15 04:28:10 2002 UTC revision 1.5 by cvsjoko, Sat Jun 15 05:19:36 2002 UTC
# Line 5  Line 5 
5  ## $Id$  ## $Id$
6  ##  ##
7  ## $Log$  ## $Log$
8    ## Revision 1.5  2002/06/15 05:19:36  cvsjoko
9    ## + modified order/way of key-handling-logic
10    ##
11  ## Revision 1.4  2002/06/15 04:28:10  cvsjoko  ## Revision 1.4  2002/06/15 04:28:10  cvsjoko
12  ## immediate polling, no delay  ## immediate polling, no delay
13  ##  ##
# Line 194  sub pollForKey { Line 197  sub pollForKey {
197    }    }
198    
199    my $key = ReadKey(-1);    my $key = ReadKey(-1);
200    if ($key) {    if ( defined $key ) {
201            
     # normal key?  
     if ($key =~ m/[a-zA-Z? ]/) {  
       $heap->{state}{InputBuffer} .= $key;  
       #print $key;  
     }  
   
202      # enter pressed?      # enter pressed?
203      if ($key eq $self->{conf}{EnterKey}) {      if ($key eq $self->{conf}{EnterKey}) {
204        # send command        # send command
# Line 222  sub pollForKey { Line 219  sub pollForKey {
219      }      }
220    
221      # backspace pressed?      # backspace pressed?
222      if (ord($key) == 8) {      elsif (ord($key) == 8) {
223        $heap->{state}{InputBuffer} = substr($heap->{state}{InputBuffer}, 0, -1);        $heap->{state}{InputBuffer} = substr($heap->{state}{InputBuffer}, 0, -1);
224      }      }
225    
226        # normal key?
227        #elsif ($key =~ m/[a-zA-Z? ]/) {
228        else {
229          $heap->{state}{InputBuffer} .= $key;
230          #print $key;
231        }
232    
233      # mark "KeyPressed" for next poll      # mark "KeyPressed" for next poll
234      $heap->{state}{KeyPressed} = 1;      $heap->{state}{KeyPressed} = 1;
235    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed