예제 #1
0
        private static void OnTimedEvent(Object source, System.Timers.ElapsedEventArgs e)
        {
            Types.XINPUT_GAMEPAD_STATE s = Controller.get_gamepad_state((int)Types.UserIndex.One);

            if (Controller.button_pressed(Types.ButtonFlags.GUIDE))
            {
                Application.OpenForms[0].WindowState = FormWindowState.Normal;
                Application.OpenForms[0].Activate();
                Application.OpenForms[0].Focus();
            }

            foreach (Action a in actions_always_run)
            {
                a.execute(s);
            }

            foreach (Types.ButtonFlags b in current_mapping.mappings.Keys)
            {
                if (Controller.button_pressed(b))
                {
                    if (current_mapping.mappings.ContainsKey(b))
                    {
                        current_mapping.mappings[b].execute(s);
                    }
                }
            }
        }
예제 #2
0
파일: Action.cs 프로젝트: rgoliveira/ihc
 private int get_volume_delta(Types.XINPUT_GAMEPAD_STATE state)
 {
     if (state.bLeftTrigger > (byte)Types.Thresholds.XINPUT_GAMEPAD_TRIGGER_THRESHOLD)
     {
         return(-1);
     }
     else if (state.bRightTrigger > (byte)Types.Thresholds.XINPUT_GAMEPAD_TRIGGER_THRESHOLD)
     {
         return(+1);
     }
     else
     {
         return(0);
     }
 }
예제 #3
0
파일: Action.cs 프로젝트: rgoliveira/ihc
        private int get_wheel_deltaY(Types.XINPUT_GAMEPAD_STATE state)
        {
            double delta = get_axis_delta(state.sThumbRY, (short)Types.Thresholds.XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE);

            return((int)(delta * (int)Types.Velocities.Wheel_Rotation));
        }
예제 #4
0
파일: Action.cs 프로젝트: rgoliveira/ihc
        private int get_mouse_deltaY(Types.XINPUT_GAMEPAD_STATE state)
        {
            double delta = get_axis_delta(state.sThumbLY, (short)Types.Thresholds.XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE);

            return((int)(-delta * (int)Types.Velocities.Mouse_Movement));
        }
예제 #5
0
파일: Action.cs 프로젝트: rgoliveira/ihc
 public void execute(Types.XINPUT_GAMEPAD_STATE state)
 {
     this._act(state);
 }