Game Development Reference
In-Depth Information
return true;
}
return false;
}
private void AsynchronousPolling()
{
while (_context.Created)
{
_eventTrigger.WaitOne(-1, false);
try
{
if (_device == null)
{
continue;
}
Acquire();
if (_acquired)
{
Retrieve and cache the current keyboard state so that the KeyDown method can use it.
_keyboardState = _device.GetCurrentKeyboardState();
}
}
catch (InputException)
{
continue;
}
if (_context.Created && !_context.Disposing)
_context.BeginInvoke(new PollTriggerDelegate(PollTrigger));
}
}
private void PollTrigger()
{
if (KeyboardAction != null)
KeyboardAction();
}
Search Nedrilad ::




Custom Search