StringRequest() keeps showing dialog box on amiga

Discuss any general programming issues here
Post Reply
peceha
Posts: 111
Joined: Tue Dec 13, 2016 8:39 am
Location: Poland

StringRequest() keeps showing dialog box on amiga

Post 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.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: StringRequest() keeps showing dialog box on amiga

Post 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?
peceha
Posts: 111
Joined: Tue Dec 13, 2016 8:39 am
Location: Poland

Re: StringRequest() keeps showing dialog box on amiga

Post by peceha »

So far so good - it is working now.
Thank you.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: StringRequest() keeps showing dialog box on amiga

Post 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
Post Reply