Hi,
I'm having trouble with the logic in my code where the PreviewKeyDown Event is firing multiple times before the KeyUp Event is triggered.
For example:
I press two keys very quickly but NOT at the exact same time. However, my KeyUp event has some logic that needs to be completed in time before the next PreviewKeyDown should be fired.
Is there a way that I can prevent a PreviewKeyDown event from firing again until the respective KeyUp event has finished?
I suppose one solution would be to programmatically Add and Remove the events. I just wondered if there was a flag I can use to check instead.
You can see from my Debug output below that the PreviewKeyDown is firing twice before the KeyUp events have finished:
Many thanks,
Rob
I'm having trouble with the logic in my code where the PreviewKeyDown Event is firing multiple times before the KeyUp Event is triggered.
For example:
I press two keys very quickly but NOT at the exact same time. However, my KeyUp event has some logic that needs to be completed in time before the next PreviewKeyDown should be fired.
Is there a way that I can prevent a PreviewKeyDown event from firing again until the respective KeyUp event has finished?
I suppose one solution would be to programmatically Add and Remove the events. I just wondered if there was a flag I can use to check instead.
You can see from my Debug output below that the PreviewKeyDown is firing twice before the KeyUp events have finished:
key press: N
Update Modification - PreviewKeyDown Event (Is Selection Empty: False)
key press: A
Update Modification - PreviewKeyDown Event (Is Selection Empty: False)
KeyUp Event Fired
KeyUp Event Fired
Many thanks,
Rob