spnav-csharp-wrapper/Program.cs

42 lines
818 B
C#
Raw Normal View History

using System;
2018-05-30 17:36:06 +00:00
namespace SpaceNavWrapper
2018-05-30 17:15:37 +00:00
{
class Program
{
static void Main(string[] args)
{
//spnavwrapper.SpaceNav.Instance.Threshold = 5;
//spnavwrapper.SpaceNav.Instance.Sensitivity = 0.1;
//for (; ; )
//{
// var ev = spnavwrapper.SpaceNav.Instance.WaitEvent(100);
// Console.WriteLine(ev);
//}
SpaceNavDriver navDriver = new SpaceNavDriver();
navDriver.InitDevice();
navDriver.Button += OnButton;
navDriver.Motion += OnMotion;
Console.CancelKeyPress += delegate {
navDriver.Dispose();
};
2018-05-30 17:36:06 +00:00
for (; ; )
{
}
2018-05-30 17:15:37 +00:00
}
private static void OnMotion(object sender, MotionEventArgs e)
{
Console.WriteLine(e);
}
private static void OnButton(object sender, EventArgs e)
{
Console.WriteLine("Button pressed");
}
2018-05-30 17:15:37 +00:00
}
}