Changeset 249

Show
Ignore:
Timestamp:
07/02/07 11:36:46 (1 year ago)
Author:
ajps
Message:

Fix the inputting of macro triggers to allow, e.g. function keys again. Closes #162.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/cmd4.c

    r240 r249  
    28272827 
    28282828        /* Read the pattern */ 
    2829         while (ch != ESCAPE && ch != '\xff') 
     2829        while (ch != 0 && ch != '\xff') 
    28302830        { 
    28312831                /* Save the key */ 
     
    28362836                ascii_to_text(tmp, sizeof(tmp), buf+n-1); 
    28372837                text_out(tmp); 
    2838                 flush(); 
    2839  
    28402838 
    28412839                /* Do not process macros */ 
  • trunk/src/util.c

    r206 r249  
    11771177                if (inkey_base) 
    11781178                { 
    1179                   int w = 0; 
    1180  
    1181                   /* Wait forever */ 
    1182                   if (!inkey_scan) 
    1183                   { 
    1184                         /* Wait for (and remove) a pending key */ 
    1185                         if (0 == Term_inkey(&ke, TRUE, TRUE)) 
     1179                        int w = 0; 
     1180 
     1181                        /* Wait forever */ 
     1182                        if (!inkey_scan) 
    11861183                        { 
    1187                                 /* Done */ 
     1184                                /* Wait for (and remove) a pending key */ 
     1185                                if (0 == Term_inkey(&ke, TRUE, TRUE)) 
     1186                                { 
     1187                                        /* Done */ 
     1188                                        break; 
     1189                                } 
     1190 
     1191                                /* Oops */ 
    11881192                                break; 
    11891193                        } 
    11901194 
    1191                         /* Oops */ 
     1195                        /* Wait only as long as macro activation would wait*/ 
     1196                        while (TRUE) 
     1197                        { 
     1198                                /* Check for (and remove) a pending key */ 
     1199                                if (0 == Term_inkey(&ke, FALSE, TRUE)) 
     1200                                { 
     1201                                        /* Done */ 
     1202                                        break; 
     1203                                } 
     1204 
     1205                                /* No key ready */ 
     1206                                else 
     1207                                { 
     1208                                        /* Increase "wait" */ 
     1209                                        w += 10; 
     1210 
     1211                                        /* Excessive delay */ 
     1212                                        if (w >= 100) break; 
     1213 
     1214                                        /* Delay */ 
     1215                                        Term_xtra(TERM_XTRA_DELAY, w); 
     1216 
     1217                                } 
     1218                        } 
     1219 
     1220                        /* Done */ 
     1221                        ke.type = EVT_KBRD; 
    11921222                        break; 
    1193                   } 
    1194  
    1195                   /* Wait */ 
    1196                   while (TRUE) 
    1197                   { 
    1198                         /* Check for (and remove) a pending key */ 
    1199                         if (0 == Term_inkey(&ke, FALSE, TRUE)) 
    1200                         { 
    1201                                 /* Done */ 
    1202                                 break; 
    1203                         } 
    1204  
    1205                         /* No key ready */ 
    1206                         else 
    1207                         { 
    1208                                 /* Increase "wait" */ 
    1209                                 w += 10; 
    1210                          
    1211                                 /* Excessive delay */ 
    1212                                 if (w >= 100) break; 
    1213                          
    1214                                 /* Delay */ 
    1215                                 Term_xtra(TERM_XTRA_DELAY, w); 
    1216                                 } 
    1217                   } 
    1218  
    1219                   /* Done */ 
    1220                   break; 
    12211223                } 
    12221224