Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var controllers = SteamControllerDevice.OpenControllers();

            while (true)
            {
                int i = 0;
                foreach (var controller in controllers)
                {
                    var evt = controller.ReadEvent();
                    if (evt != null)
                    {
                        if (evt is ConnectionEvent && ((ConnectionEvent)evt).State == WirelessState.Connected)
                        {
                            controller.Configuration = 0;
                        }
                        controller.UpdateState(evt);
                        Console.WriteLine("Controller " + i);
                        Console.WriteLine("  Buttons:  " + controller.ButtonState);
                        Console.WriteLine("  Triggers: " + controller.LeftTrigger + ", " + controller.RightTrigger);
                        Console.WriteLine("  Stick:    " + controller.Stick.x + ", " + controller.Stick.y);
                        Console.WriteLine("  LPad:     " + controller.LeftPad.x + ", " + controller.LeftPad.y);
                        Console.WriteLine("  RPad:     " + controller.RightPad.x + ", " + controller.RightPad.y);
                        Console.WriteLine();
                    }
                    i++;
                }
            }
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var controllers = SteamControllerDevice.OpenControllers();

            for (var i = 0; i < controllers.Length; i++)
            {
                var i1 = i;
                new Thread(t => PollThread(i1, controllers[i1])).Start();
            }
        }