示例#1
0
 private void MainClass_Load(object sender, System.EventArgs e)
 {
     if (!myJStick.InitDirectInput())
     {
         MessageBox.Show("No input device was found!");
     }
     else
     {
         this.socket = new UDPClientASocket();
         //Start controller timer
         timer1.Start();
     }
 }
示例#2
0
        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            myJStick = new ZalJoystick(this, JOYSTICK_MAX);
            myJStick.InitDirectInput();
            this.gamepadThold = 50;
            this.axisCount    = 0;
            this.axisFRSign   = new int[4];
            this.socket       = new UDPClientASocket();

            this.x           = this.Width / 2;
            this.y           = this.Height / 2;
            this.guiCircle   = new ZalCircle(this.ClientSize.Width / 2, this.ClientSize.Height / 2, this.ClientSize.Width / 2);
            this.limitCircle = new ZalCircle(0, 0, JOYSTICK_MAX);
            rad45            = (Math.PI / 180) * 45;
        }