예제 #1
0
        public bool HasBindingTo(InputID input)
        {
            foreach (InputBindingElement binding in this)
            {
                if (binding.Input == input) { return true; }
            }

            return false;
        }
예제 #2
0
        public Input GetInput(string deviceName, string inputName)
        {
            InputID key = new InputID(_name, deviceName, inputName);

            try
            {
                return _inputDictionary[key];
            }
            catch
            {
                throw new ArgumentException("Input " + _name + deviceName + inputName + " not found.");
            }
        }
예제 #3
0
 public Input(InputID id, InputDimensionality dimensionality, InputScale scale, InputSemantic semantic)
 {
     _id = id;
     _dimensionality = dimensionality;
     _scale = scale;
     _semantic = semantic;
 }
예제 #4
0
        protected override void OnLoad(EventArgs e)
        {
            Rectangle screenRect = Screen.GetWorkingArea(this);
            Left = screenRect.Left + (screenRect.Width - Width) / 2;
            Top = screenRect.Top + (screenRect.Height - Height) / 2;

            DialogResult = DialogResult.None;

            _aggregator = new InputAggregator();
            _aggregator.AddDriver(new RawInputDriver(this));

            _aggregator.ReportNextInput(_predicate, (i) =>
            {
                _inputID = i.ID;
                DialogResult = DialogResult.OK;
                Close();
            });

            base.OnLoad(e);
        }