This script is attached to a sprite with an editable text member:

on keyUp
  if the controlDown then
    put the keyCode
  end if
end

I'm trying to understand why in my movie this works differently under Windows than under Mac OS X.

In Windows, if I keep the Ctrl key pressed as I tap letter keys, each time a letter key is tapped, its keyCode appears in the message window. That's what I expect.

On my Mac OS X computer, if I keep the Ctrl key pressed as I tap letter keys, only the first letter key results in its keyCode displayed in the message window. Unless I release the Ctrl key and then press it again, the other letter keys don't register as I tap them. It is as though the Mac doesn't know the Ctrl key is down unless I release it and then press it again.

Is this a known fact, or am I missing something?

The reason I need to figure this out is this:

My editable text field is for the user to type a search target. My TextCruncher Xtra then finds all occurrences of the target in the movie's texts, and the first find is displayed. I want the user to press Ctrl+N to see the next find.

This works fine in Windows, but in Mac OS X, if I keep Ctrl pressed while tapping the N key to see the other finds, only the first tap on the N key works as expected. The subsequent taps on the N key actually enter the letter "n" in the field. I have to release Ctrl and then press it again in order to achieve my results.

Is this just the way Mac OS X works, or am I approaching this in the wrong way?

Another unpleasant thing is that sometimes the control character (decimal 14, Ctrl-N) actually gets input in the text field. I tried getting around that with this little trap:

on keyDown me
  if the controlDown than
    stopEvent
  end if
end

I tried an identical handler for keyUp. But that works only some of the time--depending on how fast each key is released, and which is released first--Ctrl or the letter key. As far as I know, there's no keyStillDown handler in Lingo.

I'm sure other people must have dealt with similar situations. What should I do?

Thanks,

Slava

[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]

Reply via email to