A Windows application that monitors mouse and keyboard activity and automatically moves the mouse cursor to a random position when no activity is detected for a specified period.
- Activity Monitoring: Monitors both mouse and keyboard events system-wide
- Configurable Timeout: Set the inactivity period (default: 30 seconds, max: 3600 seconds)
- Instant Timeout Updates: Apply timeout changes immediately with the "Apply" button
- Random Mouse Movement: Moves mouse cursor to random screen position when timeout expires
- Customizable Global Hotkey: Configure any combination of modifier keys (Ctrl, Alt, Shift, Win) with function keys, letters, numbers, or special keys
- Single Instance Protection: Only one instance of the application can run at a time - launching a second instance will bring the existing one to the foreground
- System Tray Integration:
- Minimize to system tray instead of taskbar
- Tray icon shows current monitoring status
- Right-click tray icon for context menu
- Double-click tray icon to show main window
- Startup Behavior Options:
- Start application hidden (tray only)
- Start monitoring automatically
- Minimize to tray instead of taskbar
- Start with Windows - Automatically launch when Windows starts
- Settings Persistence: All settings are saved in Windows registry
- Run the application (
mma.exe) - Set the desired timeout period in seconds
- Click "Apply" to update the timeout immediately (works even while monitoring)
- Click "Start Monitoring" or use the global hotkey to start
- The application will monitor for mouse and keyboard activity
- If no activity is detected within the timeout period, the mouse cursor will move to a random position
- Only one instance of MMA can run at a time
- If you try to launch the application when it's already running:
- The existing instance will be brought to the foreground
- The window will be restored if minimized
- The window will flash briefly to get your attention
- The new instance will exit silently
- This prevents conflicts and ensures consistent behavior
- Set Hotkey Button: Opens the hotkey configuration dialog
- Modifier Keys: Choose any combination of Ctrl, Alt, Shift, and Win keys
- Key Selection: Choose from F1-F12, A-Z, 0-9, or special keys (Space, Enter, Arrow keys, etc.)
- Live Preview: See your hotkey combination as you configure it
- Reset to Default: Quickly restore the default Ctrl+Shift+M hotkey
- Validation: Ensures at least one modifier key is selected for security
- Edit Field: Enter timeout value (1-3600 seconds)
- Apply Button: Instantly applies the new timeout value
- Real-time Updates: Changes take effect immediately, even during active monitoring
- Input Validation: Shows error messages for invalid values and reverts to current setting
- Confirmation: Displays success message when timeout is updated
- Double-click: Show/hide main window
- Right-click: Access context menu with:
- Show Window
- Start/Stop Monitoring
- About
- Exit
- Minimize to system tray: When checked, minimizing the window will hide it to the system tray
- Start application hidden: When checked, the application will start with only the tray icon visible
- Start monitoring automatically: When checked, monitoring will begin automatically when the application starts
- Start with Windows: When checked, the application will automatically launch when Windows starts
- Default: Ctrl+Shift+M
- Function Key: Ctrl+F12
- Alt Combination: Alt+Shift+H
- Win Key: Win+Ctrl+Space
- Simple: Ctrl+Q
The "Start with Windows" feature adds the application to Windows startup registry. When enabled:
- The application will automatically launch when Windows starts
- Works with the current executable path (handles moved files automatically)
- Can be combined with "Start application hidden" for completely silent startup
- Registry entry is added to
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Note: If the feature fails to enable/disable, try running the application as administrator.
- Built with C++ and Windows SDK (raw Win32 API)
- Uses low-level system hooks (WH_MOUSE_LL and WH_KEYBOARD_LL)
- System tray integration using Shell_NotifyIcon API
- Global hotkey registration using RegisterHotKey API
- Single instance protection via named mutex
- Settings stored in HKEY_CURRENT_USER\SOFTWARE\MMA
- Windows startup integration via registry manipulation
- Requires Windows Vista or later
- May require administrator privileges for proper hook installation and startup registry modification
This project uses Visual Studio and requires:
- Windows SDK
- C++14 compiler support
Simply open the solution file and build in Visual Studio.
The application stores settings in the Windows registry under:
HKEY_CURRENT_USER\SOFTWARE\MMA
Settings include:
- Timeout value
- Hotkey modifier keys and virtual key code
- Minimize to tray preference
- Start hidden preference
- Start monitoring automatically preference
- Start with Windows preference
Windows startup is managed via:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12
A through Z
0 through 9
- Space, Enter, Escape, Tab
- Backspace, Delete, Insert
- Home, End, Page Up, Page Down
- Arrow Keys (Up, Down, Left, Right)
- Ctrl (Control)
- Alt
- Shift
- Win (Windows key)
- Single Instance: Only one copy of the application can run at a time for safety and consistency
- The application resets the activity timer after each automatic mouse movement
- Global hotkey is automatically registered when the application starts
- The timeout value is validated (1-3600 seconds range)
- The application uses a secure random number generator for mouse positioning
- Tray icon tooltip shows current monitoring status
- Settings are automatically saved when changed
- Windows startup setting is verified on application startup
- Application path is automatically quoted in registry to handle paths with spaces
- New: Single instance protection prevents multiple copies from running
- New: Timeout changes can be applied instantly without restarting monitoring
- New: Apply button provides immediate feedback and validation
- New: Complete hotkey customization with intuitive dialog interface
- New: Hotkey validation prevents conflicts and ensures usability