/// <inheritdoc/>
        public override Boolean UsesSameButtons(InputBinding binding)
        {
            if (ReferenceEquals(binding, null)) return false;
            if (ReferenceEquals(binding, this)) return true;

            var gpib = binding as GamePadInputBinding;
            if (gpib != null)
            {
                return
                    this.PlayerIndex == gpib.PlayerIndex &&
                    this.Button == gpib.Button;
            }

            return false;
        }
Esempio n. 2
0
 /// <summary>
 /// Gets a value indicating whether the input binding uses the same device 
 /// and the same primary buttons as the specified input binding.
 /// </summary>
 /// <param name="binding">The <see cref="InputBinding"/> to compare against this input binding.</param>
 /// <returns><c>true</c> if the specified input binding uses the same device and the same primary 
 /// buttons as this input binding; otherwise, <c>false</c>.</returns>
 public abstract Boolean UsesSamePrimaryButtons(InputBinding binding);
        /// <summary>
        /// Gets a value indicating whether the input binding uses the same device 
        /// and the same primary buttons as the specified input binding.
        /// </summary>
        /// <param name="binding">The <see cref="InputBinding"/> to compare against this input binding.</param>
        /// <returns><c>true</c> if the specified input binding uses the same device and the same primary 
        /// buttons as this input binding; otherwise, <c>false</c>.</returns>
        public override Boolean UsesSamePrimaryButtons(InputBinding binding)
        {
            if (ReferenceEquals(binding, null)) return false;
            if (ReferenceEquals(binding, this)) return true;

            var kbib = binding as KeyboardInputBinding;
            if (kbib != null)
            {
                return 
                    this.Keyboard == kbib.Keyboard &&
                    this.Key == kbib.Key;
            }

            return false;
        }
        /// <summary>
        /// Gets a value indicating whether the input binding uses the same device 
        /// and the same button configuration as the specified input binding.
        /// </summary>
        /// <param name="binding">The <see cref="InputBinding"/> to compare against this input binding.</param>
        /// <returns><c>true</c> if the specified input binding uses the same device and the same button 
        /// configuration as this input binding; otherwise, <c>false</c>.</returns>
        public override Boolean UsesSameButtons(InputBinding binding)
        {
            if (ReferenceEquals(binding, null)) return false;
            if (ReferenceEquals(binding, this)) return true;

            var kbib = binding as KeyboardInputBinding;
            if (kbib != null)
            {
                return
                    this.Keyboard == kbib.Keyboard &&
                    this.Key == kbib.Key &&
                    this.IsControlRequired == kbib.IsControlRequired &&
                    this.IsAltRequired == kbib.IsAltRequired &&
                    this.IsShiftRequired == kbib.IsShiftRequired;
            }

            return false;
        }
Esempio n. 5
0
 /// <summary>
 /// Gets a value indicating whether the input binding uses the same device 
 /// and the same primary buttons as the specified input binding.
 /// </summary>
 /// <param name="binding">The input binding to compare against this input binding.</param>
 /// <returns>true if the specified input binding uses the same device and the same primary 
 /// buttons as this input binding; otherwise, false.</returns>
 public override Boolean UsesSamePrimaryButtons(InputBinding binding)
 {
     return false;
 }
Esempio n. 6
0
        /// <summary>
        /// Unregisters the specified input binding.
        /// </summary>
        /// <param name="binding">The input binding to unregister.</param>
        private void Unregister(InputBinding binding)
        {
            if (binding == null)
                return;

            if (binding == pressed)
            {
                released = true;
                pressed = null;
                OnReleased();
            }

            binding.AdjustPriority(null);
            collection.UnregisterBinding(binding);
        }
Esempio n. 7
0
        /// <summary>
        /// Registers the specified binding.
        /// </summary>
        /// <param name="binding">The input binding to register.</param>
        private void Register(InputBinding binding)
        {
            if (binding == null)
                return;

            binding.AdjustPriority(priorityAdjustment);
            collection.RegisterBinding(binding);
        }
        /// <summary>
        /// Gets a value indicating whether the input binding uses the same device 
        /// and the same primary buttons as the specified input binding.
        /// </summary>
        /// <param name="binding">The <see cref="InputBinding"/> to compare against this input binding.</param>
        /// <returns><c>true</c> if the specified input binding uses the same device and the same primary 
        /// buttons as this input binding; otherwise, <c>false</c>.</returns>
        public override Boolean UsesSamePrimaryButtons(InputBinding binding)
        {
            if (ReferenceEquals(binding, null)) return false;
            if (ReferenceEquals(binding, this)) return true;

            var mib = binding as MouseInputBinding;
            if (mib != null)
            {
                return
                    this.Mouse == mib.Mouse &&
                    this.Button == mib.Button;
            }

            return false;
        }
        /// <summary>
        /// Gets a value indicating whether the input binding uses the same device 
        /// and the same button configuration as the specified input binding.
        /// </summary>
        /// <param name="binding">The <see cref="InputBinding"/> to compare against this input binding.</param>
        /// <returns><c>true</c> if the specified input binding uses the same device and the same button 
        /// configuration as this input binding; otherwise, <c>false</c>.</returns>
        public override Boolean UsesSameButtons(InputBinding binding)
        {
            if (ReferenceEquals(binding, null)) return false;
            if (ReferenceEquals(binding, this)) return true;

            var mib = binding as MouseInputBinding;
            if (mib != null)
            {
                return
                    this.Mouse == mib.Mouse &&
                    this.Button == mib.Button &&
                    this.IsControlRequired == mib.IsControlRequired &&
                    this.IsAltRequired == mib.IsAltRequired &&
                    this.IsShiftRequired == mib.IsShiftRequired;
            }

            return false;
        }
Esempio n. 10
0
 /// <summary>
 /// Gets a value indicating whether the input binding uses the same device
 /// and the same primary buttons as the specified input binding.
 /// </summary>
 /// <param name="binding">The input binding to compare against this input binding.</param>
 /// <returns>true if the specified input binding uses the same device and the same primary
 /// buttons as this input binding; otherwise, false.</returns>
 public override Boolean UsesSamePrimaryButtons(InputBinding binding)
 {
     return(false);
 }
 /// <summary>
 /// Removes a binding from the group.
 /// </summary>
 /// <param name="binding">The <see cref="InputBinding"/> to remove from the group.</param>
 /// <returns><see langword="true"/> if the binding was removed from the group; otherwise, <see langword="false"/>.</returns>
 public Boolean Remove(InputBinding binding)
 {
     return(bindings.Remove(binding));
 }