コード例 #1
0
		private bool FocusHookFilter(InputEventMessageRedirector.MessageType type, EventArgs e)
		{
			if (Sandbox.State == SandboxState.Playing)
			{
				// Don't capture keys in sandbox mode. They're likely to be needed in the current Game View
				if (type == InputEventMessageRedirector.MessageType.KeyDown) return false;
			}
			
			return true;
		}
コード例 #2
0
		private void InstallFocusHook()
		{
			if (this.glControl.Focused) return;

			// Hook global message filter
			if (this.waitForInputFilter == null)
			{
				this.waitForInputFilter = new InputEventMessageRedirector(this.glControl, this.FocusHookFilter,
					InputEventMessageRedirector.MessageType.MouseWheel, 
					InputEventMessageRedirector.MessageType.KeyDown);
				Application.AddMessageFilter(this.waitForInputFilter);
			}
		}
コード例 #3
0
		private void RemoveFocusHook()
		{
			// Remove global message filter
			if (this.waitForInputFilter != null)
			{
				Application.RemoveMessageFilter(this.waitForInputFilter);
				this.waitForInputFilter = null;
			}
		}
コード例 #4
0
ファイル: CamView.cs プロジェクト: Banbury/duality
		private bool FocusHookFilter(InputEventMessageRedirector.MessageType type, EventArgs e)
		{
			// Don't capture stuff in sandbox mode. Input is likely to be needed in the current Game View
			if (Sandbox.State == SandboxState.Playing)
				return false;
			
			return true;
		}