Bug with keyDown?
Bug with keyDown?
- Subject: Bug with keyDown?
- From: "Matt R" <email@hidden>
- Date: Mon, 15 Jan 2007 14:33:46 -0800
I have a program that monitors keyDown events, marks a certain flag as set,
and then waits for the matching 'keyUp' to un-mark the flag. I have run into
a problem I can't seem to fix, maybe someone can help me solve this? If
someone holds down a key, for instance the 'A' key, it fires a series of
keyDowns. Then when they release it, the keyUp for A fires. So far so good.
When someone hits command-A, it fires a performKeyEquivalent, which can be
checked to see if its 'A'- okay that's fine too. The problem comes when
someone holds down the A key, and then (perhaps by accident) presses the
command key. Now, when the A key is released (before the command key),
*neither* a keyup for the A key, nor a performKeyEquivalent, is ever fired.
In fact, nothing happens at all. I have tested this numerous times with the
same results.
My issue is that in order for this particular program to work, the keyUp has
to matched to the keyDown, or else the 'flag' that was triggered will just
continue indefinitely, because my App is never realizing that the user
released the A key. I realize that the user hitting the command key on
accident and releasing the A key first is perhaps a weird combo, but it
*will* happen, because I found this bug by accidentally doing the same
thing! It causes a very awful bug because the program continues executing as
if the user is holding down this key on the keyboard.
I'm new to Cocoa so if anyone can help me out I would appreciate it. This
issue seems contrary to the basic idea of the keyDown/keyUp/keyEquivalent
event design.
Thank you
-Matt
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden