예제 #1
0
        public PlayerKeyboard(IInputDevice inputDevice, PlayerIndex playerIndex)
        {
            if (inputDevice == null) throw new ArgumentNullException("inputDevice");

            InputDevice = inputDevice;
            PlayerIndex = playerIndex;
        }
예제 #2
0
        public RawInputEventArgs(IInputDevice device, uint timestamp)
        {
            Contract.Requires<ArgumentNullException>(device != null);

            Device = device;
            Timestamp = timestamp;
        }
예제 #3
0
파일: Button.cs 프로젝트: xoxota99/Myre
        private void MouseDown(IGesture gesture, GameTime time, IInputDevice device)
        {
            if (RespondOnMouseDown)
                OnSelected();

            _mouseDown = true;
        }
예제 #4
0
        public TabletConnection(IInputDevice tablet, WirelessReceiver receiver, int index)
        {
            Tablet = tablet;
              Receiver = receiver;
              ReceiverIndex = index;

              Settings = new TabletSettings();
        }
예제 #5
0
        public VsoMonitor(IInputDevice device, VsoConnection.Factory connectionFactory)
        {
            name = device.Name;
            vsoConnection = connectionFactory(device);

            var pollingInterval = device.PollingInterval > 0 ? device.PollingInterval : 30; // default to 30 seconds
            delayInterval = TimeSpan.FromSeconds(pollingInterval);
        }
예제 #6
0
        int jumpcount; // when this hits 0, the player is once again affected by gravity.

        #endregion Fields

        #region Constructors

        // --------------- code --------------
        public Player(Engine e)
            : base(e, e.TabbySprite)
        {
            input = engine.input.Keyboard;

            Width = 12;

            UpdateState = Walk;
        }
예제 #7
0
        public PlayerGamePad(IInputDevice inputDevice, PlayerIndex playerIndex)
        {
            if (inputDevice == null) throw new ArgumentNullException("inputDevice");

            InputDevice = inputDevice;
            PlayerIndex = playerIndex;
            wasConnected = false;
            Enabled = false;
        }
예제 #8
0
 public RawMouseWheelEventArgs(
     IInputDevice device,
     uint timestamp,
     IInputRoot root,
     Point position,
     Vector delta, ModifierKeys modifierKeys)
     : base(device, timestamp, root, RawMouseEventType.Wheel, position, modifierKeys)
 {
     Delta = delta;
 }
예제 #9
0
 public RawMouseWheelEventArgs(
     IInputDevice device,
     uint timestamp,
     IInputElement root,
     Point position,
     Vector delta)
     : base(device, timestamp, root, RawMouseEventType.Wheel, position)
 {
     this.Delta = delta;
 }
예제 #10
0
파일: Player.cs 프로젝트: kg/XnaMannux
        int jumpcount; // when this hits 0, the player is once again affected by gravity.

        #endregion Fields

        #region Constructors

        // --------------- code --------------
        public Player(Engine e)
            : base(e, e.TabbySprite)
        {
            input = engine.input.Keyboard;

            width = 12;

            System.Console.WriteLine("Player {0}x{1}", width, height);

            UpdateState = Walk;
        }
예제 #11
0
        public RawMouseEventArgs(
            IInputDevice device,
            uint timestamp,
            IInputRoot root,
            RawMouseEventType type,
            Point position, InputModifiers inputModifiers)
            : base(device, timestamp)
        {
            Contract.Requires<ArgumentNullException>(device != null);
            Contract.Requires<ArgumentNullException>(root != null);

            Root = root;
            Position = position;
            Type = type;
            InputModifiers = inputModifiers;
        }
예제 #12
0
        public ConsoleManager(IInputDevice inputDevice, int sleepTimeout)
        {
            this.inputDevice = inputDevice;
            this.sleepTimeout = sleepTimeout;

            inputDevice.LeftArrowKeyPressed += new EventHandler(this.inputDevice_LeftArrowKeyPressed);
            inputDevice.RightArrowKeyPressed += new EventHandler(this.inputDevice_RightArrowKeyPressed);
            inputDevice.UpArrowKeyPressed += new EventHandler(this.inputDevice_UpArrowKeyPressed);
            inputDevice.DownArrowKeyPressed += new EventHandler(this.inputDevice_DownArrowKeyPressed);

            InitMaze();

            pacman = new Pacman(new Location(15, 18), '>', ConsoleColor.Yellow);
            pacman.ScoreUpdated += new ScoreUpdatedEventHandler(this.pacman_ScoreUpdated);
            Draw(pacman);

            IMovingStrategy strategy = new BfsStrategy();

            // Shadow, the red guy
            Ghost blinky = new Ghost(new Location(8, 18), ConsoleColor.Red, strategy);
            // Bashful, the blue guy
            Ghost inky = new Ghost(new Location(11, 16), ConsoleColor.Cyan, strategy);
            // Speedy, the pink guy
            Ghost pinky = new Ghost(new Location(11, 18), ConsoleColor.Magenta, strategy);
            // Pokey, the slow guy
            Ghost clyde = new Ghost(new Location(11, 20), ConsoleColor.Green, strategy);

            ghosts = new Ghost[4];
            ghosts[0] = blinky;
            ghosts[1] = inky;
            ghosts[2] = pinky;
            ghosts[3] = clyde;

            foreach (Ghost ghost in ghosts)
            {
                ghost.EndOfRouteReached += new EventHandler(this.ghost_EndOfRouteReached);
                ghost.CalcRoute(routeTargets[targetSelector.Next(routeTargets.Length)], maze);
            }
        }
예제 #13
0
 public PlayerObject(string name, IInputDevice inputDevice, Viewport viewport,
     Vector2 startPosition, Color color, Texture2D texture, int size)
 {
     this.viewport = viewport;
     this.name = name;
     this.inputDevice = inputDevice;
     //pos = startPosition;
     this.color = color;
     this.texture = texture;
     this.size = size;
     velocity = new Vector2(0, 0);
     rect = new Rectangle((int)startPosition.X, (int)startPosition.Y,
         size, size);
     currentState = new PlayerState()
     {
         name = this.name,
         size = this.size,
         posX = (int)this.Rect.X,
         posY = (int)this.Rect.Y,
         velX = (int)this.velocity.X,
         velY = (int)this.velocity.Y
     };
 }
예제 #14
0
 private void OnPreviousCommand(IGesture gesture, GameTime gameTime, IInputDevice device)
 {
     if (_commandScrollPointer == null)
     {
         _commandScrollPointer = _previousCommands.Last;
         WritePreviousCommand();
     }
     else if (_commandScrollPointer.Previous != null)
     {
         _commandScrollPointer = _commandScrollPointer.Previous;
         WritePreviousCommand();
     }
 }
예제 #15
0
 public ConfigBuilder WithInputDevice(IInputDevice device)
 {
     config.InputDevices.Add(device);
     return this;
 }
예제 #16
0
 public void ConnectController(IInputDevice input)
 {
     inputDevice = input;
     m_Marker.SetActive(true);
 }
예제 #17
0
        private void OnAutocomplete(IGesture gesture, GameTime gameTime, IInputDevice device)
        {
            if (_help.HasValue && _help.Value.PossibleCommands.Length > 0)
            {
                var h = _help.Value;
                string similarity = "";

                int letter = 0;
                bool b = true;
                while (true)
                {
                    char c = ' ';
                    for (int i = 0; i < _help.Value.PossibleCommands.Length; i++)
                    {
                        if (letter >= _help.Value.PossibleCommands[i].Length)
                        {
                            b = false;
                            break;
                        }

                        if (c == ' ')
                            c = _help.Value.PossibleCommands[i][letter];
                        else
                        {
                            if (c != _help.Value.PossibleCommands[i][letter])
                            {
                                b = false;
                                break;
                            }
                        }
                    }
                    if (!b)
                        break;

                    similarity += c;
                    letter++;
                }

                _textBox.Text = h.Command.Substring(0, h.TabStart) + similarity;
            }
        }
예제 #18
0
 public InputSettingsViewModel(InputSettingsModel model, HidGuardianManager hidGuardianManager, IInputDevice device, bool isAdmin) : base(model)
 {
     this.hidGuardianManager = hidGuardianManager;
     this.device             = device;
     Model.IsAdmin           = isAdmin && device.HardwareID != null;
     if (Model.IsAdmin)
     {
         Model.HidGuardianAdded = hidGuardianManager.IsAffected(device.HardwareID);
     }
     Model.Title = device.DisplayName;
     CreateInputControls();
     SetForceFeedback();
     dispatcherTimer.Interval   = TimeSpan.FromSeconds(1);
     dispatcherTimer.Tick      += DispatcherTimerTick;
     Model.TestButtonText       = "Start";
     Model.ForceFeedbackEnabled = device.InputConfiguration.ForceFeedback;
 }
예제 #19
0
 public PinchGesture(IInputDevice inputDevice) : base(inputDevice)
 {
 }
예제 #20
0
 public ClickGesture(IInputDevice input) : base(input)
 {
 }
예제 #21
0
 /// <summary>
 /// Retrieves a new event that can be used, either from the pool or a new instance
 /// </summary>
 /// <param name="device">The device that generates this event</param>
 /// <returns>An event</returns>
 public static TEventType GetOrCreate(IInputDevice device)
 {
     return(pool.Value.GetOrCreate(device));
 }
예제 #22
0
 public KeyboardSource(IInputDevice inputDevice, string name, Key key) : base(inputDevice, name, InputSourceTypes.Button, (int)key)
 {
     this.key = key;
 }
