Opentk/InputTest/Program.cs

35 lines
847 B
C#
Raw Normal View History

using System;
using System.Threading;
using OpenTK;
using OpenTK.Input;
using OpenTK.Platform;
namespace InputTest
{
class Program
{
static void Main(string[] args)
{
Toolkit.Init(new ToolkitOptions()
{
Backend = PlatformBackend.PreferNative,
EnableHighResolution = true
});
Console.WriteLine("Testing Keyboard");
while (true)
{
2020-02-04 23:29:00 +01:00
var mouseCurs = Mouse.GetCursorState();
var mouse = Mouse.GetState();
if (mouseCurs.IsAnyButtonDown || mouse.IsAnyButtonDown)
{
2020-02-04 23:29:00 +01:00
Console.WriteLine(mouseCurs.X + " " + mouseCurs.Y + " - " + mouse.X + " " + mouse.Y);
}
Thread.Sleep(500);
}
}
}
}