Browse Source

+echo() +noecho()

phyto 6 months ago
parent
commit
32379c5441
2 changed files with 6 additions and 4 deletions
  1. 1
    0
      essai.c
  2. 5
    4
      ui/terminal.c

+ 1
- 0
essai.c View File

@@ -52,6 +52,7 @@ for (idx=0; idx<nbloops; idx++) {
52 52
 		else if (0x14==key) {		/* request for terminal */
53 53
 
54 54
 			foo = run_the_terminal(sfd, " terminal ", 0);
55
+			putbyte(sfd, 'x'); putbyte(sfd, '\n');	
55 56
 			sprintf(ligne, "retour terminal = %d", foo);
56 57
 			aff_message(ligne);	sleep(1);
57 58
 			}

+ 5
- 4
ui/terminal.c View File

@@ -88,7 +88,9 @@ do	{
88 88
 
89 89
 	/*** est-ce le yuser avec son clavier ? */
90 90
 	if (FD_ISSET(fd_local, &rfds)) {
91
-		received = getch();
91
+		noecho();
92
+		received = wgetch(glass);
93
+		echo();
92 94
 
93 95
 #if DEBUG_LEVEL > 1
94 96
 		sprintf(ligne, " got $%X\n", received); 
@@ -123,9 +125,8 @@ int		foo;
123 125
 // unsigned char	byte;
124 126
 int		fd_stdin;
125 127
 
126
-lin_term = col_term = 4;			/* position */
127
-wid_term = 60;
128
-hei_term = 25;
128
+lin_term = 4;	col_term = 9;			/* position */
129
+wid_term = 60;	hei_term = 25;			/* dimensions */
129 130
 
130 131
 fd_stdin = fileno(stdin);	/* for select or pool */
131 132
 

Loading…
Cancel
Save