예제 #23
0
        public unsafe int tUpdateAndDraw(int x, int y)
        {
            if ((!base.bNotActivated))
            {
                #region [ムービーのフレーム作成処理]
                if (((this.tx描画用 != null)) && (this.rAVI != null))        //クリップ無し曲での進入防止。
                {
                    Rectangle rectangle;
                    Rectangle rectangle2;

                    #region [ frameNoFromTime ]
                    int time            = (int)((CSoundManager.rcPerformanceTimer.nCurrentTime - this.n移動開始時刻ms) * (((double)CDTXMania.ConfigIni.nPlaySpeed) / 20.0));
                    int frameNoFromTime = 0;
                    if (this.bUseCAviDS)
                    {
                        frameNoFromTime = time;
                    }
                    //else
                    //    frameNoFromTime = this.rAVI.avi.GetFrameNoFromTime( time );
                    #endregion

                    if ((this.n総移動時間ms != 0) && (this.n総移動時間ms < time))
                    {
                        this.n総移動時間ms  = 0;
                        this.n移動開始時刻ms = -1L;
                    }

                    //Loop
                    if (n総移動時間ms == 0 && time >= rAVI.avi.GetDuration())
                    {
                        if (!bIsPreviewMovie && !bLoop)
                        {
                            n移動開始時刻ms = -1L;
                            //return 0;
                        }
                        else
                        {
                            n移動開始時刻ms = CSoundManager.rcPerformanceTimer.nCurrentTime;
                            time      = (int)((CSoundManager.rcPerformanceTimer.nCurrentTime - this.n移動開始時刻ms) * (((double)CDTXMania.ConfigIni.nPlaySpeed) / 20.0));
                            rAVI.avi.Seek(0);
                        }
                    }

                    if ((((this.n前回表示したフレーム番号 != frameNoFromTime) || !this.bフレームを作成した)) && (fClipアスペクト比 < 1.77f))
                    {
                        this.n前回表示したフレーム番号 = frameNoFromTime;
                        this.bフレームを作成した    = true;
                    }

                    Size  size      = new Size((int)this.framewidth, (int)this.frameheight);
                    Size  sz720pサイズ = new Size(1280, 720);
                    Size  sz開始サイズ   = new Size(this.n開始サイズW, this.n開始サイズH);
                    Size  sz終了サイズ   = new Size(this.n終了サイズW, this.n終了サイズH);
                    Point location  = new Point(this.n画像側開始位置X, this.n画像側終了位置Y);
                    Point point2    = new Point(this.n画像側終了位置X, this.n画像側終了位置Y);
                    Point point3    = new Point(this.n表示側開始位置X, this.n表示側開始位置Y);
                    Point point4    = new Point(this.n表示側終了位置X, this.n表示側終了位置Y);
                    if (CSoundManager.rcPerformanceTimer.nCurrentTime < this.n移動開始時刻ms)
                    {
                        this.n移動開始時刻ms = CSoundManager.rcPerformanceTimer.nCurrentTime;
                    }
                    if (this.n総移動時間ms == 0)
                    {
                        rectangle  = new Rectangle(location, sz開始サイズ);
                        rectangle2 = new Rectangle(point3, sz開始サイズ);
                    }
                    else
                    {
                        double db経過時間倍率 = ((double)time) / ((double)this.n総移動時間ms);
                        Size   size5    = new Size(sz開始サイズ.Width + ((int)((sz終了サイズ.Width - sz開始サイズ.Width) * db経過時間倍率)), sz開始サイズ.Height + ((int)((sz終了サイズ.Height - sz開始サイズ.Height) * db経過時間倍率)));
                        rectangle  = new Rectangle((int)((point2.X - location.X) * db経過時間倍率), (int)((point2.Y - location.Y) * db経過時間倍率), ((int)((point2.X - location.X) * db経過時間倍率)) + size5.Width, ((int)((point2.Y - location.Y) * db経過時間倍率)) + size5.Height);
                        rectangle2 = new Rectangle((int)((point4.X - point3.X) * db経過時間倍率), (int)((point4.Y - point3.Y) * db経過時間倍率), ((int)((point4.X - point3.X) * db経過時間倍率)) + size5.Width, ((int)((point4.Y - point3.Y) * db経過時間倍率)) + size5.Height);
                        if (rectangle.X < 0)
                        {
                            int num6 = -rectangle.X;
                            rectangle2.X     += num6;
                            rectangle2.Width -= num6;
                            rectangle.X       = 0;
                            rectangle.Width  -= num6;
                        }
                        if (rectangle.Y < 0)
                        {
                            int num7 = -rectangle.Y;
                            rectangle2.Y      += num7;
                            rectangle2.Height -= num7;
                            rectangle.Y        = 0;
                            rectangle.Height  -= num7;
                        }
                        if (rectangle.Right > size.Width)
                        {
                            int num8 = rectangle.Right - size.Width;
                            rectangle2.Width -= num8;
                            rectangle.Width  -= num8;
                        }
                        if (rectangle.Bottom > size.Height)
                        {
                            int num9 = rectangle.Bottom - size.Height;
                            rectangle2.Height -= num9;
                            rectangle.Height  -= num9;
                        }
                        if (rectangle2.X < 0)
                        {
                            int num10 = -rectangle2.X;
                            rectangle.X      += num10;
                            rectangle.Width  -= num10;
                            rectangle2.X      = 0;
                            rectangle2.Width -= num10;
                        }
                        if (rectangle2.Y < 0)
                        {
                            int num11 = -rectangle2.Y;
                            rectangle.Y       += num11;
                            rectangle.Height  -= num11;
                            rectangle2.Y       = 0;
                            rectangle2.Height -= num11;
                        }
                        if (rectangle2.Right > sz720pサイズ.Width)
                        {
                            int num12 = rectangle2.Right - sz720pサイズ.Width;
                            rectangle.Width  -= num12;
                            rectangle2.Width -= num12;
                        }
                        if (rectangle2.Bottom > sz720pサイズ.Height)
                        {
                            int num13 = rectangle2.Bottom - sz720pサイズ.Height;
                            rectangle.Height  -= num13;
                            rectangle2.Height -= num13;
                        }
                    }

                    if (this.bUseCAviDS)
                    {
                        if ((this.tx描画用 != null) && (this.n総移動時間ms != -1))
                        {
                            #region [ フレームの生成 ]
                            this.rAVI.avi.tGetBitmap(CDTXMania.app.Device, this.tx描画用, time);
                            #endregion

                            if (this.bFullScreen)
                            {
                                #region [ 動画の描画 ]
                                if (fClipアスペクト比 > 1.77f)
                                {
                                    this.tx描画用.tDraw2DUpsideDown(CDTXMania.app.Device, this.position, 0);
                                    //this.tx描画用.tDraw2D(CDTXMania.app.Device, this.position, 0);
                                }
                                else
                                {
                                    if (CDTXMania.ConfigIni.bDrumsEnabled)
                                    {
                                        this.tx描画用.vcScaleRatio = this.vclip;
                                        //this.tx描画用.tDraw2D( CDTXMania.app.Device, 882, 0 );
                                        this.tx描画用.tDraw2DUpsideDown(CDTXMania.app.Device, 882, 0);
                                    }
                                    else if (CDTXMania.ConfigIni.bGuitarEnabled)
                                    {
                                        this.tx描画用.vcScaleRatio = new Vector3(1f, 1f, 1f);
                                        this.PositionG          = (int)((1280f - (float)(this.framewidth)) / 2f);
                                        //this.tx描画用.tDraw2D( CDTXMania.app.Device, this.PositionG, 0 );
                                        this.tx描画用.tDraw2DUpsideDown(CDTXMania.app.Device, this.PositionG, 0);
                                    }
                                }
                                #endregion
                            }
                        }
                    }
                }


                #endregion

                if (this.bIsDuringPerformance)
                {
                    if (CDTXMania.DTX != null && CDTXMania.DTX.listBMP.Count >= 1 && CDTXMania.ConfigIni.bBGAEnabled == true)
                    {
                        if (CDTXMania.ConfigIni.bDrumsEnabled)
                        {
                            CDTXMania.stagePerfDrumsScreen.actBGA.tUpdateAndDraw(980, 0);
                        }
                        else
                        {
                            CDTXMania.stagePerfGuitarScreen.actBGA.tUpdateAndDraw(501, 0);
                        }
                    }
                }

                if (CDTXMania.ConfigIni.DisplayBonusEffects == true)
                {
                    for (int i = 0; i < 1; i++)
                    {
                        if (this.stFillIn[i].bInUse)
                        {
                            int numf = this.stFillIn[i].ctUpdate.nCurrentValue;
                            this.stFillIn[i].ctUpdate.tUpdate();
                            if (this.stFillIn[i].ctUpdate.bReachedEndValue)
                            {
                                this.stFillIn[i].ctUpdate.tStop();
                                this.stFillIn[i].bInUse = false;
                            }
                            //if ( this.txフィルインエフェクト != null )
                            CStagePerfDrumsScreen stageDrum = CDTXMania.stagePerfDrumsScreen;
                            //CStagePerfGuitarScreen stageGuitar = CDTXMania.stagePerfGuitarScreen;

                            //if( ( CDTXMania.ConfigIni.bDrumsEnabled ? stageDrum.txBonusEffect : stageGuitar.txBonusEffect ) != null )
                            {
                                //this.txフィルインエフェクト.vcScaleRatio.X = 2.0f;
                                //this.txフィルインエフェクト.vcScaleRatio.Y = 2.0f;
                                //this.txフィルインエフェクト.bAdditiveBlending = true;
                                //this.txフィルインエフェクト.tDraw2D(CDTXMania.app.Device, 0, -2, new Rectangle(0, 0 + (360 * numf), 640, 360));
                                if (CDTXMania.ConfigIni.bDrumsEnabled && stageDrum.txBonusEffect != null)
                                {
                                    stageDrum.txBonusEffect.vcScaleRatio      = new Vector3(2.0f, 2.0f, 1.0f);
                                    stageDrum.txBonusEffect.bAdditiveBlending = true;
                                    stageDrum.txBonusEffect.tDraw2D(CDTXMania.app.Device, 0, -2, new Rectangle(0, 0 + (360 * numf), 640, 360));
                                    try
                                    {
                                        //if( this.txフィルインエフェクト[ this.stFillIn[ i ].ctUpdate.nCurrentValue ] != null )
                                        //    this.txフィルインエフェクト[ this.stFillIn[ i ].ctUpdate.nCurrentValue ].tDraw2D( CDTXMania.app.Device, 0, 0 );
                                    }
                                    catch (Exception ex)
                                    {
                                    }
                                }
                            }
                        }
                    }
                }

                if (CDTXMania.ConfigIni.bShowMusicInfo && this.bIsDuringPerformance)
                {
                    this.actPanel.tUpdateAndDraw();
                }

                if (((this.bWindowMode) && this.tx描画用 != null && (CDTXMania.ConfigIni.bAVIEnabled)))
                {
                    this.vector              = this.tx描画用.vcScaleRatio;
                    this.tx描画用.vcScaleRatio  = this.smallvc;
                    this.tx描画用.nTransparency = 0xff;

                    if (CDTXMania.ConfigIni.bDrumsEnabled)
                    {
                        if (CDTXMania.ConfigIni.bGraph有効.Drums)
                        {
                            #region [ スキルメーター有効 ]
                            this.n本体X = 2;
                            this.n本体Y = 402;

                            if (this.fClipアスペクト比 > 0.96f)
                            {
                                this.ratio2    = 260f / ((float)this.framewidth);
                                this.position2 = 20 + this.n本体Y + (int)((270f - (this.frameheight * this.ratio2)) / 2f);
                            }
                            else
                            {
                                this.ratio2    = 270f / ((float)this.frameheight);
                                this.position2 = 5 + this.n本体X + (int)((260 - (this.framewidth * this.ratio2)) / 2f);
                            }
                            if (this.txクリップパネル != null)
                            {
                                this.txクリップパネル.tDraw2D(CDTXMania.app.Device, this.n本体X, this.n本体Y);
                            }

                            this.smallvc = new Vector3(this.ratio2, this.ratio2, 1f);

                            {
                                if (this.n総移動時間ms != -1 && this.rAVI != null)
                                {
                                    if (this.fClipアスペクト比 < 0.96f)
                                    {
                                        this.tx描画用.tDraw2DUpsideDown(CDTXMania.app.Device, this.position2, 20 + this.n本体Y);
                                    }
                                    else
                                    {
                                        this.tx描画用.tDraw2DUpsideDown(CDTXMania.app.Device, 5 + this.n本体X, this.position2);
                                    }
                                }
                            }
                        }
                        #endregion
                        else
                        {
                            #region [ スキルメーター無効 ]
                            this.n本体X = 854;
                            this.n本体Y = 142;

                            if (this.fClipアスペクト比 > 1.77f)
                            {
                                this.ratio2    = 416f / ((float)this.framewidth);
                                this.position2 = 30 + this.n本体Y + (int)((234f - (this.frameheight * this.ratio2)) / 2f);
                            }
                            else
                            {
                                this.ratio2    = 234f / ((float)this.frameheight);
                                this.position2 = 5 + this.n本体X + (int)((416f - (this.framewidth * this.ratio2)) / 2f);
                            }
                            if (this.txクリップパネル != null)
                            {
                                this.txクリップパネル.tDraw2D(CDTXMania.app.Device, this.n本体X, this.n本体Y);
                            }
                            this.smallvc            = new Vector3(this.ratio2, this.ratio2, 1f);
                            this.tx描画用.vcScaleRatio = this.smallvc;
                            {
                                if (this.n総移動時間ms != -1 && this.rAVI != null)
                                {
                                    if (this.fClipアスペクト比 < 1.77f)
                                    {
                                        this.tx描画用.tDraw2DUpsideDown(CDTXMania.app.Device, this.position2, 30 + this.n本体Y);
                                    }
                                    else
                                    {
                                        this.tx描画用.tDraw2DUpsideDown(CDTXMania.app.Device, 5 + this.n本体X, this.position2);
                                    }
                                }
                            }
                            #endregion
                        }
                    }
                    else if (CDTXMania.ConfigIni.bGuitarEnabled)
                    {
                        #region [ ギター時 ]
                        #region [ 本体位置 ]
                        this.n本体X = 380;
                        this.n本体Y = 50;
                        int nグラフX = 267;

                        if (CDTXMania.ConfigIni.bGraph有効.Bass && CDTXMania.DTX != null && !CDTXMania.DTX.bチップがある.Bass)
                        {
                            this.n本体X = this.n本体X + nグラフX;
                        }
                        if (CDTXMania.ConfigIni.bGraph有効.Guitar && CDTXMania.DTX != null && !CDTXMania.DTX.bチップがある.Guitar)
                        {
                            this.n本体X = this.n本体X - nグラフX;
                        }
                        #endregion

                        if (this.fClipアスペクト比 > 1.77f)
                        {
                            this.ratio2    = 460f / ((float)this.framewidth);
                            this.position2 = 5 + this.n本体Y + (int)((258f - (this.frameheight * this.ratio2)) / 2f);
                        }
                        else
                        {
                            this.ratio2    = 258f / ((float)this.frameheight);
                            this.position2 = 30 + this.n本体X + (int)((460f - (this.framewidth * this.ratio2)) / 2f);
                        }
                        if (this.txクリップパネル != null)
                        {
                            this.txクリップパネル.tDraw2D(CDTXMania.app.Device, this.n本体X, this.n本体Y);
                        }
                        this.smallvc            = new Vector3(this.ratio2, this.ratio2, 1f);
                        this.tx描画用.vcScaleRatio = this.smallvc;

                        {
                            if (this.rAVI != null)
                            {
                                if (this.fClipアスペクト比 < 1.77f)
                                {
                                    this.tx描画用.tDraw2D(CDTXMania.app.Device, this.position2, 5 + this.n本体Y);
                                }
                                else
                                {
                                    this.tx描画用.tDraw2D(CDTXMania.app.Device, 30 + this.n本体X, this.position2);
                                }
                            }
                        }
                        #endregion
                    }
                    this.tx描画用.vcScaleRatio = this.vector;
                }
                IInputDevice keyboard = CDTXMania.InputManager.Keyboard;
                if (CDTXMania.Pad.bPressed(EInstrumentPart.BASS, EPad.Help))
                {
                    if (this.b再生トグル == false)
                    {
                        if (this.bUseCAviDS)
                        {
                            if (this.rAVI != null && this.rAVI.avi != null)
                            {
                                this.rAVI.avi.Pause();
                            }
                        }
                        this.b再生トグル = true;
                    }
                    else if (this.b再生トグル == true)
                    {
                        if (this.bUseCAviDS)
                        {
                            if (this.rAVI != null && this.rAVI.avi != null)
                            {
                                this.rAVI.avi.Run();
                            }
                        }
                        this.b再生トグル = false;
                    }
                }
            }

            return(0);
        }
