Page 1 of 1

StringRequest() keeps showing dialog box on amiga

Posted: Fri Dec 30, 2016 5:21 pm
by peceha
Hi
take a look at the following:

Code: Select all

Function ask(title,body,min,max)
	PauseTimer(20)
        /* I removed here nonesential parts and changed a little the rest - so just you can easy reproduce the problem*/
	a = Limit(Val((StringRequest(title,body,1,#NUMERICAL))),min,max)
	ResumeTimer(20)
EndFunction


StartTimer(20)
While quit = False
	If IsKeyDown("F1")	Then ask("","blabla1",3,20)
	If IsKeyDown("F2")	Then ask("","blabla2",3,20)
	If IsKeyDown("F3")	Then ask("","blabla3",1,20)
	WaitTimer(20,80)
Wend
On PC everything works like expected - whenewer I press F1/F2/F3 the requester shows up and when I write my numbers it goes away after pressing ENTER/ESC or OK/CANCEL.
On Amiga (wb3.1) the dialog box is comming back in fraction of second just after I dismiss it.
Am I doing something wrong?

Thank You.

Re: StringRequest() keeps showing dialog box on amiga

Posted: Tue Jan 03, 2017 9:49 pm
by airsoftsoftwair
Try calling ResetKeyStates() after StringRequest(). Like this:

Code: Select all

Function ask(title,body,min,max)
   PauseTimer(20)
        /* I removed here nonesential parts and changed a little the rest - so just you can easy reproduce the problem*/
   a = Limit(Val((StringRequest(title,body,1,#NUMERICAL))),min,max)
   ResetKeyStates
   ResumeTimer(20)
EndFunction
Does it help?

Re: StringRequest() keeps showing dialog box on amiga

Posted: Wed Jan 04, 2017 2:49 pm
by peceha
So far so good - it is working now.
Thank you.

Re: StringRequest() keeps showing dialog box on amiga

Posted: Wed Jan 04, 2017 10:17 pm
by airsoftsoftwair
Alright, so this was actually a bug in Hollywood. Fixed now.

Code: Select all

- Fix: StringRequest(), ListRequest(), ColorRequest(), and PathRequest() didn't reset the
  key states which could lead to keyboard events still being triggered after those requesters
  were closed