/[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.108 by sysadm, Thu Oct 9 12:20:31 2025 UTC Revision 1.111 by sysadm, Fri Oct 17 01:25:08 2025 UTC
# Line 38  Line 38 
38    
39  #define STR_TOP_LEFT_MAX_LEN 80  #define STR_TOP_LEFT_MAX_LEN 80
40  #define STR_TOP_MIDDLE_MAX_LEN 40  #define STR_TOP_MIDDLE_MAX_LEN 40
41  #define STR_TOP_RIGHT_MAX_LEN 40  #define STR_TOP_RIGHT_MAX_LEN 80
42    
43  static const char *get_time_str(char *s, size_t len)  static const char *get_time_str(char *s, size_t len)
44  {  {
# Line 118  void set_input_echo(int echo) Line 118  void set_input_echo(int echo)
118          if (echo)          if (echo)
119          {          {
120                  outc('\x83'); // ASCII code 131                  outc('\x83'); // ASCII code 131
                 iflush();  
121          }          }
122          else          else
123          {          {
124                  //    outc ('\x85'); // ASCII code 133                  // outc ('\x85'); // ASCII code 133
125                  prints("\xff\xfb\x01\xff\xfb\x03");                  prints("\xff\xfb\x01\xff\xfb\x03");
                 iflush();  
                 igetch(0);  
                 igetch_reset();  
126          }          }
127            iflush();
128  }  }
129    
130  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 148  static int _str_input(char *buffer, int
148    
149                  if (ch == CR)                  if (ch == CR)
150                  {                  {
                         igetch_reset();  
151                          break;                          break;
152                  }                  }
153                  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 318  int get_data(int row, int col, char *pro
318    
319                  if (ch == CR)                  if (ch == CR)
320                  {                  {
                         igetch_reset();  
321                          break;                          break;
322                  }                  }
323                  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 653  int display_data(const void *p_data, lon Line 648  int display_data(const void *p_data, lon
648                                  ch = igetch_t(MAX_DELAY_TIME);                                  ch = igetch_t(MAX_DELAY_TIME);
649                                  input_ok = 1;                                  input_ok = 1;
650    
651                                    if (ch != KEY_NULL && ch != KEY_TIMEOUT)
652                                    {
653                                            BBS_last_access_tm = time(NULL);
654                                    }
655    
656                                  // extended key handler                                  // extended key handler
657                                  if (key_handler(&ch, &ctx) != 0)                                  if (key_handler(&ch, &ctx) != 0)
658                                  {                                  {
# Line 662  int display_data(const void *p_data, lon Line 662  int display_data(const void *p_data, lon
662                                  switch (ch)                                  switch (ch)
663                                  {                                  {
664                                  case KEY_NULL:                                  case KEY_NULL:
665                                            log_error("KEY_NULL\n");
666                                            goto cleanup;
667                                  case KEY_TIMEOUT:                                  case KEY_TIMEOUT:
668                                            log_error("User input timeout\n");
669                                          goto cleanup;                                          goto cleanup;
670                                  case KEY_HOME:                                  case KEY_HOME:
671                                          if (line_current - output_current_row < 0) // Reach begin                                          if (line_current - output_current_row < 0) // Reach begin
# Line 696  int display_data(const void *p_data, lon Line 699  int display_data(const void *p_data, lon
699                                          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
700                                          break;                                          break;
701                                  case CR:                                  case CR:
                                         igetch_reset();  
702                                  case KEY_SPACE:                                  case KEY_SPACE:
703                                  case KEY_DOWN:                                  case KEY_DOWN:
704                                          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
# Line 765  int display_data(const void *p_data, lon Line 767  int display_data(const void *p_data, lon
767                                          input_ok = 0;                                          input_ok = 0;
768                                          break;                                          break;
769                                  }                                  }
   
                                 BBS_last_access_tm = time(NULL);  
770                          }                          }
771    
772                          continue;                          continue;


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

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