예제 #24
0
 public PlayerController(IInputDevice device)
 {
     _device = device;
 }
예제 #25
0
 public NAudioMidiPublisher(IInputDevice inputDevice)
 {
     _device = inputDevice;
 }
예제 #26
0
        }                                   // if applicable, axis for instance..

        public InputDeviceEvent(IInputDevice d, int en, bool p, int v = 0)
        {
            Device = d; EventNumber = en; Pressed = p; Value = v;
        }
예제 #27
0
 /// <summary>
 /// コンテンツを読み込みます。
 /// </summary>
 public virtual void LoadContent()
 {
     inputDevice = screenContext.GetRequiredService<IInputDeviceService>().InputDevice;
     localContent = new ContentManager(screenContext, "Content");
 }
예제 #28
0
 public RadioButton(IScreen screen, IInputDevice inputDevice, int top, int bottom, int left, int right)
     : base(screen, inputDevice, top, bottom, left, right)
 {
 }
예제 #29
0
파일: Menu.cs 프로젝트: ylyking/Myre
 private void PreviousOption(IGesture gesture, GameTime time, IInputDevice device)
 {
     PreviousOption();
 }
예제 #30
0
 public RadioButton(IScreenObject parent, IInputDevice inputDevice, int top, int bottom, int left, int right)
     : base(parent, inputDevice, top, bottom, left, right)
 {
 }
 public InputDeviceScreenDragSession(IInputDevice inputDevice)
 {
     _inputDevice = inputDevice;
 }
