I'm trying to intercept and cancel function key presses by using statements like this in the handler that is assigned as the keyDownScript:
if the keyCode = 11 then --the F 12 key stopEvent exit end if
The values of keyCode for the function keys are between 96 and 101, and also 103, 109, and 11. The reason I want to intercept these keypresses is that they enter junk into the editable member that has the focus.
My intercept works for all function keys except F1, F2, F4, and F12. The interesting part is that any of these keypresses is detected, but only the other function key presses can be stopped. The F1, F2, F4, and F12 seem to be impervious to stopEvent. What am I doing wrong? How do I stop these keys from entering junk into editable members?
This is in Dir MX (9) and Windows XP.
Well, you could tackle it from the other direction. Make a string of acceptable characters, and do something like this:
(untested email code, in the form of a behavior for your editable text sprite)
------------------------------
property pAcceptableCharsString = "abcdefghijklmnopqrstuvwxyz1234567890!,.:;'? etc."
on keyUp me
if offset(the key, pAcceptableCharsString) > 0 then
pass
end if
end
------------------------------hth, Kurt
[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!]
