/[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.3 by cvsjoko, Sat Jun 15 04:24:15 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
12    ## immediate polling, no delay
13    ##
14  ## Revision 1.3  2002/06/15 04:24:15  cvsjoko  ## Revision 1.3  2002/06/15 04:24:15  cvsjoko
15  ## + added modifier for running in linux or win32  ## + added modifier for running in linux or win32
16  ## + modified order of some commands in core key-polling  ## + modified order of some commands in core key-polling
# Line 191  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 219  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    
236    }    }
237    
238    #$kernel->post($session, "pollForKey");    $kernel->post($session, "pollForKey");
239    #$kernel->delay("pollForKey", 0.1);    #$kernel->delay("pollForKey", 0.1);
240    $kernel->delay("pollForKey", 0.01);    #$kernel->delay("pollForKey", 0.01);
241    
242  }  }
243    

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

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