예제 #32
0
 bool IGesture.Test(IInputDevice device)
 {
     return(Test((Device)device));
 }
예제 #33
0
 public ForceFeedbackTarget(IInputDevice inputDevice, string name, int offset)
 {
     this.inputDevice = inputDevice;
     this.name        = name;
     this.offset      = offset;
 }
예제 #34
0
 /// <summary>
 /// C
 /// </summary>
 /// <param name="device"></param>
 public InputDiagnostics(IInputDevice device)
 {
     this.device = device;
 }
예제 #35
0
파일: Button.cs 프로젝트: ylyking/Myre
 private void Select(IGesture gesture, GameTime time, IInputDevice device)
 {
     OnSelected();
 }
예제 #36
0
 public static MouseSource FromButton(IInputDevice device, DeviceObjectInstance instance, int index)
 {
     return(new MouseSource(device, "Button " + instance.Usage, SourceTypes.Button, instance.Offset, state => state.Buttons[index] ? 1 : 0));
 }
예제 #37
0
        public override void Initialize()
        {
            // IInputDevice を取得します。
            inputDevice = debugContext.GetRequiredService<IInputDeviceService>().InputDevice;

            base.Initialize();
        }
예제 #38
0
        public static MouseSource FromSlider(IInputDevice device, DeviceObjectInstance instance, int index)
        {
            string name = instance.Name;

            return(new MouseSource(device, name, SourceTypes.Slider, instance.Offset, state => GetSliderValue(state, index + 1) / (double)ushort.MaxValue));
        }
