2020-02-03 19:43:22 +01:00
|
|
|
|
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-03 19:43:22 +01:00
|
|
|
|
{
|
2020-02-04 23:29:00 +01:00
|
|
|
|
Console.WriteLine(mouseCurs.X + " " + mouseCurs.Y + " - " + mouse.X + " " + mouse.Y);
|
2020-02-03 19:43:22 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|