Ejemplo n.º 1
0
 private void OnJoystickPressEvent(int xxx, int yyy, int zzz, JoystickButtonType btt)
 {
     if (JoystickPressEvent != null)
     {
         JoystickPressEvent(null, new JoystickPressEventArgs(xxx, yyy, zzz, btt));
     }
 }
Ejemplo n.º 2
0
        public JoystickPressEventArgs(int xx, int yy, int zz, JoystickButtonType btt)
        {
            this.X = xx;
            this.Y = yy;
            this.Z = zz;

            ButtonType = btt;
        }
Ejemplo n.º 3
0
        private static void JoystickService_JoystickPressEvent(object sender, JoystickPressEventArgs args)
        {
            //保存当前按钮状态
            if (SuperObject.Config.CurrentGoType == GoType.Joy && args.ButtonType != JoystickButtonType.None)
            {
                if (args.ButtonType == JoystickButtonType.MiddleCenter)
                {
                    if (LastJoystickButtonType != JoystickButtonType.TopLeft && LastJoystickButtonType != JoystickButtonType.TopCenter && LastJoystickButtonType != JoystickButtonType.TopRight && LastJoystickButtonType != JoystickButtonType.MiddleLeft && LastJoystickButtonType != JoystickButtonType.MiddleRight && LastJoystickButtonType != JoystickButtonType.BottomLeft && LastJoystickButtonType != JoystickButtonType.BottomCenter && LastJoystickButtonType != JoystickButtonType.MiddleRight)
                    {
                        return;
                    }
                }

                if (LastJoystickButtonType == args.ButtonType)
                {
                    return;
                }

                LastJoystickButtonType = args.ButtonType;
                TaskService.Request(TaskActionType.Joy, args.ButtonType);
            }

            #region 向ConfigUI界面中的手柄测试界面传递按键指令
            if (MainUIObj != null)
            {
                if (MainUIObj.IsHandleCreated)
                {
                    MainUIObj.Invoke(new MethodInvoker(delegate()
                    {
                        if (ConfigUIObj != null)
                        {
                            ConfigUIObj.JoystickStateInfo.ProcessorJoystickButtons(args);
                        }
                    }));
                }
            }
            #endregion
        }
Ejemplo n.º 4
0
 /// <summary>
 /// ボタンの状態を種類から取得します。
 /// </summary>
 /// <param name="joystickIndex">検索するジョイスティックのインデックス</param>
 /// <param name="type">状態を検索するボタンの種類</param>
 /// <returns>指定種類のボタンの状態</returns>
 public ButtonState GetButtonState(int joystickIndex, JoystickButtonType type)
 => (ButtonState)cbg_Joystick_GetButtonStateByType(selfPtr, joystickIndex, (int)type);
Ejemplo n.º 5
0
 private void OnJoystickPressEvent(JoystickButtonType bttt)
 {
     OnJoystickPressEvent(0, 0, 0, bttt);
 }