예제 #39
0
 private void OnNextCommand(IGesture gesture, GameTime gameTime, IInputDevice device)
 {
     if (_commandScrollPointer != null)
     {
         if (_commandScrollPointer.Next != null)
         {
             _commandScrollPointer = _commandScrollPointer.Next;
             WritePreviousCommand();
         }
         else
         {
             _textBox.Text = "";
             _commandScrollPointer = null;
         }
     }
 }
예제 #40
0
 public MouseSource(IInputDevice inputDevice, string name, SourceTypes type, int offset, Func <JoystickState, double> valueGetter) : base(inputDevice, name, type, offset)
 {
     this.valueGetter = valueGetter;
 }
예제 #41
0
 public void AddInputDevice(int port, IInputDevice device)
 {
     if (_inputDevices.ContainsKey(port))
     {
         _inputDevices.Remove(port);
     }
     _inputDevices.Add(port, device);
 }
예제 #42
0
 public RawInputSource(IInputDevice inputDevice, string name, SourceTypes type, int usage, Func <Dictionary <Usage, DataValue>, double?> getNewValue) : base(inputDevice, name, type, usage)
 {
     this.getNewValue = getNewValue;
 }
예제 #43
0
 public IBuildMonitor Create(IInputDevice device)
 {
     return monitorFactory(device);
 }
예제 #44
0
        public static RawInputSource[] FromUsage(IInputDevice device, Usage usage)
        {
            switch (usage)
            {
            case Usage.GenericDesktopX:
                return(new RawInputSource[] { new RawInputSource(device, "X axis", SourceTypes.AxisX, usage,
                                                                 (changes) => GetValueFromChanges(changes, usage)) });

            case Usage.GenericDesktopRx:
                return(new RawInputSource[] { new RawInputSource(device, "Rx axis", SourceTypes.AxisX, usage,
                                                                 (changes) => GetValueFromChanges(changes, usage)) });

            case Usage.GenericDesktopY:
                return(new RawInputSource[] { new RawInputSource(device, "Y axis", SourceTypes.AxisY, usage,
                                                                 (changes) => GetValueFromChanges(changes, usage)) });

            case Usage.GenericDesktopRy:
                return(new RawInputSource[] { new RawInputSource(device, "Ry axis", SourceTypes.AxisY, usage,
                                                                 (changes) => GetValueFromChanges(changes, usage)) });

            case Usage.GenericDesktopZ:
                return(new RawInputSource[] { new RawInputSource(device, "Z axis", SourceTypes.AxisZ, usage,
                                                                 (changes) => GetValueFromChanges(changes, usage)) });

            case Usage.GenericDesktopRz:
                return(new RawInputSource[] { new RawInputSource(device, "Rz axis", SourceTypes.AxisZ, usage,
                                                                 (changes) => GetValueFromChanges(changes, usage)) });

            case Usage.Button1:
            case Usage.Button2:
            case Usage.Button3:
            case Usage.Button4:
            case Usage.Button5:
            case Usage.Button6:
            case Usage.Button7:
            case Usage.Button8:
            case Usage.Button9:
            case Usage.Button10:
            case Usage.Button11:
            case Usage.Button12:
            case Usage.Button13:
            case Usage.Button14:
            case Usage.Button15:
            case Usage.Button16:
            case Usage.Button17:
            case Usage.Button18:
            case Usage.Button19:
            case Usage.Button20:
            case Usage.Button21:
            case Usage.Button22:
            case Usage.Button23:
            case Usage.Button24:
            case Usage.Button25:
            case Usage.Button26:
            case Usage.Button27:
            case Usage.Button28:
            case Usage.Button29:
            case Usage.Button30:
            case Usage.Button31:
                return(new RawInputSource[] { new RawInputSource(device, "Button " + (usage - Usage.Button1 + 1), SourceTypes.Button, usage,
                                                                 (changes) => GetValueFromChanges(changes, usage)) });

            case Usage.GenericDesktopHatSwitch:
                return(new RawInputSource[] {
                    new RawInputSource(device, "DPad Up", SourceTypes.Dpad, 100000,
                                       (changes) => HasDirection(changes, DPadDirection.Up)),
                    new RawInputSource(device, "DPad Down", SourceTypes.Dpad, 100001,
                                       (changes) => HasDirection(changes, DPadDirection.Down)),
                    new RawInputSource(device, "DPad Left", SourceTypes.Dpad, 100002,
                                       (changes) => HasDirection(changes, DPadDirection.Left)),
                    new RawInputSource(device, "DPad Right", SourceTypes.Dpad, 100003,
                                       (changes) => HasDirection(changes, DPadDirection.Right)),
                });

            case Usage.GenericDesktopSlider:
            case Usage.GenericDesktopDial:
            case Usage.GenericDesktopWheel:
                return(new RawInputSource[] { new RawInputSource(device, usage.ToString(), SourceTypes.Slider, usage,
                                                                 (changes) => GetValueFromChanges(changes, usage)) });

            default:
                return(new RawInputSource[0]);
            }
        }
