コード例 #1
0
ファイル: WiimoteMono.cs プロジェクト: detlefgrohs/HexyPilot
        private void DoButtonUpdate(CWIID_BTN buttons)
        {
            var state = new WiimoteState();

            state.ButtonState.A     = (buttons & CWIID_BTN.A) != 0;
            state.ButtonState.B     = (buttons & CWIID_BTN.B) != 0;
            state.ButtonState.One   = (buttons & CWIID_BTN.BTN1) != 0;
            state.ButtonState.Two   = (buttons & CWIID_BTN.BTN2) != 0;
            state.ButtonState.Up    = (buttons & CWIID_BTN.UP) != 0;
            state.ButtonState.Down  = (buttons & CWIID_BTN.DOWN) != 0;
            state.ButtonState.Left  = (buttons & CWIID_BTN.LEFT) != 0;
            state.ButtonState.Right = (buttons & CWIID_BTN.RIGHT) != 0;
            state.ButtonState.Plus  = (buttons & CWIID_BTN.PLUS) != 0;
            state.ButtonState.Minus = (buttons & CWIID_BTN.MINUS) != 0;
            state.ButtonState.Home  = (buttons & CWIID_BTN.HOME) != 0;
            var handler = WiimoteChanged;

            if (handler != null)
            {
                handler(this, new WiimoteChangedEventArgs(state));
            }
        }
コード例 #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ws">Wiimote state</param>
 public WiimoteChangedEventArgs(WiimoteState ws)
 {
     WiimoteState = ws;
 }
コード例 #3
0
ファイル: Events.cs プロジェクト: distantcam/HexyPilot
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ws">Wiimote state</param>
 public WiimoteChangedEventArgs(WiimoteState ws)
 {
     WiimoteState = ws;
 }