SessionKeep is a Windows utility designed for use within Remote Desktop (RDP) sessions. Its purpose is to prevent sessions from locking or disconnecting due to user inactivity.
The application executes in the background and resides in the system tray. It continuously monitors user activity and responds when the session remains idle.
If no activity is detected for a period exceeding 60 seconds, SessionKeep may generate subtle input events. For example, the application may move the mouse by a few pixels or dispatch non-disruptive key events designed not to modify user input.
Generation of simulated input is configurable. When simulation is disabled, SessionKeep retains functionality intended to reduce the likelihood of session locks or disconnects.
The application exposes the following commands via the tray icon context menu:
Start— Enable inactivity monitoring. When enabled, the utility detects inactivity intervals longer than 60 seconds and may simulate input to maintain the session.Stop— Disable monitoring and input simulation.Mouse movement— Enable or disable small, nearly imperceptible simulated mouse movements.Keyboard presses— Enable or disable non-intrusive simulated key presses.Dark Mode— Toggle the user interface theme between light and dark variants.Exit— Terminate the application.
The application has been validated on 64-bit editions of Windows 10 and Windows 11, and on Windows Server 2016, 2019 and 2022.
SessionKeep is implemented in C for the Win32 API and employs CMake for project configuration. The recommended development environment is MSYS2 with either Clang or GCC.
Recommended MSYS2 packages (examples):
- mingw-w64-x86_64-cmake
- mingw-w64-x86_64-gcc (or mingw-w64-x86_64-clang)
- mingw-w64-x86_64-make
Build instructions (MSYS2 terminal):
-
Change directory to the project root (the directory that contains
CMakeLists.txt). -
Configure and build the project:
cmake -DCMAKE_BUILD_TYPE=Release -B build/Release
cmake --build build/Release
The resulting executable SessionKeep.exe will be produced in build/Release.
To produce a debug build, specify -DCMAKE_BUILD_TYPE=Debug and build the corresponding output directory build/Debug.
The following instructions apply to the 64-bit Microsoft Remote Desktop Connection client (mstsc.exe) on the local (client) system.
To ensure SessionKeep remains effective when the Remote Desktop client window is minimized, set the following registry value on the client:
Registry key:
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
Value name: RemoteDesktop_SuppressWhenMinimized (DWORD)
Value: 2
Procedure using Registry Editor (regedit.exe):
- Open Registry Editor.
- Navigate to the key specified above.
- If
RemoteDesktop_SuppressWhenMinimizeddoes not exist, create a 32-bit DWORD entry with that name. - Set the entry value to
2(decimal).
By default, the Remote Desktop client may pause or "suppress" activity when its window is minimized.
Setting RemoteDesktop_SuppressWhenMinimized to 2 prevents such suppression.
Consequently, applications executing within the RDP session (including SessionKeep) are permitted to continue operating and, where configured, to generate input events.