예제 #45
0
파일: Menu.cs 프로젝트: ylyking/Myre
 private void NextOption(IGesture gesture, GameTime time, IInputDevice device)
 {
     NextOption();
 }
예제 #46
0
 public DeviceInputChangedEventArgs(IInputDevice device)
 {
     this.device   = device;
     changedValues = new InputSource[0];
 }
예제 #47
0
 public void DisconnectController()
 {
     inputDevice = null;
     m_Marker.SetActive(false);
 }
예제 #48
0
 public static bool IsLockingRequiredForDispose(this IInputDevice inputDevice)
 {
     return(inputDevice.GetType().GetMethod("Dispose").GetCustomAttribute <LockingRequiredAttribute>()?.IsLockingRequired ?? true);
 }
예제 #49
0
        public TabletConnection(IInputDevice tablet)
        {
            Tablet = tablet;

              Settings = new TabletSettings();
        }
예제 #50
0
        public bool Create()
        {
            Debug.Assert( _isCreated == false );
            if( _isCreated == true )
                return true;

            _shutDown = false;
            _state = InstanceState.Idle;

            // Try to create all the components
            Debug.Assert( _params.BiosComponent != null );
            Debug.Assert( _params.CpuComponent != null );
            if( _params.AudioComponent != null )
            {
                _audio = _params.AudioComponent.CreateInstance( this, _params[ _params.AudioComponent ] ) as IAudioDriver;
                _instances.Add( ( IComponentInstance )_audio );
            }
            _cpu = _params.CpuComponent.CreateInstance( this, _params[ _params.CpuComponent ] ) as ICpu;
            _instances.Add( ( IComponentInstance )_cpu );
            _bios = _params.BiosComponent.CreateInstance( this, _params[ _params.BiosComponent ] ) as IBios;
            _instances.Add( ( IComponentInstance )_bios );
            foreach( IComponent component in _params.IOComponents )
            {
                IIODriver driver = component.CreateInstance( this, _params[ component ] ) as IIODriver;
                _io.Add( driver );
                _instances.Add( ( IComponentInstance )driver );
            }
            if( _params.InputComponent != null )
            {
                _input = _params.InputComponent.CreateInstance( this, _params[ _params.InputComponent ] ) as IInputDevice;
                _instances.Add( _input );
                _input.WindowHandle = _host.Player.Handle;
            }
            if( _params.UmdComponent != null )
            {
                _umd = _params.UmdComponent.CreateInstance( this, _params[ _params.UmdComponent ] ) as IUmdDevice;
                _instances.Add( _umd );
            }
            if( _params.MemoryStickComponent != null )
            {
                _memoryStick = _params.MemoryStickComponent.CreateInstance( this, _params[ _params.MemoryStickComponent ] ) as IMemoryStickDevice;
                _instances.Add( _memoryStick );
            }
            if( _params.VideoComponent != null )
            {
                _video = _params.VideoComponent.CreateInstance( this, _params[ _params.VideoComponent ] ) as IVideoDriver;
                _video.ControlHandle = _host.Player.ControlHandle;
                _instances.Add( ( IComponentInstance )_video );
            }

            #if XMB
            _xmb = new CrossMediaBar.Manager( this, _host.Player.Handle, _host.Player.ControlHandle );
            #else
            #endif

            // Create thread
            _thread = new Thread( new ThreadStart( this.RuntimeThread ) );
            _thread.Name = "Host runtime thread";
            _thread.IsBackground = true;
            _thread.Start();

            _isCreated = true;

            return true;
        }
예제 #51
0
 public DeviceInfo(GameObject deviceObject, IInputDevice inputDevice)
 {
     this.deviceObject = deviceObject;
     this.inputDevice  = inputDevice;
     transform         = deviceObject.transform;
 }
예제 #52
0
 public MouseSource(IInputDevice inputDevice, string name, int offset) : base(inputDevice, name, SourceTypes.Button, offset)
 {
 }
예제 #53
0
파일: Chip8Cpu.cs 프로젝트: JerreS/Chip8Emu
 public Chip8Cpu(IGraphicsDevice graphicsDevice, IInputDevice inputDevice)
 {
     Graphics = graphicsDevice;
     Input = inputDevice;
 }
