Basically you start a thread (grabValues
, implemented by function RInvokeMe
) which endlessly invoke on your form methods MUpdate
and CUpdate
. When you invoke a method then you post a message on the windows message queue in order to let the window execute the given function. But when you press a key even the keypress message is posted to the windows queue... but maybe it is not served quickly because of the tons of invoke requests you are already executing on the form.
You could try to introduce a small delay (Thread.Sleep(500);
) in your RInvokeMe
loop just to see if the problem is there...
Then if so, I would consider to completely re-design your project in order to avoid such a scenario (if your characters are only moved only when pressing keys, why you simply do not redraw the scene only upon keypress but you do it continuously?)