GUI: slight fix on input handling

This commit is contained in:
(Tim) Efthimis Kritikos 2024-02-05 12:34:28 +00:00
parent 2d4c021130
commit 1f3f26d91e

13
gui.c
View File

@ -334,8 +334,14 @@ int update_gui(struct simdata_t *simdata){
int gui_continue_request(){ int gui_continue_request(){
char inch; char inch;
if(((inch=getch())==ERR)&&CPU_STATE==SINGLE_STEPPING) int release=0;
while(release==0){
if(((inch=getch())==ERR)){
if(CPU_STATE==SINGLE_STEPPING)
return 1; return 1;
else
release=1;
}
switch(inch){ switch(inch){
case 'r': case 'r':
if(CPU_STATE==RUNNING){ if(CPU_STATE==RUNNING){
@ -348,6 +354,11 @@ int gui_continue_request(){
break; break;
case 'q': case 'q':
return 2; return 2;
case '\n':
release=1;
break;
default:
}
} }
return 0; return 0;
} }