]> pd.if.org Git - pd_readline/commitdiff
More work.
authorandy <andy@obsidian.(none)>
Sat, 27 Oct 2012 10:30:26 +0000 (23:30 +1300)
committerandy <andy@obsidian.(none)>
Sat, 27 Oct 2012 10:30:26 +0000 (23:30 +1300)
funcs.c
keyhandler.c
pd_readline.h

diff --git a/funcs.c b/funcs.c
index f298d7a41497952d5f797f45782a0bd560a7a5ed..8ac14c685c0d129e797959084f007ad2ee7a3d14 100644 (file)
--- a/funcs.c
+++ b/funcs.c
@@ -103,11 +103,16 @@ int type(int i)
 
 /*  Function for special key combinations  */ 
 /*  (Ctrl, Alt, function keys.             */ 
 
 /*  Function for special key combinations  */ 
 /*  (Ctrl, Alt, function keys.             */ 
-int spec(int i)
+void spec(void)
 { 
        
 { 
        
-       
-
+  int j = getch();  
+   
+       if ( ( j == 65 )        )  printf("Up ");  
+  else if ( ( j == 66 )        )  printf("Down "); 
+  else if ( ( j == 67 )        )  printf("Right "); 
+  else if ( ( j == 68 )        )  printf("Left "); 
+               
 }      
 
 
 }      
 
 
index 2fc6ee5dd974f2dae10f8ebdcb9400d5505726b9..9636491b59caae9bd181deb132ceae2b1f71155a 100644 (file)
@@ -82,7 +82,7 @@ void keyhandler(buf b)
          
        case (1):   break;     /*  Ctrl a  */   
        case (2):   break;     /*  Ctrl b  */   
          
        case (1):   break;     /*  Ctrl a  */   
        case (2):   break;     /*  Ctrl b  */   
-       case (3):   break;     /*  Ctrl c  */     
+       case (3):   getch();  spec(); break;   /*  Ctrl c  */     
        case (4):   printf("%c", i);  break;    /*  Printable chars.  */    
        case (5):   delch(b);  break;  
        case (6):   break;  
        case (4):   printf("%c", i);  break;    /*  Printable chars.  */    
        case (5):   delch(b);  break;  
        case (6):   break;  
index 67f844c3f26b6dd49b85e6ae577d508443265efd..a79e7a67bac07308ba0f13ca148acbf532af4d65 100644 (file)
@@ -27,8 +27,9 @@ int range(int rstart, int rend, int i);
 int type(int i); 
 
 
 int type(int i); 
 
 
-/*  Escape-key handling.  */ 
-int spec(int i); 
+/*  Special key handling.  */ 
+void spec(void); 
+
 
 /*  Other funcs.  */  
 void readhistory(char *fname); 
 
 /*  Other funcs.  */  
 void readhistory(char *fname);