@@ -10,6 +10,43 @@ void sel_windowsize_protect ()
1010 }
1111}
1212
13+ char ipt[100 ];
14+
15+ int sel_command ()
16+ {
17+ strcpy (ipt, " " );
18+ while (true )
19+ {
20+ int read = keyboard ();
21+ if (read == 27 ) return 0 ;
22+ if (read == 127 && strlen (ipt) > 0 )
23+ {
24+ ipt[strlen (ipt) - 1 ] = ' \0 ' ;
25+ BOTTOM_LEFT_INFO[strlen (BOTTOM_LEFT_INFO) - 1 ] = ' \0 ' ;
26+ }
27+ else if ((read >= ' a' && read <= ' z' ) || (read >= ' 0' && read <= ' 9' ) || read == ' ' )
28+ {
29+ char tmp[2 ] = {char (read)};
30+ strcat (ipt, tmp);
31+ strcat (BOTTOM_LEFT_INFO, tmp);
32+ }
33+ else if (read == 10 )
34+ {
35+ if (check_custom_data (ipt))
36+ {
37+ return 1 ;
38+ }
39+ else
40+ {
41+ strcpy (BOTTOM_LEFT_INFO, " Error" );
42+ msleep (OUTPUT_TIME * 1000 );
43+ return 0 ;
44+ }
45+ }
46+ }
47+ return 0 ;
48+ }
49+
1350int doselect ()
1451{
1552 int read;
@@ -20,10 +57,18 @@ int doselect ()
2057 strcpy (BOTTOM_RIGHT_INFO, inttochar (pid + 1 ));
2158 strcat (BOTTOM_RIGHT_INFO, " /" );
2259 strcat (BOTTOM_RIGHT_INFO, inttochar (PIDMAX));
23- while ((read < 1 || read > 4 ) && read != 9 && read != 32 && read != ' / ' && read != 10 )
60+ while ((read < 1 || read > 4 ) && read != 9 && read != 32 && read != ' l ' && read != 10 )
2461 {
2562 read = check (keyboard ());
2663 }
64+ if (read == ' l' )
65+ {
66+ strcpy (BOTTOM_LEFT_INFO, " Load: " );
67+ if (sel_command () == 1 )
68+ {
69+ return -2 ;
70+ }
71+ }
2772 if (read == 3 )
2873 {
2974 if (pid > 0 )
@@ -82,6 +127,7 @@ int func_select ()
82127 SEL_OUTPUT_STOP = 1 ;
83128
84129 if (k == -1 ) return -1 ;
130+ else if (k == -2 ) return -2 ;
85131 else return pid + 1 ;
86132}
87133
0 commit comments