Arrow keys in Rev are evil

curry curry at pair.com
Wed Jul 16 08:01:00 EDT 2003


It's true....

When making a game, I noticed that the background music (played by QT 
players) dropped out when I started playing and moved the character. 
I was puzzled, and finally noticed that when a sound played at 
exactly the same time as the music started, it didn't drop out, so I 
used that as a workaround--playing a small sound whenever I started 
music.

But later, when I was working on other parts of the game--intro and 
menu screens--I noticed that music would drop out there too if the 
arrow key was held down. I put it on my list of issues to try to 
figure out when I got time. That's been several weeks ago.

Finally today, it all came together and I realized what was going on. 
The QT players are interpreting the arrow keys (when held down for a 
moment) as a fast forward and rewind.

But to show how devious it is--the QT players were not on the active 
card. They were in a separate (and invisible) window which was not 
active. Furthermore, the QT player can have the controller turned off 
and keyboard focusable turned off, and it *still* happens! The only 
way I found to avoid it is to hide the player object. (And I think it 
only happens when you use the browse tool.)

Is this behavior due to Revolution or Apple? (If it's a Rev behavior, 
I would seriously suggest changing it to only affect the player if 
the window is active, and perhaps also only if the controller is 
shown.)

Today I was amazed to find that arrow keys were also stopping an 
animation and found out that holding down arrow keys can stop 
handlers cold that are using "wait...with messages." It happens when 
navigationArrows are turned off, unless you trap arrowkey messages. 
It looks like the Rev IDE scripts may cause it; it didn't happen for 
me when I tried it with the engine only. I'll enter this in the 
bugzilla when I get to it, and in the meantime here's a demo stack in 
case anyone wants to see how it may affect a handler and avoid it:

http://www25.pair.com/curry/evilarrows.rev.hqx

(I didn't make a demo stack for the QT player issue because it's 
pretty easy to test--just set a player up to play a MIDI file.)

I'm getting to dread arrow keys.... Why are they so cursed in Rev?

Seriously though, the QT thing was a headache because although the 
solution is simple in the end, tracking it down is difficult because 
of such unexpected behavior. The wait drop-out is pretty surprising 
too, but I was lucky that I had just turned off navigation arrows 
when I noticed it--if I had them on before making the animation, I 
probably would have never figure it out. I sincerely hope that's all 
the arrow key issues I run up against for a while! I hope I can save 
somebody going through the same thing.

Whew...

Curry



More information about the use-livecode mailing list