Keyboard Input
using System;
using odl;
namespace TestNamespace
{
class Program
{
public static void Main(string[] args)
{
Graphics.Start();
Window w = new Window();
w.Initialize();
w.Show();
w.OnTick += delegate (BaseEventArgs e)
{
if (Input.Trigger(SDL2.SDL.SDL_Keycode.SDLK_RETURN))
{
Console.WriteLine("Return from the window's OnTick event!");
}
};
while (Graphics.CanUpdate())
{
Graphics.Update();
if (Input.Trigger(SDL2.SDL.SDL_Keycode.SDLK_RETURN))
{
Console.WriteLine("Return from the game loop!");
}
}
Graphics.Stop();
}
}
}Last updated