示例#1
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);
        }
示例#2
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);
        }