Changeset 20310


Ignore:
Timestamp:
Jun 27, 2006, 11:48:39 PM (18 years ago)
Author:
hamish
Message:

fix octals, allow both backspace and DEL

Location:
grass/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • grass/trunk/display/d.colors/curses.c

    r18934 r20310  
    246246        newchar = wgetch(MENU_WIN) & 0177 ;
    247247
    248         if ((newchar > 037) && (newchar < 0177))
    249         {
     248        if ((newchar > '\037') && (newchar < '\177'))
     249        {   /* octal codes: accept space to '~' */
    250250            *(pointer++) = newchar ;
    251251            *pointer = 000 ;
     
    253253            wrefresh(MENU_WIN) ;
    254254        }
    255         else if (newchar == 010)
    256         {
     255        else if (newchar == '\b' || newchar == '\177')
     256        {   /* backspace or DEL */
    257257            if (pointer > answer)
    258258            {
  • grass/trunk/imagery/i.class/curses.c

    r18934 r20310  
    213213
    214214        getyx (stdscr, y, x);
    215         if (c > 037 && c < 0177)
     215        if (c > '\037' && c < '\177') /* octal codes: accept space to '~' */
    216216        {
    217217            if (x < PROMPT_WINDOW->right)
     
    224224            continue;
    225225        }
    226         if (c == '\b')
     226        if (c == '\b' || c == '\177') /* backspace or DEL (decimal 8,127) */
    227227        {
    228228            if (n > 0)
  • grass/trunk/imagery/i.points/curses.c

    r16897 r20310  
    208208
    209209        getyx (stdscr, y, x);
    210         if (c > 037 && c < 0177)
     210        if (c > '\037' && c < '\177') /* octal codes: accept space to '~' */
    211211        {
    212212            if (x < PROMPT_WINDOW->right)
     
    219219            continue;
    220220        }
    221         if (c == '\b')
     221        if (c == '\b' || c == '\177') /* backspace or DEL (decimal 8,127) */
    222222        {
    223223            if (n > 0)
  • grass/trunk/imagery/i.vpoints/curses.c

    r17473 r20310  
    200200        refresh ();
    201201        c = Curses_getch(0) ;
     202
    202203        if (c == '\n' || c == '\r')
    203204            break;
    204205
    205206        getyx (stdscr, y, x);
    206         if (c > 037 && c < 0177)
     207
     208        if (c > '\037' && c < '\177') /* octal codes: accept space to '~' */
    207209        {
    208210            if (x < PROMPT_WINDOW->right)
     
    215217            continue;
    216218        }
    217         if (c == '\b')
     219
     220        if (c == '\b' || c == '\177') /* backspace or DEL (decimal 8,127) */
    218221        {
    219222            if (n > 0)
Note: See TracChangeset for help on using the changeset viewer.