From 70af067414078d9e2e5b3e905cc94cfb56b3ad54 Mon Sep 17 00:00:00 2001 From: orfao Date: Fri, 8 Dec 2023 10:17:31 +0100 Subject: [PATCH] =?UTF-8?q?ajout=20d'une=20condition=20d'arr=C3=AAt=20(non?= =?UTF-8?q?=20test=C3=A9)=20=C3=A0=20timer.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/timer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/timer.c b/src/timer.c index 8af00ba..d75bde4 100644 --- a/src/timer.c +++ b/src/timer.c @@ -59,13 +59,13 @@ int afficher_minute(int min){ } void creer_timer(void){ - int sec = 0,min=0; + int sec = 0,min=0,x=1; unsigned long int temps = 0,seconde,pause=0; seconde=Microsecondes()+cycle; afficher_seconde(sec); afficher_minute(min); EcrireTexte(110,100,":",2); - while(1){ + while(x=1){ if(Microsecondes()>seconde){ sec++; printf("%d\n",sec); @@ -83,6 +83,9 @@ void creer_timer(void){ if(Touche()==XK_space){ pause=attendre(); } + if(Touche()==XK_Escape){ + x=0; + } } } }