WindowsApplication.RemoveLowLevelMouseFilter

WindowsApplication.RemoveLowLevelMouseFilter

#Overview

name: WindowsApplication.RemoveLowLevelMouseFilter

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of WindowsApplication.RemoveLowLevelMouseFilter is to remove a low-level mouse filter that filters out mouse inputs that act like touch inputs in the Windows application environment of Unreal Engine.

This setting variable is primarily used by the Windows-specific application subsystem within Unreal Engine’s ApplicationCore module. It’s part of the input handling system for Windows platforms.

The value of this variable is not directly set as a traditional variable. Instead, it’s registered as a console command that can be executed at runtime. The command is registered in the FWindowsApplication constructor and can be called to remove the low-level mouse filter.

This variable interacts with its counterpart, WindowsApplication.ApplyLowLevelMouseFilter, which applies the filter. They work together to toggle the low-level mouse input filtering.

Developers must be aware of several things when using this variable:

  1. It’s specifically for Windows platforms.
  2. It’s implemented as a console command, not a traditional variable.
  3. It affects how mouse inputs are processed, potentially impacting touch-like inputs.
  4. It’s automatically removed when the application is destroyed or shuts down after an error.

Best practices when using this variable include:

  1. Use it in conjunction with WindowsApplication.ApplyLowLevelMouseFilter to toggle the filter as needed.
  2. Be cautious when using it in the editor, as it may interfere with digitizer devices.
  3. Consider the implications on touch-like inputs when removing the filter.
  4. Be aware that it’s automatically removed on application shutdown, so manual removal may not always be necessary.
  5. Use it primarily in game scenarios, as indicated by the check for FApp::IsGame() in the ApplyLowLevelMouseFilter function.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/ApplicationCore/Private/Windows/WindowsApplication.cpp:231

Scope (from outer to inner):

file
function     FWindowsApplication::FWindowsApplication

Source code excerpt:

	}	
	IConsoleManager::Get().RegisterConsoleCommand(TEXT("WindowsApplication.ApplyLowLevelMouseFilter"), TEXT("Applies Low Level mouse filter that filters out mouse inputs that act like touch inputs"), FConsoleCommandDelegate::CreateRaw(this, &FWindowsApplication::ApplyLowLevelMouseFilter));
	IConsoleManager::Get().RegisterConsoleCommand(TEXT("WindowsApplication.RemoveLowLevelMouseFilter"), TEXT("Removes Low Level mouse filter that filters out mouse inputs that act like touch inputs"), FConsoleCommandDelegate::CreateRaw(this, &FWindowsApplication::RemoveLowLevelMouseFilter));
}

void FWindowsApplication::ApplyLowLevelMouseFilter()
{
	//Only check fake mouse inputs in game or digitizer devices will not work in the editor.
	if (FApp::IsGame() && !bLowLevelMouseFilterIsApplied)

#Loc: <Workspace>/Engine/Source/Runtime/ApplicationCore/Private/Windows/WindowsApplication.cpp:309

Scope (from outer to inner):

file
function     void FWindowsApplication::DestroyApplication

Source code excerpt:

	RemoveLowLevelMouseFilter();
	IConsoleManager::Get().UnregisterConsoleObject(TEXT("WindowsApplication.ApplyLowLevelMouseFilter"));
	IConsoleManager::Get().UnregisterConsoleObject(TEXT("WindowsApplication.RemoveLowLevelMouseFilter"));
}

void FWindowsApplication::ShutDownAfterError()
{
	// Restore accessibility shortcuts and remove the saved state from the .ini
	AllowAccessibilityShortcutKeys(true);

#Loc: <Workspace>/Engine/Source/Runtime/ApplicationCore/Private/Windows/WindowsApplication.cpp:322

Scope (from outer to inner):

file
function     void FWindowsApplication::ShutDownAfterError

Source code excerpt:

	RemoveLowLevelMouseFilter();
	IConsoleManager::Get().UnregisterConsoleObject(TEXT("WindowsApplication.ApplyLowLevelMouseFilter"));
	IConsoleManager::Get().UnregisterConsoleObject(TEXT("WindowsApplication.RemoveLowLevelMouseFilter"));
}

bool FWindowsApplication::RegisterClass( const HINSTANCE HInstance, const HICON HIcon )
{
	WNDCLASS wc;
	FMemory::Memzero( &wc, sizeof(wc) );