/[LeafOK_CVS]/lbbs/src/screen.c
ViewVC logotype

Diff of /lbbs/src/screen.c

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

Revision 1.110 by sysadm, Thu Oct 16 11:26:16 2025 UTC Revision 1.112 by sysadm, Fri Oct 17 10:57:43 2025 UTC
# Line 104  void clearscr() Line 104  void clearscr()
104    
105  int press_any_key()  int press_any_key()
106  {  {
107            int ch = 0;
108            int wait_seconds = 60;
109            int duration = 0;
110            time_t t_begin = time(NULL);
111    
112          moveto(SCREEN_ROWS, 0);          moveto(SCREEN_ROWS, 0);
113          clrtoeol();          clrtoeol();
114    
115          prints("                           \033[1;33m按任意键继续...\033[0;37m");          prints("                           \033[1;33m按任意键继续...\033[0;37m");
116          iflush();          iflush();
117    
118          return igetch_t(MIN(MAX_DELAY_TIME, 60));          do
119            {
120                    ch = igetch_t(wait_seconds - duration);
121                    duration = (int)(time(NULL) - t_begin);
122            } while (!SYS_server_exit && ch == 0 && duration < 60);
123    
124            return ch;
125  }  }
126    
127  void set_input_echo(int echo)  void set_input_echo(int echo)
# Line 118  void set_input_echo(int echo) Line 129  void set_input_echo(int echo)
129          if (echo)          if (echo)
130          {          {
131                  outc('\x83'); // ASCII code 131                  outc('\x83'); // ASCII code 131
                 iflush();  
132          }          }
133          else          else
134          {          {
135                  //    outc ('\x85'); // ASCII code 133                  // outc ('\x85'); // ASCII code 133
136                  prints("\xff\xfb\x01\xff\xfb\x03");                  prints("\xff\xfb\x01\xff\xfb\x03");
                 iflush();  
                 igetch(0);  
                 igetch_reset();  
137          }          }
138            iflush();
139  }  }
140    
141  static int _str_input(char *buffer, int buf_size, int max_display_len, int echo_mode)  static int _str_input(char *buffer, int buf_size, int max_display_len, int echo_mode)
# Line 151  static int _str_input(char *buffer, int Line 159  static int _str_input(char *buffer, int
159    
160                  if (ch == CR)                  if (ch == CR)
161                  {                  {
                         igetch_reset();  
162                          break;                          break;
163                  }                  }
164                  else if (ch == KEY_TIMEOUT || ch == KEY_NULL) // timeout or broken pipe                  else if (ch == KEY_TIMEOUT || ch == KEY_NULL) // timeout or broken pipe
# Line 322  int get_data(int row, int col, char *pro Line 329  int get_data(int row, int col, char *pro
329    
330                  if (ch == CR)                  if (ch == CR)
331                  {                  {
                         igetch_reset();  
332                          break;                          break;
333                  }                  }
334                  else if (ch == KEY_TIMEOUT || ch == KEY_NULL) // timeout or broken pipe                  else if (ch == KEY_TIMEOUT || ch == KEY_NULL) // timeout or broken pipe
# Line 704  int display_data(const void *p_data, lon Line 710  int display_data(const void *p_data, lon
710                                          output_end_row = SCREEN_ROWS - 1; // Legacy Fterm only works with this line                                          output_end_row = SCREEN_ROWS - 1; // Legacy Fterm only works with this line
711                                          break;                                          break;
712                                  case CR:                                  case CR:
                                         igetch_reset();  
713                                  case KEY_SPACE:                                  case KEY_SPACE:
714                                  case KEY_DOWN:                                  case KEY_DOWN:
715                                          if (line_current + (screen_row_total - (output_current_row - screen_begin_row)) >= display_line_total) // Reach end                                          if (line_current + (screen_row_total - (output_current_row - screen_begin_row)) >= display_line_total) // Reach end


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1