public Command GetInputDown(PCInputBinding binding) { if (binding.Key != Keys.None) { return(this.GetKeyDown(binding.Key)); } else if (binding.MouseButton != MouseButton.None) { switch (binding.MouseButton) { case MouseButton.LeftMouseButton: return(this.LeftMouseButtonDown); case MouseButton.MiddleMouseButton: return(this.MiddleMouseButtonDown); case MouseButton.RightMouseButton: return(this.RightMouseButtonDown); default: return(null); } } else { return(this.GetButtonDown(binding.GamePadButton)); } }
public bool GetInput(PCInputBinding binding) { bool result = false; if (binding.Key != Keys.None) { result |= this.GetKey(binding.Key); } switch (binding.MouseButton) { case MouseButton.LeftMouseButton: result |= this.LeftMouseButton; break; case MouseButton.MiddleMouseButton: result |= this.MiddleMouseButton; break; case MouseButton.RightMouseButton: result |= this.RightMouseButton; break; default: break; } if (binding.GamePadButton != 0) { result |= this.GetButton(binding.GamePadButton); } return(result); }
public Command GetInputUp(PCInputBinding binding) { if (binding.Key != Keys.None) return this.GetKeyUp(binding.Key); else { switch (binding.MouseButton) { case MouseButton.LeftMouseButton: return this.LeftMouseButtonUp; case MouseButton.MiddleMouseButton: return this.MiddleMouseButtonUp; case MouseButton.RightMouseButton: return this.RightMouseButtonUp; default: return null; } } }
public Property<bool> GetInput(PCInputBinding binding) { if (binding.Key != Keys.None) return this.GetKey(binding.Key); else { switch (binding.MouseButton) { case MouseButton.LeftMouseButton: return this.LeftMouseButton; case MouseButton.MiddleMouseButton: return this.MiddleMouseButton; case MouseButton.RightMouseButton: return this.RightMouseButton; default: return null; } } }