コード例 #1
0
ファイル: ControllerState.cs プロジェクト: MrPnut/SCXI
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = A.GetHashCode();
         hashCode = (hashCode * 397) ^ B.GetHashCode();
         hashCode = (hashCode * 397) ^ X.GetHashCode();
         hashCode = (hashCode * 397) ^ Y.GetHashCode();
         hashCode = (hashCode * 397) ^ LeftGrip.GetHashCode();
         hashCode = (hashCode * 397) ^ RightGrip.GetHashCode();
         hashCode = (hashCode * 397) ^ Select.GetHashCode();
         hashCode = (hashCode * 397) ^ Start.GetHashCode();
         hashCode = (hashCode * 397) ^ Steam.GetHashCode();
         hashCode = (hashCode * 397) ^ LeftBumper.GetHashCode();
         hashCode = (hashCode * 397) ^ RightBumper.GetHashCode();
         hashCode = (hashCode * 397) ^ LeftStickX.GetHashCode();
         hashCode = (hashCode * 397) ^ LeftStickY.GetHashCode();
         hashCode = (hashCode * 397) ^ LeftStickClick.GetHashCode();
         hashCode = (hashCode * 397) ^ RightPadX.GetHashCode();
         hashCode = (hashCode * 397) ^ RightPadY.GetHashCode();
         hashCode = (hashCode * 397) ^ RightPadClick.GetHashCode();
         hashCode = (hashCode * 397) ^ LeftPadClick.GetHashCode();
         hashCode = (hashCode * 397) ^ LeftTrigger.GetHashCode();
         hashCode = (hashCode * 397) ^ RightTrigger.GetHashCode();
         hashCode = (hashCode * 397) ^ LeftPadTouched.GetHashCode();
         return(hashCode);
     }
 }
コード例 #2
0
ファイル: Form_WOC.cs プロジェクト: hu13779472390/LimitlessUI
        protected override void WndProc(ref Message message)
        {
            base.WndProc(ref message);
            if (message.Msg == 0x84)    // WM_NCHITTEST
            {
                var cursor = this.PointToClient(Cursor.Position);

                if (TopLeftGrip.Contains(cursor))
                {
                    message.Result = (IntPtr)HTTOPLEFT;
                }
                else if (TopRightGrip.Contains(cursor))
                {
                    message.Result = (IntPtr)HTTOPRIGHT;
                }
                else if (BottomLeftGrip.Contains(cursor))
                {
                    message.Result = (IntPtr)HTBOTTOMLEFT;
                }
                else if (BottomRightGrip.Contains(cursor))
                {
                    message.Result = (IntPtr)HTBOTTOMRIGHT;
                }

                else if (TopGrip.Contains(cursor))
                {
                    message.Result = (IntPtr)HTTOP;
                }
                else if (LeftGrip.Contains(cursor))
                {
                    message.Result = (IntPtr)HTLEFT;
                }
                else if (RightGrip.Contains(cursor))
                {
                    message.Result = (IntPtr)HTRIGHT;
                }
                else if (BottomGrip.Contains(cursor))
                {
                    message.Result = (IntPtr)HTBOTTOM;
                }
            }
        }
コード例 #3
0
        private int HitTestFrame(Point point)
        {
            int result = 0;

            if (TopLeftGrip.Contains(point))
            {
                result = WM.HTTOPLEFT;
            }
            else if (TopRightGrip.Contains(point))
            {
                result = WM.HTTOPRIGHT;
            }
            else if (BottomLeftGrip.Contains(point))
            {
                result = WM.HTBOTTOMLEFT;
            }
            else if (BottomRightGrip.Contains(point))
            {
                result = WM.HTBOTTOMRIGHT;
            }
            else if (TopLine.Contains(point) || TopGrip.Contains(point))
            {
                result = WM.HTTOP;
            }
            else if (LeftLine.Contains(point) || LeftGrip.Contains(point))
            {
                result = WM.HTLEFT;
            }
            else if (RightLine.Contains(point) || RightGrip.Contains(point))
            {
                result = WM.HTRIGHT;
            }
            else if (BottomLine.Contains(point) || (BottomGrip.Contains(point)))
            {
                result = WM.HTBOTTOM;
            }

            return(result);
        }
コード例 #4
0
        private void OnGUI()
        {
            if (showValues)
            {
                Rect rect = new Rect(0, 0, 400, 30);
                GUILayout.BeginHorizontal();
                GUILayout.BeginVertical();
                ////
                GUILayout.TextArea(LeftMenuDown.ToString());
                GUILayout.TextArea(LeftMenu.ToString());
                GUILayout.TextArea(LeftMenuUp.ToString());

                GUILayout.TextArea(LeftPadPressDown.ToString());
                GUILayout.TextArea(LeftPadPress.ToString());
                GUILayout.TextArea(LeftPadPressUp.ToString());

                GUILayout.TextArea(LeftPadTouchDown.ToString());
                GUILayout.TextArea(LeftPadTouch.ToString());
                GUILayout.TextArea(LeftPadTouchUp.ToString());

                GUILayout.TextArea(LeftTouchPad.x.ToString("F2") + " " + LeftTouchPad.y.ToString("F2"));

                GUILayout.TextArea(LeftTriggerMagnitude.ToString("F2"));

                GUILayout.TextArea(LeftTriggerDown.ToString());
                GUILayout.TextArea(LeftTrigger.ToString());
                GUILayout.TextArea(LeftTriggerUp.ToString());

                GUILayout.TextArea(LeftGripDown.ToString());
                GUILayout.TextArea(LeftGrip.ToString());
                GUILayout.TextArea(LeftGripUp.ToString());

                GUILayout.EndVertical();
                GUILayout.BeginVertical();
                ////
                GUILayout.TextArea(RightMenuDown.ToString());
                GUILayout.TextArea(RightMenu.ToString());
                GUILayout.TextArea(RightMenuUp.ToString());

                GUILayout.TextArea(RightPadPressDown.ToString());
                GUILayout.TextArea(RightPadPress.ToString());
                GUILayout.TextArea(RightPadPressUp.ToString());

                GUILayout.TextArea(RightPadTouchDown.ToString());
                GUILayout.TextArea(RightPadTouch.ToString());
                GUILayout.TextArea(RightPadTouchUp.ToString());

                GUILayout.TextArea(RightTouchPad.x.ToString("F2") + " " + RightTouchPad.y.ToString("F2"));

                GUILayout.TextArea(RightTriggerMagnitude.ToString("F2"));

                GUILayout.TextArea(RightTriggerDown.ToString());
                GUILayout.TextArea(RightTrigger.ToString());
                GUILayout.TextArea(RightTriggerUp.ToString());

                GUILayout.TextArea(RightGripDown.ToString());
                GUILayout.TextArea(RightGrip.ToString());
                GUILayout.TextArea(RightGripUp.ToString());

                GUILayout.EndVertical();
                GUILayout.EndHorizontal();
            }
        }