arrowKey 'up' and 'down'

RM richmondmathewson at gmail.com
Sat Apr 23 15:49:17 EDT 2016


Thanks for those recommendations; will try them tomorrow as it is almost 
my bedtime
over here in Bulgaria.

Richmond.

On 23.04.2016 22:31, J. Landman Gay wrote:
> On 4/23/2016 1:00 PM, RM wrote:
>> (pseudocode)
>>
>> on arrowKey ArKey
>>   if ArKey = "right" then
>>     move object in some way this line defines
>>     send signal to object to initiate animation script within object
>>   end if
>> end arrowKey
>>
>> when I hit my right arrow key ONCE the object moves and then animates 
>> ONCE.
>>
>> HOWEVER, if I keep my finger on the right arrow key the movement
>> repeats, but the multiple
>> instances of the "send signal to object" scriptLine get "saved up" and
>> fire at the point I take my finger
>> off the arrow key;
>
> The signals are added to a queue but don't get a chance to fire, 
> presumably because the arrowkey message is happening repeatedly. 
> Queued messages need some idle time before they'll execute.
>
> This might work better if you add "without waiting" to the move 
> command, allowing the handler to continue immediately, and then call 
> the animation handler directly without using "send".
>
>> How can I tell when an end-user ('punter') has stopped pressing an 
>> arrowKey?
>
> Try rawKeyUp, but you may not need that if you change the move command.
>





More information about the use-livecode mailing list