static void PrintPOV(Extreme3DProService s, int id)
        {
            POV pov = POV.POV_NONE;

            if (!s.GetPOV(id, ref pov))
            {
                pov = POV.POV_NONE;
            }

            Console.WriteLine("{0}", povNameMap[pov]);
        }
        static void PrintButtons(Extreme3DProService s, int id)
        {
            bool[] buttons = new bool[12];

            if (!s.GetButtons(id, ref buttons))
            {
                for (int i = 0; i < 12; i++)
                {
                    buttons[i] = false;
                }
            }

            for (int i = 0; i < 12; i++)
            {
                Console.Write("{0} {1} ", i, buttons[i]);
            }
            Console.WriteLine();
        }
        static void PrintAbsoluteAxes(Extreme3DProService s, int id)
        {
            int x = 0, y = 0, z = 0, slider = 0;

            if (!s.GetX(id, ref x))
            {
                x = 0;
            }
            if (!s.GetY(id, ref y))
            {
                y = 0;
            }
            if (!s.GetZRot(id, ref z))
            {
                z = 0;
            }
            if (!s.GetSlider(id, ref slider))
            {
                slider = 0;
            }

            Console.WriteLine("X: {0} | Y: {1} | Z: {2} | Slider: {3}", x, y, z, slider);
        }
        static void Main(string[] args)
        {
            Extreme3DProService es = new Extreme3DProService();
            Xbox360Service      xs = new Xbox360Service();

            if (!xs.Initialize())
            {
                Console.WriteLine("Failed to initialize Xbox!");
                return;
            }

            if (!es.Initialize())
            {
                Console.WriteLine("Failed to initialize Logitech!");
                return;
            }


            Console.WriteLine("Waiting for a joystick to be plugged in...");
            while (es.GetNumberConnected() < 1)
            {
                ;
            }
            Console.WriteLine("Found one - starting main loop.");

            while (true)
            {
                foreach (int i in es.GetIDs())
                {
                    Console.Write("[{0}] ", i);
                    PrintAbsoluteAxes(es, i);
                    //PrintButtons(s, i);
                    //PrintPOV(s, i);
                }
            }
        }
        static void PrintPOV(Extreme3DProService s, int id)
        {
            POV pov = POV.POV_NONE;
            if (!s.GetPOV(id, ref pov))
                pov = POV.POV_NONE;

            Console.WriteLine("{0}", povNameMap[pov]);
        }
        static void PrintButtons(Extreme3DProService s, int id)
        {
            bool[] buttons = new bool[12];

            if (!s.GetButtons(id, ref buttons))
                for (int i = 0; i < 12; i++)
                    buttons[i] = false;

            for (int i = 0; i < 12; i++)
                Console.Write("{0} {1} ", i, buttons[i]);
            Console.WriteLine();
        }
        static void PrintAbsoluteAxes(Extreme3DProService s, int id)
        {
            int x = 0, y = 0, z = 0, slider = 0;

            if (!s.GetX(id, ref x))
                x = 0;
            if (!s.GetY(id, ref y))
                y = 0;
            if (!s.GetZRot(id, ref z))
                z = 0;
            if (!s.GetSlider(id, ref slider))
                slider = 0;

            Console.WriteLine("X: {0} | Y: {1} | Z: {2} | Slider: {3}", x, y, z, slider);
        }