Page 1 of 1

What need an idle message to start ?

Posted: Tue Apr 09, 2013 4:18 pm
by jmburnod
Hi All,
I have an idle message on the cd script

Code: Select all

on idle
   if the environment <> "mobile" then
      set the hilite of btn "bMultipleSelection" to (shiftKey() is down)
   end if
   pass idle
end idle
Don't work after the opencard message.
If I clic on an other stack, idle message start
I feel i forget something basic :oops:
Best regards
Jean-Marc

Re: What need an idle message to start ?

Posted: Tue Apr 09, 2013 4:46 pm
by magice
This doesn't exactly answer your question, but every time I have started out with an idle message, I have found a way to use the send command in its place and it had worked more efficiently. Rather than fight with making the idle work, you might be better off just creating a polling system with send to in time.

Re: What need an idle message to start ?

Posted: Tue Apr 09, 2013 4:50 pm
by jmburnod
Thanks for your reply
I'll do that
Best regards
Jean-marc

Re: What need an idle message to start ?

Posted: Tue Apr 09, 2013 8:26 pm
by Dixie
What are you trying to do here ?

Dixie

Re: What need an idle message to start ?

Posted: Tue Apr 09, 2013 10:14 pm
by jmburnod
Hi John,

I doesn't try. I do :D
It seems a pendingmessage will be better than an idle message to set the hilite of a btn to the shiftKey() is down

Re: What need an idle message to start ?

Posted: Tue Apr 09, 2013 10:38 pm
by jmburnod
Magice,
I confirm pendingmessage is better than idle message in this case

Code: Select all

on DoCheckShift
   set the hilite of btn "bMultipleSelection" to (shiftKey() is down)
   if "DoCheckShift"  is not in the pendingmessages then
      send "DoCheckShift" to me in 10 milliseconds
   end if
end DoCheckShift

Re: What need an idle message to start ?

Posted: Tue Apr 09, 2013 11:16 pm
by bn
Hi Jean-Marc,

if you use 10 milliseconds you make a very tight loop.

I think the screen refresh is every 16 milliseconds = 1 tick. The shortest mouseMove intervall is 16 milliseconds.

For user interface things everything below 100 milliseconds is barely noticeable. Especially if you have to push a key on the keyboard one is distracted and this shortens the perceived latency.

I tried with 150 milliseconds in the loop and that seems to respond quite immediately. 200 and more milliseconds start to show latency.

The short story is you don't need a 10 millisecond loop it strains the program unnecessarily.
And please make shure to clear all your pendingMessages when e.g. you leave the card. Windows Standalones don't like continuing messaging when closing and refuse to close. On a Mac it kills the messages somehow

Code: Select all

on closeCard
   repeat for each line aLine in the pendingMessages
      if aLine contains "DoCheckShift" then cancel item 1 of aLine
   end repeat
   set the hilite of btn "bMultipleSelection" to false
end closeCard
Kind regards
Bernd

Re: What need an idle message to start ?

Posted: Tue Apr 09, 2013 11:28 pm
by jmburnod
Hi Bernd,
Thanks one more for your comments.
I just tested the interval for the pending message and you're right, 150 milliseconds work fine
make shure to clear all your pendingMessages
Yes, i killed the pending message at closecard
Kind regards
Jean-Marc

Re: What need an idle message to start ?

Posted: Thu Apr 25, 2013 4:17 pm
by jmburnod
Hi All,
Using shiftkey() to change the hilitedlines selection mode wasn't a good idea (multipleHilitedlines or not)
It work normally and logically (like a multipleHilitedlines with the shifkey() = true

I use a checkbox instead shiftkey() and I can live with that.
By the way, if someone have a light idea, I will take it
Best regards
Jean-Marc