1
DotNet / Re: Input detect once
« on: October 07, 2018, 01:36:32 pm »
Sure sorry
OnKeyPressed function
Update function
The Update function is call when i do the while window.isOpen
Thanks
OnKeyPressed function
private void OnKeyPressed(object sender, KeyEventArgs e)
{
Window window = (Window)sender;
window.SetKeyRepeatEnabled(false);
if (e.Code == Keyboard.Key.A)
{
Console.WriteLine("Bou");
}
}
{
Window window = (Window)sender;
window.SetKeyRepeatEnabled(false);
if (e.Code == Keyboard.Key.A)
{
Console.WriteLine("Bou");
}
}
Update function
private void Update()
{
_window.Closed += new EventHandler(OnClosed);
_window.KeyPressed += new EventHandler<KeyEventArgs>(OnKeyPressed);
_window.SetFramerateLimit(60);
}
{
_window.Closed += new EventHandler(OnClosed);
_window.KeyPressed += new EventHandler<KeyEventArgs>(OnKeyPressed);
_window.SetFramerateLimit(60);
}
The Update function is call when i do the while window.isOpen
Thanks