예제 #54
0
 public UIMap(ISettingsStore settings, IWindowFinder windowFinder, IOCRReader ocr, IInputDevice input, IScreen screen)
 {
     Settings     = settings;
     WindowFinder = windowFinder;
     OCR          = ocr;
     InputDevice  = input;
     Screen       = screen;
 }
예제 #55
0
 private void PreviousOption(IGesture gesture, GameTime time, IInputDevice device)
 {
     SelectedOption--;
 }
예제 #56
0
 public PopulationAndProductionWindow(IScreen screen, IWindowFinder windowFinder, IInputDevice inputDevice, IOCRReader ocr, ISettingsStore settings)
     : base("Population and Production", screen, windowFinder, inputDevice, settings)
 {
     ResearchTable = new Datagrid(this, inputDevice, ocr, 406, 613, new [] { 406, 687, 754, 776 })
     {
         LineHeight            = 16,
         TopOfCharactersOffset = 3,
         Settings = PrintSettings.NewResearchTable
     };
     AvailableScientistsTable = new Datagrid(this, inputDevice, ocr, 406, 613, new[] { 790, 909, 1056, 1184 })
     {
         LineHeight            = 16,
         TopOfCharactersOffset = 3,
         Settings = PrintSettings.AvailableScientistTable
     };
     ConstructionOptions = new Datagrid(this, inputDevice, ocr, 245, 669, new [] { 398, 599 })
     {
         LineHeight            = 16,
         TopOfCharactersOffset = 3
     };
     AllocatedLabs = new Textbox(this, inputDevice, ocr, left: 885, right: 929, top: 357, bottom: 371)
     {
         CharacterOffset = 3,
         CharacterHeight = 9,
         Colors          = new[] { new byte[] { 0, 0, 0 } }
     };
     AvailableLabs = new Textbox(this, inputDevice, ocr, left: 1037, right: 1073, top: 357, bottom: 371)
     {
         CharacterOffset = 3,
         CharacterHeight = 9,
         Colors          = new[] { new byte[] { 109, 109, 109 } }
     };
     NumberOfIndustrialProject = new Textbox(this, inputDevice, ocr, left: 725, right: 769, top: 696, bottom: 710)
     {
         CharacterOffset = 3,
         CharacterHeight = 9,
         Colors          = new[] { new byte[] { 0, 0, 0 } }
     };
     CreateIndustrialProject = new Button(this, inputDevice, left: 635, right: 707, top: 730, bottom: 754);
     InstallationType        = new Combobox(this, inputDevice, ocr, left: 501, right: 801, top: 180, bottom: 196)
     {
         CharacterOffset = 4,
         CharacterHeight = 9,
         Colors          = new[] { new byte[] { 0, 0, 0 } }
     };
     ContractAmount = new Textbox(this, inputDevice, ocr, left: 501, right: 553, top: 220, bottom: 234)
     {
         CharacterOffset = 3,
         CharacterHeight = 9,
         Colors          = new[] { new byte[] { 0, 0, 0 } }
     };
     CivilianContractSupply = new RadioButton(this, inputDevice, left: 696, right: 707, top: 220, bottom: 231);
     CivilianContractDemand = new RadioButton(this, inputDevice, left: 784, right: 795, top: 221, bottom: 232);
     AddCivilianContract    = new Button(this, inputDevice, left: 411, right: 491, top: 514, bottom: 538);
     Populations            = new TreeList(this, inputDevice, ocr, left: 21, right: 361, top: 100, bottom: 807);
     Populations.Refresh   += (sender, args) =>
     {
         MakeActive();
         Empire.SelectOption(1);
     };
     PurchaseMineralOutput = new RadioButton(this, inputDevice, left: 536, right: 547, top: 804, bottom: 815);
     MassDriverDestination = new Combobox(this, inputDevice, ocr, left: 1005, right: 1184, top: 156, bottom: 172)
     {
         CharacterOffset = 4,
         CharacterHeight = 9,
         Colors          = new[] { new byte[] { 0, 0, 0 } }
     };
     Empire = new Combobox(this, inputDevice, ocr, left: 19, right: 363, top: 46, bottom: 66)
     {
         CharacterOffset = 6,
         CharacterHeight = 11,
         Colors          = new[] { new byte[] { 0, 0, 0 } }
     };
     CurrentResearchProject = new Datagrid(this, inputDevice, ocr, 193, 289, new[] { 399, 632, 799, 859, 929, 999, 1132, 1158 })
     {
         LineHeight            = 16,
         TopOfCharactersOffset = 3
     };
     RemoveRL               = new Button(this, inputDevice, left: 683, right: 763, top: 299, bottom: 323);
     AddRL                  = new Button(this, inputDevice, left: 587, right: 667, top: 299, bottom: 323);
     NumberOfLabs           = new Label(this, inputDevice, ocr, left: 515, right: 541, top: 140, bottom: 148);
     MatchingScientistsOnly = new RadioButton(this, inputDevice, left: 740, right: 750, top: 362, bottom: 372);
 }
예제 #57
0
 private void NextOption(IGesture gesture, GameTime time, IInputDevice device)
 {
     SelectedOption++;
 }
예제 #58
0
파일: Button.cs 프로젝트: ylyking/Myre
 private void MouseUp(IGesture gesture, GameTime time, IInputDevice device)
 {
     if (!RespondOnMouseDown && _mouseDown)
         OnSelected();
 }
예제 #59
0
 public void ChangeConnection(IInputDevice device, bool connected)
 => ConnectionChanged?.Invoke(device, connected);
예제 #60
0
 public void Execute(IInputDevice inputDevice, int elapsedMs)
 {
     inputDevice.InjectPointer(pointerData: this.pointerData);
 }